From 49f57ba4777b551c5543eb13627562ddc8729d70 Mon Sep 17 00:00:00 2001 From: Jerry Date: Thu, 28 Nov 2024 05:57:37 +0900 Subject: [PATCH 01/29] feat: Add scrollBarEnabled function --- .../lib/src/webview_controller.dart | 10 ++++ .../webviewflutter/AndroidWebkitLibrary.g.kt | 54 ++++++++++++++++++ .../webviewflutter/WebViewProxyApi.java | 10 ++++ .../lib/src/android_webkit.g.dart | 56 +++++++++++++++++++ .../lib/src/android_webview_controller.dart | 8 +++ .../lib/src/platform_webview_controller.dart | 12 ++++ .../FWFGeneratedWebKitApis.m | 56 +++++++++++++++++++ .../FWFScrollViewHostApi.m | 16 ++++++ .../FWFGeneratedWebKitApis.h | 6 ++ .../lib/src/common/web_kit.g.dart | 48 ++++++++++++++++ .../lib/src/ui_kit/ui_kit.dart | 10 ++++ .../lib/src/ui_kit/ui_kit_api_impls.dart | 22 ++++++++ .../lib/src/webkit_webview_controller.dart | 22 ++++++++ .../pigeons/web_kit.dart | 6 ++ 14 files changed, 336 insertions(+) diff --git a/packages/webview_flutter/webview_flutter/lib/src/webview_controller.dart b/packages/webview_flutter/webview_flutter/lib/src/webview_controller.dart index 603f9cf4be3..03a85132f69 100644 --- a/packages/webview_flutter/webview_flutter/lib/src/webview_controller.dart +++ b/packages/webview_flutter/webview_flutter/lib/src/webview_controller.dart @@ -405,6 +405,16 @@ class WebViewController { ) { return platform.setOnScrollPositionChange(onScrollPositionChange); } + + /// Define whether the vertical scrollbar should be drawn or not. The default value is true. + Future verticalScrollBarEnabled(bool enabled) { + return platform.verticalScrollBarEnabled(enabled); + } + + /// Define whether the horizontal scrollbar should be drawn or not. The default value is true. + Future horizontalScrollBarEnabled(bool enabled) { + return platform.horizontalScrollBarEnabled(enabled); + } } /// Permissions request when web content requests access to protected resources. diff --git a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/AndroidWebkitLibrary.g.kt b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/AndroidWebkitLibrary.g.kt index f2808272548..bb9f68a24fb 100644 --- a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/AndroidWebkitLibrary.g.kt +++ b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/AndroidWebkitLibrary.g.kt @@ -1387,6 +1387,12 @@ abstract class PigeonApiWebView( /** Sets the background color for this view. */ abstract fun setBackgroundColor(pigeon_instance: android.webkit.WebView, color: Long) + /** Define whether the vertical scrollbar should be drawn or not. The default value is true. */ + abstract fun verticalScrollBarEnabled(pigeon_instance: android.webkit.WebView, enabled: Boolean) + + /** Define whether the horizontal scrollbar should be drawn or not. The default value is true. */ + abstract fun horizontalScrollBarEnabled(pigeon_instance: android.webkit.WebView, enabled: Boolean) + /** Destroys the internal state of this WebView. */ abstract fun destroy(pigeon_instance: android.webkit.WebView) @@ -1924,6 +1930,54 @@ abstract class PigeonApiWebView( channel.setMessageHandler(null) } } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.verticalScrollBarEnabled", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as android.webkit.WebView + val enabledArg = args[1] as Boolean + val wrapped: List = + try { + api.verticalScrollBarEnabled(pigeon_instanceArg, enabledArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.horizontalScrollBarEnabled", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as android.webkit.WebView + val enabledArg = args[1] as Boolean + val wrapped: List = + try { + api.horizontalScrollBarEnabled(pigeon_instanceArg, enabledArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } run { val channel = BasicMessageChannel( diff --git a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebViewProxyApi.java b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebViewProxyApi.java index 7f976905526..7164fd2d682 100644 --- a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebViewProxyApi.java +++ b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebViewProxyApi.java @@ -271,6 +271,16 @@ public void setBackgroundColor(@NonNull WebView pigeon_instance, long color) { pigeon_instance.setBackgroundColor((int) color); } + @Override + public void verticalScrollBarEnabled(@NonNull WebView pigeon_instance, boolean enabled) { + pigeon_instance.setVerticalScrollBarEnabled(enabled); + } + + @Override + public void horizontalScrollBarEnabled(@NonNull WebView pigeon_instance, boolean enabled) { + pigeon_instance.setHorizontalScrollBarEnabled(enabled); + } + @NonNull @Override public ProxyApiRegistrar getPigeonRegistrar() { diff --git a/packages/webview_flutter/webview_flutter_android/lib/src/android_webkit.g.dart b/packages/webview_flutter/webview_flutter_android/lib/src/android_webkit.g.dart index fc7174a27d0..b95003ef6f6 100644 --- a/packages/webview_flutter/webview_flutter_android/lib/src/android_webkit.g.dart +++ b/packages/webview_flutter/webview_flutter_android/lib/src/android_webkit.g.dart @@ -2170,6 +2170,62 @@ class WebView extends View { } } + /// Define whether the vertical scrollbar should be drawn or not. The default value is true. + Future verticalScrollBarEnabled(bool enabled) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecWebView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_android.WebView.verticalScrollBarEnabled'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = await pigeonVar_channel + .send([this, enabled]) 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; + } + } + + /// Define whether the horizontal scrollbar should be drawn or not. The default value is true. + Future horizontalScrollBarEnabled(bool enabled) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecWebView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_android.WebView.horizontalScrollBarEnabled'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = await pigeonVar_channel + .send([this, enabled]) 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; + } + } + /// Destroys the internal state of this WebView. Future destroy() async { final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = diff --git a/packages/webview_flutter/webview_flutter_android/lib/src/android_webview_controller.dart b/packages/webview_flutter/webview_flutter_android/lib/src/android_webview_controller.dart index c250a87d36a..a5a36a07305 100644 --- a/packages/webview_flutter/webview_flutter_android/lib/src/android_webview_controller.dart +++ b/packages/webview_flutter/webview_flutter_android/lib/src/android_webview_controller.dart @@ -712,6 +712,14 @@ class AndroidWebViewController extends PlatformWebViewController { _onJavaScriptPrompt = onJavaScriptTextInputDialog; return _webChromeClient.setSynchronousReturnValueForOnJsPrompt(true); } + + @override + Future verticalScrollBarEnabled(bool enabled) => + _webView.verticalScrollBarEnabled(enabled); + + @override + Future horizontalScrollBarEnabled(bool enabled) => + _webView.horizontalScrollBarEnabled(enabled); } /// Android implementation of [PlatformWebViewPermissionRequest]. diff --git a/packages/webview_flutter/webview_flutter_platform_interface/lib/src/platform_webview_controller.dart b/packages/webview_flutter/webview_flutter_platform_interface/lib/src/platform_webview_controller.dart index 2aaabb519cc..6a04c8607f8 100644 --- a/packages/webview_flutter/webview_flutter_platform_interface/lib/src/platform_webview_controller.dart +++ b/packages/webview_flutter/webview_flutter_platform_interface/lib/src/platform_webview_controller.dart @@ -229,6 +229,18 @@ abstract class PlatformWebViewController extends PlatformInterface { 'scrollBy is not implemented on the current platform'); } + /// Define whether the vertical scrollbar should be drawn or not. The default value is true. + Future verticalScrollBarEnabled(bool enabled) { + throw UnimplementedError( + 'verticalScrollBarEnabled is not implemented on the current platform'); + } + + /// Define whether the horizontal scrollbar should be drawn or not. The default value is true. + Future horizontalScrollBarEnabled(bool enabled) { + throw UnimplementedError( + 'horizontalScrollBarEnabled is not implemented on the current platform'); + } + /// Return the current scroll position of this view. /// /// Scroll position is measured from the top left. diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFGeneratedWebKitApis.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFGeneratedWebKitApis.m index 0ceb9214dde..783fc8c6112 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFGeneratedWebKitApis.m +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFGeneratedWebKitApis.m @@ -1183,6 +1183,62 @@ void SetUpFWFUIScrollViewHostApiWithSuffix(id binaryMess [channel setMessageHandler:nil]; } } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"UIScrollViewHostApi.verticalScrollBarEnabled", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FWFUIScrollViewHostApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector + (verticalScrollBarEnabledForScrollViewWithIdentifier:isEnabled:error:)], + @"FWFWKPreferencesHostApi api (%@) doesn't respond to " + @"@selector(verticalScrollBarEnabledForScrollViewWithIdentifier:isEnabled:error:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; + BOOL arg_enabled = [GetNullableObjectAtIndex(args, 1) boolValue]; + FlutterError *error; + [api verticalScrollBarEnabledForScrollViewWithIdentifier:arg_identifier + isEnabled:arg_enabled + error:&error]; + callback(wrapResult(nil, error)); + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"UIScrollViewHostApi.horizontalScrollBarEnabled", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FWFUIScrollViewHostApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector + (horizontalScrollBarEnabledForScrollViewWithIdentifier:isEnabled:error:)], + @"FWFWKPreferencesHostApi api (%@) doesn't respond to " + @"@selector(horizontalScrollBarEnabledForScrollViewWithIdentifier:isEnabled:error:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; + BOOL arg_enabled = [GetNullableObjectAtIndex(args, 1) boolValue]; + FlutterError *error; + [api horizontalScrollBarEnabledForScrollViewWithIdentifier:arg_identifier + isEnabled:arg_enabled + error:&error]; + callback(wrapResult(nil, error)); + }]; + } else { + [channel setMessageHandler:nil]; + } + } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFScrollViewHostApi.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFScrollViewHostApi.m index b57ba2a539a..33b0fe7a145 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFScrollViewHostApi.m +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFScrollViewHostApi.m @@ -65,6 +65,22 @@ - (void)scrollByForScrollViewWithIdentifier:(NSInteger)identifier #endif } +- (void)verticalScrollBarEnabledForScrollViewWithIdentifier:(NSInteger)identifier + isEnabled:(BOOL)enabled + error:(FlutterError *_Nullable *_Nonnull)error { +#if TARGET_OS_IOS + [[self scrollViewForIdentifier:identifier] setShowsVerticalScrollIndicator:enabled]; +#endif +} + +- (void)horizontalScrollBarEnabledForScrollViewWithIdentifier:(NSInteger)identifier + isEnabled:(BOOL)enabled + error:(FlutterError *_Nullable *_Nonnull)error { +#if TARGET_OS_IOS + [[self scrollViewForIdentifier:identifier] setShowsHorizontalScrollIndicator:enabled]; +#endif +} + - (void)setContentOffsetForScrollViewWithIdentifier:(NSInteger)identifier toX:(double)x y:(double)y diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFGeneratedWebKitApis.h b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFGeneratedWebKitApis.h index dd5fdf97bbc..6d68c6c5bf3 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFGeneratedWebKitApis.h +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFGeneratedWebKitApis.h @@ -645,6 +645,12 @@ NSObject *FWFUIScrollViewHostApiGetCodec(void); x:(double)x y:(double)y error:(FlutterError *_Nullable *_Nonnull)error; +- (void)verticalScrollBarEnabledForScrollViewWithIdentifier:(NSInteger)identifier + isEnabled:(BOOL)enabled + error:(FlutterError *_Nullable *_Nonnull)error; +- (void)horizontalScrollBarEnabledForScrollViewWithIdentifier:(NSInteger)identifier + isEnabled:(BOOL)enabled + error:(FlutterError *_Nullable *_Nonnull)error; - (void)setContentOffsetForScrollViewWithIdentifier:(NSInteger)identifier toX:(double)x y:(double)y 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 bd0ac2c0294..38e4cb187cf 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 @@ -1128,6 +1128,54 @@ class UIScrollViewHostApi { } } + Future verticalScrollBarEnabled(int identifier, bool enabled) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.verticalScrollBarEnabled$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = await __pigeon_channel + .send([identifier, enabled]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { + throw PlatformException( + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], + ); + } else { + return; + } + } + + Future horizontalScrollBarEnabled(int identifier, bool enabled) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.horizontalScrollBarEnabled$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = await __pigeon_channel + .send([identifier, enabled]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { + throw PlatformException( + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], + ); + } else { + return; + } + } + Future setContentOffset(int identifier, double x, double y) async { final String __pigeon_channelName = 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.setContentOffset$__pigeon_messageChannelSuffix'; diff --git a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/ui_kit/ui_kit.dart b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/ui_kit/ui_kit.dart index fe5a0a3343b..a331792dd37 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/ui_kit/ui_kit.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/ui_kit/ui_kit.dart @@ -68,6 +68,16 @@ class UIScrollView extends UIViewBase { return _scrollViewApi.scrollByForInstances(this, offset); } + /// Define whether the vertical scrollbar should be drawn or not. The default value is true. + Future verticalScrollBarEnabled(bool enabled) { + return _scrollViewApi.verticalScrollBarEnabledForInstances(this, enabled); + } + + /// Define whether the horizontal scrollbar should be drawn or not. The default value is true. + Future horizontalScrollBarEnabled(bool enabled) { + return _scrollViewApi.horizontalScrollBarEnabledForInstances(this, enabled); + } + /// Set point at which the origin of the content view is offset from the origin of the scroll view. /// /// The default value is `Point(0.0, 0.0)`. diff --git a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/ui_kit/ui_kit_api_impls.dart b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/ui_kit/ui_kit_api_impls.dart index 6f15f7d6a9a..97f562c86c7 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/ui_kit/ui_kit_api_impls.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/ui_kit/ui_kit_api_impls.dart @@ -64,6 +64,28 @@ class UIScrollViewHostApiImpl extends UIScrollViewHostApi { ); } + /// Calls [verticalScrollBarEnabled] with the ids of the provided object instances. + Future verticalScrollBarEnabledForInstances( + UIView instance, + bool enabled, + ) async { + return verticalScrollBarEnabled( + instanceManager.getIdentifier(instance)!, + enabled, + ); + } + + /// Calls [horizontalScrollBarEnabled] with the ids of the provided object instances. + Future horizontalScrollBarEnabledForInstances( + UIView instance, + bool enabled, + ) async { + return horizontalScrollBarEnabled( + instanceManager.getIdentifier(instance)!, + enabled, + ); + } + /// Calls [setContentOffset] with the ids of the provided object instances. Future setContentOffsetForInstances( UIScrollView instance, 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 ae254ef52fe..c93f66587fc 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 @@ -517,6 +517,28 @@ class WebKitWebViewController extends PlatformWebViewController { } } + @override + Future verticalScrollBarEnabled(bool enabled) { + final WKWebView webView = _webView; + if (webView is WKWebViewIOS) { + return webView.scrollView.verticalScrollBarEnabled(enabled); + } else { + // TODO(stuartmorgan): Investigate doing this via JS instead. + throw UnimplementedError('verticalScrollBarEnabled is not implemented on macOS'); + } + } + + @override + Future horizontalScrollBarEnabled(bool enabled) { + final WKWebView webView = _webView; + if (webView is WKWebViewIOS) { + return webView.scrollView.horizontalScrollBarEnabled(enabled); + } else { + // TODO(stuartmorgan): Investigate doing this via JS instead. + throw UnimplementedError('horizontalScrollBarEnabled is not implemented on macOS'); + } + } + @override Future getScrollPosition() async { final WKWebView webView = _webView; 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 a7d2fbd488d..c62a0dd2a83 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/pigeons/web_kit.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/pigeons/web_kit.dart @@ -480,6 +480,12 @@ abstract class UIScrollViewHostApi { @ObjCSelector('scrollByForScrollViewWithIdentifier:x:y:') void scrollBy(int identifier, double x, double y); + @ObjCSelector('verticalScrollBarEnabledForScrollViewWithIdentifier:isEnabled:') + void verticalScrollBarEnabled(int identifier, bool enabled); + + @ObjCSelector('horizontalScrollBarEnabledForScrollViewWithIdentifier:isEnabled:') + void horizontalScrollBarEnabled(int identifier, bool enabled); + @ObjCSelector('setContentOffsetForScrollViewWithIdentifier:toX:y:') void setContentOffset(int identifier, double x, double y); From 1f1ad6fe4054754f8d6aed1994ff0a5da2de24d9 Mon Sep 17 00:00:00 2001 From: Jerry Date: Thu, 28 Nov 2024 06:09:40 +0900 Subject: [PATCH 02/29] chore: Modify pubspec for test setup --- packages/webview_flutter/webview_flutter/pubspec.yaml | 9 ++++++--- .../webview_flutter/webview_flutter_android/pubspec.yaml | 3 ++- .../webview_flutter_wkwebview/pubspec.yaml | 3 ++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/packages/webview_flutter/webview_flutter/pubspec.yaml b/packages/webview_flutter/webview_flutter/pubspec.yaml index 837800d7fee..1e90c37be23 100644 --- a/packages/webview_flutter/webview_flutter/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter/pubspec.yaml @@ -21,9 +21,12 @@ flutter: dependencies: flutter: sdk: flutter - webview_flutter_android: ^4.0.0 - webview_flutter_platform_interface: ^2.10.0 - webview_flutter_wkwebview: ^3.15.0 + webview_flutter_android: + path: ../webview_flutter_android + webview_flutter_platform_interface: + path: ../webview_flutter_platform_interface + webview_flutter_wkwebview: + path: ../webview_flutter_wkwebview dev_dependencies: build_runner: ^2.1.5 diff --git a/packages/webview_flutter/webview_flutter_android/pubspec.yaml b/packages/webview_flutter/webview_flutter_android/pubspec.yaml index 4ff9b6166a6..ed75d555191 100644 --- a/packages/webview_flutter/webview_flutter_android/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter_android/pubspec.yaml @@ -20,7 +20,8 @@ flutter: dependencies: flutter: sdk: flutter - webview_flutter_platform_interface: ^2.10.0 + webview_flutter_platform_interface: + path: ../webview_flutter_platform_interface dev_dependencies: build_runner: ^2.1.4 diff --git a/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml b/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml index 735efa3f86e..cb7796bc487 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml @@ -25,7 +25,8 @@ dependencies: flutter: sdk: flutter path: ^1.8.0 - webview_flutter_platform_interface: ^2.10.0 + webview_flutter_platform_interface: + path: ../webview_flutter_platform_interface dev_dependencies: build_runner: ^2.1.5 From 4217429ef74ab00f719c69a008f8e8987b65375a Mon Sep 17 00:00:00 2001 From: Jerry Date: Thu, 28 Nov 2024 06:34:24 +0900 Subject: [PATCH 03/29] test: Add dart test code --- .../test/webview_controller_test.dart | 24 ++++++++++ .../test/webview_controller_test.mocks.dart | 22 ++++++++++ .../test/webview_widget_test.mocks.dart | 22 ++++++++++ .../test/android_webview_controller_test.dart | 22 ++++++++++ ...android_webview_controller_test.mocks.dart | 44 +++++++++++++++++++ ...oid_webview_cookie_manager_test.mocks.dart | 22 ++++++++++ .../platform_webview_controller_test.dart | 24 ++++++++++ .../test/webkit_webview_controller_test.dart | 22 ++++++++++ .../webkit_webview_controller_test.mocks.dart | 22 ++++++++++ 9 files changed, 224 insertions(+) diff --git a/packages/webview_flutter/webview_flutter/test/webview_controller_test.dart b/packages/webview_flutter/webview_flutter/test/webview_controller_test.dart index 6cae01a4941..49351a119c7 100644 --- a/packages/webview_flutter/webview_flutter/test/webview_controller_test.dart +++ b/packages/webview_flutter/webview_flutter/test/webview_controller_test.dart @@ -281,6 +281,30 @@ void main() { verify(mockPlatformWebViewController.scrollBy(2, 3)); }); + test('verticalScrollBarEnabled', () async { + final MockPlatformWebViewController mockPlatformWebViewController = + MockPlatformWebViewController(); + + final WebViewController webViewController = WebViewController.fromPlatform( + mockPlatformWebViewController, + ); + + await webViewController.verticalScrollBarEnabled(false); + verify(mockPlatformWebViewController.verticalScrollBarEnabled(false)); + }); + + test('horizontalScrollBarEnabled', () async { + final MockPlatformWebViewController mockPlatformWebViewController = + MockPlatformWebViewController(); + + final WebViewController webViewController = WebViewController.fromPlatform( + mockPlatformWebViewController, + ); + + await webViewController.horizontalScrollBarEnabled(false); + verify(mockPlatformWebViewController.horizontalScrollBarEnabled(false)); + }); + test('getScrollPosition', () async { final MockPlatformWebViewController mockPlatformWebViewController = MockPlatformWebViewController(); diff --git a/packages/webview_flutter/webview_flutter/test/webview_controller_test.mocks.dart b/packages/webview_flutter/webview_flutter/test/webview_controller_test.mocks.dart index 981e7386ac0..7bef6d0efe2 100644 --- a/packages/webview_flutter/webview_flutter/test/webview_controller_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter/test/webview_controller_test.mocks.dart @@ -313,6 +313,28 @@ class MockPlatformWebViewController extends _i1.Mock returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); + @override + _i5.Future verticalScrollBarEnabled(bool? enabled) => + (super.noSuchMethod( + Invocation.method( + #verticalScrollBarEnabled, + [enabled], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + _i5.Future horizontalScrollBarEnabled(bool? enabled) => + (super.noSuchMethod( + Invocation.method( + #horizontalScrollBarEnabled, + [enabled], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + @override _i5.Future<_i3.Offset> getScrollPosition() => (super.noSuchMethod( Invocation.method( diff --git a/packages/webview_flutter/webview_flutter/test/webview_widget_test.mocks.dart b/packages/webview_flutter/webview_flutter/test/webview_widget_test.mocks.dart index ec6bd85e095..3e8471b4a78 100644 --- a/packages/webview_flutter/webview_flutter/test/webview_widget_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter/test/webview_widget_test.mocks.dart @@ -331,6 +331,28 @@ class MockPlatformWebViewController extends _i1.Mock returnValueForMissingStub: _i7.Future.value(), ) as _i7.Future); + @override + _i7.Future verticalScrollBarEnabled(bool? enabled) => + (super.noSuchMethod( + Invocation.method( + #verticalScrollBarEnabled, + [enabled], + ), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); + + @override + _i7.Future horizontalScrollBarEnabled(bool? enabled) => + (super.noSuchMethod( + Invocation.method( + #horizontalScrollBarEnabled, + [enabled], + ), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); + @override _i7.Future<_i3.Offset> getScrollPosition() => (super.noSuchMethod( Invocation.method( diff --git a/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.dart b/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.dart index 6879c33253e..3cea924df86 100644 --- a/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.dart +++ b/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.dart @@ -1401,6 +1401,28 @@ void main() { verify(mockWebView.scrollBy(4, 2)).called(1); }); + test('verticalScrollBarEnabled', () async { + final MockWebView mockWebView = MockWebView(); + final AndroidWebViewController controller = createControllerWithMocks( + mockWebView: mockWebView, + ); + + await controller.verticalScrollBarEnabled(false); + + verify(mockWebView.verticalScrollBarEnabled(false)).called(1); + }); + + test('horizontalScrollBarEnabled', () async { + final MockWebView mockWebView = MockWebView(); + final AndroidWebViewController controller = createControllerWithMocks( + mockWebView: mockWebView, + ); + + await controller.horizontalScrollBarEnabled(false); + + verify(mockWebView.horizontalScrollBarEnabled(false)).called(1); + }); + test('getScrollPosition', () async { final MockWebView mockWebView = MockWebView(); final AndroidWebViewController controller = createControllerWithMocks( diff --git a/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.mocks.dart b/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.mocks.dart index d0254f2bd80..04df59a0065 100644 --- a/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.mocks.dart @@ -911,6 +911,28 @@ class MockAndroidWebViewController extends _i1.Mock returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); + + @override + _i8.Future verticalScrollBarEnabled(bool? enabled) => + (super.noSuchMethod( + Invocation.method( + #verticalScrollBarEnabled, + [enabled], + ), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); + + @override + _i8.Future horizontalScrollBarEnabled(bool? enabled) => + (super.noSuchMethod( + Invocation.method( + #horizontalScrollBarEnabled, + [enabled], + ), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); } /// A class which mocks [AndroidWebViewProxy]. @@ -2977,6 +2999,28 @@ class MockWebView extends _i1.Mock implements _i2.WebView { returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); + @override + _i8.Future verticalScrollBarEnabled(bool? enabled) => + (super.noSuchMethod( + Invocation.method( + #verticalScrollBarEnabled, + [enabled], + ), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); + + @override + _i8.Future horizontalScrollBarEnabled(bool? enabled) => + (super.noSuchMethod( + Invocation.method( + #horizontalScrollBarEnabled, + [enabled], + ), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); + @override _i8.Future destroy() => (super.noSuchMethod( Invocation.method( diff --git a/packages/webview_flutter/webview_flutter_android/test/android_webview_cookie_manager_test.mocks.dart b/packages/webview_flutter/webview_flutter_android/test/android_webview_cookie_manager_test.mocks.dart index 303f54d46f6..80c2843e40d 100644 --- a/packages/webview_flutter/webview_flutter_android/test/android_webview_cookie_manager_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_android/test/android_webview_cookie_manager_test.mocks.dart @@ -615,4 +615,26 @@ class MockAndroidWebViewController extends _i1.Mock returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); + + @override + _i5.Future verticalScrollBarEnabled(bool? enabled) => + (super.noSuchMethod( + Invocation.method( + #verticalScrollBarEnabled, + [enabled], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + _i5.Future horizontalScrollBarEnabled(bool? enabled) => + (super.noSuchMethod( + Invocation.method( + #horizontalScrollBarEnabled, + [enabled], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); } diff --git a/packages/webview_flutter/webview_flutter_platform_interface/test/platform_webview_controller_test.dart b/packages/webview_flutter/webview_flutter_platform_interface/test/platform_webview_controller_test.dart index db3cf1dd5d6..ae458d7b994 100644 --- a/packages/webview_flutter/webview_flutter_platform_interface/test/platform_webview_controller_test.dart +++ b/packages/webview_flutter/webview_flutter_platform_interface/test/platform_webview_controller_test.dart @@ -311,6 +311,30 @@ void main() { ); }); + test('Default implementation of verticalScrollBarEnabled should throw unimplemented error', + () { + final PlatformWebViewController controller = + ExtendsPlatformWebViewController( + const PlatformWebViewControllerCreationParams()); + + expect( + () => controller.verticalScrollBarEnabled(false), + throwsUnimplementedError, + ); + }); + + test('Default implementation of horizontalScrollBarEnabled should throw unimplemented error', + () { + final PlatformWebViewController controller = + ExtendsPlatformWebViewController( + const PlatformWebViewControllerCreationParams()); + + expect( + () => controller.horizontalScrollBarEnabled(false), + throwsUnimplementedError, + ); + }); + test( 'Default implementation of getScrollPosition should throw unimplemented error', () { 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 4e1208641e8..235932953f1 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 @@ -603,6 +603,28 @@ void main() { verify(mockScrollView.scrollBy(const Point(2.0, 4.0))); }); + test('verticalScrollBarEnabled', () async { + final MockUIScrollView mockScrollView = MockUIScrollView(); + + final WebKitWebViewController controller = createControllerWithMocks( + mockScrollView: mockScrollView, + ); + + await controller.verticalScrollBarEnabled(false); + verify(mockScrollView.verticalScrollBarEnabled(false)); + }); + + test('horizontalScrollBarEnabled', () async { + final MockUIScrollView mockScrollView = MockUIScrollView(); + + final WebKitWebViewController controller = createControllerWithMocks( + mockScrollView: mockScrollView, + ); + + await controller.horizontalScrollBarEnabled(false); + verify(mockScrollView.horizontalScrollBarEnabled(false); + }); + test('getScrollPosition', () { final MockUIScrollView mockScrollView = MockUIScrollView(); 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 0c4924df62d..b2abb40db13 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 @@ -244,6 +244,28 @@ class MockUIScrollView extends _i1.Mock implements _i4.UIScrollView { returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override + _i6.Future verticalScrollBarEnabled(bool? enabled) => + (super.noSuchMethod( + Invocation.method( + #verticalScrollBarEnabled, + [enabled], + ), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); + + @override + _i6.Future horizontalScrollBarEnabled(bool? enabled) => + (super.noSuchMethod( + Invocation.method( + #horizontalScrollBarEnabled, + [enabled], + ), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); + @override _i6.Future setContentOffset(_i3.Point? offset) => (super.noSuchMethod( From 45abbc125990bb344668721be50d9cc9d120eb60 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Mon, 7 Apr 2025 22:17:39 -0400 Subject: [PATCH 04/29] reset wkwebview --- .../webview_flutter_wkwebview/CHANGELOG.md | 34 + .../webview_flutter_wkwebview/CONTRIBUTING.md | 54 + .../webview_flutter_wkwebview/README.md | 4 + ...cationChallengeResponseProxyAPITests.swift | 41 + .../darwin/Tests/ErrorProxyAPITests.swift | 42 + .../darwin/Tests/FWFDataConvertersTests.m | 209 - .../darwin/Tests/FWFErrorTests.m | 18 - .../Tests/FWFHTTPCookieStoreHostApiTests.m | 59 - .../darwin/Tests/FWFInstanceManagerTests.m | 73 - .../Tests/FWFNavigationDelegateHostApiTests.m | 317 - .../darwin/Tests/FWFObjectHostApiTests.m | 190 - .../darwin/Tests/FWFPreferencesHostApiTests.m | 48 - .../FWFScriptMessageHandlerHostApiTests.m | 92 - .../Tests/FWFScrollViewDelegateHostApiTests.m | 89 - .../darwin/Tests/FWFScrollViewHostApiTests.m | 88 - .../darwin/Tests/FWFUIDelegateHostApiTests.m | 148 - .../darwin/Tests/FWFUIViewHostApiTests.m | 55 - ...WFURLAuthenticationChallengeHostApiTests.m | 52 - .../Tests/FWFURLCredentialHostApiTests.m | 40 - .../Tests/FWFURLProtectionSpaceHostApiTests.m | 48 - .../darwin/Tests/FWFURLTests.m | 53 - .../FWFUserContentControllerHostApiTests.m | 132 - .../FWFWebViewConfigurationHostApiTests.m | 116 - ...FWebViewFlutterWKWebViewExternalAPITests.m | 35 - ...ViewFlutterWKWebViewExternalAPITests.swift | 137 + .../darwin/Tests/FWFWebViewHostApiTests.m | 520 - .../Tests/FWFWebsiteDataStoreHostApiTests.m | 82 - .../darwin/Tests/FrameInfoProxyAPITests.swift | 54 + .../Tests/HTTPCookieProxyAPITests.swift | 34 + .../Tests/HTTPCookieStoreProxyAPITests.swift | 63 + .../Tests/HTTPURLResponseProxyAPITests.swift | 20 + .../darwin/Tests/NSObjectProxyAPITests.swift | 89 + .../Tests/NavigationActionProxyAPITests.swift | 56 + .../NavigationDelegateProxyAPITests.swift | 258 + .../NavigationResponseProxyAPITests.swift | 42 + .../Tests/PreferencesProxyAPITests.swift | 27 + .../ScriptMessageHandlerProxyAPITests.swift | 42 + .../Tests/ScriptMessageProxyAPITests.swift | 40 + .../ScrollViewDelegateProxyAPITests.swift | 50 + .../Tests/ScrollViewProxyAPITests.swift | 154 + .../Tests/SecurityOriginProxyAPITests.swift | 65 + .../darwin/Tests/TestBinaryMessenger.swift | 33 + .../darwin/Tests/TestProxyApiRegistrar.swift | 25 + .../Tests/UIDelegateProxyAPITests.swift | 175 + .../darwin/Tests/UIViewProxyAPITests.swift | 44 + ...AuthenticationChallengeProxyAPITests.swift | 21 + .../Tests/URLCredentialProxyAPITests.swift | 18 + .../URLProtectionSpaceProxyAPITests.swift | 59 + .../Tests/URLRequestProxyAPITests.swift | 108 + .../UserContentControllerProxyAPITests.swift | 97 + .../Tests/UserScriptProxyAPITests.swift | 52 + .../WebViewConfigurationProxyAPITests.swift | 138 + .../darwin/Tests/WebViewProxyAPITests.swift | 477 + .../WebpagePreferencesProxyAPITests.swift | 23 + .../Tests/WebsiteDataStoreProxyAPITests.swift | 51 + .../darwin/webview_flutter_wkwebview.podspec | 10 +- .../webview_flutter_wkwebview/Package.swift | 4 - .../AuthenticationChallengeResponse.swift | 20 + ...ionChallengeResponseProxyAPIDelegate.swift | 61 + .../ErrorProxyAPIDelegate.swift | 23 + .../FLTWebViewFlutterPlugin.m | 149 - .../FWFDataConverters.m | 356 - .../FWFGeneratedWebKitApis.m | 4191 -------- .../FWFHTTPCookieStoreHostApi.m | 46 - .../FWFInstanceManager.m | 173 - .../FWFNavigationDelegateHostApi.m | 327 - .../FWFObjectHostApi.m | 147 - .../FWFPreferencesHostApi.m | 48 - .../FWFScriptMessageHandlerHostApi.m | 94 - .../FWFScrollViewDelegateHostApi.m | 97 - .../FWFScrollViewHostApi.m | 104 - .../FWFUIDelegateHostApi.m | 255 - .../FWFUIViewHostApi.m | 51 - .../FWFURLAuthenticationChallengeHostApi.m | 52 - .../FWFURLCredentialHostApi.m | 58 - .../webview_flutter_wkwebview/FWFURLHostApi.m | 74 - .../FWFURLProtectionSpaceHostApi.m | 36 - .../FWFUserContentControllerHostApi.m | 80 - .../FWFWebViewConfigurationHostApi.m | 139 - .../FWFWebViewFlutterWKWebViewExternalAPI.m | 21 - .../FWFWebViewHostApi.m | 318 - .../FWFWebsiteDataStoreHostApi.m | 66 - .../FlutterAssetManager.swift | 17 + .../FlutterViewFactory.swift | 74 + .../FrameInfoProxyAPIDelegate.swift | 37 + .../HTTPCookieProxyAPIDelegate.swift | 125 + .../HTTPCookieStoreProxyAPIDelegate.swift | 21 + .../HTTPURLResponseProxyAPIDelegate.swift | 17 + .../NSObjectProxyAPIDelegate.swift | 107 + .../NavigationActionProxyAPIDelegate.swift | 44 + .../NavigationDelegateProxyAPIDelegate.swift | 334 + .../NavigationResponseProxyAPIDelegate.swift | 23 + .../PreferencesProxyAPIDelegate.swift | 26 + .../ProxyAPIRegistrar.swift | 283 + ...ScriptMessageHandlerProxyAPIDelegate.swift | 43 + .../ScriptMessageProxyAPIDelegate.swift | 19 + .../ScrollViewDelegateProxyAPIDelegate.swift | 48 + .../ScrollViewProxyAPIDelegate.swift | 92 + .../SecurityOriginProxyAPIDelegate.swift | 27 + .../StructWrappers.swift | 17 + .../UIDelegateProxyAPIDelegate.swift | 262 + .../UIViewProxyAPIDelegate.swift | 34 + ...henticationChallengeProxyAPIDelegate.swift | 17 + .../URLCredentialProxyAPIDelegate.swift | 29 + .../URLProtectionSpaceProxyAPIDelegate.swift | 35 + .../URLProxyAPIDelegate.swift | 15 + .../URLRequestProxyAPIDelegate.swift | 78 + ...serContentControllerProxyAPIDelegate.swift | 51 + .../UserScriptProxyAPIDelegate.swift | 52 + .../WebKitLibrary.g.swift | 6945 ++++++++++++ ...WebViewConfigurationProxyAPIDelegate.swift | 102 + .../WebViewFlutterPlugin.swift | 40 + .../WebViewFlutterWKWebViewExternalAPI.swift | 37 + .../WebViewProxyAPIDelegate.swift | 385 + .../WebpagePreferencesProxyAPIDelegate.swift | 25 + .../WebsiteDataStoreProxyAPIDelegate.swift | 62 + .../include/FlutterWebView.modulemap | 10 - .../include/webview-umbrella.h | 27 - .../FLTWebViewFlutterPlugin.h | 18 - .../FWFDataConverters.h | 210 - .../FWFGeneratedWebKitApis.h | 1257 --- .../FWFHTTPCookieStoreHostApi.h | 25 - .../FWFInstanceManager.h | 84 - .../FWFInstanceManager_Test.h | 25 - .../FWFNavigationDelegateHostApi.h | 44 - .../FWFObjectHostApi.h | 45 - .../FWFPreferencesHostApi.h | 24 - .../FWFScriptMessageHandlerHostApi.h | 44 - .../FWFScrollViewDelegateHostApi.h | 47 - .../FWFScrollViewHostApi.h | 25 - .../FWFUIDelegateHostApi.h | 47 - .../FWFUIViewHostApi.h | 26 - .../FWFURLAuthenticationChallengeHostApi.h | 32 - .../FWFURLCredentialHostApi.h | 27 - .../webview_flutter_wkwebview/FWFURLHostApi.h | 41 - .../FWFURLProtectionSpaceHostApi.h | 34 - .../FWFUserContentControllerHostApi.h | 25 - .../FWFWebViewConfigurationHostApi.h | 46 - .../FWFWebViewFlutterWKWebViewExternalAPI.h | 38 - .../FWFWebViewHostApi.h | 54 - .../FWFWebsiteDataStoreHostApi.h | 25 - .../legacy/webview_flutter_test.dart | 305 +- .../webview_flutter_test.dart | 209 +- .../example/ios/Flutter/Debug.xcconfig | 2 +- .../example/ios/Flutter/Release.xcconfig | 2 +- .../ios/Runner.xcodeproj/project.pbxproj | 372 +- .../xcshareddata/xcschemes/Runner.xcscheme | 3 +- .../RunnerTests/RunnerTests-Bridging-Header.h | 3 + .../WebpagePreferencesProxyAPITests.swift | 23 + .../example/lib/main.dart | 18 +- .../macos/Runner.xcodeproj/project.pbxproj | 340 +- .../xcshareddata/xcschemes/Runner.xcscheme | 19 + .../RunnerTests/RunnerTests-Bridging-Header.h | 3 + .../WebpagePreferencesProxyAPITests.swift | 23 + .../example/pubspec.yaml | 4 +- .../lib/src/common/instance_manager.dart | 198 - .../lib/src/common/platform_webview.dart | 400 + .../lib/src/common/weak_reference_utils.dart | 2 +- .../lib/src/common/web_kit.g.dart | 9348 ++++++++++++----- .../lib/src/common/webkit_constants.dart | 72 + .../lib/src/foundation/foundation.dart | 538 - .../src/foundation/foundation_api_impls.dart | 392 - .../src/legacy/web_kit_webview_widget.dart | 310 +- .../lib/src/legacy/webview_cupertino.dart | 7 +- .../src/legacy/wkwebview_cookie_manager.dart | 32 +- .../lib/src/ui_kit/ui_kit.dart | 222 - .../lib/src/ui_kit/ui_kit_api_impls.dart | 203 - .../lib/src/web_kit/web_kit.dart | 1308 --- .../lib/src/web_kit/web_kit_api_impls.dart | 1213 --- .../lib/src/webkit_proxy.dart | 280 +- .../lib/src/webkit_webview_controller.dart | 575 +- .../src/webkit_webview_cookie_manager.dart | 21 +- .../pigeons/web_kit.dart | 1462 +-- .../webview_flutter_wkwebview/pubspec.yaml | 11 +- .../legacy/web_kit_cookie_manager_test.dart | 52 +- .../web_kit_cookie_manager_test.mocks.dart | 184 +- .../legacy/web_kit_webview_widget_test.dart | 436 +- .../web_kit_webview_widget_test.mocks.dart | 2246 ++-- .../src/common/instance_manager_test.dart | 153 - .../test/src/common/test_web_kit.g.dart | 2500 ----- .../test/src/foundation/foundation_test.dart | 389 - .../src/foundation/foundation_test.mocks.dart | 125 - .../test/src/ui_kit/ui_kit_test.dart | 177 - .../test/src/ui_kit/ui_kit_test.mocks.dart | 517 - .../test/src/web_kit/web_kit_test.dart | 1133 -- .../test/src/web_kit/web_kit_test.mocks.dart | 659 -- .../test/webkit_navigation_delegate_test.dart | 473 +- ...webkit_navigation_delegate_test.mocks.dart | 262 + .../test/webkit_webview_controller_test.dart | 984 +- .../webkit_webview_controller_test.mocks.dart | 2000 ++-- .../webkit_webview_cookie_manager_test.dart | 54 +- ...kit_webview_cookie_manager_test.mocks.dart | 184 +- .../test/webkit_webview_widget_test.dart | 131 +- .../webkit_webview_widget_test.mocks.dart | 375 +- 194 files changed, 25911 insertions(+), 28937 deletions(-) create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/CONTRIBUTING.md create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/AuthenticationChallengeResponseProxyAPITests.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/ErrorProxyAPITests.swift delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFDataConvertersTests.m delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFErrorTests.m delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFHTTPCookieStoreHostApiTests.m delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFInstanceManagerTests.m delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFNavigationDelegateHostApiTests.m delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFObjectHostApiTests.m delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFPreferencesHostApiTests.m delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFScriptMessageHandlerHostApiTests.m delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFScrollViewDelegateHostApiTests.m delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFScrollViewHostApiTests.m delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFUIDelegateHostApiTests.m delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFUIViewHostApiTests.m delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFURLAuthenticationChallengeHostApiTests.m delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFURLCredentialHostApiTests.m delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFURLProtectionSpaceHostApiTests.m delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFURLTests.m delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFUserContentControllerHostApiTests.m delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFWebViewConfigurationHostApiTests.m delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFWebViewFlutterWKWebViewExternalAPITests.m create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFWebViewFlutterWKWebViewExternalAPITests.swift delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFWebViewHostApiTests.m delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFWebsiteDataStoreHostApiTests.m create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FrameInfoProxyAPITests.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/HTTPCookieProxyAPITests.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/HTTPCookieStoreProxyAPITests.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/HTTPURLResponseProxyAPITests.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/NSObjectProxyAPITests.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/NavigationActionProxyAPITests.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/NavigationDelegateProxyAPITests.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/NavigationResponseProxyAPITests.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/PreferencesProxyAPITests.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/ScriptMessageHandlerProxyAPITests.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/ScriptMessageProxyAPITests.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/ScrollViewDelegateProxyAPITests.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/ScrollViewProxyAPITests.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/SecurityOriginProxyAPITests.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/TestBinaryMessenger.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/TestProxyApiRegistrar.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/UIDelegateProxyAPITests.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/UIViewProxyAPITests.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/URLAuthenticationChallengeProxyAPITests.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/URLCredentialProxyAPITests.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/URLProtectionSpaceProxyAPITests.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/URLRequestProxyAPITests.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/UserContentControllerProxyAPITests.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/UserScriptProxyAPITests.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/WebViewConfigurationProxyAPITests.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/WebViewProxyAPITests.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/WebpagePreferencesProxyAPITests.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/WebsiteDataStoreProxyAPITests.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/AuthenticationChallengeResponse.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/AuthenticationChallengeResponseProxyAPIDelegate.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/ErrorProxyAPIDelegate.swift delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FLTWebViewFlutterPlugin.m delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFDataConverters.m delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFGeneratedWebKitApis.m delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFHTTPCookieStoreHostApi.m delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFInstanceManager.m delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFNavigationDelegateHostApi.m delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFObjectHostApi.m delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFPreferencesHostApi.m delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFScriptMessageHandlerHostApi.m delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFScrollViewDelegateHostApi.m delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFScrollViewHostApi.m delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFUIDelegateHostApi.m delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFUIViewHostApi.m delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFURLAuthenticationChallengeHostApi.m delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFURLCredentialHostApi.m delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFURLHostApi.m delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFURLProtectionSpaceHostApi.m delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFUserContentControllerHostApi.m delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFWebViewConfigurationHostApi.m delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFWebViewFlutterWKWebViewExternalAPI.m delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFWebViewHostApi.m delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFWebsiteDataStoreHostApi.m create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FlutterAssetManager.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FlutterViewFactory.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FrameInfoProxyAPIDelegate.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/HTTPCookieProxyAPIDelegate.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/HTTPCookieStoreProxyAPIDelegate.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/HTTPURLResponseProxyAPIDelegate.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/NSObjectProxyAPIDelegate.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/NavigationActionProxyAPIDelegate.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/NavigationDelegateProxyAPIDelegate.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/NavigationResponseProxyAPIDelegate.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/PreferencesProxyAPIDelegate.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/ProxyAPIRegistrar.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/ScriptMessageHandlerProxyAPIDelegate.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/ScriptMessageProxyAPIDelegate.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/ScrollViewDelegateProxyAPIDelegate.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/ScrollViewProxyAPIDelegate.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/SecurityOriginProxyAPIDelegate.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/StructWrappers.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/UIDelegateProxyAPIDelegate.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/UIViewProxyAPIDelegate.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/URLAuthenticationChallengeProxyAPIDelegate.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/URLCredentialProxyAPIDelegate.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/URLProtectionSpaceProxyAPIDelegate.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/URLProxyAPIDelegate.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/URLRequestProxyAPIDelegate.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/UserContentControllerProxyAPIDelegate.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/UserScriptProxyAPIDelegate.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebKitLibrary.g.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebViewConfigurationProxyAPIDelegate.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebViewFlutterPlugin.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebViewFlutterWKWebViewExternalAPI.swift create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebViewProxyAPIDelegate.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/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebsiteDataStoreProxyAPIDelegate.swift delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/FlutterWebView.modulemap delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview-umbrella.h delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FLTWebViewFlutterPlugin.h delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFDataConverters.h delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFGeneratedWebKitApis.h delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFHTTPCookieStoreHostApi.h delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFInstanceManager.h delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFInstanceManager_Test.h delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFNavigationDelegateHostApi.h delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFObjectHostApi.h delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFPreferencesHostApi.h delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFScriptMessageHandlerHostApi.h delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFScrollViewDelegateHostApi.h delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFScrollViewHostApi.h delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFUIDelegateHostApi.h delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFUIViewHostApi.h delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFURLAuthenticationChallengeHostApi.h delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFURLCredentialHostApi.h delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFURLHostApi.h delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFURLProtectionSpaceHostApi.h delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFUserContentControllerHostApi.h delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFWebViewConfigurationHostApi.h delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFWebViewFlutterWKWebViewExternalAPI.h delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFWebViewHostApi.h delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFWebsiteDataStoreHostApi.h create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/RunnerTests-Bridging-Header.h 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/RunnerTests-Bridging-Header.h create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/example/macos/RunnerTests/WebpagePreferencesProxyAPITests.swift delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/lib/src/common/instance_manager.dart create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/lib/src/common/platform_webview.dart create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/lib/src/common/webkit_constants.dart delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/lib/src/foundation/foundation.dart delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/lib/src/foundation/foundation_api_impls.dart delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/lib/src/ui_kit/ui_kit.dart delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/lib/src/ui_kit/ui_kit_api_impls.dart delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/lib/src/web_kit/web_kit.dart delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/lib/src/web_kit/web_kit_api_impls.dart delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/test/src/common/instance_manager_test.dart delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/test/src/common/test_web_kit.g.dart delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/test/src/foundation/foundation_test.dart delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/test/src/foundation/foundation_test.mocks.dart delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/test/src/ui_kit/ui_kit_test.dart delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/test/src/ui_kit/ui_kit_test.mocks.dart delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/test/src/web_kit/web_kit_test.dart delete mode 100644 packages/webview_flutter/webview_flutter_wkwebview/test/src/web_kit/web_kit_test.mocks.dart create mode 100644 packages/webview_flutter/webview_flutter_wkwebview/test/webkit_navigation_delegate_test.mocks.dart diff --git a/packages/webview_flutter/webview_flutter_wkwebview/CHANGELOG.md b/packages/webview_flutter/webview_flutter_wkwebview/CHANGELOG.md index 11e10486544..a4ea405f961 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/CHANGELOG.md +++ b/packages/webview_flutter/webview_flutter_wkwebview/CHANGELOG.md @@ -1,3 +1,37 @@ +## 3.18.5 + +* Fixes crash when sending undefined message via JavaScript channel. + +## 3.18.4 + +* Fixes crash when native `WKFrameInfo.request` is nil. + +## 3.18.3 + +* Fixes crash where the native `AuthenticationChallengeResponse` could not be found for auth + requests. + +## 3.18.2 + +* Updates generated pigeon code to ensure the internal wrapper immediately sends constructor calls. + +## 3.18.1 + +* 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`. + +## 3.18.0 + +* Updates internal API wrapper to use ProxyApis. + +## 3.17.0 + +* Adds a change listener for the `canGoBack` property. See + `WebKitWebViewController.setOnCanGoBackChange`. +* Updates minimum supported SDK version to Flutter 3.22/Dart 3.4. + ## 3.16.3 * Fixes re-registering existing channels while removing Javascript channels. diff --git a/packages/webview_flutter/webview_flutter_wkwebview/CONTRIBUTING.md b/packages/webview_flutter/webview_flutter_wkwebview/CONTRIBUTING.md new file mode 100644 index 00000000000..b4b0e702e47 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/CONTRIBUTING.md @@ -0,0 +1,54 @@ +# Contributing to `webview_flutter_wkwebview` + +Please start by taking a look at the general guide to contributing to the `flutter/packages` repo: +https://github.com/flutter/packages/blob/main/CONTRIBUTING.md + +## Package Structure + +This plugin serves as a platform implementation plugin as outlined in [federated plugins](https://docs.flutter.dev/packages-and-plugins/developing-packages#federated-plugins). +The sections below will provide an overview of how this plugin implements this portion with iOS and +macOS. + +For making changes to this package, please take a look at [changing federated plugins](https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-federated-plugins). + +### Quick Overview + +This plugin implements the platform interface provided by `webview_flutter_platform_interface` using +the native WebKit APIs for WKWebView APIs. + +#### SDK Wrappers + +To access native APIS, this plugins uses Dart wrappers of the native library. The native library is +wrapped using using the `ProxyApi` feature from the `pigeon` package. + +The wrappers for the native library can be updated and modified by changing `pigeons/web_kit.dart`. + +The generated files are located: +* `lib/src/common/web_kit.g.dart` +* `darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebKitLibrary.g.swift` + +To update the wrapper, follow the steps below: + +##### 1. Make changes to the respective pigeon file that matches the native SDK + +* WebKit Dependency: https://developer.apple.com/documentation/webkit +* Pigeon file to update: `pigeons/web_kit.dart` + +##### 2. Run the code generator from the terminal + +Run: `dart run pigeon --input pigeons/web_kit.dart` + +##### 3. Update the generated APIs in native code + +Running the `flutter build` command from step 1 again should provide build errors and indicate what +needs to be done. Alternatively, it can be easier to update native code with the platform's specific +IDE: + +Open `example/ios/` or `example/macos/` in Xcode. + +##### 4. Write API tests + +Assuming a non-static method or constructor was added to the native wrapper, a native test will need +to be added. + +Tests location: `darwin/Tests` diff --git a/packages/webview_flutter/webview_flutter_wkwebview/README.md b/packages/webview_flutter/webview_flutter_wkwebview/README.md index 2822a0c232f..58deca7792c 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/README.md +++ b/packages/webview_flutter/webview_flutter_wkwebview/README.md @@ -29,5 +29,9 @@ Objective-C: Then you will have access to the native class `FWFWebViewFlutterWKWebViewExternalAPI`. +## Contributing + +For information on contributing to this plugin, see [`CONTRIBUTING.md`](CONTRIBUTING.md). + [1]: https://pub.dev/packages/webview_flutter [2]: https://flutter.dev/to/endorsed-federated-plugin diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/AuthenticationChallengeResponseProxyAPITests.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/AuthenticationChallengeResponseProxyAPITests.swift new file mode 100644 index 00000000000..7283ada3926 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/AuthenticationChallengeResponseProxyAPITests.swift @@ -0,0 +1,41 @@ +// 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 XCTest + +@testable import webview_flutter_wkwebview + +class AuthenticationChallengeResponseProxyAPITests: XCTestCase { + func testPigeonDefaultConstructor() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiAuthenticationChallengeResponse(registrar) + + let instance = try? api.pigeonDelegate.pigeonDefaultConstructor( + pigeonApi: api, disposition: UrlSessionAuthChallengeDisposition.useCredential, + credential: URLCredential()) + XCTAssertNotNil(instance) + } + + func testDisposition() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiAuthenticationChallengeResponse(registrar) + + let instance = AuthenticationChallengeResponse( + disposition: .useCredential, credential: URLCredential()) + let value = try? api.pigeonDelegate.disposition(pigeonApi: api, pigeonInstance: instance) + + XCTAssertEqual(value, UrlSessionAuthChallengeDisposition.useCredential) + } + + func testCredential() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiAuthenticationChallengeResponse(registrar) + + let instance = AuthenticationChallengeResponse( + disposition: .useCredential, credential: URLCredential()) + let value = try? api.pigeonDelegate.credential(pigeonApi: api, pigeonInstance: instance) + + XCTAssertEqual(value, instance.credential) + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/ErrorProxyAPITests.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/ErrorProxyAPITests.swift new file mode 100644 index 00000000000..1ac1e1ec92e --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/ErrorProxyAPITests.swift @@ -0,0 +1,42 @@ +// 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 XCTest + +@testable import webview_flutter_wkwebview + +class ErrorProxyAPITests: XCTestCase { + func testCode() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiNSError(registrar) + + let code = 0 + let instance = NSError(domain: "", code: code) + let value = try? api.pigeonDelegate.code(pigeonApi: api, pigeonInstance: instance) + + XCTAssertEqual(value, Int64(code)) + } + + func testDomain() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiNSError(registrar) + + let domain = "domain" + let instance = NSError(domain: domain, code: 0) + let value = try? api.pigeonDelegate.domain(pigeonApi: api, pigeonInstance: instance) + + XCTAssertEqual(value, domain) + } + + func testUserInfo() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiNSError(registrar) + + let userInfo: [String: String?] = ["some": "info"] + let instance = NSError(domain: "", code: 0, userInfo: userInfo as [String: Any]) + let value = try? api.pigeonDelegate.userInfo(pigeonApi: api, pigeonInstance: instance) + + XCTAssertEqual(value as! [String: String?], userInfo) + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFDataConvertersTests.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFDataConvertersTests.m deleted file mode 100644 index 642c138d14b..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFDataConvertersTests.m +++ /dev/null @@ -1,209 +0,0 @@ -// 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 XCTest; -@import webview_flutter_wkwebview; - -#if TARGET_OS_OSX -@import FlutterMacOS; -#else -@import Flutter; -#endif - -#import - -@interface FWFDataConvertersTests : XCTestCase -@end - -@implementation FWFDataConvertersTests -- (void)testFWFNSURLRequestFromRequestData { - NSURLRequest *request = FWFNativeNSURLRequestFromRequestData([FWFNSUrlRequestData - makeWithUrl:@"https://flutter.dev" - httpMethod:@"post" - httpBody:[FlutterStandardTypedData typedDataWithBytes:[NSData data]] - allHttpHeaderFields:@{@"a" : @"header"}]); - - XCTAssertEqualObjects(request.URL, [NSURL URLWithString:@"https://flutter.dev"]); - XCTAssertEqualObjects(request.HTTPMethod, @"POST"); - XCTAssertEqualObjects(request.HTTPBody, [NSData data]); - XCTAssertEqualObjects(request.allHTTPHeaderFields, @{@"a" : @"header"}); -} - -- (void)testFWFNSURLRequestFromRequestDataDoesNotOverrideDefaultValuesWithNull { - NSURLRequest *request = - FWFNativeNSURLRequestFromRequestData([FWFNSUrlRequestData makeWithUrl:@"https://flutter.dev" - httpMethod:nil - httpBody:nil - allHttpHeaderFields:@{}]); - - XCTAssertEqualObjects(request.HTTPMethod, @"GET"); -} - -- (void)testFWFNSHTTPCookieFromCookieData { - NSHTTPCookie *cookie = FWFNativeNSHTTPCookieFromCookieData([FWFNSHttpCookieData - makeWithPropertyKeys:@[ [FWFNSHttpCookiePropertyKeyEnumData - makeWithValue:FWFNSHttpCookiePropertyKeyEnumName] ] - propertyValues:@[ @"cookieName" ]]); - XCTAssertEqualObjects(cookie, - [NSHTTPCookie cookieWithProperties:@{NSHTTPCookieName : @"cookieName"}]); -} - -- (void)testFWFWKUserScriptFromScriptData { - WKUserScript *userScript = FWFNativeWKUserScriptFromScriptData([FWFWKUserScriptData - makeWithSource:@"mySource" - injectionTime:[FWFWKUserScriptInjectionTimeEnumData - makeWithValue:FWFWKUserScriptInjectionTimeEnumAtDocumentStart] - isMainFrameOnly:NO]); - - XCTAssertEqualObjects(userScript.source, @"mySource"); - XCTAssertEqual(userScript.injectionTime, WKUserScriptInjectionTimeAtDocumentStart); - XCTAssertEqual(userScript.isForMainFrameOnly, NO); -} - -- (void)testFWFWKNavigationActionDataFromNavigationAction { - WKNavigationAction *mockNavigationAction = OCMClassMock([WKNavigationAction class]); - - OCMStub([mockNavigationAction navigationType]).andReturn(WKNavigationTypeReload); - - NSURL *testURL = [NSURL URLWithString:@"https://www.flutter.dev/"]; - NSURLRequest *request = [NSURLRequest requestWithURL:testURL]; - OCMStub([mockNavigationAction request]).andReturn(request); - - WKFrameInfo *mockFrameInfo = OCMClassMock([WKFrameInfo class]); - OCMStub([mockFrameInfo isMainFrame]).andReturn(YES); - OCMStub([mockNavigationAction targetFrame]).andReturn(mockFrameInfo); - - FWFWKNavigationActionData *data = - FWFWKNavigationActionDataFromNativeWKNavigationAction(mockNavigationAction); - XCTAssertNotNil(data); - XCTAssertEqual(data.navigationType, FWFWKNavigationTypeReload); -} - -- (void)testFWFNSUrlRequestDataFromNSURLRequest { - NSURL *testURL = [NSURL URLWithString:@"https://www.flutter.dev/"]; - NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:testURL]; - request.HTTPMethod = @"POST"; - request.HTTPBody = [@"aString" dataUsingEncoding:NSUTF8StringEncoding]; - request.allHTTPHeaderFields = @{@"a" : @"field"}; - - FWFNSUrlRequestData *data = FWFNSUrlRequestDataFromNativeNSURLRequest(request); - XCTAssertEqualObjects(data.url, @"https://www.flutter.dev/"); - XCTAssertEqualObjects(data.httpMethod, @"POST"); - XCTAssertEqualObjects(data.httpBody.data, [@"aString" dataUsingEncoding:NSUTF8StringEncoding]); - XCTAssertEqualObjects(data.allHttpHeaderFields, @{@"a" : @"field"}); -} - -- (void)testFWFWKFrameInfoDataFromWKFrameInfo { - WKFrameInfo *mockFrameInfo = OCMClassMock([WKFrameInfo class]); - OCMStub([mockFrameInfo isMainFrame]).andReturn(YES); - - FWFWKFrameInfoData *targetFrameData = FWFWKFrameInfoDataFromNativeWKFrameInfo(mockFrameInfo); - XCTAssertEqual(targetFrameData.isMainFrame, YES); -} - -- (void)testFWFNSErrorDataFromNSError { - NSObject *unsupportedType = [[NSObject alloc] init]; - NSError *error = [NSError errorWithDomain:@"domain" - code:23 - userInfo:@{@"a" : @"b", @"c" : unsupportedType}]; - - FWFNSErrorData *data = FWFNSErrorDataFromNativeNSError(error); - XCTAssertEqual(data.code, 23); - XCTAssertEqualObjects(data.domain, @"domain"); - - NSDictionary *userInfo = @{ - @"a" : @"b", - @"c" : [NSString stringWithFormat:@"Unsupported Type: %@", unsupportedType.description] - }; - XCTAssertEqualObjects(data.userInfo, userInfo); -} - -- (void)testFWFWKScriptMessageDataFromWKScriptMessage { - WKScriptMessage *mockScriptMessage = OCMClassMock([WKScriptMessage class]); - OCMStub([mockScriptMessage name]).andReturn(@"name"); - OCMStub([mockScriptMessage body]).andReturn(@"message"); - - FWFWKScriptMessageData *data = FWFWKScriptMessageDataFromNativeWKScriptMessage(mockScriptMessage); - XCTAssertEqualObjects(data.name, @"name"); - XCTAssertEqualObjects(data.body, @"message"); -} - -- (void)testFWFWKSecurityOriginDataFromWKSecurityOrigin { - WKSecurityOrigin *mockSecurityOrigin = OCMClassMock([WKSecurityOrigin class]); - OCMStub([mockSecurityOrigin host]).andReturn(@"host"); - OCMStub([mockSecurityOrigin port]).andReturn(2); - OCMStub([mockSecurityOrigin protocol]).andReturn(@"protocol"); - - FWFWKSecurityOriginData *data = - FWFWKSecurityOriginDataFromNativeWKSecurityOrigin(mockSecurityOrigin); - XCTAssertEqualObjects(data.host, @"host"); - XCTAssertEqual(data.port, 2); - XCTAssertEqualObjects(data.protocol, @"protocol"); -} - -- (void)testFWFWKPermissionDecisionFromData API_AVAILABLE(ios(15.0), macos(12)) { - XCTAssertEqual(FWFNativeWKPermissionDecisionFromData( - [FWFWKPermissionDecisionData makeWithValue:FWFWKPermissionDecisionDeny]), - WKPermissionDecisionDeny); - XCTAssertEqual(FWFNativeWKPermissionDecisionFromData( - [FWFWKPermissionDecisionData makeWithValue:FWFWKPermissionDecisionGrant]), - WKPermissionDecisionGrant); - XCTAssertEqual(FWFNativeWKPermissionDecisionFromData( - [FWFWKPermissionDecisionData makeWithValue:FWFWKPermissionDecisionPrompt]), - WKPermissionDecisionPrompt); -} - -- (void)testFWFWKMediaCaptureTypeDataFromWKMediaCaptureType API_AVAILABLE(ios(15.0), macos(12)) { - XCTAssertEqual( - FWFWKMediaCaptureTypeDataFromNativeWKMediaCaptureType(WKMediaCaptureTypeCamera).value, - FWFWKMediaCaptureTypeCamera); - XCTAssertEqual( - FWFWKMediaCaptureTypeDataFromNativeWKMediaCaptureType(WKMediaCaptureTypeMicrophone).value, - FWFWKMediaCaptureTypeMicrophone); - XCTAssertEqual( - FWFWKMediaCaptureTypeDataFromNativeWKMediaCaptureType(WKMediaCaptureTypeCameraAndMicrophone) - .value, - FWFWKMediaCaptureTypeCameraAndMicrophone); -} - -- (void)testNSKeyValueChangeKeyConversionReturnsUnknownIfUnrecognized { - XCTAssertEqual( - FWFNSKeyValueChangeKeyEnumDataFromNativeNSKeyValueChangeKey(@"SomeUnknownValue").value, - FWFNSKeyValueChangeKeyEnumUnknown); -} - -- (void)testWKNavigationTypeConversionReturnsUnknownIfUnrecognized { - XCTAssertEqual(FWFWKNavigationTypeFromNativeWKNavigationType(-15), FWFWKNavigationTypeUnknown); -} - -- (void)testFWFWKNavigationResponseDataFromNativeNavigationResponse { - WKNavigationResponse *mockResponse = OCMClassMock([WKNavigationResponse class]); - OCMStub([mockResponse isForMainFrame]).andReturn(YES); - - NSHTTPURLResponse *mockURLResponse = OCMClassMock([NSHTTPURLResponse class]); - OCMStub([mockURLResponse statusCode]).andReturn(1); - OCMStub([mockResponse response]).andReturn(mockURLResponse); - - FWFWKNavigationResponseData *data = - FWFWKNavigationResponseDataFromNativeNavigationResponse(mockResponse); - XCTAssertEqual(data.forMainFrame, YES); -} - -- (void)testFWFNSHttpUrlResponseDataFromNativeNSURLResponse { - NSHTTPURLResponse *mockResponse = OCMClassMock([NSHTTPURLResponse class]); - OCMStub([mockResponse statusCode]).andReturn(1); - - FWFNSHttpUrlResponseData *data = FWFNSHttpUrlResponseDataFromNativeNSURLResponse(mockResponse); - XCTAssertEqual(data.statusCode, 1); -} - -- (void)testFWFNativeWKNavigationResponsePolicyFromEnum { - XCTAssertEqual( - FWFNativeWKNavigationResponsePolicyFromEnum(FWFWKNavigationResponsePolicyEnumAllow), - WKNavigationResponsePolicyAllow); - XCTAssertEqual( - FWFNativeWKNavigationResponsePolicyFromEnum(FWFWKNavigationResponsePolicyEnumCancel), - WKNavigationResponsePolicyCancel); -} -@end diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFErrorTests.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFErrorTests.m deleted file mode 100644 index 422b7e49aee..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFErrorTests.m +++ /dev/null @@ -1,18 +0,0 @@ -// 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 XCTest; - -#import - -@interface FWFErrorTests : XCTestCase -@end - -@implementation FWFErrorTests -- (void)testNSErrorUserInfoKey { - // These MUST match the String values in the Dart class NSErrorUserInfoKey. - XCTAssertEqualObjects(NSLocalizedDescriptionKey, @"NSLocalizedDescription"); - XCTAssertEqualObjects(NSURLErrorFailingURLStringErrorKey, @"NSErrorFailingURLStringKey"); -} -@end diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFHTTPCookieStoreHostApiTests.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFHTTPCookieStoreHostApiTests.m deleted file mode 100644 index eb1e6f250ff..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFHTTPCookieStoreHostApiTests.m +++ /dev/null @@ -1,59 +0,0 @@ -// 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 XCTest; -@import webview_flutter_wkwebview; - -#if TARGET_OS_OSX -@import FlutterMacOS; -#else -@import Flutter; -#endif - -#import - -@interface FWFHTTPCookieStoreHostApiTests : XCTestCase -@end - -@implementation FWFHTTPCookieStoreHostApiTests -- (void)testCreateFromWebsiteDataStoreWithIdentifier { - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - FWFHTTPCookieStoreHostApiImpl *hostAPI = - [[FWFHTTPCookieStoreHostApiImpl alloc] initWithInstanceManager:instanceManager]; - - WKWebsiteDataStore *mockDataStore = OCMClassMock([WKWebsiteDataStore class]); - OCMStub([mockDataStore httpCookieStore]).andReturn(OCMClassMock([WKHTTPCookieStore class])); - [instanceManager addDartCreatedInstance:mockDataStore withIdentifier:0]; - - FlutterError *error; - [hostAPI createFromWebsiteDataStoreWithIdentifier:1 dataStoreIdentifier:0 error:&error]; - WKHTTPCookieStore *cookieStore = (WKHTTPCookieStore *)[instanceManager instanceForIdentifier:1]; - XCTAssertTrue([cookieStore isKindOfClass:[WKHTTPCookieStore class]]); - XCTAssertNil(error); -} - -- (void)testSetCookie { - WKHTTPCookieStore *mockHttpCookieStore = OCMClassMock([WKHTTPCookieStore class]); - - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - [instanceManager addDartCreatedInstance:mockHttpCookieStore withIdentifier:0]; - - FWFHTTPCookieStoreHostApiImpl *hostAPI = - [[FWFHTTPCookieStoreHostApiImpl alloc] initWithInstanceManager:instanceManager]; - - FWFNSHttpCookieData *cookieData = [FWFNSHttpCookieData - makeWithPropertyKeys:@[ [FWFNSHttpCookiePropertyKeyEnumData - makeWithValue:FWFNSHttpCookiePropertyKeyEnumName] ] - propertyValues:@[ @"hello" ]]; - FlutterError *__block blockError; - [hostAPI setCookieForStoreWithIdentifier:0 - cookie:cookieData - completion:^(FlutterError *error) { - blockError = error; - }]; - NSHTTPCookie *cookie = [NSHTTPCookie cookieWithProperties:@{NSHTTPCookieName : @"hello"}]; - OCMVerify([mockHttpCookieStore setCookie:cookie completionHandler:OCMOCK_ANY]); - XCTAssertNil(blockError); -} -@end diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFInstanceManagerTests.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFInstanceManagerTests.m deleted file mode 100644 index 710dcb791b2..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFInstanceManagerTests.m +++ /dev/null @@ -1,73 +0,0 @@ -// 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 XCTest; - -@import webview_flutter_wkwebview; -#if __has_include() -@import webview_flutter_wkwebview.Test; -#endif - -@interface FWFInstanceManagerTests : XCTestCase -@end - -@implementation FWFInstanceManagerTests -- (void)testAddDartCreatedInstance { - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - NSObject *object = [[NSObject alloc] init]; - - [instanceManager addDartCreatedInstance:object withIdentifier:0]; - XCTAssertEqualObjects([instanceManager instanceForIdentifier:0], object); - XCTAssertEqual([instanceManager identifierWithStrongReferenceForInstance:object], 0); -} - -- (void)testAddHostCreatedInstance { - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - NSObject *object = [[NSObject alloc] init]; - [instanceManager addHostCreatedInstance:object]; - - long identifier = [instanceManager identifierWithStrongReferenceForInstance:object]; - XCTAssertNotEqual(identifier, NSNotFound); - XCTAssertEqualObjects([instanceManager instanceForIdentifier:identifier], object); -} - -- (void)testRemoveInstanceWithIdentifier { - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - NSObject *object = [[NSObject alloc] init]; - - [instanceManager addDartCreatedInstance:object withIdentifier:0]; - - XCTAssertEqualObjects([instanceManager removeInstanceWithIdentifier:0], object); - XCTAssertEqual([instanceManager strongInstanceCount], 0); -} - -- (void)testDeallocCallbackIsIgnoredIfNull { -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wnonnull" - // This sets deallocCallback to nil to test that uses are null checked. - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] initWithDeallocCallback:nil]; -#pragma clang diagnostic pop - - [instanceManager addDartCreatedInstance:[[NSObject alloc] init] withIdentifier:0]; - - // Tests that this doesn't cause a EXC_BAD_ACCESS crash. - [instanceManager removeInstanceWithIdentifier:0]; -} - -- (void)testObjectsAreStoredWithPointerHashcode { - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - - NSURL *url1 = [NSURL URLWithString:@"https://www.flutter.dev"]; - NSURL *url2 = [NSURL URLWithString:@"https://www.flutter.dev"]; - - // Ensure urls are considered equal. - XCTAssertTrue([url1 isEqual:url2]); - - [instanceManager addHostCreatedInstance:url1]; - [instanceManager addHostCreatedInstance:url2]; - - XCTAssertNotEqual([instanceManager identifierWithStrongReferenceForInstance:url1], - [instanceManager identifierWithStrongReferenceForInstance:url2]); -} -@end diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFNavigationDelegateHostApiTests.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFNavigationDelegateHostApiTests.m deleted file mode 100644 index 4bd8337070b..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFNavigationDelegateHostApiTests.m +++ /dev/null @@ -1,317 +0,0 @@ -// 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 XCTest; -@import webview_flutter_wkwebview; - -#if TARGET_OS_OSX -@import FlutterMacOS; -#else -@import Flutter; -#endif - -#import - -@interface FWFNavigationDelegateHostApiTests : XCTestCase -@end - -@implementation FWFNavigationDelegateHostApiTests -/** - * Creates a partially mocked FWFNavigationDelegate and adds it to instanceManager. - * - * @param instanceManager Instance manager to add the delegate to. - * @param identifier Identifier for the delegate added to the instanceManager. - * - * @return A mock FWFNavigationDelegate. - */ -- (id)mockNavigationDelegateWithManager:(FWFInstanceManager *)instanceManager - identifier:(long)identifier { - FWFNavigationDelegate *navigationDelegate = [[FWFNavigationDelegate alloc] - initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger)) - instanceManager:instanceManager]; - - [instanceManager addDartCreatedInstance:navigationDelegate withIdentifier:0]; - return OCMPartialMock(navigationDelegate); -} - -/** - * Creates a mock FWFNavigationDelegateFlutterApiImpl with instanceManager. - * - * @param instanceManager Instance manager passed to the Flutter API. - * - * @return A mock FWFNavigationDelegateFlutterApiImpl. - */ -- (id)mockFlutterApiWithManager:(FWFInstanceManager *)instanceManager { - FWFNavigationDelegateFlutterApiImpl *flutterAPI = [[FWFNavigationDelegateFlutterApiImpl alloc] - initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger)) - instanceManager:instanceManager]; - return OCMPartialMock(flutterAPI); -} - -- (void)testCreateWithIdentifier { - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - FWFNavigationDelegateHostApiImpl *hostAPI = [[FWFNavigationDelegateHostApiImpl alloc] - initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger)) - instanceManager:instanceManager]; - - FlutterError *error; - [hostAPI createWithIdentifier:0 error:&error]; - FWFNavigationDelegate *navigationDelegate = - (FWFNavigationDelegate *)[instanceManager instanceForIdentifier:0]; - - XCTAssertTrue([navigationDelegate conformsToProtocol:@protocol(WKNavigationDelegate)]); - XCTAssertNil(error); -} - -- (void)testDidFinishNavigation { - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - - FWFNavigationDelegate *mockDelegate = [self mockNavigationDelegateWithManager:instanceManager - identifier:0]; - FWFNavigationDelegateFlutterApiImpl *mockFlutterAPI = - [self mockFlutterApiWithManager:instanceManager]; - - OCMStub([mockDelegate navigationDelegateAPI]).andReturn(mockFlutterAPI); - - WKWebView *mockWebView = OCMClassMock([WKWebView class]); - OCMStub([mockWebView URL]).andReturn([NSURL URLWithString:@"https://flutter.dev/"]); - [instanceManager addDartCreatedInstance:mockWebView withIdentifier:1]; - - [mockDelegate webView:mockWebView didFinishNavigation:OCMClassMock([WKNavigation class])]; - OCMVerify([mockFlutterAPI didFinishNavigationForDelegateWithIdentifier:0 - webViewIdentifier:1 - URL:@"https://flutter.dev/" - completion:OCMOCK_ANY]); -} - -- (void)testDidStartProvisionalNavigation { - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - - FWFNavigationDelegate *mockDelegate = [self mockNavigationDelegateWithManager:instanceManager - identifier:0]; - FWFNavigationDelegateFlutterApiImpl *mockFlutterAPI = - [self mockFlutterApiWithManager:instanceManager]; - - OCMStub([mockDelegate navigationDelegateAPI]).andReturn(mockFlutterAPI); - - WKWebView *mockWebView = OCMClassMock([WKWebView class]); - OCMStub([mockWebView URL]).andReturn([NSURL URLWithString:@"https://flutter.dev/"]); - [instanceManager addDartCreatedInstance:mockWebView withIdentifier:1]; - - [mockDelegate webView:mockWebView - didStartProvisionalNavigation:OCMClassMock([WKNavigation class])]; - OCMVerify([mockFlutterAPI - didStartProvisionalNavigationForDelegateWithIdentifier:0 - webViewIdentifier:1 - URL:@"https://flutter.dev/" - completion:OCMOCK_ANY]); -} - -- (void)testDecidePolicyForNavigationAction { - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - - FWFNavigationDelegate *mockDelegate = [self mockNavigationDelegateWithManager:instanceManager - identifier:0]; - FWFNavigationDelegateFlutterApiImpl *mockFlutterAPI = - [self mockFlutterApiWithManager:instanceManager]; - - OCMStub([mockDelegate navigationDelegateAPI]).andReturn(mockFlutterAPI); - - WKWebView *mockWebView = OCMClassMock([WKWebView class]); - [instanceManager addDartCreatedInstance:mockWebView withIdentifier:1]; - - WKNavigationAction *mockNavigationAction = OCMClassMock([WKNavigationAction class]); - NSURL *testURL = [NSURL URLWithString:@"https://www.flutter.dev"]; - OCMStub([mockNavigationAction request]).andReturn([NSURLRequest requestWithURL:testURL]); - - WKFrameInfo *mockFrameInfo = OCMClassMock([WKFrameInfo class]); - OCMStub([mockFrameInfo isMainFrame]).andReturn(YES); - OCMStub([mockNavigationAction targetFrame]).andReturn(mockFrameInfo); - - OCMStub([mockFlutterAPI - decidePolicyForNavigationActionForDelegateWithIdentifier:0 - webViewIdentifier:1 - navigationAction: - [OCMArg isKindOfClass:[FWFWKNavigationActionData - class]] - completion: - ([OCMArg - invokeBlockWithArgs: - [FWFWKNavigationActionPolicyEnumData - makeWithValue: - FWFWKNavigationActionPolicyEnumCancel], - [NSNull null], nil])]); - - WKNavigationActionPolicy __block callbackPolicy = -1; - [mockDelegate webView:mockWebView - decidePolicyForNavigationAction:mockNavigationAction - decisionHandler:^(WKNavigationActionPolicy policy) { - callbackPolicy = policy; - }]; - XCTAssertEqual(callbackPolicy, WKNavigationActionPolicyCancel); -} - -- (void)testDidFailNavigation { - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - - FWFNavigationDelegate *mockDelegate = [self mockNavigationDelegateWithManager:instanceManager - identifier:0]; - FWFNavigationDelegateFlutterApiImpl *mockFlutterAPI = - [self mockFlutterApiWithManager:instanceManager]; - - OCMStub([mockDelegate navigationDelegateAPI]).andReturn(mockFlutterAPI); - - WKWebView *mockWebView = OCMClassMock([WKWebView class]); - [instanceManager addDartCreatedInstance:mockWebView withIdentifier:1]; - - [mockDelegate webView:mockWebView - didFailNavigation:OCMClassMock([WKNavigation class]) - withError:[NSError errorWithDomain:@"domain" code:0 userInfo:nil]]; - OCMVerify([mockFlutterAPI - didFailNavigationForDelegateWithIdentifier:0 - webViewIdentifier:1 - error:[OCMArg isKindOfClass:[FWFNSErrorData class]] - completion:OCMOCK_ANY]); -} - -- (void)testDidFailProvisionalNavigation { - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - - FWFNavigationDelegate *mockDelegate = [self mockNavigationDelegateWithManager:instanceManager - identifier:0]; - FWFNavigationDelegateFlutterApiImpl *mockFlutterAPI = - [self mockFlutterApiWithManager:instanceManager]; - - OCMStub([mockDelegate navigationDelegateAPI]).andReturn(mockFlutterAPI); - - WKWebView *mockWebView = OCMClassMock([WKWebView class]); - [instanceManager addDartCreatedInstance:mockWebView withIdentifier:1]; - - [mockDelegate webView:mockWebView - didFailProvisionalNavigation:OCMClassMock([WKNavigation class]) - withError:[NSError errorWithDomain:@"domain" code:0 userInfo:nil]]; - OCMVerify([mockFlutterAPI - didFailProvisionalNavigationForDelegateWithIdentifier:0 - webViewIdentifier:1 - error:[OCMArg isKindOfClass:[FWFNSErrorData - class]] - completion:OCMOCK_ANY]); -} - -- (void)testWebViewWebContentProcessDidTerminate { - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - - FWFNavigationDelegate *mockDelegate = [self mockNavigationDelegateWithManager:instanceManager - identifier:0]; - FWFNavigationDelegateFlutterApiImpl *mockFlutterAPI = - [self mockFlutterApiWithManager:instanceManager]; - - OCMStub([mockDelegate navigationDelegateAPI]).andReturn(mockFlutterAPI); - - WKWebView *mockWebView = OCMClassMock([WKWebView class]); - [instanceManager addDartCreatedInstance:mockWebView withIdentifier:1]; - - [mockDelegate webViewWebContentProcessDidTerminate:mockWebView]; - OCMVerify([mockFlutterAPI - webViewWebContentProcessDidTerminateForDelegateWithIdentifier:0 - webViewIdentifier:1 - completion:OCMOCK_ANY]); -} - -- (void)testDidReceiveAuthenticationChallenge { - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - - FWFNavigationDelegate *mockDelegate = [self mockNavigationDelegateWithManager:instanceManager - identifier:0]; - FWFNavigationDelegateFlutterApiImpl *mockFlutterAPI = - [self mockFlutterApiWithManager:instanceManager]; - - OCMStub([mockDelegate navigationDelegateAPI]).andReturn(mockFlutterAPI); - - WKWebView *mockWebView = OCMClassMock([WKWebView class]); - [instanceManager addDartCreatedInstance:mockWebView withIdentifier:1]; - - NSURLAuthenticationChallenge *mockChallenge = OCMClassMock([NSURLAuthenticationChallenge class]); - NSURLProtectionSpace *protectionSpace = [[NSURLProtectionSpace alloc] initWithHost:@"host" - port:0 - protocol:nil - realm:@"realm" - authenticationMethod:nil]; - OCMStub([mockChallenge protectionSpace]).andReturn(protectionSpace); - [instanceManager addDartCreatedInstance:mockChallenge withIdentifier:2]; - - NSURLCredential *credential = [NSURLCredential credentialWithUser:@"user" - password:@"password" - persistence:NSURLCredentialPersistenceNone]; - [instanceManager addDartCreatedInstance:credential withIdentifier:5]; - - OCMStub([mockFlutterAPI - didReceiveAuthenticationChallengeForDelegateWithIdentifier:0 - webViewIdentifier:1 - challengeIdentifier:2 - completion: - ([OCMArg - invokeBlockWithArgs: - [FWFAuthenticationChallengeResponse - makeWithDisposition: - FWFNSUrlSessionAuthChallengeDispositionCancelAuthenticationChallenge - credentialIdentifier:@(5)], - [NSNull null], nil])]); - - NSURLSessionAuthChallengeDisposition __block callbackDisposition = -1; - NSURLCredential *__block callbackCredential; - [mockDelegate webView:mockWebView - didReceiveAuthenticationChallenge:mockChallenge - completionHandler:^(NSURLSessionAuthChallengeDisposition dispositionArg, - NSURLCredential *credentialArg) { - callbackDisposition = dispositionArg; - callbackCredential = credentialArg; - }]; - - XCTAssertEqual(callbackDisposition, NSURLSessionAuthChallengeCancelAuthenticationChallenge); - XCTAssertEqualObjects(callbackCredential, credential); -} - -- (void)testDecidePolicyForNavigationResponse { - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - - FWFNavigationDelegate *mockDelegate = [self mockNavigationDelegateWithManager:instanceManager - identifier:0]; - FWFNavigationDelegateFlutterApiImpl *mockFlutterAPI = - [self mockFlutterApiWithManager:instanceManager]; - - OCMStub([mockDelegate navigationDelegateAPI]).andReturn(mockFlutterAPI); - - WKWebView *mockWebView = OCMClassMock([WKWebView class]); - [instanceManager addDartCreatedInstance:mockWebView withIdentifier:1]; - - WKNavigationResponse *mockNavigationResponse = OCMClassMock([WKNavigationResponse class]); - OCMStub([mockNavigationResponse isForMainFrame]).andReturn(YES); - - NSHTTPURLResponse *mockURLResponse = OCMClassMock([NSHTTPURLResponse class]); - OCMStub([mockURLResponse statusCode]).andReturn(1); - OCMStub([mockNavigationResponse response]).andReturn(mockURLResponse); - - OCMStub([mockFlutterAPI - decidePolicyForNavigationResponseForDelegateWithIdentifier:0 - webViewIdentifier:1 - navigationResponse:OCMOCK_ANY - completion: - ([OCMArg - invokeBlockWithArgs: - [[FWFWKNavigationResponsePolicyEnumBox - alloc] - initWithValue: - FWFWKNavigationResponsePolicyEnumAllow], - [NSNull null], nil])]); - - WKNavigationResponsePolicy __block callbackPolicy = -1; - [mockDelegate webView:mockWebView - decidePolicyForNavigationResponse:mockNavigationResponse - decisionHandler:^(WKNavigationResponsePolicy policy) { - callbackPolicy = policy; - }]; - XCTAssertEqual(callbackPolicy, WKNavigationResponsePolicyAllow); -} -@end diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFObjectHostApiTests.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFObjectHostApiTests.m deleted file mode 100644 index 4b4f576ffee..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFObjectHostApiTests.m +++ /dev/null @@ -1,190 +0,0 @@ -// 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 XCTest; -@import webview_flutter_wkwebview; - -#if TARGET_OS_OSX -@import FlutterMacOS; -#else -@import Flutter; -#endif - -#import - -@interface FWFObjectHostApiTests : XCTestCase -@end - -@implementation FWFObjectHostApiTests -/** - * Creates a partially mocked FWFObject and adds it to instanceManager. - * - * @param instanceManager Instance manager to add the delegate to. - * @param identifier Identifier for the delegate added to the instanceManager. - * - * @return A mock FWFObject. - */ -- (id)mockObjectWithManager:(FWFInstanceManager *)instanceManager identifier:(long)identifier { - FWFObject *object = - [[FWFObject alloc] initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger)) - instanceManager:instanceManager]; - - [instanceManager addDartCreatedInstance:object withIdentifier:0]; - return OCMPartialMock(object); -} - -/** - * Creates a mock FWFObjectFlutterApiImpl with instanceManager. - * - * @param instanceManager Instance manager passed to the Flutter API. - * - * @return A mock FWFObjectFlutterApiImpl. - */ -- (id)mockFlutterApiWithManager:(FWFInstanceManager *)instanceManager { - FWFObjectFlutterApiImpl *flutterAPI = [[FWFObjectFlutterApiImpl alloc] - initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger)) - instanceManager:instanceManager]; - return OCMPartialMock(flutterAPI); -} - -- (void)testAddObserver { - NSObject *mockObject = OCMClassMock([NSObject class]); - - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - [instanceManager addDartCreatedInstance:mockObject withIdentifier:0]; - - FWFObjectHostApiImpl *hostAPI = - [[FWFObjectHostApiImpl alloc] initWithInstanceManager:instanceManager]; - - NSObject *observerObject = [[NSObject alloc] init]; - [instanceManager addDartCreatedInstance:observerObject withIdentifier:1]; - - FlutterError *error; - [hostAPI - addObserverForObjectWithIdentifier:0 - observerIdentifier:1 - keyPath:@"myKey" - options:@[ - [FWFNSKeyValueObservingOptionsEnumData - makeWithValue:FWFNSKeyValueObservingOptionsEnumOldValue], - [FWFNSKeyValueObservingOptionsEnumData - makeWithValue:FWFNSKeyValueObservingOptionsEnumNewValue] - ] - error:&error]; - - OCMVerify([mockObject addObserver:observerObject - forKeyPath:@"myKey" - options:(NSKeyValueObservingOptionOld | NSKeyValueObservingOptionNew) - context:nil]); - XCTAssertNil(error); -} - -- (void)testRemoveObserver { - NSObject *mockObject = OCMClassMock([NSObject class]); - - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - [instanceManager addDartCreatedInstance:mockObject withIdentifier:0]; - - FWFObjectHostApiImpl *hostAPI = - [[FWFObjectHostApiImpl alloc] initWithInstanceManager:instanceManager]; - - NSObject *observerObject = [[NSObject alloc] init]; - [instanceManager addDartCreatedInstance:observerObject withIdentifier:1]; - - FlutterError *error; - [hostAPI removeObserverForObjectWithIdentifier:0 - observerIdentifier:1 - keyPath:@"myKey" - error:&error]; - OCMVerify([mockObject removeObserver:observerObject forKeyPath:@"myKey"]); - XCTAssertNil(error); -} - -- (void)testDispose { - NSObject *object = [[NSObject alloc] init]; - - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - [instanceManager addDartCreatedInstance:object withIdentifier:0]; - - FWFObjectHostApiImpl *hostAPI = - [[FWFObjectHostApiImpl alloc] initWithInstanceManager:instanceManager]; - - FlutterError *error; - [hostAPI disposeObjectWithIdentifier:0 error:&error]; - // Only the strong reference is removed, so the weak reference will remain until object is set to - // nil. - object = nil; - XCTAssertFalse([instanceManager containsInstance:object]); - XCTAssertNil(error); -} - -- (void)testObserveValueForKeyPath { - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - - FWFObject *mockObject = [self mockObjectWithManager:instanceManager identifier:0]; - FWFObjectFlutterApiImpl *mockFlutterAPI = [self mockFlutterApiWithManager:instanceManager]; - - OCMStub([mockObject objectApi]).andReturn(mockFlutterAPI); - - NSObject *object = [[NSObject alloc] init]; - [instanceManager addDartCreatedInstance:object withIdentifier:1]; - - [mockObject observeValueForKeyPath:@"keyPath" - ofObject:object - change:@{NSKeyValueChangeOldKey : @"key"} - context:nil]; - OCMVerify([mockFlutterAPI - observeValueForObjectWithIdentifier:0 - keyPath:@"keyPath" - objectIdentifier:1 - changeKeys:[OCMArg checkWithBlock:^BOOL( - NSArray - *value) { - return value[0].value == FWFNSKeyValueChangeKeyEnumOldValue; - }] - changeValues:[OCMArg checkWithBlock:^BOOL(id value) { - FWFObjectOrIdentifier *changeObject = - (FWFObjectOrIdentifier *)value[0]; - return !changeObject.isIdentifier && - [@"key" isEqual:changeObject.value]; - }] - completion:OCMOCK_ANY]); -} - -- (void)testObserveValueForKeyPathWithIdentifier { - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - - FWFObject *mockObject = [self mockObjectWithManager:instanceManager identifier:0]; - FWFObjectFlutterApiImpl *mockFlutterAPI = [self mockFlutterApiWithManager:instanceManager]; - - OCMStub([mockObject objectApi]).andReturn(mockFlutterAPI); - - NSObject *object = [[NSObject alloc] init]; - [instanceManager addDartCreatedInstance:object withIdentifier:1]; - - NSObject *returnedObject = [[NSObject alloc] init]; - [instanceManager addDartCreatedInstance:returnedObject withIdentifier:2]; - - [mockObject observeValueForKeyPath:@"keyPath" - ofObject:object - change:@{NSKeyValueChangeOldKey : returnedObject} - context:nil]; - OCMVerify([mockFlutterAPI - observeValueForObjectWithIdentifier:0 - keyPath:@"keyPath" - objectIdentifier:1 - changeKeys:[OCMArg checkWithBlock:^BOOL( - NSArray - *value) { - return value[0].value == FWFNSKeyValueChangeKeyEnumOldValue; - }] - changeValues:[OCMArg checkWithBlock:^BOOL(id value) { - FWFObjectOrIdentifier *changeObject = - (FWFObjectOrIdentifier *)value[0]; - return changeObject.isIdentifier && - [@(2) isEqual:changeObject.value]; - }] - completion:OCMOCK_ANY]); -} -@end diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFPreferencesHostApiTests.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFPreferencesHostApiTests.m deleted file mode 100644 index f0f91961978..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFPreferencesHostApiTests.m +++ /dev/null @@ -1,48 +0,0 @@ -// 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 XCTest; -@import webview_flutter_wkwebview; - -#if TARGET_OS_OSX -@import FlutterMacOS; -#else -@import Flutter; -#endif - -#import - -@interface FWFPreferencesHostApiTests : XCTestCase -@end - -@implementation FWFPreferencesHostApiTests -- (void)testCreateFromWebViewConfigurationWithIdentifier { - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - FWFPreferencesHostApiImpl *hostAPI = - [[FWFPreferencesHostApiImpl alloc] initWithInstanceManager:instanceManager]; - - [instanceManager addDartCreatedInstance:[[WKWebViewConfiguration alloc] init] withIdentifier:0]; - - FlutterError *error; - [hostAPI createFromWebViewConfigurationWithIdentifier:1 configurationIdentifier:0 error:&error]; - WKPreferences *preferences = (WKPreferences *)[instanceManager instanceForIdentifier:1]; - XCTAssertTrue([preferences isKindOfClass:[WKPreferences class]]); - XCTAssertNil(error); -} - -- (void)testSetJavaScriptEnabled { - WKPreferences *mockPreferences = OCMClassMock([WKPreferences class]); - - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - [instanceManager addDartCreatedInstance:mockPreferences withIdentifier:0]; - - FWFPreferencesHostApiImpl *hostAPI = - [[FWFPreferencesHostApiImpl alloc] initWithInstanceManager:instanceManager]; - - FlutterError *error; - [hostAPI setJavaScriptEnabledForPreferencesWithIdentifier:0 isEnabled:YES error:&error]; - OCMVerify([mockPreferences setJavaScriptEnabled:YES]); - XCTAssertNil(error); -} -@end diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFScriptMessageHandlerHostApiTests.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFScriptMessageHandlerHostApiTests.m deleted file mode 100644 index 30064b5dfaa..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFScriptMessageHandlerHostApiTests.m +++ /dev/null @@ -1,92 +0,0 @@ -// 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 XCTest; -@import webview_flutter_wkwebview; - -#if TARGET_OS_OSX -@import FlutterMacOS; -#else -@import Flutter; -#endif - -#import - -@interface FWFScriptMessageHandlerHostApiTests : XCTestCase -@end - -@implementation FWFScriptMessageHandlerHostApiTests -/** - * Creates a partially mocked FWFScriptMessageHandler and adds it to instanceManager. - * - * @param instanceManager Instance manager to add the delegate to. - * @param identifier Identifier for the delegate added to the instanceManager. - * - * @return A mock FWFScriptMessageHandler. - */ -- (id)mockHandlerWithManager:(FWFInstanceManager *)instanceManager identifier:(long)identifier { - FWFScriptMessageHandler *handler = [[FWFScriptMessageHandler alloc] - initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger)) - instanceManager:instanceManager]; - - [instanceManager addDartCreatedInstance:handler withIdentifier:0]; - return OCMPartialMock(handler); -} - -/** - * Creates a mock FWFScriptMessageHandlerFlutterApiImpl with instanceManager. - * - * @param instanceManager Instance manager passed to the Flutter API. - * - * @return A mock FWFScriptMessageHandlerFlutterApiImpl. - */ -- (id)mockFlutterApiWithManager:(FWFInstanceManager *)instanceManager { - FWFScriptMessageHandlerFlutterApiImpl *flutterAPI = [[FWFScriptMessageHandlerFlutterApiImpl alloc] - initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger)) - instanceManager:instanceManager]; - return OCMPartialMock(flutterAPI); -} - -- (void)testCreateWithIdentifier { - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - FWFScriptMessageHandlerHostApiImpl *hostAPI = [[FWFScriptMessageHandlerHostApiImpl alloc] - initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger)) - instanceManager:instanceManager]; - - FlutterError *error; - [hostAPI createWithIdentifier:0 error:&error]; - - FWFScriptMessageHandler *scriptMessageHandler = - (FWFScriptMessageHandler *)[instanceManager instanceForIdentifier:0]; - - XCTAssertTrue([scriptMessageHandler conformsToProtocol:@protocol(WKScriptMessageHandler)]); - XCTAssertNil(error); -} - -- (void)testDidReceiveScriptMessageForHandler { - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - - FWFScriptMessageHandler *mockHandler = [self mockHandlerWithManager:instanceManager identifier:0]; - FWFScriptMessageHandlerFlutterApiImpl *mockFlutterAPI = - [self mockFlutterApiWithManager:instanceManager]; - - OCMStub([mockHandler scriptMessageHandlerAPI]).andReturn(mockFlutterAPI); - - WKUserContentController *userContentController = [[WKUserContentController alloc] init]; - [instanceManager addDartCreatedInstance:userContentController withIdentifier:1]; - - WKScriptMessage *mockScriptMessage = OCMClassMock([WKScriptMessage class]); - OCMStub([mockScriptMessage name]).andReturn(@"name"); - OCMStub([mockScriptMessage body]).andReturn(@"message"); - - [mockHandler userContentController:userContentController - didReceiveScriptMessage:mockScriptMessage]; - OCMVerify([mockFlutterAPI - didReceiveScriptMessageForHandlerWithIdentifier:0 - userContentControllerIdentifier:1 - message:[OCMArg isKindOfClass:[FWFWKScriptMessageData - class]] - completion:OCMOCK_ANY]); -} -@end diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFScrollViewDelegateHostApiTests.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFScrollViewDelegateHostApiTests.m deleted file mode 100644 index 21a6f4e7020..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFScrollViewDelegateHostApiTests.m +++ /dev/null @@ -1,89 +0,0 @@ -// 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. - -#include "TargetConditionals.h" - -// The scroll view delegate does not exist on macOS. -#if !TARGET_OS_OSX - -@import Flutter; -@import XCTest; -@import webview_flutter_wkwebview; - -#import - -@interface FWFScrollViewDelegateHostApiTests : XCTestCase - -@end - -@implementation FWFScrollViewDelegateHostApiTests -/** - * Creates a partially mocked FWFScrollViewDelegate and adds it to instanceManager. - * - * @param instanceManager Instance manager to add the delegate to. - * @param identifier Identifier for the delegate added to the instanceManager. - * - * @return A mock FWFScrollViewDelegate. - */ -- (id)mockDelegateWithManager:(FWFInstanceManager *)instanceManager identifier:(long)identifier { - FWFScrollViewDelegate *delegate = [[FWFScrollViewDelegate alloc] - initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger)) - instanceManager:instanceManager]; - - [instanceManager addDartCreatedInstance:delegate withIdentifier:0]; - return OCMPartialMock(delegate); -} - -/** - * Creates a mock FWFUIScrollViewDelegateFlutterApiImpl with instanceManager. - * - * @param instanceManager Instance manager passed to the Flutter API. - * - * @return A mock FWFUIScrollViewDelegateFlutterApiImpl. - */ -- (id)mockFlutterApiWithManager:(FWFInstanceManager *)instanceManager { - FWFScrollViewDelegateFlutterApiImpl *flutterAPI = [[FWFScrollViewDelegateFlutterApiImpl alloc] - initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger)) - instanceManager:instanceManager]; - return OCMPartialMock(flutterAPI); -} - -- (void)testCreateWithIdentifier { - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - FWFScrollViewDelegateHostApiImpl *hostAPI = [[FWFScrollViewDelegateHostApiImpl alloc] - initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger)) - instanceManager:instanceManager]; - - FlutterError *error; - [hostAPI createWithIdentifier:0 error:&error]; - FWFScrollViewDelegate *delegate = - (FWFScrollViewDelegate *)[instanceManager instanceForIdentifier:0]; - - XCTAssertTrue([delegate conformsToProtocol:@protocol(UIScrollViewDelegate)]); - XCTAssertNil(error); -} - -- (void)testOnScrollViewDidScrollForDelegateWithIdentifier { - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - - FWFScrollViewDelegate *mockDelegate = [self mockDelegateWithManager:instanceManager identifier:0]; - FWFScrollViewDelegateFlutterApiImpl *mockFlutterAPI = - [self mockFlutterApiWithManager:instanceManager]; - - OCMStub([mockDelegate scrollViewDelegateAPI]).andReturn(mockFlutterAPI); - UIScrollView *scrollView = [[UIScrollView alloc] init]; - scrollView.contentOffset = CGPointMake(1.0, 2.0); - - [instanceManager addDartCreatedInstance:scrollView withIdentifier:1]; - - [mockDelegate scrollViewDidScroll:scrollView]; - OCMVerify([mockFlutterAPI scrollViewDidScrollWithIdentifier:0 - UIScrollViewIdentifier:1 - x:1.0 - y:2.0 - completion:OCMOCK_ANY]); -} -@end - -#endif // !TARGET_OS_OSX diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFScrollViewHostApiTests.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFScrollViewHostApiTests.m deleted file mode 100644 index 17512ce4b5c..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFScrollViewHostApiTests.m +++ /dev/null @@ -1,88 +0,0 @@ -// 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 "TargetConditionals.h" - -// Scroll view APIs do not existing on macOS. -#if !TARGET_OS_OSX - -@import Flutter; -@import XCTest; -@import webview_flutter_wkwebview; - -#import - -@interface FWFScrollViewHostApiTests : XCTestCase -@end - -@implementation FWFScrollViewHostApiTests -- (void)testGetContentOffset { - UIScrollView *mockScrollView = OCMClassMock([UIScrollView class]); - OCMStub([mockScrollView contentOffset]).andReturn(CGPointMake(1.0, 2.0)); - - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - [instanceManager addDartCreatedInstance:mockScrollView withIdentifier:0]; - - FWFScrollViewHostApiImpl *hostAPI = - [[FWFScrollViewHostApiImpl alloc] initWithInstanceManager:instanceManager]; - - FlutterError *error; - NSArray *expectedValue = @[ @1.0, @2.0 ]; - XCTAssertEqualObjects([hostAPI contentOffsetForScrollViewWithIdentifier:0 error:&error], - expectedValue); - XCTAssertNil(error); -} - -- (void)testScrollBy { - UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, 500, 500)]; - scrollView.contentOffset = CGPointMake(1, 2); - - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - [instanceManager addDartCreatedInstance:scrollView withIdentifier:0]; - - FWFScrollViewHostApiImpl *hostAPI = - [[FWFScrollViewHostApiImpl alloc] initWithInstanceManager:instanceManager]; - - FlutterError *error; - [hostAPI scrollByForScrollViewWithIdentifier:0 x:1 y:2 error:&error]; - XCTAssertEqual(scrollView.contentOffset.x, 2); - XCTAssertEqual(scrollView.contentOffset.y, 4); - XCTAssertNil(error); -} - -- (void)testSetContentOffset { - UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, 500, 500)]; - - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - [instanceManager addDartCreatedInstance:scrollView withIdentifier:0]; - - FWFScrollViewHostApiImpl *hostAPI = - [[FWFScrollViewHostApiImpl alloc] initWithInstanceManager:instanceManager]; - - FlutterError *error; - [hostAPI setContentOffsetForScrollViewWithIdentifier:0 toX:1 y:2 error:&error]; - XCTAssertEqual(scrollView.contentOffset.x, 1); - XCTAssertEqual(scrollView.contentOffset.y, 2); - XCTAssertNil(error); -} - -- (void)testSetDelegateForScrollView { - UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, 500, 500)]; - FWFScrollViewDelegate *delegate = [[FWFScrollViewDelegate alloc] init]; - - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - [instanceManager addDartCreatedInstance:scrollView withIdentifier:0]; - [instanceManager addDartCreatedInstance:delegate withIdentifier:1]; - - FWFScrollViewHostApiImpl *hostAPI = - [[FWFScrollViewHostApiImpl alloc] initWithInstanceManager:instanceManager]; - - FlutterError *error; - [hostAPI setDelegateForScrollViewWithIdentifier:0 uiScrollViewDelegateIdentifier:@1 error:&error]; - XCTAssertEqual(scrollView.delegate, delegate); - XCTAssertNil(error); -} -@end - -#endif // !TARGET_OS_OSX diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFUIDelegateHostApiTests.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFUIDelegateHostApiTests.m deleted file mode 100644 index 792d65da669..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFUIDelegateHostApiTests.m +++ /dev/null @@ -1,148 +0,0 @@ -// 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 XCTest; -@import webview_flutter_wkwebview; -#if __has_include() -@import webview_flutter_wkwebview.Test; -#endif - -#if TARGET_OS_OSX -@import FlutterMacOS; -#else -@import Flutter; -#endif - -#import - -@interface FWFUIDelegateHostApiTests : XCTestCase -@end - -@implementation FWFUIDelegateHostApiTests -/** - * Creates a partially mocked FWFUIDelegate and adds it to instanceManager. - * - * @param instanceManager Instance manager to add the delegate to. - * @param identifier Identifier for the delegate added to the instanceManager. - * - * @return A mock FWFUIDelegate. - */ -- (id)mockDelegateWithManager:(FWFInstanceManager *)instanceManager identifier:(long)identifier { - FWFUIDelegate *delegate = [[FWFUIDelegate alloc] - initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger)) - instanceManager:instanceManager]; - - [instanceManager addDartCreatedInstance:delegate withIdentifier:0]; - return OCMPartialMock(delegate); -} - -/** - * Creates a mock FWFUIDelegateFlutterApiImpl with instanceManager. - * - * @param instanceManager Instance manager passed to the Flutter API. - * - * @return A mock FWFUIDelegateFlutterApiImpl. - */ -- (id)mockFlutterApiWithManager:(FWFInstanceManager *)instanceManager { - FWFUIDelegateFlutterApiImpl *flutterAPI = [[FWFUIDelegateFlutterApiImpl alloc] - initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger)) - instanceManager:instanceManager]; - return OCMPartialMock(flutterAPI); -} - -- (void)testCreateWithIdentifier { - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - FWFUIDelegateHostApiImpl *hostAPI = [[FWFUIDelegateHostApiImpl alloc] - initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger)) - instanceManager:instanceManager]; - - FlutterError *error; - [hostAPI createWithIdentifier:0 error:&error]; - FWFUIDelegate *delegate = (FWFUIDelegate *)[instanceManager instanceForIdentifier:0]; - - XCTAssertTrue([delegate conformsToProtocol:@protocol(WKUIDelegate)]); - XCTAssertNil(error); -} - -- (void)testOnCreateWebViewForDelegateWithIdentifier { - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - - FWFUIDelegate *mockDelegate = [self mockDelegateWithManager:instanceManager identifier:0]; - FWFUIDelegateFlutterApiImpl *mockFlutterAPI = [self mockFlutterApiWithManager:instanceManager]; - - OCMStub([mockDelegate UIDelegateAPI]).andReturn(mockFlutterAPI); - - WKWebView *mockWebView = OCMClassMock([WKWebView class]); - [instanceManager addDartCreatedInstance:mockWebView withIdentifier:1]; - - WKWebViewConfiguration *configuration = [[WKWebViewConfiguration alloc] init]; - id mockConfigurationFlutterApi = OCMPartialMock(mockFlutterAPI.webViewConfigurationFlutterApi); - OCMStub([mockConfigurationFlutterApi createWithIdentifier:0 completion:OCMOCK_ANY]) - .ignoringNonObjectArgs(); - - WKNavigationAction *mockNavigationAction = OCMClassMock([WKNavigationAction class]); - NSURL *testURL = [NSURL URLWithString:@"https://www.flutter.dev"]; - OCMStub([mockNavigationAction request]).andReturn([NSURLRequest requestWithURL:testURL]); - - WKFrameInfo *mockFrameInfo = OCMClassMock([WKFrameInfo class]); - OCMStub([mockFrameInfo isMainFrame]).andReturn(YES); - OCMStub([mockNavigationAction targetFrame]).andReturn(mockFrameInfo); - - // Creating the webview will create a configuration on the host side, using the next available - // identifier, so save that for checking against later. - NSInteger configurationIdentifier = instanceManager.nextIdentifier; - [mockDelegate webView:mockWebView - createWebViewWithConfiguration:configuration - forNavigationAction:mockNavigationAction - windowFeatures:OCMClassMock([WKWindowFeatures class])]; - OCMVerify([mockFlutterAPI - onCreateWebViewForDelegateWithIdentifier:0 - webViewIdentifier:1 - configurationIdentifier:configurationIdentifier - navigationAction:[OCMArg - isKindOfClass:[FWFWKNavigationActionData class]] - completion:OCMOCK_ANY]); -} - -- (void)testRequestMediaCapturePermissionForOrigin API_AVAILABLE(ios(15.0), macos(12)) { - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - - FWFUIDelegate *mockDelegate = [self mockDelegateWithManager:instanceManager identifier:0]; - FWFUIDelegateFlutterApiImpl *mockFlutterAPI = [self mockFlutterApiWithManager:instanceManager]; - - OCMStub([mockDelegate UIDelegateAPI]).andReturn(mockFlutterAPI); - - WKWebView *mockWebView = OCMClassMock([WKWebView class]); - [instanceManager addDartCreatedInstance:mockWebView withIdentifier:1]; - - WKSecurityOrigin *mockSecurityOrigin = OCMClassMock([WKSecurityOrigin class]); - OCMStub([mockSecurityOrigin host]).andReturn(@""); - OCMStub([mockSecurityOrigin port]).andReturn(0); - OCMStub([mockSecurityOrigin protocol]).andReturn(@""); - - WKFrameInfo *mockFrameInfo = OCMClassMock([WKFrameInfo class]); - OCMStub([mockFrameInfo isMainFrame]).andReturn(YES); - - [mockDelegate webView:mockWebView - requestMediaCapturePermissionForOrigin:mockSecurityOrigin - initiatedByFrame:mockFrameInfo - type:WKMediaCaptureTypeMicrophone - decisionHandler:^(WKPermissionDecision decision){ - }]; - - OCMVerify([mockFlutterAPI - requestMediaCapturePermissionForDelegateWithIdentifier:0 - webViewIdentifier:1 - origin:[OCMArg isKindOfClass: - [FWFWKSecurityOriginData - class]] - frame:[OCMArg - isKindOfClass:[FWFWKFrameInfoData - class]] - type:[OCMArg isKindOfClass: - [FWFWKMediaCaptureTypeData - class]] - completion:OCMOCK_ANY]); -} -@end diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFUIViewHostApiTests.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFUIViewHostApiTests.m deleted file mode 100644 index 4c2ceecfaa9..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFUIViewHostApiTests.m +++ /dev/null @@ -1,55 +0,0 @@ -// 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 "TargetConditionals.h" - -#if !TARGET_OS_OSX - -@import Flutter; -@import XCTest; -@import webview_flutter_wkwebview; - -#import - -@interface FWFUIViewHostApiTests : XCTestCase -@end - -@implementation FWFUIViewHostApiTests -- (void)testSetBackgroundColor { - UIView *mockUIView = OCMClassMock([UIView class]); - - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - [instanceManager addDartCreatedInstance:mockUIView withIdentifier:0]; - - FWFUIViewHostApiImpl *hostAPI = - [[FWFUIViewHostApiImpl alloc] initWithInstanceManager:instanceManager]; - - FlutterError *error; - [hostAPI setBackgroundColorForViewWithIdentifier:0 toValue:@123 error:&error]; - - OCMVerify([mockUIView setBackgroundColor:[UIColor colorWithRed:(123 >> 16 & 0xff) / 255.0 - green:(123 >> 8 & 0xff) / 255.0 - blue:(123 & 0xff) / 255.0 - alpha:(123 >> 24 & 0xff) / 255.0]]); - XCTAssertNil(error); -} - -- (void)testSetOpaque { - UIView *mockUIView = OCMClassMock([UIView class]); - - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - [instanceManager addDartCreatedInstance:mockUIView withIdentifier:0]; - - FWFUIViewHostApiImpl *hostAPI = - [[FWFUIViewHostApiImpl alloc] initWithInstanceManager:instanceManager]; - - FlutterError *error; - [hostAPI setOpaqueForViewWithIdentifier:0 isOpaque:YES error:&error]; - OCMVerify([mockUIView setOpaque:YES]); - XCTAssertNil(error); -} - -@end - -#endif // !TARGET_OS_OSX diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFURLAuthenticationChallengeHostApiTests.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFURLAuthenticationChallengeHostApiTests.m deleted file mode 100644 index ff6fb663cf8..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFURLAuthenticationChallengeHostApiTests.m +++ /dev/null @@ -1,52 +0,0 @@ -// 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 XCTest; -@import webview_flutter_wkwebview; - -#if TARGET_OS_OSX -@import FlutterMacOS; -#else -@import Flutter; -#endif - -#import - -@interface FWFURLAuthenticationChallengeHostApiTests : XCTestCase - -@end - -@implementation FWFURLAuthenticationChallengeHostApiTests -- (void)testFlutterApiCreate { - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - FWFURLAuthenticationChallengeFlutterApiImpl *flutterApi = - [[FWFURLAuthenticationChallengeFlutterApiImpl alloc] - initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger)) - instanceManager:instanceManager]; - - flutterApi.api = OCMClassMock([FWFNSUrlAuthenticationChallengeFlutterApi class]); - - NSURLProtectionSpace *protectionSpace = [[NSURLProtectionSpace alloc] initWithHost:@"host" - port:0 - protocol:nil - realm:@"realm" - authenticationMethod:nil]; - - NSURLAuthenticationChallenge *mockChallenge = OCMClassMock([NSURLAuthenticationChallenge class]); - OCMStub([mockChallenge protectionSpace]).andReturn(protectionSpace); - - [flutterApi createWithInstance:mockChallenge - protectionSpace:protectionSpace - completion:^(FlutterError *error){ - - }]; - - long identifier = [instanceManager identifierWithStrongReferenceForInstance:mockChallenge]; - long protectionSpaceIdentifier = - [instanceManager identifierWithStrongReferenceForInstance:protectionSpace]; - OCMVerify([flutterApi.api createWithIdentifier:identifier - protectionSpaceIdentifier:protectionSpaceIdentifier - completion:OCMOCK_ANY]); -} -@end diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFURLCredentialHostApiTests.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFURLCredentialHostApiTests.m deleted file mode 100644 index bcc9f59e506..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFURLCredentialHostApiTests.m +++ /dev/null @@ -1,40 +0,0 @@ -// 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 XCTest; -@import webview_flutter_wkwebview; - -#if TARGET_OS_OSX -@import FlutterMacOS; -#else -@import Flutter; -#endif - -#import - -@interface FWFURLCredentialHostApiTests : XCTestCase -@end - -@implementation FWFURLCredentialHostApiTests -- (void)testHostApiCreate { - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - - FWFURLCredentialHostApiImpl *hostApi = [[FWFURLCredentialHostApiImpl alloc] - initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger)) - instanceManager:instanceManager]; - - FlutterError *error; - [hostApi createWithUserWithIdentifier:0 - user:@"user" - password:@"password" - persistence:FWFNSUrlCredentialPersistencePermanent - error:&error]; - XCTAssertNil(error); - - NSURLCredential *credential = (NSURLCredential *)[instanceManager instanceForIdentifier:0]; - XCTAssertEqualObjects(credential.user, @"user"); - XCTAssertEqualObjects(credential.password, @"password"); - XCTAssertEqual(credential.persistence, NSURLCredentialPersistencePermanent); -} -@end diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFURLProtectionSpaceHostApiTests.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFURLProtectionSpaceHostApiTests.m deleted file mode 100644 index be5738e919e..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFURLProtectionSpaceHostApiTests.m +++ /dev/null @@ -1,48 +0,0 @@ -// 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 XCTest; -@import webview_flutter_wkwebview; - -#if TARGET_OS_OSX -@import FlutterMacOS; -#else -@import Flutter; -#endif - -#import - -@interface FWFURLProtectionSpaceHostApiTests : XCTestCase -@end - -@implementation FWFURLProtectionSpaceHostApiTests -- (void)testFlutterApiCreate { - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - FWFURLProtectionSpaceFlutterApiImpl *flutterApi = [[FWFURLProtectionSpaceFlutterApiImpl alloc] - initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger)) - instanceManager:instanceManager]; - - flutterApi.api = OCMClassMock([FWFNSUrlProtectionSpaceFlutterApi class]); - - NSURLProtectionSpace *protectionSpace = [[NSURLProtectionSpace alloc] initWithHost:@"host" - port:0 - protocol:nil - realm:@"realm" - authenticationMethod:nil]; - [flutterApi createWithInstance:protectionSpace - host:@"host" - realm:@"realm" - authenticationMethod:@"method" - completion:^(FlutterError *error){ - - }]; - - long identifier = [instanceManager identifierWithStrongReferenceForInstance:protectionSpace]; - OCMVerify([flutterApi.api createWithIdentifier:identifier - host:@"host" - realm:@"realm" - authenticationMethod:@"method" - completion:OCMOCK_ANY]); -} -@end diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFURLTests.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFURLTests.m deleted file mode 100644 index a2e88197ca8..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFURLTests.m +++ /dev/null @@ -1,53 +0,0 @@ -// 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 XCTest; -@import webview_flutter_wkwebview; - -#if TARGET_OS_OSX -@import FlutterMacOS; -#else -@import Flutter; -#endif - -#import - -@interface FWFURLTests : XCTestCase -@end - -@implementation FWFURLTests -- (void)testAbsoluteString { - NSURL *mockUrl = OCMClassMock([NSURL class]); - OCMStub([mockUrl absoluteString]).andReturn(@"https://www.google.com"); - - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - [instanceManager addDartCreatedInstance:mockUrl withIdentifier:0]; - - FWFURLHostApiImpl *hostApi = [[FWFURLHostApiImpl alloc] - initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger)) - instanceManager:instanceManager]; - - FlutterError *error; - XCTAssertEqualObjects([hostApi absoluteStringForNSURLWithIdentifier:0 error:&error], - @"https://www.google.com"); - XCTAssertNil(error); -} - -- (void)testFlutterApiCreate { - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - FWFURLFlutterApiImpl *flutterApi = [[FWFURLFlutterApiImpl alloc] - initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger)) - instanceManager:instanceManager]; - - flutterApi.api = OCMClassMock([FWFNSUrlFlutterApi class]); - - NSURL *url = [[NSURL alloc] initWithString:@"https://www.google.com"]; - [flutterApi create:url - completion:^(FlutterError *error){ - }]; - - long identifier = [instanceManager identifierWithStrongReferenceForInstance:url]; - OCMVerify([flutterApi.api createWithIdentifier:identifier completion:OCMOCK_ANY]); -} -@end diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFUserContentControllerHostApiTests.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFUserContentControllerHostApiTests.m deleted file mode 100644 index 82ca3261d1a..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFUserContentControllerHostApiTests.m +++ /dev/null @@ -1,132 +0,0 @@ -// 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 XCTest; -@import webview_flutter_wkwebview; - -#if TARGET_OS_OSX -@import FlutterMacOS; -#else -@import Flutter; -#endif - -#import - -@interface FWFUserContentControllerHostApiTests : XCTestCase -@end - -@implementation FWFUserContentControllerHostApiTests -- (void)testCreateFromWebViewConfigurationWithIdentifier { - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - FWFUserContentControllerHostApiImpl *hostAPI = - [[FWFUserContentControllerHostApiImpl alloc] initWithInstanceManager:instanceManager]; - - [instanceManager addDartCreatedInstance:[[WKWebViewConfiguration alloc] init] withIdentifier:0]; - - FlutterError *error; - [hostAPI createFromWebViewConfigurationWithIdentifier:1 configurationIdentifier:0 error:&error]; - WKUserContentController *userContentController = - (WKUserContentController *)[instanceManager instanceForIdentifier:1]; - XCTAssertTrue([userContentController isKindOfClass:[WKUserContentController class]]); - XCTAssertNil(error); -} - -- (void)testAddScriptMessageHandler { - WKUserContentController *mockUserContentController = - OCMClassMock([WKUserContentController class]); - - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - [instanceManager addDartCreatedInstance:mockUserContentController withIdentifier:0]; - - FWFUserContentControllerHostApiImpl *hostAPI = - [[FWFUserContentControllerHostApiImpl alloc] initWithInstanceManager:instanceManager]; - - id mockMessageHandler = - OCMProtocolMock(@protocol(WKScriptMessageHandler)); - [instanceManager addDartCreatedInstance:mockMessageHandler withIdentifier:1]; - - FlutterError *error; - [hostAPI addScriptMessageHandlerForControllerWithIdentifier:0 - handlerIdentifier:1 - ofName:@"apple" - error:&error]; - OCMVerify([mockUserContentController addScriptMessageHandler:mockMessageHandler name:@"apple"]); - XCTAssertNil(error); -} - -- (void)testRemoveScriptMessageHandler { - WKUserContentController *mockUserContentController = - OCMClassMock([WKUserContentController class]); - - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - [instanceManager addDartCreatedInstance:mockUserContentController withIdentifier:0]; - - FWFUserContentControllerHostApiImpl *hostAPI = - [[FWFUserContentControllerHostApiImpl alloc] initWithInstanceManager:instanceManager]; - - FlutterError *error; - [hostAPI removeScriptMessageHandlerForControllerWithIdentifier:0 name:@"apple" error:&error]; - OCMVerify([mockUserContentController removeScriptMessageHandlerForName:@"apple"]); - XCTAssertNil(error); -} - -- (void)testRemoveAllScriptMessageHandlers API_AVAILABLE(ios(14.0), macos(11)) { - WKUserContentController *mockUserContentController = - OCMClassMock([WKUserContentController class]); - - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - [instanceManager addDartCreatedInstance:mockUserContentController withIdentifier:0]; - - FWFUserContentControllerHostApiImpl *hostAPI = - [[FWFUserContentControllerHostApiImpl alloc] initWithInstanceManager:instanceManager]; - - FlutterError *error; - [hostAPI removeAllScriptMessageHandlersForControllerWithIdentifier:0 error:&error]; - OCMVerify([mockUserContentController removeAllScriptMessageHandlers]); - XCTAssertNil(error); -} - -- (void)testAddUserScript { - WKUserContentController *mockUserContentController = - OCMClassMock([WKUserContentController class]); - - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - [instanceManager addDartCreatedInstance:mockUserContentController withIdentifier:0]; - - FWFUserContentControllerHostApiImpl *hostAPI = - [[FWFUserContentControllerHostApiImpl alloc] initWithInstanceManager:instanceManager]; - - FlutterError *error; - [hostAPI - addUserScriptForControllerWithIdentifier:0 - userScript: - [FWFWKUserScriptData - makeWithSource:@"runAScript" - injectionTime: - [FWFWKUserScriptInjectionTimeEnumData - makeWithValue: - FWFWKUserScriptInjectionTimeEnumAtDocumentEnd] - isMainFrameOnly:YES] - error:&error]; - - OCMVerify([mockUserContentController addUserScript:[OCMArg isKindOfClass:[WKUserScript class]]]); - XCTAssertNil(error); -} - -- (void)testRemoveAllUserScripts { - WKUserContentController *mockUserContentController = - OCMClassMock([WKUserContentController class]); - - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - [instanceManager addDartCreatedInstance:mockUserContentController withIdentifier:0]; - - FWFUserContentControllerHostApiImpl *hostAPI = - [[FWFUserContentControllerHostApiImpl alloc] initWithInstanceManager:instanceManager]; - - FlutterError *error; - [hostAPI removeAllUserScriptsForControllerWithIdentifier:0 error:&error]; - OCMVerify([mockUserContentController removeAllUserScripts]); - XCTAssertNil(error); -} -@end diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFWebViewConfigurationHostApiTests.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFWebViewConfigurationHostApiTests.m deleted file mode 100644 index 585f4cd047c..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFWebViewConfigurationHostApiTests.m +++ /dev/null @@ -1,116 +0,0 @@ -// 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 XCTest; -@import webview_flutter_wkwebview; - -#if TARGET_OS_OSX -@import FlutterMacOS; -#else -@import Flutter; -#endif - -#import - -@interface FWFWebViewConfigurationHostApiTests : XCTestCase -@end - -@implementation FWFWebViewConfigurationHostApiTests -- (void)testCreateWithIdentifier { - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - FWFWebViewConfigurationHostApiImpl *hostAPI = [[FWFWebViewConfigurationHostApiImpl alloc] - initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger)) - instanceManager:instanceManager]; - - FlutterError *error; - [hostAPI createWithIdentifier:0 error:&error]; - WKWebViewConfiguration *configuration = - (WKWebViewConfiguration *)[instanceManager instanceForIdentifier:0]; - XCTAssertTrue([configuration isKindOfClass:[WKWebViewConfiguration class]]); - XCTAssertNil(error); -} - -- (void)testCreateFromWebViewWithIdentifier { - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - FWFWebViewConfigurationHostApiImpl *hostAPI = [[FWFWebViewConfigurationHostApiImpl alloc] - initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger)) - instanceManager:instanceManager]; - - WKWebView *mockWebView = OCMClassMock([WKWebView class]); - OCMStub([mockWebView configuration]).andReturn(OCMClassMock([WKWebViewConfiguration class])); - [instanceManager addDartCreatedInstance:mockWebView withIdentifier:0]; - - FlutterError *error; - [hostAPI createFromWebViewWithIdentifier:1 webViewIdentifier:0 error:&error]; - WKWebViewConfiguration *configuration = - (WKWebViewConfiguration *)[instanceManager instanceForIdentifier:1]; - XCTAssertTrue([configuration isKindOfClass:[WKWebViewConfiguration class]]); - XCTAssertNil(error); -} - -- (void)testSetAllowsInlineMediaPlayback { - WKWebViewConfiguration *mockWebViewConfiguration = OCMClassMock([WKWebViewConfiguration class]); - - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - [instanceManager addDartCreatedInstance:mockWebViewConfiguration withIdentifier:0]; - - FWFWebViewConfigurationHostApiImpl *hostAPI = [[FWFWebViewConfigurationHostApiImpl alloc] - initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger)) - instanceManager:instanceManager]; - - FlutterError *error; - [hostAPI setAllowsInlineMediaPlaybackForConfigurationWithIdentifier:0 isAllowed:NO error:&error]; - // setAllowsInlineMediaPlayback does not existing on macOS; the call above should no-op for macOS. -#if !TARGET_OS_OSX - OCMVerify([mockWebViewConfiguration setAllowsInlineMediaPlayback:NO]); -#endif - XCTAssertNil(error); -} - -- (void)testSetLimitsNavigationsToAppBoundDomains API_AVAILABLE(ios(14.0), macos(11)) { - WKWebViewConfiguration *mockWebViewConfiguration = OCMClassMock([WKWebViewConfiguration class]); - - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - [instanceManager addDartCreatedInstance:mockWebViewConfiguration withIdentifier:0]; - - FWFWebViewConfigurationHostApiImpl *hostAPI = [[FWFWebViewConfigurationHostApiImpl alloc] - initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger)) - instanceManager:instanceManager]; - - FlutterError *error; - [hostAPI setLimitsNavigationsToAppBoundDomainsForConfigurationWithIdentifier:0 - isLimited:NO - error:&error]; - OCMVerify([mockWebViewConfiguration setLimitsNavigationsToAppBoundDomains:NO]); - XCTAssertNil(error); -} - -- (void)testSetMediaTypesRequiringUserActionForPlayback { - WKWebViewConfiguration *mockWebViewConfiguration = OCMClassMock([WKWebViewConfiguration class]); - - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - [instanceManager addDartCreatedInstance:mockWebViewConfiguration withIdentifier:0]; - - FWFWebViewConfigurationHostApiImpl *hostAPI = [[FWFWebViewConfigurationHostApiImpl alloc] - initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger)) - instanceManager:instanceManager]; - - FlutterError *error; - [hostAPI - setMediaTypesRequiresUserActionForConfigurationWithIdentifier:0 - forTypes:@[ - [FWFWKAudiovisualMediaTypeEnumData - makeWithValue: - FWFWKAudiovisualMediaTypeEnumAudio], - [FWFWKAudiovisualMediaTypeEnumData - makeWithValue: - FWFWKAudiovisualMediaTypeEnumVideo] - ] - error:&error]; - OCMVerify([mockWebViewConfiguration - setMediaTypesRequiringUserActionForPlayback:(WKAudiovisualMediaTypeAudio | - WKAudiovisualMediaTypeVideo)]); - XCTAssertNil(error); -} -@end diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFWebViewFlutterWKWebViewExternalAPITests.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFWebViewFlutterWKWebViewExternalAPITests.m deleted file mode 100644 index d4137c1997b..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFWebViewFlutterWKWebViewExternalAPITests.m +++ /dev/null @@ -1,35 +0,0 @@ -// 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 XCTest; - -#if TARGET_OS_OSX -@import FlutterMacOS; -#else -@import Flutter; -#endif - -#import - -@import webview_flutter_wkwebview; - -@interface FWFWebViewFlutterWKWebViewExternalAPITests : XCTestCase -@end - -@implementation FWFWebViewFlutterWKWebViewExternalAPITests -- (void)testWebViewForIdentifier { - WKWebView *webView = [[WKWebView alloc] init]; - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - [instanceManager addDartCreatedInstance:webView withIdentifier:0]; - - id mockPluginRegistry = OCMProtocolMock(@protocol(FlutterPluginRegistry)); - OCMStub([mockPluginRegistry valuePublishedByPlugin:@"FLTWebViewFlutterPlugin"]) - .andReturn(instanceManager); - - XCTAssertEqualObjects( - [FWFWebViewFlutterWKWebViewExternalAPI webViewForIdentifier:0 - withPluginRegistry:mockPluginRegistry], - webView); -} -@end diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFWebViewFlutterWKWebViewExternalAPITests.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFWebViewFlutterWKWebViewExternalAPITests.swift new file mode 100644 index 00000000000..9e7275374b0 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFWebViewFlutterWKWebViewExternalAPITests.swift @@ -0,0 +1,137 @@ +// 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 + +#if os(iOS) + import Flutter +#elseif os(macOS) + import FlutterMacOS +#else + #error("Unsupported platform.") +#endif + +class FWFWebViewFlutterWKWebViewExternalAPITests: XCTestCase { + @MainActor func testWebViewForIdentifier() { + let registry = TestRegistry() + + #if os(iOS) + let registrar = registry.registrar(forPlugin: "")! + #elseif os(macOS) + let registrar = registry.registrar(forPlugin: "") + #endif + + WebViewFlutterPlugin.register(with: registrar) + + let plugin = registry.registrar.plugin + + let webView = WKWebView(frame: .zero) + let webViewIdentifier = 0 + plugin?.proxyApiRegistrar?.instanceManager.addDartCreatedInstance( + webView, withIdentifier: Int64(webViewIdentifier)) + + let result = FWFWebViewFlutterWKWebViewExternalAPI.webView( + forIdentifier: Int64(webViewIdentifier), withPluginRegistry: registry) + XCTAssertEqual(result, webView) + } +} + +class TestRegistry: NSObject, FlutterPluginRegistry { + let registrar = TestFlutterPluginRegistrar() + + #if os(iOS) + func registrar(forPlugin pluginKey: String) -> FlutterPluginRegistrar? { + return registrar + } + #elseif os(macOS) + func registrar(forPlugin pluginKey: String) -> FlutterPluginRegistrar { + return registrar + } + #endif + + func hasPlugin(_ pluginKey: String) -> Bool { + return true + } + + func valuePublished(byPlugin pluginKey: String) -> NSObject? { + if pluginKey == "WebViewFlutterPlugin" { + return registrar.plugin + } + return nil + } +} + +class TestFlutterTextureRegistry: NSObject, FlutterTextureRegistry { + func register(_ texture: FlutterTexture) -> Int64 { + return 0 + } + + func textureFrameAvailable(_ textureId: Int64) { + + } + + func unregisterTexture(_ textureId: Int64) { + + } +} + +class TestFlutterPluginRegistrar: NSObject, FlutterPluginRegistrar { + var plugin: WebViewFlutterPlugin? = nil + + #if os(iOS) + func messenger() -> FlutterBinaryMessenger { + return TestBinaryMessenger() + } + + func textures() -> FlutterTextureRegistry { + return TestFlutterTextureRegistry() + } + + func addApplicationDelegate(_ delegate: FlutterPlugin) { + + } + + func register( + _ factory: FlutterPlatformViewFactory, withId factoryId: String, + gestureRecognizersBlockingPolicy: FlutterPlatformViewGestureRecognizersBlockingPolicy + ) { + } + #elseif os(macOS) + var view: NSView? + + var messenger: FlutterBinaryMessenger { + return TestBinaryMessenger() + } + + var textures: FlutterTextureRegistry { + return TestFlutterTextureRegistry() + } + + func addApplicationDelegate(_ delegate: FlutterAppLifecycleDelegate) { + + } + #endif + + func register(_ factory: FlutterPlatformViewFactory, withId factoryId: String) { + } + + func publish(_ value: NSObject) { + plugin = (value as! WebViewFlutterPlugin) + } + + func addMethodCallDelegate(_ delegate: FlutterPlugin, channel: FlutterMethodChannel) { + + } + + func lookupKey(forAsset asset: String) -> String { + return "" + } + + func lookupKey(forAsset asset: String, fromPackage package: String) -> String { + return "" + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFWebViewHostApiTests.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFWebViewHostApiTests.m deleted file mode 100644 index 49d5a20dd57..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFWebViewHostApiTests.m +++ /dev/null @@ -1,520 +0,0 @@ -// 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 XCTest; -@import webview_flutter_wkwebview; - -#if TARGET_OS_OSX -@import FlutterMacOS; -#else -@import Flutter; -#endif - -#import - -// Only used in !OSX test code, and causes unused function error if not ifdef'd out. -#if !TARGET_OS_OSX -static bool feq(CGFloat a, CGFloat b) { return fabs(b - a) < FLT_EPSILON; } -#endif - -@interface FWFWebViewHostApiTests : XCTestCase -@end - -@implementation FWFWebViewHostApiTests -- (void)testCreateWithIdentifier { - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - FWFWebViewHostApiImpl *hostAPI = [[FWFWebViewHostApiImpl alloc] - initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger)) - instanceManager:instanceManager]; - - [instanceManager addDartCreatedInstance:[[WKWebViewConfiguration alloc] init] withIdentifier:0]; - - FlutterError *error; - [hostAPI createWithIdentifier:1 configurationIdentifier:0 error:&error]; - WKWebView *webView = (WKWebView *)[instanceManager instanceForIdentifier:1]; - XCTAssertTrue([webView isKindOfClass:[WKWebView class]]); - XCTAssertNil(error); -} - -- (void)testLoadRequest { - FWFWebView *mockWebView = OCMClassMock([FWFWebView class]); - - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - [instanceManager addDartCreatedInstance:mockWebView withIdentifier:0]; - - FWFWebViewHostApiImpl *hostAPI = [[FWFWebViewHostApiImpl alloc] - initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger)) - instanceManager:instanceManager]; - - FlutterError *error; - FWFNSUrlRequestData *requestData = [FWFNSUrlRequestData makeWithUrl:@"https://www.flutter.dev" - httpMethod:@"get" - httpBody:nil - allHttpHeaderFields:@{@"a" : @"header"}]; - [hostAPI loadRequestForWebViewWithIdentifier:0 request:requestData error:&error]; - - NSURL *url = [NSURL URLWithString:@"https://www.flutter.dev"]; - NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url]; - request.HTTPMethod = @"get"; - request.allHTTPHeaderFields = @{@"a" : @"header"}; - OCMVerify([mockWebView loadRequest:request]); - XCTAssertNil(error); -} - -- (void)testLoadRequestWithInvalidUrl { - FWFWebView *mockWebView = OCMClassMock([FWFWebView class]); - - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - [instanceManager addDartCreatedInstance:mockWebView withIdentifier:0]; - - FWFWebViewHostApiImpl *hostAPI = [[FWFWebViewHostApiImpl alloc] - initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger)) - instanceManager:instanceManager]; - - NSString *badURLString = @"%invalidUrl%"; - FlutterError *error; - FWFNSUrlRequestData *requestData = [FWFNSUrlRequestData makeWithUrl:badURLString - httpMethod:nil - httpBody:nil - allHttpHeaderFields:@{}]; - [hostAPI loadRequestForWebViewWithIdentifier:0 request:requestData error:&error]; - // When linking against the iOS 17 SDK or later, NSURL uses a lenient parser, and won't - // fail to parse URLs, so the test must allow for either outcome. - if (error) { - XCTAssertEqualObjects(error.code, @"FWFURLRequestParsingError"); - XCTAssertEqualObjects(error.message, @"Failed instantiating an NSURLRequest."); - XCTAssertEqualObjects(error.details, @"URL was: '%invalidUrl%'"); - } else { - NSURL *badURL = [NSURL URLWithString:badURLString]; - NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:badURL]; - OCMVerify([mockWebView loadRequest:request]); - } -} - -- (void)testSetCustomUserAgent { - FWFWebView *mockWebView = OCMClassMock([FWFWebView class]); - - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - [instanceManager addDartCreatedInstance:mockWebView withIdentifier:0]; - - FWFWebViewHostApiImpl *hostAPI = [[FWFWebViewHostApiImpl alloc] - initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger)) - instanceManager:instanceManager]; - - FlutterError *error; - [hostAPI setCustomUserAgentForWebViewWithIdentifier:0 userAgent:@"userA" error:&error]; - OCMVerify([mockWebView setCustomUserAgent:@"userA"]); - XCTAssertNil(error); -} - -- (void)testURL { - FWFWebView *mockWebView = OCMClassMock([FWFWebView class]); - OCMStub([mockWebView URL]).andReturn([NSURL URLWithString:@"https://www.flutter.dev/"]); - - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - [instanceManager addDartCreatedInstance:mockWebView withIdentifier:0]; - - FWFWebViewHostApiImpl *hostAPI = [[FWFWebViewHostApiImpl alloc] - initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger)) - instanceManager:instanceManager]; - - FlutterError *error; - XCTAssertEqualObjects([hostAPI URLForWebViewWithIdentifier:0 error:&error], - @"https://www.flutter.dev/"); - XCTAssertNil(error); -} - -- (void)testCanGoBack { - FWFWebView *mockWebView = OCMClassMock([FWFWebView class]); - OCMStub([mockWebView canGoBack]).andReturn(YES); - - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - [instanceManager addDartCreatedInstance:mockWebView withIdentifier:0]; - - FWFWebViewHostApiImpl *hostAPI = [[FWFWebViewHostApiImpl alloc] - initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger)) - instanceManager:instanceManager]; - - FlutterError *error; - XCTAssertEqualObjects([hostAPI canGoBackForWebViewWithIdentifier:0 error:&error], @YES); - XCTAssertNil(error); -} - -- (void)testSetUIDelegate { - FWFWebView *mockWebView = OCMClassMock([FWFWebView class]); - - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - [instanceManager addDartCreatedInstance:mockWebView withIdentifier:0]; - - FWFWebViewHostApiImpl *hostAPI = [[FWFWebViewHostApiImpl alloc] - initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger)) - instanceManager:instanceManager]; - - id mockDelegate = OCMProtocolMock(@protocol(WKUIDelegate)); - [instanceManager addDartCreatedInstance:mockDelegate withIdentifier:1]; - - FlutterError *error; - [hostAPI setUIDelegateForWebViewWithIdentifier:0 delegateIdentifier:@1 error:&error]; - OCMVerify([mockWebView setUIDelegate:mockDelegate]); - XCTAssertNil(error); -} - -- (void)testSetNavigationDelegate { - FWFWebView *mockWebView = OCMClassMock([FWFWebView class]); - - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - [instanceManager addDartCreatedInstance:mockWebView withIdentifier:0]; - - FWFWebViewHostApiImpl *hostAPI = [[FWFWebViewHostApiImpl alloc] - initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger)) - instanceManager:instanceManager]; - - id mockDelegate = OCMProtocolMock(@protocol(WKNavigationDelegate)); - [instanceManager addDartCreatedInstance:mockDelegate withIdentifier:1]; - FlutterError *error; - - [hostAPI setNavigationDelegateForWebViewWithIdentifier:0 delegateIdentifier:@1 error:&error]; - OCMVerify([mockWebView setNavigationDelegate:mockDelegate]); - XCTAssertNil(error); -} - -- (void)testEstimatedProgress { - FWFWebView *mockWebView = OCMClassMock([FWFWebView class]); - OCMStub([mockWebView estimatedProgress]).andReturn(34.0); - - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - [instanceManager addDartCreatedInstance:mockWebView withIdentifier:0]; - - FWFWebViewHostApiImpl *hostAPI = [[FWFWebViewHostApiImpl alloc] - initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger)) - instanceManager:instanceManager]; - - FlutterError *error; - XCTAssertEqualObjects([hostAPI estimatedProgressForWebViewWithIdentifier:0 error:&error], @34.0); - XCTAssertNil(error); -} - -- (void)testloadHTMLString { - FWFWebView *mockWebView = OCMClassMock([FWFWebView class]); - - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - [instanceManager addDartCreatedInstance:mockWebView withIdentifier:0]; - - FWFWebViewHostApiImpl *hostAPI = [[FWFWebViewHostApiImpl alloc] - initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger)) - instanceManager:instanceManager]; - - FlutterError *error; - [hostAPI loadHTMLForWebViewWithIdentifier:0 - HTMLString:@"myString" - baseURL:@"myBaseUrl" - error:&error]; - OCMVerify([mockWebView loadHTMLString:@"myString" baseURL:[NSURL URLWithString:@"myBaseUrl"]]); - XCTAssertNil(error); -} - -- (void)testLoadFileURL { - FWFWebView *mockWebView = OCMClassMock([FWFWebView class]); - - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - [instanceManager addDartCreatedInstance:mockWebView withIdentifier:0]; - - FWFWebViewHostApiImpl *hostAPI = [[FWFWebViewHostApiImpl alloc] - initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger)) - instanceManager:instanceManager]; - - FlutterError *error; - [hostAPI loadFileForWebViewWithIdentifier:0 - fileURL:@"myFolder/apple.txt" - readAccessURL:@"myFolder" - error:&error]; - XCTAssertNil(error); - OCMVerify([mockWebView loadFileURL:[NSURL fileURLWithPath:@"myFolder/apple.txt" isDirectory:NO] - allowingReadAccessToURL:[NSURL fileURLWithPath:@"myFolder/" isDirectory:YES] - - ]); -} - -- (void)testLoadFlutterAsset { - FWFWebView *mockWebView = OCMClassMock([FWFWebView class]); - - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - [instanceManager addDartCreatedInstance:mockWebView withIdentifier:0]; - - FWFAssetManager *mockAssetManager = OCMClassMock([FWFAssetManager class]); - OCMStub([mockAssetManager lookupKeyForAsset:@"assets/index.html"]) - .andReturn(@"myFolder/assets/index.html"); - - NSBundle *mockBundle = OCMClassMock([NSBundle class]); - OCMStub([mockBundle URLForResource:@"myFolder/assets/index" withExtension:@"html"]) - .andReturn([NSURL URLWithString:@"webview_flutter/myFolder/assets/index.html"]); - - FWFWebViewHostApiImpl *hostAPI = [[FWFWebViewHostApiImpl alloc] - initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger)) - instanceManager:instanceManager - bundle:mockBundle - assetManager:mockAssetManager]; - - FlutterError *error; - [hostAPI loadAssetForWebViewWithIdentifier:0 assetKey:@"assets/index.html" error:&error]; - - XCTAssertNil(error); - NSURL *fileURL = [NSURL URLWithString:@"webview_flutter/myFolder/assets/index.html"]; - NSURL *directoryURL = [NSURL URLWithString:@"webview_flutter/myFolder/assets/"]; - OCMVerify([mockWebView loadFileURL:fileURL allowingReadAccessToURL:directoryURL]); -} - -- (void)testCanGoForward { - FWFWebView *mockWebView = OCMClassMock([FWFWebView class]); - OCMStub([mockWebView canGoForward]).andReturn(NO); - - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - [instanceManager addDartCreatedInstance:mockWebView withIdentifier:0]; - - FWFWebViewHostApiImpl *hostAPI = [[FWFWebViewHostApiImpl alloc] - initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger)) - instanceManager:instanceManager]; - - FlutterError *error; - XCTAssertEqualObjects([hostAPI canGoForwardForWebViewWithIdentifier:0 error:&error], @NO); - XCTAssertNil(error); -} - -- (void)testGoBack { - FWFWebView *mockWebView = OCMClassMock([FWFWebView class]); - - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - [instanceManager addDartCreatedInstance:mockWebView withIdentifier:0]; - - FWFWebViewHostApiImpl *hostAPI = [[FWFWebViewHostApiImpl alloc] - initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger)) - instanceManager:instanceManager]; - - FlutterError *error; - [hostAPI goBackForWebViewWithIdentifier:0 error:&error]; - OCMVerify([mockWebView goBack]); - XCTAssertNil(error); -} - -- (void)testGoForward { - FWFWebView *mockWebView = OCMClassMock([FWFWebView class]); - - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - [instanceManager addDartCreatedInstance:mockWebView withIdentifier:0]; - - FWFWebViewHostApiImpl *hostAPI = [[FWFWebViewHostApiImpl alloc] - initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger)) - instanceManager:instanceManager]; - - FlutterError *error; - [hostAPI goForwardForWebViewWithIdentifier:0 error:&error]; - OCMVerify([mockWebView goForward]); - XCTAssertNil(error); -} - -- (void)testReload { - FWFWebView *mockWebView = OCMClassMock([FWFWebView class]); - - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - [instanceManager addDartCreatedInstance:mockWebView withIdentifier:0]; - - FWFWebViewHostApiImpl *hostAPI = [[FWFWebViewHostApiImpl alloc] - initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger)) - instanceManager:instanceManager]; - - FlutterError *error; - [hostAPI reloadWebViewWithIdentifier:0 error:&error]; - OCMVerify([mockWebView reload]); - XCTAssertNil(error); -} - -- (void)testTitle { - FWFWebView *mockWebView = OCMClassMock([FWFWebView class]); - OCMStub([mockWebView title]).andReturn(@"myTitle"); - - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - [instanceManager addDartCreatedInstance:mockWebView withIdentifier:0]; - - FWFWebViewHostApiImpl *hostAPI = [[FWFWebViewHostApiImpl alloc] - initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger)) - instanceManager:instanceManager]; - - FlutterError *error; - XCTAssertEqualObjects([hostAPI titleForWebViewWithIdentifier:0 error:&error], @"myTitle"); - XCTAssertNil(error); -} - -- (void)testSetAllowsBackForwardNavigationGestures { - FWFWebView *mockWebView = OCMClassMock([FWFWebView class]); - - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - [instanceManager addDartCreatedInstance:mockWebView withIdentifier:0]; - - FWFWebViewHostApiImpl *hostAPI = [[FWFWebViewHostApiImpl alloc] - initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger)) - instanceManager:instanceManager]; - - FlutterError *error; - [hostAPI setAllowsBackForwardForWebViewWithIdentifier:0 isAllowed:YES error:&error]; - OCMVerify([mockWebView setAllowsBackForwardNavigationGestures:YES]); - XCTAssertNil(error); -} - -- (void)testEvaluateJavaScript { - FWFWebView *mockWebView = OCMClassMock([FWFWebView class]); - - OCMStub([mockWebView - evaluateJavaScript:@"runJavaScript" - completionHandler:([OCMArg invokeBlockWithArgs:@"result", [NSNull null], nil])]); - - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - [instanceManager addDartCreatedInstance:mockWebView withIdentifier:0]; - - FWFWebViewHostApiImpl *hostAPI = [[FWFWebViewHostApiImpl alloc] - initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger)) - instanceManager:instanceManager]; - - NSString __block *returnValue; - FlutterError __block *returnError; - [hostAPI evaluateJavaScriptForWebViewWithIdentifier:0 - javaScriptString:@"runJavaScript" - completion:^(id result, FlutterError *error) { - returnValue = result; - returnError = error; - }]; - - XCTAssertEqualObjects(returnValue, @"result"); - XCTAssertNil(returnError); -} - -- (void)testEvaluateJavaScriptReturnsNSErrorData { - FWFWebView *mockWebView = OCMClassMock([FWFWebView class]); - - OCMStub([mockWebView - evaluateJavaScript:@"runJavaScript" - completionHandler:([OCMArg invokeBlockWithArgs:[NSNull null], - [NSError errorWithDomain:@"errorDomain" - code:0 - userInfo:@{ - NSLocalizedDescriptionKey : - @"description" - }], - nil])]); - - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - [instanceManager addDartCreatedInstance:mockWebView withIdentifier:0]; - - FWFWebViewHostApiImpl *hostAPI = [[FWFWebViewHostApiImpl alloc] - initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger)) - instanceManager:instanceManager]; - - NSString __block *returnValue; - FlutterError __block *returnError; - [hostAPI evaluateJavaScriptForWebViewWithIdentifier:0 - javaScriptString:@"runJavaScript" - completion:^(id result, FlutterError *error) { - returnValue = result; - returnError = error; - }]; - - XCTAssertNil(returnValue); - FWFNSErrorData *errorData = returnError.details; - XCTAssertTrue([errorData isKindOfClass:[FWFNSErrorData class]]); - XCTAssertEqual(errorData.code, 0); - XCTAssertEqualObjects(errorData.domain, @"errorDomain"); - XCTAssertEqualObjects(errorData.userInfo, @{NSLocalizedDescriptionKey : @"description"}); -} - -// Content inset APIs don't exist on macOS. -#if !TARGET_OS_OSX -- (void)testWebViewContentInsetBehaviorShouldBeNever { - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - FWFWebViewHostApiImpl *hostAPI = [[FWFWebViewHostApiImpl alloc] - initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger)) - instanceManager:instanceManager]; - - [instanceManager addDartCreatedInstance:[[WKWebViewConfiguration alloc] init] withIdentifier:0]; - - FlutterError *error; - [hostAPI createWithIdentifier:1 configurationIdentifier:0 error:&error]; - FWFWebView *webView = (FWFWebView *)[instanceManager instanceForIdentifier:1]; - - XCTAssertEqual(webView.scrollView.contentInsetAdjustmentBehavior, - UIScrollViewContentInsetAdjustmentNever); -} - -- (void)testScrollViewsAutomaticallyAdjustsScrollIndicatorInsetsShouldbeNoOnIOS13 API_AVAILABLE( - ios(13.0)) { - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - FWFWebViewHostApiImpl *hostAPI = [[FWFWebViewHostApiImpl alloc] - initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger)) - instanceManager:instanceManager]; - - [instanceManager addDartCreatedInstance:[[WKWebViewConfiguration alloc] init] withIdentifier:0]; - - FlutterError *error; - [hostAPI createWithIdentifier:1 configurationIdentifier:0 error:&error]; - FWFWebView *webView = (FWFWebView *)[instanceManager instanceForIdentifier:1]; - - XCTAssertFalse(webView.scrollView.automaticallyAdjustsScrollIndicatorInsets); -} - -- (void)testContentInsetsSumAlwaysZeroAfterSetFrame { - FWFWebView *webView = [[FWFWebView alloc] initWithFrame:CGRectMake(0, 0, 300, 400) - configuration:[[WKWebViewConfiguration alloc] init]]; - - webView.scrollView.contentInset = UIEdgeInsetsMake(0, 0, 300, 0); - XCTAssertFalse(UIEdgeInsetsEqualToEdgeInsets(webView.scrollView.contentInset, UIEdgeInsetsZero)); - - webView.frame = CGRectMake(0, 0, 300, 200); - XCTAssertTrue(UIEdgeInsetsEqualToEdgeInsets(webView.scrollView.contentInset, UIEdgeInsetsZero)); - XCTAssertTrue(CGRectEqualToRect(webView.frame, CGRectMake(0, 0, 300, 200))); - - // Make sure the contentInset compensates the adjustedContentInset. - UIScrollView *partialMockScrollView = OCMPartialMock(webView.scrollView); - UIEdgeInsets insetToAdjust = UIEdgeInsetsMake(0, 0, 300, 0); - OCMStub(partialMockScrollView.adjustedContentInset).andReturn(insetToAdjust); - XCTAssertTrue(UIEdgeInsetsEqualToEdgeInsets(webView.scrollView.contentInset, UIEdgeInsetsZero)); - - webView.frame = CGRectMake(0, 0, 300, 100); - XCTAssertTrue(feq(webView.scrollView.contentInset.bottom, -insetToAdjust.bottom)); - XCTAssertTrue(CGRectEqualToRect(webView.frame, CGRectMake(0, 0, 300, 100))); -} -#endif // !TARGET_OS_OSX - -- (void)testSetInspectable API_AVAILABLE(ios(16.4), macos(13.3)) { - FWFWebView *mockWebView = OCMClassMock([FWFWebView class]); - - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - [instanceManager addDartCreatedInstance:mockWebView withIdentifier:0]; - - FWFWebViewHostApiImpl *hostAPI = [[FWFWebViewHostApiImpl alloc] - initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger)) - instanceManager:instanceManager]; - - FlutterError *error; - [hostAPI setInspectableForWebViewWithIdentifier:0 inspectable:YES error:&error]; - OCMVerify([mockWebView setInspectable:YES]); - XCTAssertNil(error); -} - -- (void)testCustomUserAgent { - FWFWebView *mockWebView = OCMClassMock([FWFWebView class]); - - NSString *userAgent = @"str"; - OCMStub([mockWebView customUserAgent]).andReturn(userAgent); - - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - [instanceManager addDartCreatedInstance:mockWebView withIdentifier:0]; - - FWFWebViewHostApiImpl *hostAPI = [[FWFWebViewHostApiImpl alloc] - initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger)) - instanceManager:instanceManager]; - - FlutterError *error; - XCTAssertEqualObjects([hostAPI customUserAgentForWebViewWithIdentifier:0 error:&error], - userAgent); - XCTAssertNil(error); -} -@end diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFWebsiteDataStoreHostApiTests.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFWebsiteDataStoreHostApiTests.m deleted file mode 100644 index bab732b88de..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFWebsiteDataStoreHostApiTests.m +++ /dev/null @@ -1,82 +0,0 @@ -// 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 XCTest; -@import webview_flutter_wkwebview; - -#if TARGET_OS_OSX -@import FlutterMacOS; -#else -@import Flutter; -#endif - -#import - -@interface FWFWebsiteDataStoreHostApiTests : XCTestCase -@end - -@implementation FWFWebsiteDataStoreHostApiTests -- (void)testCreateFromWebViewConfigurationWithIdentifier { - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - FWFWebsiteDataStoreHostApiImpl *hostAPI = - [[FWFWebsiteDataStoreHostApiImpl alloc] initWithInstanceManager:instanceManager]; - - [instanceManager addDartCreatedInstance:[[WKWebViewConfiguration alloc] init] withIdentifier:0]; - - FlutterError *error; - [hostAPI createFromWebViewConfigurationWithIdentifier:1 configurationIdentifier:0 error:&error]; - WKWebsiteDataStore *dataStore = (WKWebsiteDataStore *)[instanceManager instanceForIdentifier:1]; - XCTAssertTrue([dataStore isKindOfClass:[WKWebsiteDataStore class]]); - XCTAssertNil(error); -} - -- (void)testCreateDefaultDataStoreWithIdentifier { - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - FWFWebsiteDataStoreHostApiImpl *hostAPI = - [[FWFWebsiteDataStoreHostApiImpl alloc] initWithInstanceManager:instanceManager]; - - FlutterError *error; - [hostAPI createDefaultDataStoreWithIdentifier:0 error:&error]; - WKWebsiteDataStore *dataStore = (WKWebsiteDataStore *)[instanceManager instanceForIdentifier:0]; - XCTAssertEqualObjects(dataStore, [WKWebsiteDataStore defaultDataStore]); - XCTAssertNil(error); -} - -- (void)testRemoveDataOfTypes { - WKWebsiteDataStore *mockWebsiteDataStore = OCMClassMock([WKWebsiteDataStore class]); - - WKWebsiteDataRecord *mockDataRecord = OCMClassMock([WKWebsiteDataRecord class]); - OCMStub([mockWebsiteDataStore - fetchDataRecordsOfTypes:[NSSet setWithObject:WKWebsiteDataTypeLocalStorage] - completionHandler:([OCMArg invokeBlockWithArgs:@[ mockDataRecord ], nil])]); - - OCMStub([mockWebsiteDataStore - removeDataOfTypes:[NSSet setWithObject:WKWebsiteDataTypeLocalStorage] - modifiedSince:[NSDate dateWithTimeIntervalSince1970:45.0] - completionHandler:([OCMArg invokeBlock])]); - - FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; - [instanceManager addDartCreatedInstance:mockWebsiteDataStore withIdentifier:0]; - - FWFWebsiteDataStoreHostApiImpl *hostAPI = - [[FWFWebsiteDataStoreHostApiImpl alloc] initWithInstanceManager:instanceManager]; - - NSNumber __block *returnValue; - FlutterError *__block blockError; - [hostAPI removeDataFromDataStoreWithIdentifier:0 - ofTypes:@[ - [FWFWKWebsiteDataTypeEnumData - makeWithValue:FWFWKWebsiteDataTypeEnumLocalStorage] - ] - modifiedSince:45.0 - completion:^(NSNumber *result, FlutterError *error) { - returnValue = result; - blockError = error; - }]; - XCTAssertEqualObjects(returnValue, @YES); - // Asserts whether the NSNumber will be deserialized by the standard codec as a boolean. - XCTAssertEqual(CFGetTypeID((__bridge CFTypeRef)(returnValue)), CFBooleanGetTypeID()); - XCTAssertNil(blockError); -} -@end diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FrameInfoProxyAPITests.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FrameInfoProxyAPITests.swift new file mode 100644 index 00000000000..a0ece4a78be --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FrameInfoProxyAPITests.swift @@ -0,0 +1,54 @@ +// 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 + +@MainActor +class FrameInfoProxyAPITests: XCTestCase { + @MainActor func testIsMainFrame() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiWKFrameInfo(registrar) + + let instance: TestFrameInfo? = TestFrameInfo() + let value = try? api.pigeonDelegate.isMainFrame(pigeonApi: api, pigeonInstance: instance!) + + XCTAssertEqual(value, instance!.isMainFrame) + } + + @MainActor func testRequest() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiWKFrameInfo(registrar) + + let instance: TestFrameInfo? = TestFrameInfo() + let value = try? api.pigeonDelegate.request(pigeonApi: api, pigeonInstance: instance!) + + XCTAssertEqual(value?.value, instance!.request) + } + + @MainActor func testNilRequest() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiWKFrameInfo(registrar) + + let instance = TestFrameInfoWithNilRequest() + let value = try? api.pigeonDelegate.request(pigeonApi: api, pigeonInstance: instance) + + XCTAssertNil(value) + } +} + +class TestFrameInfo: WKFrameInfo { + override var isMainFrame: Bool { + return true + } + + override var request: URLRequest { + return URLRequest(url: URL(string: "https://google.com")!) + } +} + +class TestFrameInfoWithNilRequest: WKFrameInfo { +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/HTTPCookieProxyAPITests.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/HTTPCookieProxyAPITests.swift new file mode 100644 index 00000000000..13e7754c491 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/HTTPCookieProxyAPITests.swift @@ -0,0 +1,34 @@ +// 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 XCTest + +@testable import webview_flutter_wkwebview + +class HTTPCookieProxyAPITests: XCTestCase { + func testPigeonDefaultConstructor() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiHTTPCookie(registrar) + + let instance = try? api.pigeonDelegate.pigeonDefaultConstructor( + pigeonApi: api, + properties: [.name: "foo", .value: "bar", .domain: "http://google.com", .path: "/anything"]) + XCTAssertNotNil(instance) + } + + func testGetProperties() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiHTTPCookie(registrar) + + let instance = HTTPCookie(properties: [ + .name: "foo", .value: "bar", .domain: "http://google.com", .path: "/anything", + ])! + let value = try? api.pigeonDelegate.getProperties(pigeonApi: api, pigeonInstance: instance) + + XCTAssertEqual(value?[.name] as? String, "foo") + XCTAssertEqual(value?[.value] as? String, "bar") + XCTAssertEqual(value?[.domain] as? String, "http://google.com") + XCTAssertEqual(value?[.path] as? String, "/anything") + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/HTTPCookieStoreProxyAPITests.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/HTTPCookieStoreProxyAPITests.swift new file mode 100644 index 00000000000..673ce8c9107 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/HTTPCookieStoreProxyAPITests.swift @@ -0,0 +1,63 @@ +// 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 HTTPCookieStoreProxyAPITests: XCTestCase { + @MainActor func testSetCookie() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiWKHTTPCookieStore(registrar) + + let instance: TestCookieStore? = TestCookieStore.customInit() + let cookie = HTTPCookie(properties: [ + .name: "foo", .value: "bar", .domain: "http://google.com", .path: "/anything", + ])! + + let expect = expectation(description: "Wait for setCookie.") + api.pigeonDelegate.setCookie(pigeonApi: api, pigeonInstance: instance!, cookie: cookie) { + result in + switch result { + case .success(_): + expect.fulfill() + case .failure(_): + break + } + } + + wait(for: [expect], timeout: 1.0) + XCTAssertEqual(instance!.setCookieArg, cookie) + } +} + +class TestCookieStore: WKHTTPCookieStore { + var setCookieArg: HTTPCookie? = nil + + // Workaround to subclass an Objective-C class that has an `init` constructor with NS_UNAVAILABLE + static func customInit() -> TestCookieStore { + let instance = + TestCookieStore.perform(NSSelectorFromString("new")).takeRetainedValue() as! TestCookieStore + return instance + } + + #if compiler(>=6.0) + public override func setCookie( + _ cookie: HTTPCookie, completionHandler: (@MainActor () -> Void)? = nil + ) { + setCookieArg = cookie + DispatchQueue.main.async { + completionHandler?() + } + } + #else + public override func setCookie(_ cookie: HTTPCookie, completionHandler: (() -> Void)? = nil) { + setCookieArg = cookie + DispatchQueue.main.async { + completionHandler?() + } + } + #endif +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/HTTPURLResponseProxyAPITests.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/HTTPURLResponseProxyAPITests.swift new file mode 100644 index 00000000000..4199d189c05 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/HTTPURLResponseProxyAPITests.swift @@ -0,0 +1,20 @@ +// 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 XCTest + +@testable import webview_flutter_wkwebview + +class HTTPURLResponseProxyAPITests: XCTestCase { + func testStatusCode() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiHTTPURLResponse(registrar) + + let instance = HTTPURLResponse( + url: URL(string: "http://google.com")!, statusCode: 400, httpVersion: nil, headerFields: nil)! + let value = try? api.pigeonDelegate.statusCode(pigeonApi: api, pigeonInstance: instance) + + XCTAssertEqual(value, Int64(instance.statusCode)) + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/NSObjectProxyAPITests.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/NSObjectProxyAPITests.swift new file mode 100644 index 00000000000..68b56079ede --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/NSObjectProxyAPITests.swift @@ -0,0 +1,89 @@ +// 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 XCTest + +@testable import webview_flutter_wkwebview + +class ObjectProxyAPITests: XCTestCase { + func testPigeonDefaultConstructor() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiNSObject(registrar) + + let instance = try? api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api) + XCTAssertNotNil(instance) + } + + func testAddObserver() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiNSObject(registrar) + + let instance = TestObject() + let observer = NSObject() + let keyPath = "myString" + let options: [KeyValueObservingOptions] = [.newValue] + try? api.pigeonDelegate.addObserver( + pigeonApi: api, pigeonInstance: instance, observer: observer, keyPath: keyPath, + options: options) + + var nativeOptions: NSKeyValueObservingOptions = [] + nativeOptions.insert(.new) + + XCTAssertEqual(instance.addObserverArgs, [observer, keyPath, nativeOptions.rawValue]) + } + + func testRemoveObserver() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiNSObject(registrar) + + let instance = TestObject() + let object = NSObject() + let keyPath = "myString" + try? api.pigeonDelegate.removeObserver( + pigeonApi: api, pigeonInstance: instance, observer: object, keyPath: keyPath) + + XCTAssertEqual(instance.removeObserverArgs, [object, keyPath]) + } + + func testObserveValue() { + let api = TestObjectApi() + + let registrar = TestProxyApiRegistrar() + let instance = NSObjectImpl(api: api, registrar: registrar) + let keyPath = "myString" + let object = NSObject() + let change = [NSKeyValueChangeKey.indexesKey: -1] + instance.observeValue(forKeyPath: keyPath, of: object, change: change, context: nil) + + XCTAssertEqual(api.observeValueArgs, [keyPath, object, [KeyValueChangeKey.indexes: -1]]) + } +} + +class TestObject: NSObject { + var addObserverArgs: [AnyHashable?]? = nil + var removeObserverArgs: [AnyHashable?]? = nil + + override func addObserver( + _ observer: NSObject, forKeyPath keyPath: String, options: NSKeyValueObservingOptions = [], + context: UnsafeMutableRawPointer? + ) { + addObserverArgs = [observer, keyPath, options.rawValue] + } + + override func removeObserver(_ observer: NSObject, forKeyPath keyPath: String) { + removeObserverArgs = [observer, keyPath] + } +} + +class TestObjectApi: PigeonApiProtocolNSObject { + var observeValueArgs: [AnyHashable?]? = nil + + func observeValue( + pigeonInstance pigeonInstanceArg: NSObject, keyPath keyPathArg: String?, + object objectArg: NSObject?, change changeArg: [KeyValueChangeKey: Any?]?, + completion: @escaping (Result) -> Void + ) { + observeValueArgs = [keyPathArg, objectArg, changeArg! as! [KeyValueChangeKey: Int]] + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/NavigationActionProxyAPITests.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/NavigationActionProxyAPITests.swift new file mode 100644 index 00000000000..278604bc062 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/NavigationActionProxyAPITests.swift @@ -0,0 +1,56 @@ +// 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 NavigationActionProxyAPITests: XCTestCase { + @MainActor func testRequest() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiWKNavigationAction(registrar) + + let instance: TestNavigationAction? = TestNavigationAction() + let value = try? api.pigeonDelegate.request(pigeonApi: api, pigeonInstance: instance!) + + XCTAssertEqual(value?.value, instance!.request) + } + + @MainActor func testTargetFrame() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiWKNavigationAction(registrar) + + let instance: TestNavigationAction? = TestNavigationAction() + let value = try? api.pigeonDelegate.targetFrame(pigeonApi: api, pigeonInstance: instance!) + + XCTAssertEqual(value, instance!.targetFrame) + } + + @MainActor func testNavigationType() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiWKNavigationAction(registrar) + + let instance: TestNavigationAction? = TestNavigationAction() + let value = try? api.pigeonDelegate.navigationType(pigeonApi: api, pigeonInstance: instance!) + + XCTAssertEqual(value, .formSubmitted) + } +} + +class TestNavigationAction: WKNavigationAction { + let internalTargetFrame = TestFrameInfo() + + override var request: URLRequest { + return URLRequest(url: URL(string: "http://google.com")!) + } + + override var targetFrame: WKFrameInfo? { + return internalTargetFrame + } + + override var navigationType: WKNavigationType { + return .formSubmitted + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/NavigationDelegateProxyAPITests.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/NavigationDelegateProxyAPITests.swift new file mode 100644 index 00000000000..822e38025ff --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/NavigationDelegateProxyAPITests.swift @@ -0,0 +1,258 @@ +// 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 NavigationDelegateProxyAPITests: XCTestCase { + func testPigeonDefaultConstructor() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiWKNavigationDelegate(registrar) + + let instance = try? api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api) + XCTAssertNotNil(instance) + } + + @MainActor func testDidFinishNavigation() { + let api = TestNavigationDelegateApi() + let registrar = TestProxyApiRegistrar() + let instance = NavigationDelegateImpl(api: api, registrar: registrar) + let webView = TestWebView(frame: .zero) + + instance.webView(webView, didFinish: nil) + + XCTAssertEqual(api.didFinishNavigationArgs, [webView, webView.url?.absoluteString]) + } + + @MainActor func testDidStartProvisionalNavigation() { + let api = TestNavigationDelegateApi() + let registrar = TestProxyApiRegistrar() + let instance = NavigationDelegateImpl(api: api, registrar: registrar) + let webView = TestWebView(frame: .zero) + instance.webView(webView, didStartProvisionalNavigation: nil) + + XCTAssertEqual(api.didStartProvisionalNavigationArgs, [webView, webView.url?.absoluteString]) + } + + @MainActor func testDecidePolicyForNavigationAction() { + let api = TestNavigationDelegateApi() + let registrar = TestProxyApiRegistrar() + let instance = NavigationDelegateImpl(api: api, registrar: registrar) + let webView = WKWebView(frame: .zero) + let navigationAction = TestNavigationAction() + + let callbackExpectation = expectation(description: "Wait for callback.") + var result: WKNavigationActionPolicy? + instance.webView(webView, decidePolicyFor: navigationAction) { policy in + result = policy + callbackExpectation.fulfill() + } + + wait(for: [callbackExpectation], timeout: 1.0) + + XCTAssertEqual(api.decidePolicyForNavigationActionArgs, [webView, navigationAction]) + XCTAssertEqual(result, .allow) + } + + @MainActor func testDecidePolicyForNavigationResponse() { + let api = TestNavigationDelegateApi() + let registrar = TestProxyApiRegistrar() + let instance = NavigationDelegateImpl(api: api, registrar: registrar) + let webView = WKWebView(frame: .zero) + let navigationResponse = TestNavigationResponse() + + var result: WKNavigationResponsePolicy? + let callbackExpectation = expectation(description: "Wait for callback.") + instance.webView(webView, decidePolicyFor: navigationResponse) { policy in + result = policy + callbackExpectation.fulfill() + } + + wait(for: [callbackExpectation], timeout: 1.0) + + XCTAssertEqual(api.decidePolicyForNavigationResponseArgs, [webView, navigationResponse]) + XCTAssertEqual(result, .cancel) + } + + @MainActor func testDidFailNavigation() { + let api = TestNavigationDelegateApi() + let registrar = TestProxyApiRegistrar() + let instance = NavigationDelegateImpl(api: api, registrar: registrar) + let webView = WKWebView(frame: .zero) + let error = NSError(domain: "", code: 12) + instance.webView(webView, didFail: nil, withError: error) + + XCTAssertEqual(api.didFailNavigationArgs, [webView, error]) + } + + @MainActor func testDidFailProvisionalNavigation() { + let api = TestNavigationDelegateApi() + let registrar = TestProxyApiRegistrar() + let instance = NavigationDelegateImpl(api: api, registrar: registrar) + let webView = WKWebView(frame: .zero) + let error = NSError(domain: "", code: 12) + instance.webView(webView, didFailProvisionalNavigation: nil, withError: error) + + XCTAssertEqual(api.didFailProvisionalNavigationArgs, [webView, error]) + } + + @MainActor func testWebViewWebContentProcessDidTerminate() { + let api = TestNavigationDelegateApi() + let registrar = TestProxyApiRegistrar() + let instance = NavigationDelegateImpl(api: api, registrar: registrar) + let webView = WKWebView(frame: .zero) + instance.webViewWebContentProcessDidTerminate(webView) + + XCTAssertEqual(api.webViewWebContentProcessDidTerminateArgs, [webView]) + } + + @MainActor func testDidReceiveAuthenticationChallenge() { + let api = TestNavigationDelegateApi() + let registrar = TestProxyApiRegistrar() + let instance = NavigationDelegateImpl(api: api, registrar: registrar) + let webView = WKWebView(frame: .zero) + let challenge = URLAuthenticationChallenge( + protectionSpace: URLProtectionSpace(), proposedCredential: nil, previousFailureCount: 3, + failureResponse: nil, error: nil, sender: TestURLAuthenticationChallengeSender()) + + var dispositionResult: URLSession.AuthChallengeDisposition? + var credentialResult: URLCredential? + let callbackExpectation = expectation(description: "Wait for callback.") + instance.webView(webView, didReceive: challenge) { disposition, credential in + dispositionResult = disposition + credentialResult = credential + callbackExpectation.fulfill() + } + + wait(for: [callbackExpectation], timeout: 1.0) + + XCTAssertEqual(api.didReceiveAuthenticationChallengeArgs, [webView, challenge]) + XCTAssertEqual(dispositionResult, .useCredential) + XCTAssertEqual(credentialResult?.user, "user1") + XCTAssertEqual(credentialResult?.password, "password1") + XCTAssertEqual(credentialResult?.persistence, URLCredential.Persistence.none) + } +} + +class TestNavigationDelegateApi: PigeonApiProtocolWKNavigationDelegate { + var didFinishNavigationArgs: [AnyHashable?]? = nil + var didStartProvisionalNavigationArgs: [AnyHashable?]? = nil + var decidePolicyForNavigationActionArgs: [AnyHashable?]? = nil + var decidePolicyForNavigationResponseArgs: [AnyHashable?]? = nil + var didFailNavigationArgs: [AnyHashable?]? = nil + var didFailProvisionalNavigationArgs: [AnyHashable?]? = nil + var webViewWebContentProcessDidTerminateArgs: [AnyHashable?]? = nil + var didReceiveAuthenticationChallengeArgs: [AnyHashable?]? = nil + + func registrar() -> ProxyAPIDelegate { + return ProxyAPIDelegate() + } + + func didFinishNavigation( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + url urlArg: String?, + completion: @escaping (Result) -> Void + ) { + didFinishNavigationArgs = [webViewArg, urlArg] + } + + func didStartProvisionalNavigation( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + url urlArg: String?, + completion: @escaping (Result) -> Void + ) { + didStartProvisionalNavigationArgs = [webViewArg, urlArg] + } + + func decidePolicyForNavigationAction( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + navigationAction navigationActionArg: WKNavigationAction, + completion: @escaping ( + Result< + webview_flutter_wkwebview.NavigationActionPolicy, webview_flutter_wkwebview.PigeonError + > + ) -> Void + ) { + decidePolicyForNavigationActionArgs = [webViewArg, navigationActionArg] + completion(.success(.allow)) + } + + func decidePolicyForNavigationResponse( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + navigationResponse navigationResponseArg: WKNavigationResponse, + completion: @escaping ( + Result< + webview_flutter_wkwebview.NavigationResponsePolicy, webview_flutter_wkwebview.PigeonError + > + ) -> Void + ) { + decidePolicyForNavigationResponseArgs = [webViewArg, navigationResponseArg] + completion(.success(.cancel)) + } + + func didFailNavigation( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + error errorArg: NSError, + completion: @escaping (Result) -> Void + ) { + didFailNavigationArgs = [webViewArg, errorArg] + } + + func didFailProvisionalNavigation( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + error errorArg: NSError, + completion: @escaping (Result) -> Void + ) { + didFailProvisionalNavigationArgs = [webViewArg, errorArg] + } + + func webViewWebContentProcessDidTerminate( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + completion: @escaping (Result) -> Void + ) { + webViewWebContentProcessDidTerminateArgs = [webViewArg] + } + + func didReceiveAuthenticationChallenge( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + challenge challengeArg: URLAuthenticationChallenge, + completion: @escaping ( + Result< + [Any?], + webview_flutter_wkwebview.PigeonError + > + ) -> Void + ) { + didReceiveAuthenticationChallengeArgs = [webViewArg, challengeArg] + completion( + .success([ + UrlSessionAuthChallengeDisposition.useCredential, + ["user": "user1", "password": "password1", "persistence": UrlCredentialPersistence.none], + ])) + } +} + +class TestWebView: WKWebView { + override var url: URL? { + return URL(string: "http://google.com") + } +} + +class TestURLAuthenticationChallengeSender: NSObject, URLAuthenticationChallengeSender, @unchecked + Sendable +{ + func use(_ credential: URLCredential, for challenge: URLAuthenticationChallenge) { + + } + + func continueWithoutCredential(for challenge: URLAuthenticationChallenge) { + + } + + func cancel(_ challenge: URLAuthenticationChallenge) { + + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/NavigationResponseProxyAPITests.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/NavigationResponseProxyAPITests.swift new file mode 100644 index 00000000000..c3367b0bb40 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/NavigationResponseProxyAPITests.swift @@ -0,0 +1,42 @@ +// 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 NavigationResponseProxyAPITests: XCTestCase { + @MainActor func testResponse() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiWKNavigationResponse(registrar) + + let instance = WKNavigationResponse() + let value = try? api.pigeonDelegate.response(pigeonApi: api, pigeonInstance: instance) + + XCTAssertEqual(value, instance.response) + } + + @MainActor func testIsForMainFrame() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiWKNavigationResponse(registrar) + + let instance = TestNavigationResponse() + let value = try? api.pigeonDelegate.isForMainFrame(pigeonApi: api, pigeonInstance: instance) + + XCTAssertEqual(value, instance.isForMainFrame) + } +} + +class TestNavigationResponse: WKNavigationResponse { + let testResponse = URLResponse() + + override var isForMainFrame: Bool { + return true + } + + override var response: URLResponse { + return testResponse + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/PreferencesProxyAPITests.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/PreferencesProxyAPITests.swift new file mode 100644 index 00000000000..7088f93833e --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/PreferencesProxyAPITests.swift @@ -0,0 +1,27 @@ +// 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 PreferencesProxyAPITests: XCTestCase { + @MainActor func testSetJavaScriptEnabled() throws { + if #available(iOS 14.0, macOS 11.0, *) { + throw XCTSkip("Required API is not available for this test.") + + } 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) + + XCTAssertEqual(instance.javaScriptEnabled, enabled) + } + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/ScriptMessageHandlerProxyAPITests.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/ScriptMessageHandlerProxyAPITests.swift new file mode 100644 index 00000000000..f784f77d372 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/ScriptMessageHandlerProxyAPITests.swift @@ -0,0 +1,42 @@ +// 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 ScriptMessageHandlerProxyAPITests: XCTestCase { + func testPigeonDefaultConstructor() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiWKScriptMessageHandler(registrar) + + let instance = try? api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api) + XCTAssertNotNil(instance) + } + + @MainActor func testDidReceiveScriptMessage() { + let api = TestScriptMessageHandlerApi() + let registrar = TestProxyApiRegistrar() + let instance = ScriptMessageHandlerImpl(api: api, registrar: registrar) + let controller = WKUserContentController() + let message = WKScriptMessage() + + instance.userContentController(controller, didReceive: message) + + XCTAssertEqual(api.didReceiveScriptMessageArgs, [controller, message]) + } +} + +class TestScriptMessageHandlerApi: PigeonApiProtocolWKScriptMessageHandler { + var didReceiveScriptMessageArgs: [AnyHashable?]? = nil + + func didReceiveScriptMessage( + pigeonInstance pigeonInstanceArg: WKScriptMessageHandler, + controller controllerArg: WKUserContentController, message messageArg: WKScriptMessage, + completion: @escaping (Result) -> Void + ) { + didReceiveScriptMessageArgs = [controllerArg, messageArg] + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/ScriptMessageProxyAPITests.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/ScriptMessageProxyAPITests.swift new file mode 100644 index 00000000000..7170d5fe706 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/ScriptMessageProxyAPITests.swift @@ -0,0 +1,40 @@ +// 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 ScriptMessageProxyAPITests: XCTestCase { + @MainActor func testName() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiWKScriptMessage(registrar) + + let instance = TestScriptMessage() + let value = try? api.pigeonDelegate.name(pigeonApi: api, pigeonInstance: instance) + + XCTAssertEqual(value, instance.name) + } + + @MainActor func testBody() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiWKScriptMessage(registrar) + + let instance = TestScriptMessage() + let value = try? api.pigeonDelegate.body(pigeonApi: api, pigeonInstance: instance) + + XCTAssertEqual(value as! Int, 23) + } +} + +class TestScriptMessage: WKScriptMessage { + override var name: String { + return "myString" + } + + override var body: Any { + return NSNumber(integerLiteral: 23) + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/ScrollViewDelegateProxyAPITests.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/ScrollViewDelegateProxyAPITests.swift new file mode 100644 index 00000000000..08c60670203 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/ScrollViewDelegateProxyAPITests.swift @@ -0,0 +1,50 @@ +// 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 XCTest + +@testable import webview_flutter_wkwebview + +#if os(iOS) + import UIKit +#endif + +class ScrollViewDelegateProxyAPITests: XCTestCase { + #if os(iOS) + func testPigeonDefaultConstructor() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiUIScrollViewDelegate(registrar) + + let instance = try? api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api) + XCTAssertNotNil(instance) + } + + @MainActor func testScrollViewDidScroll() { + let api = TestScrollViewDelegateApi() + let registrar = TestProxyApiRegistrar() + let instance = ScrollViewDelegateImpl(api: api, registrar: registrar) + let scrollView = UIScrollView(frame: .zero) + let x = 1.0 + let y = 1.0 + scrollView.contentOffset = CGPoint(x: x, y: y) + instance.scrollViewDidScroll(scrollView) + + XCTAssertEqual(api.scrollViewDidScrollArgs, [scrollView, x, y]) + } + #endif +} + +#if os(iOS) + class TestScrollViewDelegateApi: PigeonApiProtocolUIScrollViewDelegate { + var scrollViewDidScrollArgs: [AnyHashable?]? = nil + + func scrollViewDidScroll( + pigeonInstance pigeonInstanceArg: UIScrollViewDelegate, + scrollView scrollViewArg: UIScrollView, x xArg: Double, y yArg: Double, + completion: @escaping (Result) -> Void + ) { + scrollViewDidScrollArgs = [scrollViewArg, xArg, yArg] + } + } +#endif diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/ScrollViewProxyAPITests.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/ScrollViewProxyAPITests.swift new file mode 100644 index 00000000000..60f39d11f1b --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/ScrollViewProxyAPITests.swift @@ -0,0 +1,154 @@ +// 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 XCTest + +@testable import webview_flutter_wkwebview + +#if os(iOS) + import UIKit +#endif + +class ScrollViewProxyAPITests: XCTestCase { + #if os(iOS) + @MainActor func testGetContentOffset() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiUIScrollView(registrar) + + let instance = TestScrollView(frame: .zero) + let value = try? api.pigeonDelegate.getContentOffset(pigeonApi: api, pigeonInstance: instance) + + XCTAssertEqual(value, [instance.contentOffset.x, instance.contentOffset.y]) + } + + @MainActor func testScrollBy() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiUIScrollView(registrar) + + let instance = TestScrollView(frame: .zero) + instance.contentOffset = CGPoint(x: 1.0, y: 1.0) + try? api.pigeonDelegate.scrollBy(pigeonApi: api, pigeonInstance: instance, x: 1.0, y: 1.0) + + XCTAssertEqual(instance.setContentOffsetArgs as? [Double], [2.0, 2.0]) + } + + @MainActor func testSetContentOffset() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiUIScrollView(registrar) + + let instance = TestScrollView(frame: .zero) + let x = 1.0 + let y = 1.0 + try? api.pigeonDelegate.setContentOffset(pigeonApi: api, pigeonInstance: instance, x: x, y: y) + + XCTAssertEqual(instance.setContentOffsetArgs as? [Double], [x, y]) + } + + @MainActor func testSetDelegate() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiUIScrollView(registrar) + + let instance = TestScrollView(frame: .zero) + let delegate = ScrollViewDelegateImpl( + api: registrar.apiDelegate.pigeonApiUIScrollViewDelegate(registrar), registrar: registrar) + try? api.pigeonDelegate.setDelegate( + pigeonApi: api, pigeonInstance: instance, delegate: delegate) + + XCTAssertEqual(instance.setDelegateArgs, [delegate]) + } + + @MainActor + func testSetBounces() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiUIScrollView(registrar) + + let instance = TestScrollView() + let value = true + try? api.pigeonDelegate.setBounces(pigeonApi: api, pigeonInstance: instance, value: value) + + XCTAssertEqual(instance.bounces, value) + } + + #if compiler(>=6.0) + @available(iOS 17.4, *) + @MainActor + func testSetBouncesHorizontally() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiUIScrollView(registrar) + + let instance = TestScrollView() + let value = true + try? api.pigeonDelegate.setBouncesHorizontally( + pigeonApi: api, pigeonInstance: instance, value: value) + + XCTAssertEqual(instance.bouncesHorizontally, value) + } + + @available(iOS 17.4, *) + @MainActor + func testSetBouncesVertically() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiUIScrollView(registrar) + + let instance = TestScrollView() + let value = true + try? api.pigeonDelegate.setBouncesVertically( + pigeonApi: api, pigeonInstance: instance, value: value) + + XCTAssertEqual(instance.bouncesVertically, value) + } + #endif + + @MainActor + func testSetAlwaysBounceVertical() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiUIScrollView(registrar) + + let instance = TestScrollView() + let value = true + try? api.pigeonDelegate.setAlwaysBounceVertical( + pigeonApi: api, pigeonInstance: instance, value: value) + + XCTAssertEqual(instance.alwaysBounceVertical, value) + } + + @MainActor + func testSetAlwaysBounceHorizontal() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiUIScrollView(registrar) + + let instance = TestScrollView() + let value = true + try? api.pigeonDelegate.setAlwaysBounceHorizontal( + pigeonApi: api, pigeonInstance: instance, value: value) + + XCTAssertEqual(instance.alwaysBounceHorizontal, value) + } + #endif +} + +#if os(iOS) + class TestScrollView: UIScrollView { + var setContentOffsetArgs: [AnyHashable?]? = nil + var setDelegateArgs: [AnyHashable?]? = nil + + override var contentOffset: CGPoint { + get { + return CGPoint(x: 1.0, y: 1.0) + } + set { + setContentOffsetArgs = [newValue.x, newValue.y] + } + } + + override var delegate: UIScrollViewDelegate? { + get { + return nil + } + set { + setDelegateArgs = ([newValue] as! [AnyHashable?]) + } + } + } +#endif diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/SecurityOriginProxyAPITests.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/SecurityOriginProxyAPITests.swift new file mode 100644 index 00000000000..d9bbea0a621 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/SecurityOriginProxyAPITests.swift @@ -0,0 +1,65 @@ +// 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 + +@MainActor +class SecurityOriginProxyAPITests: XCTestCase { + static let testSecurityOrigin = TestSecurityOrigin.customInit() + + @MainActor func testHost() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiWKSecurityOrigin(registrar) + + let instance = SecurityOriginProxyAPITests.testSecurityOrigin + let value = try? api.pigeonDelegate.host(pigeonApi: api, pigeonInstance: instance) + + XCTAssertEqual(value, instance.host) + } + + @MainActor func testPort() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiWKSecurityOrigin(registrar) + + let instance = SecurityOriginProxyAPITests.testSecurityOrigin + let value = try? api.pigeonDelegate.port(pigeonApi: api, pigeonInstance: instance) + + XCTAssertEqual(value, Int64(instance.port)) + } + + @MainActor func testSecurityProtocol() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiWKSecurityOrigin(registrar) + + let instance = SecurityOriginProxyAPITests.testSecurityOrigin + let value = try? api.pigeonDelegate.securityProtocol(pigeonApi: api, pigeonInstance: instance) + + XCTAssertEqual(value, instance.`protocol`) + } +} + +class TestSecurityOrigin: WKSecurityOrigin { + // Workaround to subclass an Objective-C class that has an `init` constructor with NS_UNAVAILABLE + static func customInit() -> TestSecurityOrigin { + let instance = + TestSecurityOrigin.perform(NSSelectorFromString("new")).takeRetainedValue() + as! TestSecurityOrigin + return instance + } + + override var host: String { + return "host" + } + + override var port: Int { + return 23 + } + + override var `protocol`: String { + return "protocol" + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/TestBinaryMessenger.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/TestBinaryMessenger.swift new file mode 100644 index 00000000000..4c89531993c --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/TestBinaryMessenger.swift @@ -0,0 +1,33 @@ +// 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. + +#if os(iOS) + import Flutter +#elseif os(macOS) + import FlutterMacOS +#else + #error("Unsupported platform.") +#endif + +class TestBinaryMessenger: NSObject, FlutterBinaryMessenger { + func send(onChannel channel: String, message: Data?) { + + } + + func send( + onChannel channel: String, message: Data?, binaryReply callback: FlutterBinaryReply? = nil + ) { + + } + + func setMessageHandlerOnChannel( + _ channel: String, binaryMessageHandler handler: FlutterBinaryMessageHandler? = nil + ) -> FlutterBinaryMessengerConnection { + return 0 + } + + func cleanUpConnection(_ connection: FlutterBinaryMessengerConnection) { + + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/TestProxyApiRegistrar.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/TestProxyApiRegistrar.swift new file mode 100644 index 00000000000..98142d219fd --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/TestProxyApiRegistrar.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 XCTest + +@testable import webview_flutter_wkwebview + +class TestProxyApiRegistrar: ProxyAPIRegistrar { + init() { + super.init(binaryMessenger: TestBinaryMessenger(), bundle: TestBundle()) + } + + override func dispatchOnMainThread( + execute work: @escaping (@escaping (String, PigeonError) -> Void) -> Void + ) { + work { _, _ in } + } +} + +class TestBundle: Bundle, @unchecked Sendable { + override func url(forResource name: String?, withExtension ext: String?) -> URL? { + return URL(string: "assets/www/index.html")! + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/UIDelegateProxyAPITests.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/UIDelegateProxyAPITests.swift new file mode 100644 index 00000000000..cbc71c18bd2 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/UIDelegateProxyAPITests.swift @@ -0,0 +1,175 @@ +// 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 UIDelegateProxyAPITests: XCTestCase { + func testPigeonDefaultConstructor() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiWKUIDelegate(registrar) + + let instance = try? api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api) + XCTAssertNotNil(instance) + } + + @MainActor func testOnCreateWebView() { + let api = TestDelegateApi() + let registrar = TestProxyApiRegistrar() + let instance = UIDelegateImpl(api: api, registrar: registrar) + let webView = WKWebView(frame: .zero) + let configuration = WKWebViewConfiguration() + let navigationAction = TestNavigationAction() + + let result = instance.webView( + webView, createWebViewWith: configuration, for: navigationAction, + windowFeatures: WKWindowFeatures()) + + XCTAssertEqual(api.onCreateWebViewArgs, [webView, configuration, navigationAction]) + XCTAssertNil(result) + } + + @available(iOS 15.0, macOS 12.0, *) + @MainActor func testRequestMediaCapturePermission() { + let api = TestDelegateApi() + let registrar = TestProxyApiRegistrar() + let instance = UIDelegateImpl(api: api, registrar: registrar) + let webView = WKWebView(frame: .zero) + let origin = SecurityOriginProxyAPITests.testSecurityOrigin + let frame = TestFrameInfo() + let type: WKMediaCaptureType = .camera + + var resultDecision: WKPermissionDecision? + let callbackExpectation = expectation(description: "Wait for callback.") + instance.webView( + webView, requestMediaCapturePermissionFor: origin, initiatedByFrame: frame, type: type + ) { decision in + resultDecision = decision + callbackExpectation.fulfill() + } + + wait(for: [callbackExpectation], timeout: 1.0) + + XCTAssertEqual( + api.requestMediaCapturePermissionArgs, [webView, origin, frame, MediaCaptureType.camera]) + XCTAssertEqual(resultDecision, .prompt) + } + + @MainActor func testRunJavaScriptAlertPanel() { + let api = TestDelegateApi() + let registrar = TestProxyApiRegistrar() + let instance = UIDelegateImpl(api: api, registrar: registrar) + let webView = WKWebView(frame: .zero) + let message = "myString" + let frame = TestFrameInfo() + + instance.webView(webView, runJavaScriptAlertPanelWithMessage: message, initiatedByFrame: frame) + { + } + + XCTAssertEqual(api.runJavaScriptAlertPanelArgs, [webView, message, frame]) + } + + @MainActor func testRunJavaScriptConfirmPanel() { + let api = TestDelegateApi() + let registrar = TestProxyApiRegistrar() + let instance = UIDelegateImpl(api: api, registrar: registrar) + let webView = WKWebView(frame: .zero) + let message = "myString" + let frame = TestFrameInfo() + + var confirmedResult: Bool? + let callbackExpectation = expectation(description: "Wait for callback.") + instance.webView( + webView, runJavaScriptConfirmPanelWithMessage: message, initiatedByFrame: frame + ) { confirmed in + confirmedResult = confirmed + callbackExpectation.fulfill() + } + + wait(for: [callbackExpectation], timeout: 1.0) + + XCTAssertEqual(api.runJavaScriptConfirmPanelArgs, [webView, message, frame]) + XCTAssertEqual(confirmedResult, true) + } + + @MainActor func testRunJavaScriptTextInputPanel() { + let api = TestDelegateApi() + let registrar = TestProxyApiRegistrar() + let instance = UIDelegateImpl(api: api, registrar: registrar) + let webView = WKWebView(frame: .zero) + let prompt = "myString" + let defaultText = "myString3" + let frame = TestFrameInfo() + + var inputResult: String? + let callbackExpectation = expectation(description: "Wait for callback.") + instance.webView( + webView, runJavaScriptTextInputPanelWithPrompt: prompt, defaultText: defaultText, + initiatedByFrame: frame + ) { input in + inputResult = input + callbackExpectation.fulfill() + } + + wait(for: [callbackExpectation], timeout: 1.0) + + XCTAssertEqual(api.runJavaScriptTextInputPanelArgs, [webView, prompt, defaultText, frame]) + XCTAssertEqual(inputResult, "myString2") + } +} + +class TestDelegateApi: PigeonApiProtocolWKUIDelegate { + var onCreateWebViewArgs: [AnyHashable?]? = nil + var requestMediaCapturePermissionArgs: [AnyHashable?]? = nil + var runJavaScriptAlertPanelArgs: [AnyHashable?]? = nil + var runJavaScriptConfirmPanelArgs: [AnyHashable?]? = nil + var runJavaScriptTextInputPanelArgs: [AnyHashable?]? = nil + + func onCreateWebView( + pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, + configuration configurationArg: WKWebViewConfiguration, + navigationAction navigationActionArg: WKNavigationAction, + completion: @escaping (Result) -> Void + ) { + onCreateWebViewArgs = [webViewArg, configurationArg, navigationActionArg] + } + + func requestMediaCapturePermission( + pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, + origin originArg: WKSecurityOrigin, frame frameArg: WKFrameInfo, type typeArg: MediaCaptureType, + completion: @escaping (Result) -> Void + ) { + requestMediaCapturePermissionArgs = [webViewArg, originArg, frameArg, typeArg] + completion(.success(.prompt)) + } + + func runJavaScriptAlertPanel( + pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, + message messageArg: String, frame frameArg: WKFrameInfo, + completion: @escaping (Result) -> Void + ) { + runJavaScriptAlertPanelArgs = [webViewArg, messageArg, frameArg] + } + + func runJavaScriptConfirmPanel( + pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, + message messageArg: String, frame frameArg: WKFrameInfo, + completion: @escaping (Result) -> Void + ) { + runJavaScriptConfirmPanelArgs = [webViewArg, messageArg, frameArg] + completion(.success(true)) + } + + func runJavaScriptTextInputPanel( + pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, + prompt promptArg: String, defaultText defaultTextArg: String?, frame frameArg: WKFrameInfo, + completion: @escaping (Result) -> Void + ) { + runJavaScriptTextInputPanelArgs = [webViewArg, promptArg, defaultTextArg, frameArg] + completion(.success("myString2")) + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/UIViewProxyAPITests.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/UIViewProxyAPITests.swift new file mode 100644 index 00000000000..d0b3191c107 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/UIViewProxyAPITests.swift @@ -0,0 +1,44 @@ +// 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 XCTest + +@testable import webview_flutter_wkwebview + +#if os(iOS) + import UIKit +#endif + +class UIViewProxyAPITests: XCTestCase { + #if os(iOS) + @MainActor func testSetBackgroundColor() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiUIView(registrar) + + let instance = UIView(frame: .zero) + let value = 0xFFF4_4336 + try? api.pigeonDelegate.setBackgroundColor( + pigeonApi: api, pigeonInstance: instance, value: Int64(value)) + + let red = CGFloat(Double((value >> 16 & 0xff)) / 255.0) + let green = CGFloat(Double(value >> 8 & 0xff) / 255.0) + let blue = CGFloat(Double(value & 0xff) / 255.0) + let alpha = CGFloat(Double(value >> 24 & 0xff) / 255.0) + + XCTAssertEqual( + instance.backgroundColor, UIColor(red: red, green: green, blue: blue, alpha: alpha)) + } + + @MainActor func testSetOpaque() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiUIView(registrar) + + let instance = UIView(frame: .zero) + let opaque = true + try? api.pigeonDelegate.setOpaque(pigeonApi: api, pigeonInstance: instance, opaque: opaque) + + XCTAssertEqual(instance.isOpaque, opaque) + } + #endif +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/URLAuthenticationChallengeProxyAPITests.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/URLAuthenticationChallengeProxyAPITests.swift new file mode 100644 index 00000000000..5d8fbe9779f --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/URLAuthenticationChallengeProxyAPITests.swift @@ -0,0 +1,21 @@ +// 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 XCTest + +@testable import webview_flutter_wkwebview + +class URLAuthenticationChallengeProxyAPITests: XCTestCase { + func testGetProtectionSpace() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiURLAuthenticationChallenge(registrar) + + let instance = URLAuthenticationChallenge( + protectionSpace: URLProtectionSpace(), proposedCredential: nil, previousFailureCount: 3, + failureResponse: nil, error: nil, sender: TestURLAuthenticationChallengeSender()) + let value = try? api.pigeonDelegate.getProtectionSpace(pigeonApi: api, pigeonInstance: instance) + + XCTAssertEqual(value, instance.protectionSpace) + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/URLCredentialProxyAPITests.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/URLCredentialProxyAPITests.swift new file mode 100644 index 00000000000..d7eb4b1192a --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/URLCredentialProxyAPITests.swift @@ -0,0 +1,18 @@ +// 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 XCTest + +@testable import webview_flutter_wkwebview + +class URLCredentialProxyAPITests: XCTestCase { + func testWithUser() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiURLCredential(registrar) + + let instance = try? api.pigeonDelegate.withUser( + pigeonApi: api, user: "myString", password: "myString", persistence: .none) + XCTAssertNotNil(instance) + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/URLProtectionSpaceProxyAPITests.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/URLProtectionSpaceProxyAPITests.swift new file mode 100644 index 00000000000..fcb9e9e4fb9 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/URLProtectionSpaceProxyAPITests.swift @@ -0,0 +1,59 @@ +// 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 XCTest + +@testable import webview_flutter_wkwebview + +class ProtectionSpaceProxyAPITests: XCTestCase { + func testHost() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiURLProtectionSpace(registrar) + + let instance = URLProtectionSpace( + host: "host", port: 23, protocol: "protocol", realm: "realm", authenticationMethod: "myMethod" + ) + let value = try? api.pigeonDelegate.host(pigeonApi: api, pigeonInstance: instance) + + XCTAssertEqual(value, instance.host) + } + + func testPort() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiURLProtectionSpace(registrar) + + let instance = URLProtectionSpace( + host: "host", port: 23, protocol: "protocol", realm: "realm", authenticationMethod: "myMethod" + ) + let value = try? api.pigeonDelegate.port(pigeonApi: api, pigeonInstance: instance) + + XCTAssertEqual(value, Int64(instance.port)) + } + + func testRealm() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiURLProtectionSpace(registrar) + + let instance = URLProtectionSpace( + host: "host", port: 23, protocol: "protocol", realm: "realm", authenticationMethod: "myMethod" + ) + let value = try? api.pigeonDelegate.realm(pigeonApi: api, pigeonInstance: instance) + + XCTAssertEqual(value, instance.realm) + } + + func testAuthenticationMethod() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiURLProtectionSpace(registrar) + + let instance = URLProtectionSpace( + host: "host", port: 23, protocol: "protocol", realm: "realm", authenticationMethod: "myMethod" + ) + let value = try? api.pigeonDelegate.authenticationMethod( + pigeonApi: api, pigeonInstance: instance) + + XCTAssertEqual(value, instance.authenticationMethod) + } + +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/URLRequestProxyAPITests.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/URLRequestProxyAPITests.swift new file mode 100644 index 00000000000..66c4782d734 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/URLRequestProxyAPITests.swift @@ -0,0 +1,108 @@ +// 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 XCTest + +@testable import webview_flutter_wkwebview + +#if os(iOS) + import Flutter +#elseif os(macOS) + import FlutterMacOS +#else + #error("Unsupported platform.") +#endif + +class RequestProxyAPITests: XCTestCase { + func testPigeonDefaultConstructor() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiURLRequest(registrar) + + let instance = try? api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api, url: "myString") + XCTAssertNotNil(instance) + } + + func testGetUrl() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiURLRequest(registrar) + + let instance = URLRequestWrapper(URLRequest(url: URL(string: "http://google.com")!)) + let value = try? api.pigeonDelegate.getUrl(pigeonApi: api, pigeonInstance: instance) + + XCTAssertEqual(value, instance.value.url?.absoluteString) + } + + func testSetHttpMethod() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiURLRequest(registrar) + + let instance = URLRequestWrapper(URLRequest(url: URL(string: "http://google.com")!)) + let method = "GET" + try? api.pigeonDelegate.setHttpMethod(pigeonApi: api, pigeonInstance: instance, method: method) + + XCTAssertEqual(instance.value.httpMethod, method) + } + + func testGetHttpMethod() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiURLRequest(registrar) + + let instance = URLRequestWrapper(URLRequest(url: URL(string: "http://google.com")!)) + + let method = "POST" + instance.value.httpMethod = method + let value = try? api.pigeonDelegate.getHttpMethod(pigeonApi: api, pigeonInstance: instance) + + XCTAssertEqual(value, method) + } + + func testSetHttpBody() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiURLRequest(registrar) + + let instance = URLRequestWrapper(URLRequest(url: URL(string: "http://google.com")!)) + let body = FlutterStandardTypedData(bytes: Data()) + try? api.pigeonDelegate.setHttpBody(pigeonApi: api, pigeonInstance: instance, body: body) + + XCTAssertEqual(instance.value.httpBody, body.data) + } + + func testGetHttpBody() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiURLRequest(registrar) + + let instance = URLRequestWrapper(URLRequest(url: URL(string: "http://google.com")!)) + let body = FlutterStandardTypedData(bytes: Data()) + instance.value.httpBody = body.data + let value = try? api.pigeonDelegate.getHttpBody(pigeonApi: api, pigeonInstance: instance) + + XCTAssertEqual(value?.data, body.data) + } + + func testSetAllHttpHeaderFields() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiURLRequest(registrar) + + let instance = URLRequestWrapper(URLRequest(url: URL(string: "http://google.com")!)) + let fields = ["key": "value"] + try? api.pigeonDelegate.setAllHttpHeaderFields( + pigeonApi: api, pigeonInstance: instance, fields: fields) + + XCTAssertEqual(instance.value.allHTTPHeaderFields, fields) + } + + func testGetAllHttpHeaderFields() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiURLRequest(registrar) + + let instance = URLRequestWrapper(URLRequest(url: URL(string: "http://google.com")!)) + let fields = ["key": "value"] + instance.value.allHTTPHeaderFields = fields + + let value = try? api.pigeonDelegate.getAllHttpHeaderFields( + pigeonApi: api, pigeonInstance: instance) + + XCTAssertEqual(value, fields) + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/UserContentControllerProxyAPITests.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/UserContentControllerProxyAPITests.swift new file mode 100644 index 00000000000..5da00684e12 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/UserContentControllerProxyAPITests.swift @@ -0,0 +1,97 @@ +// 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 UserContentControllerProxyAPITests: XCTestCase { + @MainActor func testAddScriptMessageHandler() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiWKUserContentController(registrar) + + let instance = TestUserContentController() + let handler = ScriptMessageHandlerImpl( + api: registrar.apiDelegate.pigeonApiWKScriptMessageHandler(registrar), registrar: registrar) + let name = "myString" + try? api.pigeonDelegate.addScriptMessageHandler( + pigeonApi: api, pigeonInstance: instance, handler: handler, name: name) + + XCTAssertEqual(instance.addScriptMessageHandlerArgs, [handler, name]) + } + + @MainActor func testRemoveScriptMessageHandler() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiWKUserContentController(registrar) + + let instance = TestUserContentController() + let name = "myString" + try? api.pigeonDelegate.removeScriptMessageHandler( + pigeonApi: api, pigeonInstance: instance, name: name) + + XCTAssertEqual(instance.removeScriptMessageHandlerArgs, [name]) + } + + @MainActor func testRemoveAllScriptMessageHandlers() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiWKUserContentController(registrar) + + let instance = TestUserContentController() + try? api.pigeonDelegate.removeAllScriptMessageHandlers(pigeonApi: api, pigeonInstance: instance) + + XCTAssertTrue(instance.removeAllScriptMessageHandlersCalled) + } + + @MainActor func testAddUserScript() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiWKUserContentController(registrar) + + let instance = TestUserContentController() + let userScript = WKUserScript(source: "", injectionTime: .atDocumentEnd, forMainFrameOnly: true) + try? api.pigeonDelegate.addUserScript( + pigeonApi: api, pigeonInstance: instance, userScript: userScript) + + XCTAssertEqual(instance.addUserScriptArgs, [userScript]) + } + + @MainActor func testRemoveAllUserScripts() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiWKUserContentController(registrar) + + let instance = TestUserContentController() + try? api.pigeonDelegate.removeAllUserScripts(pigeonApi: api, pigeonInstance: instance) + + XCTAssertTrue(instance.removeAllUserScriptsCalled) + } + +} + +class TestUserContentController: WKUserContentController { + var addScriptMessageHandlerArgs: [AnyHashable?]? = nil + var removeScriptMessageHandlerArgs: [AnyHashable?]? = nil + var removeAllScriptMessageHandlersCalled = false + var addUserScriptArgs: [AnyHashable?]? = nil + var removeAllUserScriptsCalled = false + + override func add(_ scriptMessageHandler: WKScriptMessageHandler, name: String) { + addScriptMessageHandlerArgs = [scriptMessageHandler as! NSObject, name] + } + + override func removeScriptMessageHandler(forName name: String) { + removeScriptMessageHandlerArgs = [name] + } + + override func removeAllScriptMessageHandlers() { + removeAllScriptMessageHandlersCalled = true + } + + override func addUserScript(_ userScript: WKUserScript) { + addUserScriptArgs = [userScript] + } + + override func removeAllUserScripts() { + removeAllUserScriptsCalled = true + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/UserScriptProxyAPITests.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/UserScriptProxyAPITests.swift new file mode 100644 index 00000000000..b9fbeebd9de --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/UserScriptProxyAPITests.swift @@ -0,0 +1,52 @@ +// 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 UserScriptProxyAPITests: XCTestCase { + func testPigeonDefaultConstructor() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiWKUserScript(registrar) + + let instance = try? api.pigeonDelegate.pigeonDefaultConstructor( + pigeonApi: api, source: "myString", injectionTime: .atDocumentStart, isForMainFrameOnly: true) + XCTAssertNotNil(instance) + } + + @MainActor func testSource() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiWKUserScript(registrar) + + let instance = WKUserScript( + source: "source", injectionTime: .atDocumentEnd, forMainFrameOnly: false) + let value = try? api.pigeonDelegate.source(pigeonApi: api, pigeonInstance: instance) + + XCTAssertEqual(value, instance.source) + } + + @MainActor func testInjectionTime() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiWKUserScript(registrar) + + let instance = WKUserScript( + source: "source", injectionTime: .atDocumentEnd, forMainFrameOnly: false) + let value = try? api.pigeonDelegate.injectionTime(pigeonApi: api, pigeonInstance: instance) + + XCTAssertEqual(value, .atDocumentEnd) + } + + @MainActor func testIsMainFrameOnly() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiWKUserScript(registrar) + + let instance = WKUserScript( + source: "source", injectionTime: .atDocumentEnd, forMainFrameOnly: false) + let value = try? api.pigeonDelegate.isForMainFrameOnly(pigeonApi: api, pigeonInstance: instance) + + XCTAssertEqual(value, instance.isForMainFrameOnly) + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/WebViewConfigurationProxyAPITests.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/WebViewConfigurationProxyAPITests.swift new file mode 100644 index 00000000000..431b3915f97 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/WebViewConfigurationProxyAPITests.swift @@ -0,0 +1,138 @@ +// 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 WebViewConfigurationProxyAPITests: XCTestCase { + func testPigeonDefaultConstructor() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiWKWebViewConfiguration(registrar) + + let instance = try? api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api) + XCTAssertNotNil(instance) + } + + @MainActor func testSetUserContentController() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiWKWebViewConfiguration(registrar) + + let instance = WKWebViewConfiguration() + let controller = WKUserContentController() + try? api.pigeonDelegate.setUserContentController( + pigeonApi: api, pigeonInstance: instance, controller: controller) + + XCTAssertEqual(instance.userContentController, controller) + } + + @MainActor func testGetUserContentController() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiWKWebViewConfiguration(registrar) + + let instance = WKWebViewConfiguration() + let value = try? api.pigeonDelegate.getUserContentController( + pigeonApi: api, pigeonInstance: instance) + + XCTAssertEqual(value, instance.userContentController) + } + + @MainActor func testSetWebsiteDataStore() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiWKWebViewConfiguration(registrar) + + let instance = WKWebViewConfiguration() + let dataStore = WKWebsiteDataStore.default() + try? api.pigeonDelegate.setWebsiteDataStore( + pigeonApi: api, pigeonInstance: instance, dataStore: dataStore) + + XCTAssertEqual(instance.websiteDataStore, dataStore) + } + + @MainActor func testGetWebsiteDataStore() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiWKWebViewConfiguration(registrar) + + let instance = WKWebViewConfiguration() + let value = try? api.pigeonDelegate.getWebsiteDataStore( + pigeonApi: api, pigeonInstance: instance) + + XCTAssertEqual(value, instance.websiteDataStore) + } + + @MainActor func testSetPreferences() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiWKWebViewConfiguration(registrar) + + let instance = WKWebViewConfiguration() + let preferences = WKPreferences() + try? api.pigeonDelegate.setPreferences( + pigeonApi: api, pigeonInstance: instance, preferences: preferences) + + XCTAssertEqual(instance.preferences, preferences) + } + + @MainActor func testGetPreferences() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiWKWebViewConfiguration(registrar) + + let instance = WKWebViewConfiguration() + let value = try? api.pigeonDelegate.getPreferences(pigeonApi: api, pigeonInstance: instance) + + XCTAssertEqual(value, instance.preferences) + } + + @MainActor func testSetAllowsInlineMediaPlayback() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiWKWebViewConfiguration(registrar) + + let instance = WKWebViewConfiguration() + let allow = true + try? api.pigeonDelegate.setAllowsInlineMediaPlayback( + pigeonApi: api, pigeonInstance: instance, allow: allow) + + // setAllowsInlineMediaPlayback does not existing on macOS; the call above should no-op for macOS. + #if !os(macOS) + XCTAssertEqual(instance.allowsInlineMediaPlayback, allow) + #endif + } + + @available(iOS 14.0, macOS 11.0, *) + @MainActor func testSetLimitsNavigationsToAppBoundDomains() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiWKWebViewConfiguration(registrar) + + let instance = WKWebViewConfiguration() + let limit = true + try? api.pigeonDelegate.setLimitsNavigationsToAppBoundDomains( + pigeonApi: api, pigeonInstance: instance, limit: limit) + + XCTAssertEqual(instance.limitsNavigationsToAppBoundDomains, limit) + } + + @MainActor func testSetMediaTypesRequiringUserActionForPlayback() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiWKWebViewConfiguration(registrar) + + let instance = WKWebViewConfiguration() + let type: AudiovisualMediaType = .none + try? api.pigeonDelegate.setMediaTypesRequiringUserActionForPlayback( + pigeonApi: api, pigeonInstance: instance, type: type) + + 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/WebViewProxyAPITests.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/WebViewProxyAPITests.swift new file mode 100644 index 00000000000..b2e0ae0f081 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/WebViewProxyAPITests.swift @@ -0,0 +1,477 @@ +// 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 + +#if os(iOS) + import UIKit +#endif + +class WebViewProxyAPITests: XCTestCase { + #if os(iOS) + func webViewProxyAPI(forRegistrar registrar: ProxyAPIRegistrar) -> PigeonApiUIViewWKWebView { + return registrar.apiDelegate.pigeonApiUIViewWKWebView(registrar) + } + #elseif os(macOS) + func webViewProxyAPI(forRegistrar registrar: ProxyAPIRegistrar) -> PigeonApiNSViewWKWebView { + return registrar.apiDelegate.pigeonApiNSViewWKWebView(registrar) + } + #endif + + @MainActor func testPigeonDefaultConstructor() { + let registrar = TestProxyApiRegistrar() + let api = webViewProxyAPI(forRegistrar: registrar) + + let instance = try? api.pigeonDelegate.pigeonDefaultConstructor( + pigeonApi: api, initialConfiguration: WKWebViewConfiguration()) + XCTAssertNotNil(instance) + } + + @MainActor func testConfiguration() { + let registrar = TestProxyApiRegistrar() + let api = webViewProxyAPI(forRegistrar: registrar) + + let instance = TestViewWKWebView() + let value = try? api.pigeonDelegate.configuration(pigeonApi: api, pigeonInstance: instance) + + XCTAssertEqual(value, instance.configuration) + } + + #if os(iOS) + @MainActor func testScrollView() { + let registrar = TestProxyApiRegistrar() + let api = webViewProxyAPI(forRegistrar: registrar) + + let instance = TestViewWKWebView() + let value = try? api.pigeonDelegate.scrollView(pigeonApi: api, pigeonInstance: instance) + + XCTAssertEqual(value, instance.scrollView) + } + #endif + + @MainActor func testSetUIDelegate() { + let registrar = TestProxyApiRegistrar() + let api = webViewProxyAPI(forRegistrar: registrar) + + let instance = TestViewWKWebView() + let delegate = UIDelegateImpl( + api: registrar.apiDelegate.pigeonApiWKUIDelegate(registrar), registrar: registrar) + try? api.pigeonDelegate.setUIDelegate( + pigeonApi: api, pigeonInstance: instance, delegate: delegate) + + XCTAssertEqual(instance.uiDelegate as! UIDelegateImpl, delegate) + } + + @MainActor func testSetNavigationDelegate() { + let registrar = TestProxyApiRegistrar() + let api = webViewProxyAPI(forRegistrar: registrar) + + let instance = TestViewWKWebView() + let delegate = NavigationDelegateImpl( + api: registrar.apiDelegate.pigeonApiWKNavigationDelegate(registrar), registrar: registrar) + try? api.pigeonDelegate.setNavigationDelegate( + pigeonApi: api, pigeonInstance: instance, delegate: delegate) + + XCTAssertEqual(instance.navigationDelegate as! NavigationDelegateImpl, delegate) + } + + @MainActor func testGetUrl() { + let registrar = TestProxyApiRegistrar() + let api = webViewProxyAPI(forRegistrar: registrar) + + let instance = TestViewWKWebView() + let value = try? api.pigeonDelegate.getUrl(pigeonApi: api, pigeonInstance: instance) + + XCTAssertEqual(value, instance.url?.absoluteString) + } + + @MainActor func testGetEstimatedProgress() { + let registrar = TestProxyApiRegistrar() + let api = webViewProxyAPI(forRegistrar: registrar) + + let instance = TestViewWKWebView() + let value = try? api.pigeonDelegate.getEstimatedProgress( + pigeonApi: api, pigeonInstance: instance) + + XCTAssertEqual(value, instance.estimatedProgress) + } + + @MainActor func testLoad() { + let registrar = TestProxyApiRegistrar() + let api = webViewProxyAPI(forRegistrar: registrar) + + let instance = TestViewWKWebView() + let request = URLRequestWrapper(URLRequest(url: URL(string: "http://google.com")!)) + try? api.pigeonDelegate.load(pigeonApi: api, pigeonInstance: instance, request: request) + + XCTAssertEqual(instance.loadArgs, [request.value]) + } + + @MainActor func testLoadHtmlString() { + let registrar = TestProxyApiRegistrar() + let api = webViewProxyAPI(forRegistrar: registrar) + + let instance = TestViewWKWebView() + let string = "myString" + let baseUrl = "http://google.com" + try? api.pigeonDelegate.loadHtmlString( + pigeonApi: api, pigeonInstance: instance, string: string, baseUrl: baseUrl) + + XCTAssertEqual(instance.loadHtmlStringArgs, [string, URL(string: baseUrl)]) + } + + @MainActor func testLoadFileUrl() { + let registrar = TestProxyApiRegistrar() + let api = webViewProxyAPI(forRegistrar: registrar) + + let instance = TestViewWKWebView() + let url = "myDirectory/myFile.txt" + let readAccessUrl = "myDirectory/" + try? api.pigeonDelegate.loadFileUrl( + pigeonApi: api, pigeonInstance: instance, url: url, readAccessUrl: readAccessUrl) + + XCTAssertEqual( + instance.loadFileUrlArgs, + [ + URL(fileURLWithPath: url, isDirectory: false), + URL(fileURLWithPath: readAccessUrl, isDirectory: true), + ]) + } + + @MainActor func testLoadFlutterAsset() { + let registrar = TestProxyApiRegistrar() + let api = webViewProxyAPI(forRegistrar: registrar) + + let instance = TestViewWKWebView() + let key = "assets/www/index.html" + try? api.pigeonDelegate.loadFlutterAsset(pigeonApi: api, pigeonInstance: instance, key: key) + + XCTAssertEqual(instance.loadFileUrlArgs?.count, 2) + let url = try! XCTUnwrap(instance.loadFileUrlArgs![0]) + let readAccessURL = try! XCTUnwrap(instance.loadFileUrlArgs![1]) + + XCTAssertTrue(url.absoluteString.contains("index.html")) + XCTAssertTrue(readAccessURL.absoluteString.contains("assets/www/")) + } + + @MainActor func testCanGoBack() { + let registrar = TestProxyApiRegistrar() + let api = webViewProxyAPI(forRegistrar: registrar) + + let instance = TestViewWKWebView() + let value = try? api.pigeonDelegate.canGoBack(pigeonApi: api, pigeonInstance: instance) + + XCTAssertEqual(value, instance.canGoBack) + } + + @MainActor func testCanGoForward() { + let registrar = TestProxyApiRegistrar() + let api = webViewProxyAPI(forRegistrar: registrar) + + let instance = TestViewWKWebView() + let value = try? api.pigeonDelegate.canGoForward(pigeonApi: api, pigeonInstance: instance) + + XCTAssertEqual(value, instance.canGoForward) + } + + @MainActor func testGoBack() { + let registrar = TestProxyApiRegistrar() + let api = webViewProxyAPI(forRegistrar: registrar) + + let instance = TestViewWKWebView() + try? api.pigeonDelegate.goBack(pigeonApi: api, pigeonInstance: instance) + + XCTAssertTrue(instance.goBackCalled) + } + + @MainActor func testGoForward() { + let registrar = TestProxyApiRegistrar() + let api = webViewProxyAPI(forRegistrar: registrar) + + let instance = TestViewWKWebView() + try? api.pigeonDelegate.goForward(pigeonApi: api, pigeonInstance: instance) + + XCTAssertTrue(instance.goForwardCalled) + } + + @MainActor func testReload() { + let registrar = TestProxyApiRegistrar() + let api = webViewProxyAPI(forRegistrar: registrar) + + let instance = TestViewWKWebView() + try? api.pigeonDelegate.reload(pigeonApi: api, pigeonInstance: instance) + + XCTAssertTrue(instance.reloadCalled) + } + + @MainActor func testGetTitle() { + let registrar = TestProxyApiRegistrar() + let api = webViewProxyAPI(forRegistrar: registrar) + + let instance = TestViewWKWebView() + let value = try? api.pigeonDelegate.getTitle(pigeonApi: api, pigeonInstance: instance) + + XCTAssertEqual(value, instance.title) + } + + @MainActor func testSetAllowsBackForwardNavigationGestures() { + let registrar = TestProxyApiRegistrar() + let api = webViewProxyAPI(forRegistrar: registrar) + + let instance = TestViewWKWebView() + let allow = true + try? api.pigeonDelegate.setAllowsBackForwardNavigationGestures( + pigeonApi: api, pigeonInstance: instance, allow: allow) + + XCTAssertEqual(instance.setAllowsBackForwardNavigationGesturesArgs, [allow]) + } + + @MainActor func testSetCustomUserAgent() { + let registrar = TestProxyApiRegistrar() + let api = webViewProxyAPI(forRegistrar: registrar) + + let instance = TestViewWKWebView() + let userAgent = "myString" + try? api.pigeonDelegate.setCustomUserAgent( + pigeonApi: api, pigeonInstance: instance, userAgent: userAgent) + + XCTAssertEqual(instance.setCustomUserAgentArgs, [userAgent]) + } + + @MainActor func testEvaluateJavaScript() { + let registrar = TestProxyApiRegistrar() + let api = webViewProxyAPI(forRegistrar: registrar) + + let instance = TestViewWKWebView() + let javaScriptString = "myString" + + var resultValue: Any? + api.pigeonDelegate.evaluateJavaScript( + pigeonApi: api, pigeonInstance: instance, javaScriptString: javaScriptString, + completion: { result in + switch result { + case .success(let value): + resultValue = value + case .failure(_): + break + } + }) + + XCTAssertEqual(instance.evaluateJavaScriptArgs, [javaScriptString]) + XCTAssertEqual(resultValue as! String, "returnValue") + } + + @MainActor func testSetInspectable() { + let registrar = TestProxyApiRegistrar() + let api = webViewProxyAPI(forRegistrar: registrar) + + let instance = TestViewWKWebView() + let inspectable = true + try? api.pigeonDelegate.setInspectable( + pigeonApi: api, pigeonInstance: instance, inspectable: inspectable) + + XCTAssertEqual(instance.setInspectableArgs, [inspectable]) + XCTAssertFalse(instance.isInspectable) + } + + @MainActor func testGetCustomUserAgent() { + let registrar = TestProxyApiRegistrar() + let api = webViewProxyAPI(forRegistrar: registrar) + + let instance = TestViewWKWebView() + let value = try? api.pigeonDelegate.getCustomUserAgent(pigeonApi: api, pigeonInstance: instance) + + XCTAssertEqual(value, instance.customUserAgent) + } + + #if os(iOS) + @MainActor func testWebViewContentInsetBehaviorShouldBeNever() { + let registrar = TestProxyApiRegistrar() + let api = PigeonApiWKWebView(pigeonRegistrar: registrar, delegate: WebViewProxyAPIDelegate()) + + let webView = WebViewImpl( + api: api, registrar: registrar, frame: .zero, configuration: WKWebViewConfiguration()) + + XCTAssertEqual(webView.scrollView.contentInsetAdjustmentBehavior, .never) + } + + @available(iOS 13.0, *) + @MainActor + func testScrollViewsAutomaticallyAdjustsScrollIndicatorInsetsShouldbeFalse() { + let registrar = TestProxyApiRegistrar() + let api = PigeonApiWKWebView(pigeonRegistrar: registrar, delegate: WebViewProxyAPIDelegate()) + + let webView = WebViewImpl( + api: api, registrar: registrar, frame: .zero, configuration: WKWebViewConfiguration()) + + XCTAssertFalse(webView.scrollView.automaticallyAdjustsScrollIndicatorInsets) + } + + @MainActor func testContentInsetsSumAlwaysZeroAfterSetFrame() { + let registrar = TestProxyApiRegistrar() + let api = PigeonApiWKWebView(pigeonRegistrar: registrar, delegate: WebViewProxyAPIDelegate()) + + let webView = WebViewImpl( + api: api, registrar: registrar, frame: .zero, configuration: WKWebViewConfiguration()) + + webView.scrollView.contentInset = UIEdgeInsets(top: 0, left: 0, bottom: 300, right: 300) + + webView.frame = .zero + XCTAssertEqual(webView.scrollView.contentInset, .zero) + } + + @MainActor func testContentInsetsIsOppositeOfScrollViewAdjustedInset() { + let registrar = TestProxyApiRegistrar() + let api = PigeonApiWKWebView(pigeonRegistrar: registrar, delegate: WebViewProxyAPIDelegate()) + + let webView = WebViewImpl( + api: api, registrar: registrar, frame: .zero, configuration: WKWebViewConfiguration()) + + webView.scrollView.contentInset = UIEdgeInsets(top: 0, left: 0, bottom: 300, right: 300) + + webView.frame = .zero + let contentInset: UIEdgeInsets = webView.scrollView.contentInset + XCTAssertEqual(contentInset.left, -webView.scrollView.adjustedContentInset.left) + XCTAssertEqual(contentInset.top, -webView.scrollView.adjustedContentInset.top) + XCTAssertEqual(contentInset.right, -webView.scrollView.adjustedContentInset.right) + XCTAssertEqual(contentInset.bottom, -webView.scrollView.adjustedContentInset.bottom) + } + #endif +} + +@MainActor +class TestViewWKWebView: WKWebView { + private var configurationTestValue = WKWebViewConfiguration() + #if os(iOS) + private var scrollViewTestValue = TestAdjustedScrollView(frame: .zero) + #endif + var getUrlCalled = false + var getEstimatedProgressCalled = false + var loadArgs: [AnyHashable?]? = nil + var loadHtmlStringArgs: [AnyHashable?]? = nil + var loadFileUrlArgs: [URL]? = nil + var goBackCalled = false + var goForwardCalled = false + var reloadCalled = false + var setAllowsBackForwardNavigationGesturesArgs: [AnyHashable?]? = nil + var setCustomUserAgentArgs: [AnyHashable?]? = nil + var evaluateJavaScriptArgs: [AnyHashable?]? = nil + var setInspectableArgs: [AnyHashable?]? = nil + + override var configuration: WKWebViewConfiguration { + return configurationTestValue + } + + #if os(iOS) + override var scrollView: UIScrollView { + return scrollViewTestValue + } + #endif + + override var url: URL? { + return URL(string: "http://google.com") + } + + override var estimatedProgress: Double { + return 2.0 + } + + override func load(_ request: URLRequest) -> WKNavigation? { + loadArgs = [request] + return nil + } + + override func loadHTMLString(_ string: String, baseURL: URL?) -> WKNavigation? { + loadHtmlStringArgs = [string, baseURL] + return nil + } + + override func loadFileURL(_ url: URL, allowingReadAccessTo readAccessURL: URL) -> WKNavigation? { + loadFileUrlArgs = [url, readAccessURL] + return nil + } + + override var canGoBack: Bool { + return false + } + + override var canGoForward: Bool { + return true + } + + override func goBack() -> WKNavigation? { + goBackCalled = true + return nil + } + + override func goForward() -> WKNavigation? { + goForwardCalled = true + return nil + } + + override func reload() -> WKNavigation? { + reloadCalled = true + return nil + } + + override var title: String? { + return "title" + } + + override var allowsBackForwardNavigationGestures: Bool { + set { + setAllowsBackForwardNavigationGesturesArgs = [newValue] + } + get { + return true + } + } + + override var customUserAgent: String? { + set { + setCustomUserAgentArgs = [newValue] + } + get { + return "myUserAgent" + } + } + + #if compiler(>=6.0) + public override func evaluateJavaScript( + _ javaScriptString: String, + completionHandler: (@MainActor @Sendable (Any?, (Error)?) -> Void)? = nil + ) { + evaluateJavaScriptArgs = [javaScriptString] + completionHandler?("returnValue", nil) + } + #else + public override func evaluateJavaScript( + _ javaScriptString: String, completionHandler: ((Any?, Error?) -> Void)? = nil + ) { + evaluateJavaScriptArgs = [javaScriptString] + completionHandler?("returnValue", nil) + } + #endif + + override var isInspectable: Bool { + set { + setInspectableArgs = [newValue] + } + get { + return false + } + } +} + +#if os(iOS) + @MainActor + class TestAdjustedScrollView: UIScrollView { + override var adjustedContentInset: UIEdgeInsets { + return UIEdgeInsets(top: 10, left: 20, bottom: 30, right: 40) + } + } +#endif 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/Tests/WebsiteDataStoreProxyAPITests.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/WebsiteDataStoreProxyAPITests.swift new file mode 100644 index 00000000000..66459339c31 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/WebsiteDataStoreProxyAPITests.swift @@ -0,0 +1,51 @@ +// 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 WebsiteDataStoreProxyAPITests: XCTestCase { + @available(iOS 17.0, *) + @MainActor func testHttpCookieStore() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiWKWebsiteDataStore(registrar) + + let instance = WKWebsiteDataStore.default() + let value = try? api.pigeonDelegate.httpCookieStore(pigeonApi: api, pigeonInstance: instance) + + XCTAssertEqual(value, instance.httpCookieStore) + } + + @available(iOS 17.0, *) + @MainActor func testRemoveDataOfTypes() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiWKWebsiteDataStore(registrar) + + let instance = WKWebsiteDataStore.default() + let dataTypes: [WebsiteDataType] = [.localStorage] + let modificationTimeInSecondsSinceEpoch = 0.0 + + let removeDataOfTypesExpectation = expectation( + description: "Wait for result of removeDataOfTypes.") + + var removeDataOfTypesResult: Bool? + api.pigeonDelegate.removeDataOfTypes( + pigeonApi: api, pigeonInstance: instance, dataTypes: dataTypes, + modificationTimeInSecondsSinceEpoch: modificationTimeInSecondsSinceEpoch, + completion: { result in + switch result { + case .success(let hasRecords): + removeDataOfTypesResult = hasRecords + case .failure(_): break + } + + removeDataOfTypesExpectation.fulfill() + }) + + wait(for: [removeDataOfTypesExpectation], timeout: 10.0) + XCTAssertNotNil(removeDataOfTypesResult) + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview.podspec b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview.podspec index af606661b6b..dabbe513a4c 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview.podspec +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview.podspec @@ -14,13 +14,17 @@ Downloaded by pub (not CocoaPods). s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' } s.source = { :http => 'https://github.com/flutter/packages/tree/main/packages/webview_flutter/webview_flutter_wkwebview' } s.documentation_url = 'https://pub.dev/packages/webview_flutter' - s.source_files = 'webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/**/*.{h,m}' - s.public_header_files = 'webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/**/*.h' - s.module_map = 'webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/FlutterWebView.modulemap' + s.source_files = 'webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/**/*.swift' s.ios.dependency 'Flutter' s.osx.dependency 'FlutterMacOS' s.ios.deployment_target = '12.0' s.osx.deployment_target = '10.14' s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } s.resource_bundles = {'webview_flutter_wkwebview_privacy' => ['webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/Resources/PrivacyInfo.xcprivacy']} + s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } + s.xcconfig = { + 'LIBRARY_SEARCH_PATHS' => '$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)/ $(SDKROOT)/usr/lib/swift', + 'LD_RUNPATH_SEARCH_PATHS' => '/usr/lib/swift', + } + s.swift_version = '5.0' end diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Package.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Package.swift index 12781458421..f152a5748f0 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Package.swift +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Package.swift @@ -20,12 +20,8 @@ let package = Package( .target( name: "webview_flutter_wkwebview", dependencies: [], - exclude: ["include/FlutterWebView.modulemap", "include/webview-umbrella.h"], resources: [ .process("Resources") - ], - cSettings: [ - .headerSearchPath("include/webview_flutter_wkwebview") ] ) ] diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/AuthenticationChallengeResponse.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/AuthenticationChallengeResponse.swift new file mode 100644 index 00000000000..067edd5c00f --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/AuthenticationChallengeResponse.swift @@ -0,0 +1,20 @@ +// 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 Foundation + +/// Data class used to respond to auth challenges from `WKNavigationDelegate`. +/// +/// The `webView(_:didReceive:completionHandler:)` method in `WKNavigationDelegate` +/// responds with a completion handler that takes two values. The wrapper returns this class instead to handle +/// this scenario. +class AuthenticationChallengeResponse { + let disposition: URLSession.AuthChallengeDisposition + let credential: URLCredential? + + init(disposition: URLSession.AuthChallengeDisposition, credential: URLCredential?) { + self.disposition = disposition + self.credential = credential + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/AuthenticationChallengeResponseProxyAPIDelegate.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/AuthenticationChallengeResponseProxyAPIDelegate.swift new file mode 100644 index 00000000000..7367e71990b --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/AuthenticationChallengeResponseProxyAPIDelegate.swift @@ -0,0 +1,61 @@ +// 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 Foundation + +/// ProxyApi implementation for `AuthenticationChallengeResponse`. +/// +/// 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 AuthenticationChallengeResponseProxyAPIDelegate: + PigeonApiDelegateAuthenticationChallengeResponse +{ + func pigeonDefaultConstructor( + pigeonApi: PigeonApiAuthenticationChallengeResponse, + disposition: UrlSessionAuthChallengeDisposition, credential: URLCredential? + ) throws -> AuthenticationChallengeResponse { + let nativeDisposition: URLSession.AuthChallengeDisposition + + switch disposition { + case .useCredential: + nativeDisposition = .useCredential + case .performDefaultHandling: + nativeDisposition = .performDefaultHandling + case .cancelAuthenticationChallenge: + nativeDisposition = .cancelAuthenticationChallenge + case .rejectProtectionSpace: + nativeDisposition = .rejectProtectionSpace + case .unknown: + throw (pigeonApi.pigeonRegistrar as! ProxyAPIRegistrar).createUnknownEnumError( + withEnum: disposition) + } + + return AuthenticationChallengeResponse(disposition: nativeDisposition, credential: credential) + } + + func disposition( + pigeonApi: PigeonApiAuthenticationChallengeResponse, + pigeonInstance: AuthenticationChallengeResponse + ) throws -> UrlSessionAuthChallengeDisposition { + switch pigeonInstance.disposition { + case .useCredential: + return .useCredential + case .performDefaultHandling: + return .performDefaultHandling + case .cancelAuthenticationChallenge: + return .cancelAuthenticationChallenge + case .rejectProtectionSpace: + return .rejectProtectionSpace + @unknown default: + return .unknown + } + } + + func credential( + pigeonApi: PigeonApiAuthenticationChallengeResponse, + pigeonInstance: AuthenticationChallengeResponse + ) throws -> URLCredential? { + return pigeonInstance.credential + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/ErrorProxyAPIDelegate.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/ErrorProxyAPIDelegate.swift new file mode 100644 index 00000000000..e82fe26dbbe --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/ErrorProxyAPIDelegate.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 Foundation + +/// ProxyApi implementation for `NSError`. +/// +/// 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 ErrorProxyAPIDelegate: PigeonApiDelegateNSError { + func code(pigeonApi: PigeonApiNSError, pigeonInstance: NSError) throws -> Int64 { + return Int64(pigeonInstance.code) + } + + func domain(pigeonApi: PigeonApiNSError, pigeonInstance: NSError) throws -> String { + return pigeonInstance.domain + } + + func userInfo(pigeonApi: PigeonApiNSError, pigeonInstance: NSError) throws -> [String: Any?] { + return pigeonInstance.userInfo + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FLTWebViewFlutterPlugin.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FLTWebViewFlutterPlugin.m deleted file mode 100644 index ffa5da84c40..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FLTWebViewFlutterPlugin.m +++ /dev/null @@ -1,149 +0,0 @@ -// 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 "./include/webview_flutter_wkwebview/FLTWebViewFlutterPlugin.h" -#import "./include/webview_flutter_wkwebview/FWFGeneratedWebKitApis.h" -#import "./include/webview_flutter_wkwebview/FWFHTTPCookieStoreHostApi.h" -#import "./include/webview_flutter_wkwebview/FWFInstanceManager.h" -#import "./include/webview_flutter_wkwebview/FWFNavigationDelegateHostApi.h" -#import "./include/webview_flutter_wkwebview/FWFObjectHostApi.h" -#import "./include/webview_flutter_wkwebview/FWFPreferencesHostApi.h" -#import "./include/webview_flutter_wkwebview/FWFScriptMessageHandlerHostApi.h" -#import "./include/webview_flutter_wkwebview/FWFScrollViewDelegateHostApi.h" -#import "./include/webview_flutter_wkwebview/FWFScrollViewHostApi.h" -#import "./include/webview_flutter_wkwebview/FWFUIDelegateHostApi.h" -#import "./include/webview_flutter_wkwebview/FWFUIViewHostApi.h" -#import "./include/webview_flutter_wkwebview/FWFURLCredentialHostApi.h" -#import "./include/webview_flutter_wkwebview/FWFURLHostApi.h" -#import "./include/webview_flutter_wkwebview/FWFUserContentControllerHostApi.h" -#import "./include/webview_flutter_wkwebview/FWFWebViewConfigurationHostApi.h" -#import "./include/webview_flutter_wkwebview/FWFWebViewHostApi.h" -#import "./include/webview_flutter_wkwebview/FWFWebsiteDataStoreHostApi.h" - -@interface FWFWebViewFactory : NSObject -@property(nonatomic, weak) FWFInstanceManager *instanceManager; - -- (instancetype)initWithManager:(FWFInstanceManager *)manager; -@end - -@implementation FWFWebViewFactory -- (instancetype)initWithManager:(FWFInstanceManager *)manager { - self = [self init]; - if (self) { - _instanceManager = manager; - } - return self; -} - -#pragma mark FlutterPlatformViewFactory - -- (NSObject *)createArgsCodec { - return [FlutterStandardMessageCodec sharedInstance]; -} - -// The FlutterPlatformViewFactory protocol is slightly different on iOS and -// macOS. -#if TARGET_OS_IOS - -- (NSObject *)createWithFrame:(CGRect)frame - viewIdentifier:(int64_t)viewId - arguments:(id _Nullable)args { - NSNumber *identifier = (NSNumber *)args; - FWFWebView *webView = - (FWFWebView *)[self.instanceManager instanceForIdentifier:identifier.longValue]; - webView.frame = frame; - return webView; -} - -#else - -- (nonnull NSView *)createWithViewIdentifier:(int64_t)viewId arguments:(nullable id)args { - NSNumber *identifier = (NSNumber *)args; - FWFWebView *webView = - (FWFWebView *)[self.instanceManager instanceForIdentifier:identifier.longValue]; - return webView; -} - -#endif - -@end - -@implementation FLTWebViewFlutterPlugin - -+ (void)registerWithRegistrar:(NSObject *)registrar { - FWFInstanceManager *instanceManager = - [[FWFInstanceManager alloc] initWithDeallocCallback:^(long identifier) { - FWFObjectFlutterApiImpl *objectApi = [[FWFObjectFlutterApiImpl alloc] - initWithBinaryMessenger:registrar.messenger - instanceManager:[[FWFInstanceManager alloc] init]]; - - dispatch_async(dispatch_get_main_queue(), ^{ - [objectApi disposeObjectWithIdentifier:identifier - completion:^(FlutterError *error) { - NSAssert(!error, @"%@", error); - }]; - }); - }]; - SetUpFWFWKHttpCookieStoreHostApi( - registrar.messenger, - [[FWFHTTPCookieStoreHostApiImpl alloc] initWithInstanceManager:instanceManager]); - SetUpFWFWKNavigationDelegateHostApi( - registrar.messenger, - [[FWFNavigationDelegateHostApiImpl alloc] initWithBinaryMessenger:registrar.messenger - instanceManager:instanceManager]); - SetUpFWFNSObjectHostApi(registrar.messenger, - [[FWFObjectHostApiImpl alloc] initWithInstanceManager:instanceManager]); - SetUpFWFWKPreferencesHostApi(registrar.messenger, [[FWFPreferencesHostApiImpl alloc] - initWithInstanceManager:instanceManager]); - SetUpFWFWKScriptMessageHandlerHostApi( - registrar.messenger, - [[FWFScriptMessageHandlerHostApiImpl alloc] initWithBinaryMessenger:registrar.messenger - instanceManager:instanceManager]); - SetUpFWFUIScrollViewHostApi(registrar.messenger, [[FWFScrollViewHostApiImpl alloc] - initWithInstanceManager:instanceManager]); - SetUpFWFWKUIDelegateHostApi(registrar.messenger, [[FWFUIDelegateHostApiImpl alloc] - initWithBinaryMessenger:registrar.messenger - instanceManager:instanceManager]); -#if TARGET_OS_IOS - SetUpFWFUIViewHostApi(registrar.messenger, - [[FWFUIViewHostApiImpl alloc] initWithInstanceManager:instanceManager]); -#endif - SetUpFWFWKUserContentControllerHostApi( - registrar.messenger, - [[FWFUserContentControllerHostApiImpl alloc] initWithInstanceManager:instanceManager]); - SetUpFWFWKWebsiteDataStoreHostApi( - registrar.messenger, - [[FWFWebsiteDataStoreHostApiImpl alloc] initWithInstanceManager:instanceManager]); - SetUpFWFWKWebViewConfigurationHostApi( - registrar.messenger, - [[FWFWebViewConfigurationHostApiImpl alloc] initWithBinaryMessenger:registrar.messenger - instanceManager:instanceManager]); - SetUpFWFWKWebViewHostApi(registrar.messenger, [[FWFWebViewHostApiImpl alloc] - initWithBinaryMessenger:registrar.messenger - instanceManager:instanceManager]); - SetUpFWFNSUrlHostApi(registrar.messenger, - [[FWFURLHostApiImpl alloc] initWithBinaryMessenger:registrar.messenger - instanceManager:instanceManager]); -#if TARGET_OS_IOS - SetUpFWFUIScrollViewDelegateHostApi( - registrar.messenger, - [[FWFScrollViewDelegateHostApiImpl alloc] initWithBinaryMessenger:registrar.messenger - instanceManager:instanceManager]); -#endif - SetUpFWFNSUrlCredentialHostApi( - registrar.messenger, - [[FWFURLCredentialHostApiImpl alloc] initWithBinaryMessenger:registrar.messenger - instanceManager:instanceManager]); - - FWFWebViewFactory *webviewFactory = [[FWFWebViewFactory alloc] initWithManager:instanceManager]; - [registrar registerViewFactory:webviewFactory withId:@"plugins.flutter.io/webview"]; - - // InstanceManager is published so that a strong reference is maintained. - [registrar publish:instanceManager]; -} - -- (void)detachFromEngineForRegistrar:(NSObject *)registrar { - [registrar publish:[NSNull null]]; -} -@end diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFDataConverters.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFDataConverters.m deleted file mode 100644 index ba752f3a8e3..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFDataConverters.m +++ /dev/null @@ -1,356 +0,0 @@ -// 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 "./include/webview_flutter_wkwebview/FWFDataConverters.h" - -#if TARGET_OS_OSX -#import -#else -#import -#endif - -NSURLRequest *_Nullable FWFNativeNSURLRequestFromRequestData(FWFNSUrlRequestData *data) { - NSURL *url = [NSURL URLWithString:data.url]; - if (!url) { - return nil; - } - - NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url]; - if (!request) { - return nil; - } - - if (data.httpMethod) { - [request setHTTPMethod:data.httpMethod]; - } - if (data.httpBody) { - [request setHTTPBody:data.httpBody.data]; - } - [request setAllHTTPHeaderFields:data.allHttpHeaderFields]; - - return request; -} - -extern NSHTTPCookie *_Nullable FWFNativeNSHTTPCookieFromCookieData(FWFNSHttpCookieData *data) { - NSMutableDictionary *properties = [NSMutableDictionary dictionary]; - for (int i = 0; i < data.propertyKeys.count; i++) { - NSHTTPCookiePropertyKey cookieKey = - FWFNativeNSHTTPCookiePropertyKeyFromEnumData(data.propertyKeys[i]); - if (!cookieKey) { - // Some keys aren't supported on all versions, so this ignores keys - // that require a higher version or are unsupported. - continue; - } - [properties setObject:data.propertyValues[i] forKey:cookieKey]; - } - return [NSHTTPCookie cookieWithProperties:properties]; -} - -NSKeyValueObservingOptions FWFNativeNSKeyValueObservingOptionsFromEnumData( - FWFNSKeyValueObservingOptionsEnumData *data) { - switch (data.value) { - case FWFNSKeyValueObservingOptionsEnumNewValue: - return NSKeyValueObservingOptionNew; - case FWFNSKeyValueObservingOptionsEnumOldValue: - return NSKeyValueObservingOptionOld; - case FWFNSKeyValueObservingOptionsEnumInitialValue: - return NSKeyValueObservingOptionInitial; - case FWFNSKeyValueObservingOptionsEnumPriorNotification: - return NSKeyValueObservingOptionPrior; - } - - return -1; -} - -NSHTTPCookiePropertyKey _Nullable FWFNativeNSHTTPCookiePropertyKeyFromEnumData( - FWFNSHttpCookiePropertyKeyEnumData *data) { - switch (data.value) { - case FWFNSHttpCookiePropertyKeyEnumComment: - return NSHTTPCookieComment; - case FWFNSHttpCookiePropertyKeyEnumCommentUrl: - return NSHTTPCookieCommentURL; - case FWFNSHttpCookiePropertyKeyEnumDiscard: - return NSHTTPCookieDiscard; - case FWFNSHttpCookiePropertyKeyEnumDomain: - return NSHTTPCookieDomain; - case FWFNSHttpCookiePropertyKeyEnumExpires: - return NSHTTPCookieExpires; - case FWFNSHttpCookiePropertyKeyEnumMaximumAge: - return NSHTTPCookieMaximumAge; - case FWFNSHttpCookiePropertyKeyEnumName: - return NSHTTPCookieName; - case FWFNSHttpCookiePropertyKeyEnumOriginUrl: - return NSHTTPCookieOriginURL; - case FWFNSHttpCookiePropertyKeyEnumPath: - return NSHTTPCookiePath; - case FWFNSHttpCookiePropertyKeyEnumPort: - return NSHTTPCookiePort; - case FWFNSHttpCookiePropertyKeyEnumSameSitePolicy: - if (@available(iOS 13.0, macOS 10.15, *)) { - return NSHTTPCookieSameSitePolicy; - } else { - return nil; - } - case FWFNSHttpCookiePropertyKeyEnumSecure: - return NSHTTPCookieSecure; - case FWFNSHttpCookiePropertyKeyEnumValue: - return NSHTTPCookieValue; - case FWFNSHttpCookiePropertyKeyEnumVersion: - return NSHTTPCookieVersion; - } - - return nil; -} - -extern WKUserScript *FWFNativeWKUserScriptFromScriptData(FWFWKUserScriptData *data) { - return [[WKUserScript alloc] - initWithSource:data.source - injectionTime:FWFNativeWKUserScriptInjectionTimeFromEnumData(data.injectionTime) - forMainFrameOnly:data.isMainFrameOnly]; -} - -WKUserScriptInjectionTime FWFNativeWKUserScriptInjectionTimeFromEnumData( - FWFWKUserScriptInjectionTimeEnumData *data) { - switch (data.value) { - case FWFWKUserScriptInjectionTimeEnumAtDocumentStart: - return WKUserScriptInjectionTimeAtDocumentStart; - case FWFWKUserScriptInjectionTimeEnumAtDocumentEnd: - return WKUserScriptInjectionTimeAtDocumentEnd; - } - - return -1; -} - -WKAudiovisualMediaTypes FWFNativeWKAudiovisualMediaTypeFromEnumData( - FWFWKAudiovisualMediaTypeEnumData *data) { - switch (data.value) { - case FWFWKAudiovisualMediaTypeEnumNone: - return WKAudiovisualMediaTypeNone; - case FWFWKAudiovisualMediaTypeEnumAudio: - return WKAudiovisualMediaTypeAudio; - case FWFWKAudiovisualMediaTypeEnumVideo: - return WKAudiovisualMediaTypeVideo; - case FWFWKAudiovisualMediaTypeEnumAll: - return WKAudiovisualMediaTypeAll; - } - - return -1; -} - -NSString *_Nullable FWFNativeWKWebsiteDataTypeFromEnumData(FWFWKWebsiteDataTypeEnumData *data) { - switch (data.value) { - case FWFWKWebsiteDataTypeEnumCookies: - return WKWebsiteDataTypeCookies; - case FWFWKWebsiteDataTypeEnumMemoryCache: - return WKWebsiteDataTypeMemoryCache; - case FWFWKWebsiteDataTypeEnumDiskCache: - return WKWebsiteDataTypeDiskCache; - case FWFWKWebsiteDataTypeEnumOfflineWebApplicationCache: - return WKWebsiteDataTypeOfflineWebApplicationCache; - case FWFWKWebsiteDataTypeEnumLocalStorage: - return WKWebsiteDataTypeLocalStorage; - case FWFWKWebsiteDataTypeEnumSessionStorage: - return WKWebsiteDataTypeSessionStorage; - case FWFWKWebsiteDataTypeEnumWebSQLDatabases: - return WKWebsiteDataTypeWebSQLDatabases; - case FWFWKWebsiteDataTypeEnumIndexedDBDatabases: - return WKWebsiteDataTypeIndexedDBDatabases; - } - - return nil; -} - -FWFWKNavigationActionData *FWFWKNavigationActionDataFromNativeWKNavigationAction( - WKNavigationAction *action) { - return [FWFWKNavigationActionData - makeWithRequest:FWFNSUrlRequestDataFromNativeNSURLRequest(action.request) - targetFrame:FWFWKFrameInfoDataFromNativeWKFrameInfo(action.targetFrame) - navigationType:FWFWKNavigationTypeFromNativeWKNavigationType(action.navigationType)]; -} - -FWFNSUrlRequestData *FWFNSUrlRequestDataFromNativeNSURLRequest(NSURLRequest *request) { - return [FWFNSUrlRequestData - makeWithUrl:request.URL.absoluteString == nil ? @"" : request.URL.absoluteString - httpMethod:request.HTTPMethod - httpBody:request.HTTPBody - ? [FlutterStandardTypedData typedDataWithBytes:request.HTTPBody] - : nil - allHttpHeaderFields:request.allHTTPHeaderFields ? request.allHTTPHeaderFields : @{}]; -} - -FWFWKFrameInfoData *FWFWKFrameInfoDataFromNativeWKFrameInfo(WKFrameInfo *info) { - return [FWFWKFrameInfoData - makeWithIsMainFrame:info.isMainFrame - request:FWFNSUrlRequestDataFromNativeNSURLRequest(info.request)]; -} - -FWFWKNavigationResponseData *FWFWKNavigationResponseDataFromNativeNavigationResponse( - WKNavigationResponse *response) { - return [FWFWKNavigationResponseData - makeWithResponse:FWFNSHttpUrlResponseDataFromNativeNSURLResponse(response.response) - forMainFrame:response.forMainFrame]; -} - -/// Cast the NSURLResponse object to NSHTTPURLResponse. -/// -/// NSURLResponse doesn't contain the status code so it must be cast to NSHTTPURLResponse. -/// This cast will always succeed because the NSURLResponse object actually is an instance of -/// NSHTTPURLResponse. See: -/// https://developer.apple.com/documentation/foundation/nsurlresponse#overview -FWFNSHttpUrlResponseData *FWFNSHttpUrlResponseDataFromNativeNSURLResponse(NSURLResponse *response) { - NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)response; - return [FWFNSHttpUrlResponseData makeWithStatusCode:httpResponse.statusCode]; -} - -WKNavigationActionPolicy FWFNativeWKNavigationActionPolicyFromEnumData( - FWFWKNavigationActionPolicyEnumData *data) { - switch (data.value) { - case FWFWKNavigationActionPolicyEnumAllow: - return WKNavigationActionPolicyAllow; - case FWFWKNavigationActionPolicyEnumCancel: - return WKNavigationActionPolicyCancel; - } - - return -1; -} - -FWFNSErrorData *FWFNSErrorDataFromNativeNSError(NSError *error) { - NSMutableDictionary *userInfo; - if (error.userInfo) { - userInfo = [NSMutableDictionary dictionary]; - for (NSErrorUserInfoKey key in error.userInfo.allKeys) { - NSObject *value = error.userInfo[key]; - if ([value isKindOfClass:[NSString class]]) { - userInfo[key] = value; - } else { - userInfo[key] = [NSString stringWithFormat:@"Unsupported Type: %@", value.description]; - } - } - } - return [FWFNSErrorData makeWithCode:error.code domain:error.domain userInfo:userInfo]; -} - -WKNavigationResponsePolicy FWFNativeWKNavigationResponsePolicyFromEnum( - FWFWKNavigationResponsePolicyEnum policy) { - switch (policy) { - case FWFWKNavigationResponsePolicyEnumAllow: - return WKNavigationResponsePolicyAllow; - case FWFWKNavigationResponsePolicyEnumCancel: - return WKNavigationResponsePolicyCancel; - } - - return -1; -} - -FWFNSKeyValueChangeKeyEnumData *FWFNSKeyValueChangeKeyEnumDataFromNativeNSKeyValueChangeKey( - NSKeyValueChangeKey key) { - if ([key isEqualToString:NSKeyValueChangeIndexesKey]) { - return [FWFNSKeyValueChangeKeyEnumData makeWithValue:FWFNSKeyValueChangeKeyEnumIndexes]; - } else if ([key isEqualToString:NSKeyValueChangeKindKey]) { - return [FWFNSKeyValueChangeKeyEnumData makeWithValue:FWFNSKeyValueChangeKeyEnumKind]; - } else if ([key isEqualToString:NSKeyValueChangeNewKey]) { - return [FWFNSKeyValueChangeKeyEnumData makeWithValue:FWFNSKeyValueChangeKeyEnumNewValue]; - } else if ([key isEqualToString:NSKeyValueChangeNotificationIsPriorKey]) { - return [FWFNSKeyValueChangeKeyEnumData - makeWithValue:FWFNSKeyValueChangeKeyEnumNotificationIsPrior]; - } else if ([key isEqualToString:NSKeyValueChangeOldKey]) { - return [FWFNSKeyValueChangeKeyEnumData makeWithValue:FWFNSKeyValueChangeKeyEnumOldValue]; - } else { - return [FWFNSKeyValueChangeKeyEnumData makeWithValue:FWFNSKeyValueChangeKeyEnumUnknown]; - } - - return nil; -} - -FWFWKScriptMessageData *FWFWKScriptMessageDataFromNativeWKScriptMessage(WKScriptMessage *message) { - return [FWFWKScriptMessageData makeWithName:message.name body:message.body]; -} - -FWFWKNavigationType FWFWKNavigationTypeFromNativeWKNavigationType(WKNavigationType type) { - switch (type) { - case WKNavigationTypeLinkActivated: - return FWFWKNavigationTypeLinkActivated; - case WKNavigationTypeFormSubmitted: - return FWFWKNavigationTypeFormResubmitted; - case WKNavigationTypeBackForward: - return FWFWKNavigationTypeBackForward; - case WKNavigationTypeReload: - return FWFWKNavigationTypeReload; - case WKNavigationTypeFormResubmitted: - return FWFWKNavigationTypeFormResubmitted; - case WKNavigationTypeOther: - return FWFWKNavigationTypeOther; - } - - return FWFWKNavigationTypeUnknown; -} - -FWFWKSecurityOriginData *FWFWKSecurityOriginDataFromNativeWKSecurityOrigin( - WKSecurityOrigin *origin) { - return [FWFWKSecurityOriginData makeWithHost:origin.host - port:origin.port - protocol:origin.protocol]; -} - -WKPermissionDecision FWFNativeWKPermissionDecisionFromData(FWFWKPermissionDecisionData *data) { - switch (data.value) { - case FWFWKPermissionDecisionDeny: - return WKPermissionDecisionDeny; - case FWFWKPermissionDecisionGrant: - return WKPermissionDecisionGrant; - case FWFWKPermissionDecisionPrompt: - return WKPermissionDecisionPrompt; - } - - return -1; -} - -FWFWKMediaCaptureTypeData *FWFWKMediaCaptureTypeDataFromNativeWKMediaCaptureType( - WKMediaCaptureType type) { - switch (type) { - case WKMediaCaptureTypeCamera: - return [FWFWKMediaCaptureTypeData makeWithValue:FWFWKMediaCaptureTypeCamera]; - case WKMediaCaptureTypeMicrophone: - return [FWFWKMediaCaptureTypeData makeWithValue:FWFWKMediaCaptureTypeMicrophone]; - case WKMediaCaptureTypeCameraAndMicrophone: - return [FWFWKMediaCaptureTypeData makeWithValue:FWFWKMediaCaptureTypeCameraAndMicrophone]; - default: - return [FWFWKMediaCaptureTypeData makeWithValue:FWFWKMediaCaptureTypeUnknown]; - } - - return nil; -} - -NSURLSessionAuthChallengeDisposition -FWFNativeNSURLSessionAuthChallengeDispositionFromFWFNSUrlSessionAuthChallengeDisposition( - FWFNSUrlSessionAuthChallengeDisposition value) { - switch (value) { - case FWFNSUrlSessionAuthChallengeDispositionUseCredential: - return NSURLSessionAuthChallengeUseCredential; - case FWFNSUrlSessionAuthChallengeDispositionPerformDefaultHandling: - return NSURLSessionAuthChallengePerformDefaultHandling; - case FWFNSUrlSessionAuthChallengeDispositionCancelAuthenticationChallenge: - return NSURLSessionAuthChallengeCancelAuthenticationChallenge; - case FWFNSUrlSessionAuthChallengeDispositionRejectProtectionSpace: - return NSURLSessionAuthChallengeRejectProtectionSpace; - } - - return -1; -} - -NSURLCredentialPersistence FWFNativeNSURLCredentialPersistenceFromFWFNSUrlCredentialPersistence( - FWFNSUrlCredentialPersistence value) { - switch (value) { - case FWFNSUrlCredentialPersistenceNone: - return NSURLCredentialPersistenceNone; - case FWFNSUrlCredentialPersistenceSession: - return NSURLCredentialPersistenceForSession; - case FWFNSUrlCredentialPersistencePermanent: - return NSURLCredentialPersistencePermanent; - case FWFNSUrlCredentialPersistenceSynchronizable: - return NSURLCredentialPersistenceSynchronizable; - } - - return -1; -} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFGeneratedWebKitApis.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFGeneratedWebKitApis.m deleted file mode 100644 index 783fc8c6112..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFGeneratedWebKitApis.m +++ /dev/null @@ -1,4191 +0,0 @@ -// 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 (v18.0.0), do not edit directly. -// See also: https://pub.dev/packages/pigeon - -#import "./include/webview_flutter_wkwebview/FWFGeneratedWebKitApis.h" - -#if TARGET_OS_OSX -#import -#else -#import -#endif - -#if !__has_feature(objc_arc) -#error File requires ARC to be enabled. -#endif - -static NSArray *wrapResult(id result, FlutterError *error) { - if (error) { - return @[ - error.code ?: [NSNull null], error.message ?: [NSNull null], error.details ?: [NSNull null] - ]; - } - return @[ result ?: [NSNull null] ]; -} - -static FlutterError *createConnectionError(NSString *channelName) { - return [FlutterError - errorWithCode:@"channel-error" - message:[NSString stringWithFormat:@"%@/%@/%@", - @"Unable to establish connection on channel: '", - channelName, @"'."] - details:@""]; -} - -static id GetNullableObjectAtIndex(NSArray *array, NSInteger key) { - id result = array[key]; - return (result == [NSNull null]) ? nil : result; -} - -/// Mirror of NSKeyValueObservingOptions. -/// -/// See -/// https://developer.apple.com/documentation/foundation/nskeyvalueobservingoptions?language=objc. -@implementation FWFNSKeyValueObservingOptionsEnumBox -- (instancetype)initWithValue:(FWFNSKeyValueObservingOptionsEnum)value { - self = [super init]; - if (self) { - _value = value; - } - return self; -} -@end - -/// Mirror of NSKeyValueChange. -/// -/// See https://developer.apple.com/documentation/foundation/nskeyvaluechange?language=objc. -@implementation FWFNSKeyValueChangeEnumBox -- (instancetype)initWithValue:(FWFNSKeyValueChangeEnum)value { - self = [super init]; - if (self) { - _value = value; - } - return self; -} -@end - -/// Mirror of NSKeyValueChangeKey. -/// -/// See https://developer.apple.com/documentation/foundation/nskeyvaluechangekey?language=objc. -@implementation FWFNSKeyValueChangeKeyEnumBox -- (instancetype)initWithValue:(FWFNSKeyValueChangeKeyEnum)value { - self = [super init]; - if (self) { - _value = value; - } - return self; -} -@end - -/// Mirror of WKUserScriptInjectionTime. -/// -/// See https://developer.apple.com/documentation/webkit/wkuserscriptinjectiontime?language=objc. -@implementation FWFWKUserScriptInjectionTimeEnumBox -- (instancetype)initWithValue:(FWFWKUserScriptInjectionTimeEnum)value { - self = [super init]; - if (self) { - _value = value; - } - return self; -} -@end - -/// Mirror of WKAudiovisualMediaTypes. -/// -/// See -/// [WKAudiovisualMediaTypes](https://developer.apple.com/documentation/webkit/wkaudiovisualmediatypes?language=objc). -@implementation FWFWKAudiovisualMediaTypeEnumBox -- (instancetype)initWithValue:(FWFWKAudiovisualMediaTypeEnum)value { - self = [super init]; - if (self) { - _value = value; - } - return self; -} -@end - -/// Mirror of WKWebsiteDataTypes. -/// -/// See -/// https://developer.apple.com/documentation/webkit/wkwebsitedatarecord/data_store_record_types?language=objc. -@implementation FWFWKWebsiteDataTypeEnumBox -- (instancetype)initWithValue:(FWFWKWebsiteDataTypeEnum)value { - self = [super init]; - if (self) { - _value = value; - } - return self; -} -@end - -/// Mirror of WKNavigationActionPolicy. -/// -/// See https://developer.apple.com/documentation/webkit/wknavigationactionpolicy?language=objc. -@implementation FWFWKNavigationActionPolicyEnumBox -- (instancetype)initWithValue:(FWFWKNavigationActionPolicyEnum)value { - self = [super init]; - if (self) { - _value = value; - } - return self; -} -@end - -/// Mirror of WKNavigationResponsePolicy. -/// -/// See https://developer.apple.com/documentation/webkit/wknavigationactionpolicy?language=objc. -@implementation FWFWKNavigationResponsePolicyEnumBox -- (instancetype)initWithValue:(FWFWKNavigationResponsePolicyEnum)value { - self = [super init]; - if (self) { - _value = value; - } - return self; -} -@end - -/// Mirror of NSHTTPCookiePropertyKey. -/// -/// See https://developer.apple.com/documentation/foundation/nshttpcookiepropertykey. -@implementation FWFNSHttpCookiePropertyKeyEnumBox -- (instancetype)initWithValue:(FWFNSHttpCookiePropertyKeyEnum)value { - self = [super init]; - if (self) { - _value = value; - } - return self; -} -@end - -/// An object that contains information about an action that causes navigation -/// to occur. -/// -/// Wraps -/// [WKNavigationType](https://developer.apple.com/documentation/webkit/wknavigationaction?language=objc). -@implementation FWFWKNavigationTypeBox -- (instancetype)initWithValue:(FWFWKNavigationType)value { - self = [super init]; - if (self) { - _value = value; - } - return self; -} -@end - -/// Possible permission decisions for device resource access. -/// -/// See https://developer.apple.com/documentation/webkit/wkpermissiondecision?language=objc. -@implementation FWFWKPermissionDecisionBox -- (instancetype)initWithValue:(FWFWKPermissionDecision)value { - self = [super init]; - if (self) { - _value = value; - } - return self; -} -@end - -/// List of the types of media devices that can capture audio, video, or both. -/// -/// See https://developer.apple.com/documentation/webkit/wkmediacapturetype?language=objc. -@implementation FWFWKMediaCaptureTypeBox -- (instancetype)initWithValue:(FWFWKMediaCaptureType)value { - self = [super init]; - if (self) { - _value = value; - } - return self; -} -@end - -/// Responses to an authentication challenge. -/// -/// See -/// https://developer.apple.com/documentation/foundation/nsurlsessionauthchallengedisposition?language=objc. -@implementation FWFNSUrlSessionAuthChallengeDispositionBox -- (instancetype)initWithValue:(FWFNSUrlSessionAuthChallengeDisposition)value { - self = [super init]; - if (self) { - _value = value; - } - return self; -} -@end - -/// Specifies how long a credential will be kept. -@implementation FWFNSUrlCredentialPersistenceBox -- (instancetype)initWithValue:(FWFNSUrlCredentialPersistence)value { - self = [super init]; - if (self) { - _value = value; - } - return self; -} -@end - -@interface FWFNSKeyValueObservingOptionsEnumData () -+ (FWFNSKeyValueObservingOptionsEnumData *)fromList:(NSArray *)list; -+ (nullable FWFNSKeyValueObservingOptionsEnumData *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FWFNSKeyValueChangeKeyEnumData () -+ (FWFNSKeyValueChangeKeyEnumData *)fromList:(NSArray *)list; -+ (nullable FWFNSKeyValueChangeKeyEnumData *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FWFWKUserScriptInjectionTimeEnumData () -+ (FWFWKUserScriptInjectionTimeEnumData *)fromList:(NSArray *)list; -+ (nullable FWFWKUserScriptInjectionTimeEnumData *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FWFWKAudiovisualMediaTypeEnumData () -+ (FWFWKAudiovisualMediaTypeEnumData *)fromList:(NSArray *)list; -+ (nullable FWFWKAudiovisualMediaTypeEnumData *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FWFWKWebsiteDataTypeEnumData () -+ (FWFWKWebsiteDataTypeEnumData *)fromList:(NSArray *)list; -+ (nullable FWFWKWebsiteDataTypeEnumData *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FWFWKNavigationActionPolicyEnumData () -+ (FWFWKNavigationActionPolicyEnumData *)fromList:(NSArray *)list; -+ (nullable FWFWKNavigationActionPolicyEnumData *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FWFNSHttpCookiePropertyKeyEnumData () -+ (FWFNSHttpCookiePropertyKeyEnumData *)fromList:(NSArray *)list; -+ (nullable FWFNSHttpCookiePropertyKeyEnumData *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FWFWKPermissionDecisionData () -+ (FWFWKPermissionDecisionData *)fromList:(NSArray *)list; -+ (nullable FWFWKPermissionDecisionData *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FWFWKMediaCaptureTypeData () -+ (FWFWKMediaCaptureTypeData *)fromList:(NSArray *)list; -+ (nullable FWFWKMediaCaptureTypeData *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FWFNSUrlRequestData () -+ (FWFNSUrlRequestData *)fromList:(NSArray *)list; -+ (nullable FWFNSUrlRequestData *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FWFNSHttpUrlResponseData () -+ (FWFNSHttpUrlResponseData *)fromList:(NSArray *)list; -+ (nullable FWFNSHttpUrlResponseData *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FWFWKUserScriptData () -+ (FWFWKUserScriptData *)fromList:(NSArray *)list; -+ (nullable FWFWKUserScriptData *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FWFWKNavigationActionData () -+ (FWFWKNavigationActionData *)fromList:(NSArray *)list; -+ (nullable FWFWKNavigationActionData *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FWFWKNavigationResponseData () -+ (FWFWKNavigationResponseData *)fromList:(NSArray *)list; -+ (nullable FWFWKNavigationResponseData *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FWFWKFrameInfoData () -+ (FWFWKFrameInfoData *)fromList:(NSArray *)list; -+ (nullable FWFWKFrameInfoData *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FWFNSErrorData () -+ (FWFNSErrorData *)fromList:(NSArray *)list; -+ (nullable FWFNSErrorData *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FWFWKScriptMessageData () -+ (FWFWKScriptMessageData *)fromList:(NSArray *)list; -+ (nullable FWFWKScriptMessageData *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FWFWKSecurityOriginData () -+ (FWFWKSecurityOriginData *)fromList:(NSArray *)list; -+ (nullable FWFWKSecurityOriginData *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FWFNSHttpCookieData () -+ (FWFNSHttpCookieData *)fromList:(NSArray *)list; -+ (nullable FWFNSHttpCookieData *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FWFObjectOrIdentifier () -+ (FWFObjectOrIdentifier *)fromList:(NSArray *)list; -+ (nullable FWFObjectOrIdentifier *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FWFAuthenticationChallengeResponse () -+ (FWFAuthenticationChallengeResponse *)fromList:(NSArray *)list; -+ (nullable FWFAuthenticationChallengeResponse *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@implementation FWFNSKeyValueObservingOptionsEnumData -+ (instancetype)makeWithValue:(FWFNSKeyValueObservingOptionsEnum)value { - FWFNSKeyValueObservingOptionsEnumData *pigeonResult = - [[FWFNSKeyValueObservingOptionsEnumData alloc] init]; - pigeonResult.value = value; - return pigeonResult; -} -+ (FWFNSKeyValueObservingOptionsEnumData *)fromList:(NSArray *)list { - FWFNSKeyValueObservingOptionsEnumData *pigeonResult = - [[FWFNSKeyValueObservingOptionsEnumData alloc] init]; - pigeonResult.value = [GetNullableObjectAtIndex(list, 0) integerValue]; - return pigeonResult; -} -+ (nullable FWFNSKeyValueObservingOptionsEnumData *)nullableFromList:(NSArray *)list { - return (list) ? [FWFNSKeyValueObservingOptionsEnumData fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.value), - ]; -} -@end - -@implementation FWFNSKeyValueChangeKeyEnumData -+ (instancetype)makeWithValue:(FWFNSKeyValueChangeKeyEnum)value { - FWFNSKeyValueChangeKeyEnumData *pigeonResult = [[FWFNSKeyValueChangeKeyEnumData alloc] init]; - pigeonResult.value = value; - return pigeonResult; -} -+ (FWFNSKeyValueChangeKeyEnumData *)fromList:(NSArray *)list { - FWFNSKeyValueChangeKeyEnumData *pigeonResult = [[FWFNSKeyValueChangeKeyEnumData alloc] init]; - pigeonResult.value = [GetNullableObjectAtIndex(list, 0) integerValue]; - return pigeonResult; -} -+ (nullable FWFNSKeyValueChangeKeyEnumData *)nullableFromList:(NSArray *)list { - return (list) ? [FWFNSKeyValueChangeKeyEnumData fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.value), - ]; -} -@end - -@implementation FWFWKUserScriptInjectionTimeEnumData -+ (instancetype)makeWithValue:(FWFWKUserScriptInjectionTimeEnum)value { - FWFWKUserScriptInjectionTimeEnumData *pigeonResult = - [[FWFWKUserScriptInjectionTimeEnumData alloc] init]; - pigeonResult.value = value; - return pigeonResult; -} -+ (FWFWKUserScriptInjectionTimeEnumData *)fromList:(NSArray *)list { - FWFWKUserScriptInjectionTimeEnumData *pigeonResult = - [[FWFWKUserScriptInjectionTimeEnumData alloc] init]; - pigeonResult.value = [GetNullableObjectAtIndex(list, 0) integerValue]; - return pigeonResult; -} -+ (nullable FWFWKUserScriptInjectionTimeEnumData *)nullableFromList:(NSArray *)list { - return (list) ? [FWFWKUserScriptInjectionTimeEnumData fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.value), - ]; -} -@end - -@implementation FWFWKAudiovisualMediaTypeEnumData -+ (instancetype)makeWithValue:(FWFWKAudiovisualMediaTypeEnum)value { - FWFWKAudiovisualMediaTypeEnumData *pigeonResult = - [[FWFWKAudiovisualMediaTypeEnumData alloc] init]; - pigeonResult.value = value; - return pigeonResult; -} -+ (FWFWKAudiovisualMediaTypeEnumData *)fromList:(NSArray *)list { - FWFWKAudiovisualMediaTypeEnumData *pigeonResult = - [[FWFWKAudiovisualMediaTypeEnumData alloc] init]; - pigeonResult.value = [GetNullableObjectAtIndex(list, 0) integerValue]; - return pigeonResult; -} -+ (nullable FWFWKAudiovisualMediaTypeEnumData *)nullableFromList:(NSArray *)list { - return (list) ? [FWFWKAudiovisualMediaTypeEnumData fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.value), - ]; -} -@end - -@implementation FWFWKWebsiteDataTypeEnumData -+ (instancetype)makeWithValue:(FWFWKWebsiteDataTypeEnum)value { - FWFWKWebsiteDataTypeEnumData *pigeonResult = [[FWFWKWebsiteDataTypeEnumData alloc] init]; - pigeonResult.value = value; - return pigeonResult; -} -+ (FWFWKWebsiteDataTypeEnumData *)fromList:(NSArray *)list { - FWFWKWebsiteDataTypeEnumData *pigeonResult = [[FWFWKWebsiteDataTypeEnumData alloc] init]; - pigeonResult.value = [GetNullableObjectAtIndex(list, 0) integerValue]; - return pigeonResult; -} -+ (nullable FWFWKWebsiteDataTypeEnumData *)nullableFromList:(NSArray *)list { - return (list) ? [FWFWKWebsiteDataTypeEnumData fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.value), - ]; -} -@end - -@implementation FWFWKNavigationActionPolicyEnumData -+ (instancetype)makeWithValue:(FWFWKNavigationActionPolicyEnum)value { - FWFWKNavigationActionPolicyEnumData *pigeonResult = - [[FWFWKNavigationActionPolicyEnumData alloc] init]; - pigeonResult.value = value; - return pigeonResult; -} -+ (FWFWKNavigationActionPolicyEnumData *)fromList:(NSArray *)list { - FWFWKNavigationActionPolicyEnumData *pigeonResult = - [[FWFWKNavigationActionPolicyEnumData alloc] init]; - pigeonResult.value = [GetNullableObjectAtIndex(list, 0) integerValue]; - return pigeonResult; -} -+ (nullable FWFWKNavigationActionPolicyEnumData *)nullableFromList:(NSArray *)list { - return (list) ? [FWFWKNavigationActionPolicyEnumData fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.value), - ]; -} -@end - -@implementation FWFNSHttpCookiePropertyKeyEnumData -+ (instancetype)makeWithValue:(FWFNSHttpCookiePropertyKeyEnum)value { - FWFNSHttpCookiePropertyKeyEnumData *pigeonResult = - [[FWFNSHttpCookiePropertyKeyEnumData alloc] init]; - pigeonResult.value = value; - return pigeonResult; -} -+ (FWFNSHttpCookiePropertyKeyEnumData *)fromList:(NSArray *)list { - FWFNSHttpCookiePropertyKeyEnumData *pigeonResult = - [[FWFNSHttpCookiePropertyKeyEnumData alloc] init]; - pigeonResult.value = [GetNullableObjectAtIndex(list, 0) integerValue]; - return pigeonResult; -} -+ (nullable FWFNSHttpCookiePropertyKeyEnumData *)nullableFromList:(NSArray *)list { - return (list) ? [FWFNSHttpCookiePropertyKeyEnumData fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.value), - ]; -} -@end - -@implementation FWFWKPermissionDecisionData -+ (instancetype)makeWithValue:(FWFWKPermissionDecision)value { - FWFWKPermissionDecisionData *pigeonResult = [[FWFWKPermissionDecisionData alloc] init]; - pigeonResult.value = value; - return pigeonResult; -} -+ (FWFWKPermissionDecisionData *)fromList:(NSArray *)list { - FWFWKPermissionDecisionData *pigeonResult = [[FWFWKPermissionDecisionData alloc] init]; - pigeonResult.value = [GetNullableObjectAtIndex(list, 0) integerValue]; - return pigeonResult; -} -+ (nullable FWFWKPermissionDecisionData *)nullableFromList:(NSArray *)list { - return (list) ? [FWFWKPermissionDecisionData fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.value), - ]; -} -@end - -@implementation FWFWKMediaCaptureTypeData -+ (instancetype)makeWithValue:(FWFWKMediaCaptureType)value { - FWFWKMediaCaptureTypeData *pigeonResult = [[FWFWKMediaCaptureTypeData alloc] init]; - pigeonResult.value = value; - return pigeonResult; -} -+ (FWFWKMediaCaptureTypeData *)fromList:(NSArray *)list { - FWFWKMediaCaptureTypeData *pigeonResult = [[FWFWKMediaCaptureTypeData alloc] init]; - pigeonResult.value = [GetNullableObjectAtIndex(list, 0) integerValue]; - return pigeonResult; -} -+ (nullable FWFWKMediaCaptureTypeData *)nullableFromList:(NSArray *)list { - return (list) ? [FWFWKMediaCaptureTypeData fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.value), - ]; -} -@end - -@implementation FWFNSUrlRequestData -+ (instancetype)makeWithUrl:(NSString *)url - httpMethod:(nullable NSString *)httpMethod - httpBody:(nullable FlutterStandardTypedData *)httpBody - allHttpHeaderFields:(NSDictionary *)allHttpHeaderFields { - FWFNSUrlRequestData *pigeonResult = [[FWFNSUrlRequestData alloc] init]; - pigeonResult.url = url; - pigeonResult.httpMethod = httpMethod; - pigeonResult.httpBody = httpBody; - pigeonResult.allHttpHeaderFields = allHttpHeaderFields; - return pigeonResult; -} -+ (FWFNSUrlRequestData *)fromList:(NSArray *)list { - FWFNSUrlRequestData *pigeonResult = [[FWFNSUrlRequestData alloc] init]; - pigeonResult.url = GetNullableObjectAtIndex(list, 0); - pigeonResult.httpMethod = GetNullableObjectAtIndex(list, 1); - pigeonResult.httpBody = GetNullableObjectAtIndex(list, 2); - pigeonResult.allHttpHeaderFields = GetNullableObjectAtIndex(list, 3); - return pigeonResult; -} -+ (nullable FWFNSUrlRequestData *)nullableFromList:(NSArray *)list { - return (list) ? [FWFNSUrlRequestData fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.url ?: [NSNull null], - self.httpMethod ?: [NSNull null], - self.httpBody ?: [NSNull null], - self.allHttpHeaderFields ?: [NSNull null], - ]; -} -@end - -@implementation FWFNSHttpUrlResponseData -+ (instancetype)makeWithStatusCode:(NSInteger)statusCode { - FWFNSHttpUrlResponseData *pigeonResult = [[FWFNSHttpUrlResponseData alloc] init]; - pigeonResult.statusCode = statusCode; - return pigeonResult; -} -+ (FWFNSHttpUrlResponseData *)fromList:(NSArray *)list { - FWFNSHttpUrlResponseData *pigeonResult = [[FWFNSHttpUrlResponseData alloc] init]; - pigeonResult.statusCode = [GetNullableObjectAtIndex(list, 0) integerValue]; - return pigeonResult; -} -+ (nullable FWFNSHttpUrlResponseData *)nullableFromList:(NSArray *)list { - return (list) ? [FWFNSHttpUrlResponseData fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.statusCode), - ]; -} -@end - -@implementation FWFWKUserScriptData -+ (instancetype)makeWithSource:(NSString *)source - injectionTime:(nullable FWFWKUserScriptInjectionTimeEnumData *)injectionTime - isMainFrameOnly:(BOOL)isMainFrameOnly { - FWFWKUserScriptData *pigeonResult = [[FWFWKUserScriptData alloc] init]; - pigeonResult.source = source; - pigeonResult.injectionTime = injectionTime; - pigeonResult.isMainFrameOnly = isMainFrameOnly; - return pigeonResult; -} -+ (FWFWKUserScriptData *)fromList:(NSArray *)list { - FWFWKUserScriptData *pigeonResult = [[FWFWKUserScriptData alloc] init]; - pigeonResult.source = GetNullableObjectAtIndex(list, 0); - pigeonResult.injectionTime = - [FWFWKUserScriptInjectionTimeEnumData nullableFromList:(GetNullableObjectAtIndex(list, 1))]; - pigeonResult.isMainFrameOnly = [GetNullableObjectAtIndex(list, 2) boolValue]; - return pigeonResult; -} -+ (nullable FWFWKUserScriptData *)nullableFromList:(NSArray *)list { - return (list) ? [FWFWKUserScriptData fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.source ?: [NSNull null], - (self.injectionTime ? [self.injectionTime toList] : [NSNull null]), - @(self.isMainFrameOnly), - ]; -} -@end - -@implementation FWFWKNavigationActionData -+ (instancetype)makeWithRequest:(FWFNSUrlRequestData *)request - targetFrame:(FWFWKFrameInfoData *)targetFrame - navigationType:(FWFWKNavigationType)navigationType { - FWFWKNavigationActionData *pigeonResult = [[FWFWKNavigationActionData alloc] init]; - pigeonResult.request = request; - pigeonResult.targetFrame = targetFrame; - pigeonResult.navigationType = navigationType; - return pigeonResult; -} -+ (FWFWKNavigationActionData *)fromList:(NSArray *)list { - FWFWKNavigationActionData *pigeonResult = [[FWFWKNavigationActionData alloc] init]; - pigeonResult.request = [FWFNSUrlRequestData nullableFromList:(GetNullableObjectAtIndex(list, 0))]; - pigeonResult.targetFrame = - [FWFWKFrameInfoData nullableFromList:(GetNullableObjectAtIndex(list, 1))]; - pigeonResult.navigationType = [GetNullableObjectAtIndex(list, 2) integerValue]; - return pigeonResult; -} -+ (nullable FWFWKNavigationActionData *)nullableFromList:(NSArray *)list { - return (list) ? [FWFWKNavigationActionData fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - (self.request ? [self.request toList] : [NSNull null]), - (self.targetFrame ? [self.targetFrame toList] : [NSNull null]), - @(self.navigationType), - ]; -} -@end - -@implementation FWFWKNavigationResponseData -+ (instancetype)makeWithResponse:(FWFNSHttpUrlResponseData *)response - forMainFrame:(BOOL)forMainFrame { - FWFWKNavigationResponseData *pigeonResult = [[FWFWKNavigationResponseData alloc] init]; - pigeonResult.response = response; - pigeonResult.forMainFrame = forMainFrame; - return pigeonResult; -} -+ (FWFWKNavigationResponseData *)fromList:(NSArray *)list { - FWFWKNavigationResponseData *pigeonResult = [[FWFWKNavigationResponseData alloc] init]; - pigeonResult.response = - [FWFNSHttpUrlResponseData nullableFromList:(GetNullableObjectAtIndex(list, 0))]; - pigeonResult.forMainFrame = [GetNullableObjectAtIndex(list, 1) boolValue]; - return pigeonResult; -} -+ (nullable FWFWKNavigationResponseData *)nullableFromList:(NSArray *)list { - return (list) ? [FWFWKNavigationResponseData fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - (self.response ? [self.response toList] : [NSNull null]), - @(self.forMainFrame), - ]; -} -@end - -@implementation FWFWKFrameInfoData -+ (instancetype)makeWithIsMainFrame:(BOOL)isMainFrame request:(FWFNSUrlRequestData *)request { - FWFWKFrameInfoData *pigeonResult = [[FWFWKFrameInfoData alloc] init]; - pigeonResult.isMainFrame = isMainFrame; - pigeonResult.request = request; - return pigeonResult; -} -+ (FWFWKFrameInfoData *)fromList:(NSArray *)list { - FWFWKFrameInfoData *pigeonResult = [[FWFWKFrameInfoData alloc] init]; - pigeonResult.isMainFrame = [GetNullableObjectAtIndex(list, 0) boolValue]; - pigeonResult.request = [FWFNSUrlRequestData nullableFromList:(GetNullableObjectAtIndex(list, 1))]; - return pigeonResult; -} -+ (nullable FWFWKFrameInfoData *)nullableFromList:(NSArray *)list { - return (list) ? [FWFWKFrameInfoData fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.isMainFrame), - (self.request ? [self.request toList] : [NSNull null]), - ]; -} -@end - -@implementation FWFNSErrorData -+ (instancetype)makeWithCode:(NSInteger)code - domain:(NSString *)domain - userInfo:(nullable NSDictionary *)userInfo { - FWFNSErrorData *pigeonResult = [[FWFNSErrorData alloc] init]; - pigeonResult.code = code; - pigeonResult.domain = domain; - pigeonResult.userInfo = userInfo; - return pigeonResult; -} -+ (FWFNSErrorData *)fromList:(NSArray *)list { - FWFNSErrorData *pigeonResult = [[FWFNSErrorData alloc] init]; - pigeonResult.code = [GetNullableObjectAtIndex(list, 0) integerValue]; - pigeonResult.domain = GetNullableObjectAtIndex(list, 1); - pigeonResult.userInfo = GetNullableObjectAtIndex(list, 2); - return pigeonResult; -} -+ (nullable FWFNSErrorData *)nullableFromList:(NSArray *)list { - return (list) ? [FWFNSErrorData fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.code), - self.domain ?: [NSNull null], - self.userInfo ?: [NSNull null], - ]; -} -@end - -@implementation FWFWKScriptMessageData -+ (instancetype)makeWithName:(NSString *)name body:(nullable id)body { - FWFWKScriptMessageData *pigeonResult = [[FWFWKScriptMessageData alloc] init]; - pigeonResult.name = name; - pigeonResult.body = body; - return pigeonResult; -} -+ (FWFWKScriptMessageData *)fromList:(NSArray *)list { - FWFWKScriptMessageData *pigeonResult = [[FWFWKScriptMessageData alloc] init]; - pigeonResult.name = GetNullableObjectAtIndex(list, 0); - pigeonResult.body = GetNullableObjectAtIndex(list, 1); - return pigeonResult; -} -+ (nullable FWFWKScriptMessageData *)nullableFromList:(NSArray *)list { - return (list) ? [FWFWKScriptMessageData fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.name ?: [NSNull null], - self.body ?: [NSNull null], - ]; -} -@end - -@implementation FWFWKSecurityOriginData -+ (instancetype)makeWithHost:(NSString *)host port:(NSInteger)port protocol:(NSString *)protocol { - FWFWKSecurityOriginData *pigeonResult = [[FWFWKSecurityOriginData alloc] init]; - pigeonResult.host = host; - pigeonResult.port = port; - pigeonResult.protocol = protocol; - return pigeonResult; -} -+ (FWFWKSecurityOriginData *)fromList:(NSArray *)list { - FWFWKSecurityOriginData *pigeonResult = [[FWFWKSecurityOriginData alloc] init]; - pigeonResult.host = GetNullableObjectAtIndex(list, 0); - pigeonResult.port = [GetNullableObjectAtIndex(list, 1) integerValue]; - pigeonResult.protocol = GetNullableObjectAtIndex(list, 2); - return pigeonResult; -} -+ (nullable FWFWKSecurityOriginData *)nullableFromList:(NSArray *)list { - return (list) ? [FWFWKSecurityOriginData fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.host ?: [NSNull null], - @(self.port), - self.protocol ?: [NSNull null], - ]; -} -@end - -@implementation FWFNSHttpCookieData -+ (instancetype)makeWithPropertyKeys:(NSArray *)propertyKeys - propertyValues:(NSArray *)propertyValues { - FWFNSHttpCookieData *pigeonResult = [[FWFNSHttpCookieData alloc] init]; - pigeonResult.propertyKeys = propertyKeys; - pigeonResult.propertyValues = propertyValues; - return pigeonResult; -} -+ (FWFNSHttpCookieData *)fromList:(NSArray *)list { - FWFNSHttpCookieData *pigeonResult = [[FWFNSHttpCookieData alloc] init]; - pigeonResult.propertyKeys = GetNullableObjectAtIndex(list, 0); - pigeonResult.propertyValues = GetNullableObjectAtIndex(list, 1); - return pigeonResult; -} -+ (nullable FWFNSHttpCookieData *)nullableFromList:(NSArray *)list { - return (list) ? [FWFNSHttpCookieData fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.propertyKeys ?: [NSNull null], - self.propertyValues ?: [NSNull null], - ]; -} -@end - -@implementation FWFObjectOrIdentifier -+ (instancetype)makeWithValue:(nullable id)value isIdentifier:(BOOL)isIdentifier { - FWFObjectOrIdentifier *pigeonResult = [[FWFObjectOrIdentifier alloc] init]; - pigeonResult.value = value; - pigeonResult.isIdentifier = isIdentifier; - return pigeonResult; -} -+ (FWFObjectOrIdentifier *)fromList:(NSArray *)list { - FWFObjectOrIdentifier *pigeonResult = [[FWFObjectOrIdentifier alloc] init]; - pigeonResult.value = GetNullableObjectAtIndex(list, 0); - pigeonResult.isIdentifier = [GetNullableObjectAtIndex(list, 1) boolValue]; - return pigeonResult; -} -+ (nullable FWFObjectOrIdentifier *)nullableFromList:(NSArray *)list { - return (list) ? [FWFObjectOrIdentifier fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.value ?: [NSNull null], - @(self.isIdentifier), - ]; -} -@end - -@implementation FWFAuthenticationChallengeResponse -+ (instancetype)makeWithDisposition:(FWFNSUrlSessionAuthChallengeDisposition)disposition - credentialIdentifier:(nullable NSNumber *)credentialIdentifier { - FWFAuthenticationChallengeResponse *pigeonResult = - [[FWFAuthenticationChallengeResponse alloc] init]; - pigeonResult.disposition = disposition; - pigeonResult.credentialIdentifier = credentialIdentifier; - return pigeonResult; -} -+ (FWFAuthenticationChallengeResponse *)fromList:(NSArray *)list { - FWFAuthenticationChallengeResponse *pigeonResult = - [[FWFAuthenticationChallengeResponse alloc] init]; - pigeonResult.disposition = [GetNullableObjectAtIndex(list, 0) integerValue]; - pigeonResult.credentialIdentifier = GetNullableObjectAtIndex(list, 1); - return pigeonResult; -} -+ (nullable FWFAuthenticationChallengeResponse *)nullableFromList:(NSArray *)list { - return (list) ? [FWFAuthenticationChallengeResponse fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.disposition), - self.credentialIdentifier ?: [NSNull null], - ]; -} -@end - -@interface FWFWKWebsiteDataStoreHostApiCodecReader : FlutterStandardReader -@end -@implementation FWFWKWebsiteDataStoreHostApiCodecReader -- (nullable id)readValueOfType:(UInt8)type { - switch (type) { - case 128: - return [FWFWKWebsiteDataTypeEnumData fromList:[self readValue]]; - default: - return [super readValueOfType:type]; - } -} -@end - -@interface FWFWKWebsiteDataStoreHostApiCodecWriter : FlutterStandardWriter -@end -@implementation FWFWKWebsiteDataStoreHostApiCodecWriter -- (void)writeValue:(id)value { - if ([value isKindOfClass:[FWFWKWebsiteDataTypeEnumData class]]) { - [self writeByte:128]; - [self writeValue:[value toList]]; - } else { - [super writeValue:value]; - } -} -@end - -@interface FWFWKWebsiteDataStoreHostApiCodecReaderWriter : FlutterStandardReaderWriter -@end -@implementation FWFWKWebsiteDataStoreHostApiCodecReaderWriter -- (FlutterStandardWriter *)writerWithData:(NSMutableData *)data { - return [[FWFWKWebsiteDataStoreHostApiCodecWriter alloc] initWithData:data]; -} -- (FlutterStandardReader *)readerWithData:(NSData *)data { - return [[FWFWKWebsiteDataStoreHostApiCodecReader alloc] initWithData:data]; -} -@end - -NSObject *FWFWKWebsiteDataStoreHostApiGetCodec(void) { - static FlutterStandardMessageCodec *sSharedObject = nil; - static dispatch_once_t sPred = 0; - dispatch_once(&sPred, ^{ - FWFWKWebsiteDataStoreHostApiCodecReaderWriter *readerWriter = - [[FWFWKWebsiteDataStoreHostApiCodecReaderWriter alloc] init]; - sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; - }); - return sSharedObject; -} - -void SetUpFWFWKWebsiteDataStoreHostApi(id binaryMessenger, - NSObject *api) { - SetUpFWFWKWebsiteDataStoreHostApiWithSuffix(binaryMessenger, api, @""); -} - -void SetUpFWFWKWebsiteDataStoreHostApiWithSuffix(id binaryMessenger, - NSObject *api, - NSString *messageChannelSuffix) { - messageChannelSuffix = messageChannelSuffix.length > 0 - ? [NSString stringWithFormat:@".%@", messageChannelSuffix] - : @""; - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKWebsiteDataStoreHostApi.createFromWebViewConfiguration", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFWKWebsiteDataStoreHostApiGetCodec()]; - if (api) { - NSCAssert( - [api respondsToSelector:@selector(createFromWebViewConfigurationWithIdentifier: - configurationIdentifier:error:)], - @"FWFWKWebsiteDataStoreHostApi api (%@) doesn't respond to " - @"@selector(createFromWebViewConfigurationWithIdentifier:configurationIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - NSInteger arg_configurationIdentifier = [GetNullableObjectAtIndex(args, 1) integerValue]; - FlutterError *error; - [api createFromWebViewConfigurationWithIdentifier:arg_identifier - configurationIdentifier:arg_configurationIdentifier - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKWebsiteDataStoreHostApi.createDefaultDataStore", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFWKWebsiteDataStoreHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(createDefaultDataStoreWithIdentifier:error:)], - @"FWFWKWebsiteDataStoreHostApi api (%@) doesn't respond to " - @"@selector(createDefaultDataStoreWithIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - FlutterError *error; - [api createDefaultDataStoreWithIdentifier:arg_identifier error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKWebsiteDataStoreHostApi.removeDataOfTypes", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFWKWebsiteDataStoreHostApiGetCodec()]; - if (api) { - NSCAssert( - [api respondsToSelector:@selector - (removeDataFromDataStoreWithIdentifier:ofTypes:modifiedSince:completion:)], - @"FWFWKWebsiteDataStoreHostApi api (%@) doesn't respond to " - @"@selector(removeDataFromDataStoreWithIdentifier:ofTypes:modifiedSince:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - NSArray *arg_dataTypes = GetNullableObjectAtIndex(args, 1); - double arg_modificationTimeInSecondsSinceEpoch = - [GetNullableObjectAtIndex(args, 2) doubleValue]; - [api removeDataFromDataStoreWithIdentifier:arg_identifier - ofTypes:arg_dataTypes - modifiedSince:arg_modificationTimeInSecondsSinceEpoch - completion:^(NSNumber *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } -} -NSObject *FWFUIViewHostApiGetCodec(void) { - static FlutterStandardMessageCodec *sSharedObject = nil; - sSharedObject = [FlutterStandardMessageCodec sharedInstance]; - return sSharedObject; -} - -void SetUpFWFUIViewHostApi(id binaryMessenger, - NSObject *api) { - SetUpFWFUIViewHostApiWithSuffix(binaryMessenger, api, @""); -} - -void SetUpFWFUIViewHostApiWithSuffix(id binaryMessenger, - NSObject *api, - NSString *messageChannelSuffix) { - messageChannelSuffix = messageChannelSuffix.length > 0 - ? [NSString stringWithFormat:@".%@", messageChannelSuffix] - : @""; - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"UIViewHostApi.setBackgroundColor", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFUIViewHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(setBackgroundColorForViewWithIdentifier: - toValue:error:)], - @"FWFUIViewHostApi api (%@) doesn't respond to " - @"@selector(setBackgroundColorForViewWithIdentifier:toValue:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - NSNumber *arg_value = GetNullableObjectAtIndex(args, 1); - FlutterError *error; - [api setBackgroundColorForViewWithIdentifier:arg_identifier toValue:arg_value error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"UIViewHostApi.setOpaque", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFUIViewHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(setOpaqueForViewWithIdentifier:isOpaque:error:)], - @"FWFUIViewHostApi api (%@) doesn't respond to " - @"@selector(setOpaqueForViewWithIdentifier:isOpaque:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - BOOL arg_opaque = [GetNullableObjectAtIndex(args, 1) boolValue]; - FlutterError *error; - [api setOpaqueForViewWithIdentifier:arg_identifier isOpaque:arg_opaque error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } -} -NSObject *FWFUIScrollViewHostApiGetCodec(void) { - static FlutterStandardMessageCodec *sSharedObject = nil; - sSharedObject = [FlutterStandardMessageCodec sharedInstance]; - return sSharedObject; -} - -void SetUpFWFUIScrollViewHostApi(id binaryMessenger, - NSObject *api) { - SetUpFWFUIScrollViewHostApiWithSuffix(binaryMessenger, api, @""); -} - -void SetUpFWFUIScrollViewHostApiWithSuffix(id binaryMessenger, - NSObject *api, - NSString *messageChannelSuffix) { - messageChannelSuffix = messageChannelSuffix.length > 0 - ? [NSString stringWithFormat:@".%@", messageChannelSuffix] - : @""; - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"UIScrollViewHostApi.createFromWebView", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFUIScrollViewHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(createFromWebViewWithIdentifier: - webViewIdentifier:error:)], - @"FWFUIScrollViewHostApi api (%@) doesn't respond to " - @"@selector(createFromWebViewWithIdentifier:webViewIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - NSInteger arg_webViewIdentifier = [GetNullableObjectAtIndex(args, 1) integerValue]; - FlutterError *error; - [api createFromWebViewWithIdentifier:arg_identifier - webViewIdentifier:arg_webViewIdentifier - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"UIScrollViewHostApi.getContentOffset", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFUIScrollViewHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(contentOffsetForScrollViewWithIdentifier:error:)], - @"FWFUIScrollViewHostApi api (%@) doesn't respond to " - @"@selector(contentOffsetForScrollViewWithIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - FlutterError *error; - NSArray *output = [api contentOffsetForScrollViewWithIdentifier:arg_identifier - error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"UIScrollViewHostApi.scrollBy", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFUIScrollViewHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(scrollByForScrollViewWithIdentifier:x:y:error:)], - @"FWFUIScrollViewHostApi api (%@) doesn't respond to " - @"@selector(scrollByForScrollViewWithIdentifier:x:y:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - double arg_x = [GetNullableObjectAtIndex(args, 1) doubleValue]; - double arg_y = [GetNullableObjectAtIndex(args, 2) doubleValue]; - FlutterError *error; - [api scrollByForScrollViewWithIdentifier:arg_identifier x:arg_x y:arg_y error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"UIScrollViewHostApi.verticalScrollBarEnabled", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFUIScrollViewHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector - (verticalScrollBarEnabledForScrollViewWithIdentifier:isEnabled:error:)], - @"FWFWKPreferencesHostApi api (%@) doesn't respond to " - @"@selector(verticalScrollBarEnabledForScrollViewWithIdentifier:isEnabled:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - BOOL arg_enabled = [GetNullableObjectAtIndex(args, 1) boolValue]; - FlutterError *error; - [api verticalScrollBarEnabledForScrollViewWithIdentifier:arg_identifier - isEnabled:arg_enabled - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"UIScrollViewHostApi.horizontalScrollBarEnabled", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFUIScrollViewHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector - (horizontalScrollBarEnabledForScrollViewWithIdentifier:isEnabled:error:)], - @"FWFWKPreferencesHostApi api (%@) doesn't respond to " - @"@selector(horizontalScrollBarEnabledForScrollViewWithIdentifier:isEnabled:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - BOOL arg_enabled = [GetNullableObjectAtIndex(args, 1) boolValue]; - FlutterError *error; - [api horizontalScrollBarEnabledForScrollViewWithIdentifier:arg_identifier - isEnabled:arg_enabled - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"UIScrollViewHostApi.setContentOffset", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFUIScrollViewHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector - (setContentOffsetForScrollViewWithIdentifier:toX:y:error:)], - @"FWFUIScrollViewHostApi api (%@) doesn't respond to " - @"@selector(setContentOffsetForScrollViewWithIdentifier:toX:y:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - double arg_x = [GetNullableObjectAtIndex(args, 1) doubleValue]; - double arg_y = [GetNullableObjectAtIndex(args, 2) doubleValue]; - FlutterError *error; - [api setContentOffsetForScrollViewWithIdentifier:arg_identifier - toX:arg_x - y:arg_y - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"UIScrollViewHostApi.setDelegate", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFUIScrollViewHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(setDelegateForScrollViewWithIdentifier: - uiScrollViewDelegateIdentifier:error:)], - @"FWFUIScrollViewHostApi api (%@) doesn't respond to " - @"@selector(setDelegateForScrollViewWithIdentifier:uiScrollViewDelegateIdentifier:" - @"error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - NSNumber *arg_uiScrollViewDelegateIdentifier = GetNullableObjectAtIndex(args, 1); - FlutterError *error; - [api setDelegateForScrollViewWithIdentifier:arg_identifier - uiScrollViewDelegateIdentifier:arg_uiScrollViewDelegateIdentifier - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } -} -@interface FWFWKWebViewConfigurationHostApiCodecReader : FlutterStandardReader -@end -@implementation FWFWKWebViewConfigurationHostApiCodecReader -- (nullable id)readValueOfType:(UInt8)type { - switch (type) { - case 128: - return [FWFWKAudiovisualMediaTypeEnumData fromList:[self readValue]]; - default: - return [super readValueOfType:type]; - } -} -@end - -@interface FWFWKWebViewConfigurationHostApiCodecWriter : FlutterStandardWriter -@end -@implementation FWFWKWebViewConfigurationHostApiCodecWriter -- (void)writeValue:(id)value { - if ([value isKindOfClass:[FWFWKAudiovisualMediaTypeEnumData class]]) { - [self writeByte:128]; - [self writeValue:[value toList]]; - } else { - [super writeValue:value]; - } -} -@end - -@interface FWFWKWebViewConfigurationHostApiCodecReaderWriter : FlutterStandardReaderWriter -@end -@implementation FWFWKWebViewConfigurationHostApiCodecReaderWriter -- (FlutterStandardWriter *)writerWithData:(NSMutableData *)data { - return [[FWFWKWebViewConfigurationHostApiCodecWriter alloc] initWithData:data]; -} -- (FlutterStandardReader *)readerWithData:(NSData *)data { - return [[FWFWKWebViewConfigurationHostApiCodecReader alloc] initWithData:data]; -} -@end - -NSObject *FWFWKWebViewConfigurationHostApiGetCodec(void) { - static FlutterStandardMessageCodec *sSharedObject = nil; - static dispatch_once_t sPred = 0; - dispatch_once(&sPred, ^{ - FWFWKWebViewConfigurationHostApiCodecReaderWriter *readerWriter = - [[FWFWKWebViewConfigurationHostApiCodecReaderWriter alloc] init]; - sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; - }); - return sSharedObject; -} - -void SetUpFWFWKWebViewConfigurationHostApi(id binaryMessenger, - NSObject *api) { - SetUpFWFWKWebViewConfigurationHostApiWithSuffix(binaryMessenger, api, @""); -} - -void SetUpFWFWKWebViewConfigurationHostApiWithSuffix( - id binaryMessenger, NSObject *api, - NSString *messageChannelSuffix) { - messageChannelSuffix = messageChannelSuffix.length > 0 - ? [NSString stringWithFormat:@".%@", messageChannelSuffix] - : @""; - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKWebViewConfigurationHostApi.create", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFWKWebViewConfigurationHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(createWithIdentifier:error:)], - @"FWFWKWebViewConfigurationHostApi api (%@) doesn't respond to " - @"@selector(createWithIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - FlutterError *error; - [api createWithIdentifier:arg_identifier error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKWebViewConfigurationHostApi.createFromWebView", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFWKWebViewConfigurationHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(createFromWebViewWithIdentifier: - webViewIdentifier:error:)], - @"FWFWKWebViewConfigurationHostApi api (%@) doesn't respond to " - @"@selector(createFromWebViewWithIdentifier:webViewIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - NSInteger arg_webViewIdentifier = [GetNullableObjectAtIndex(args, 1) integerValue]; - FlutterError *error; - [api createFromWebViewWithIdentifier:arg_identifier - webViewIdentifier:arg_webViewIdentifier - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKWebViewConfigurationHostApi.setAllowsInlineMediaPlayback", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFWKWebViewConfigurationHostApiGetCodec()]; - if (api) { - NSCAssert( - [api respondsToSelector:@selector - (setAllowsInlineMediaPlaybackForConfigurationWithIdentifier:isAllowed:error:)], - @"FWFWKWebViewConfigurationHostApi api (%@) doesn't respond to " - @"@selector(setAllowsInlineMediaPlaybackForConfigurationWithIdentifier:isAllowed:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - BOOL arg_allow = [GetNullableObjectAtIndex(args, 1) boolValue]; - FlutterError *error; - [api setAllowsInlineMediaPlaybackForConfigurationWithIdentifier:arg_identifier - isAllowed:arg_allow - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKWebViewConfigurationHostApi." - @"setLimitsNavigationsToAppBoundDomains", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFWKWebViewConfigurationHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector - (setLimitsNavigationsToAppBoundDomainsForConfigurationWithIdentifier: - isLimited:error:)], - @"FWFWKWebViewConfigurationHostApi api (%@) doesn't respond to " - @"@selector(setLimitsNavigationsToAppBoundDomainsForConfigurationWithIdentifier:" - @"isLimited:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - BOOL arg_limit = [GetNullableObjectAtIndex(args, 1) boolValue]; - FlutterError *error; - [api setLimitsNavigationsToAppBoundDomainsForConfigurationWithIdentifier:arg_identifier - isLimited:arg_limit - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKWebViewConfigurationHostApi." - @"setMediaTypesRequiringUserActionForPlayback", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFWKWebViewConfigurationHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector - (setMediaTypesRequiresUserActionForConfigurationWithIdentifier: - forTypes:error:)], - @"FWFWKWebViewConfigurationHostApi api (%@) doesn't respond to " - @"@selector(setMediaTypesRequiresUserActionForConfigurationWithIdentifier:forTypes:" - @"error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - NSArray *arg_types = GetNullableObjectAtIndex(args, 1); - FlutterError *error; - [api setMediaTypesRequiresUserActionForConfigurationWithIdentifier:arg_identifier - forTypes:arg_types - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } -} -NSObject *FWFWKWebViewConfigurationFlutterApiGetCodec(void) { - static FlutterStandardMessageCodec *sSharedObject = nil; - sSharedObject = [FlutterStandardMessageCodec sharedInstance]; - return sSharedObject; -} - -@interface FWFWKWebViewConfigurationFlutterApi () -@property(nonatomic, strong) NSObject *binaryMessenger; -@property(nonatomic, strong) NSString *messageChannelSuffix; -@end - -@implementation FWFWKWebViewConfigurationFlutterApi - -- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger { - return [self initWithBinaryMessenger:binaryMessenger messageChannelSuffix:@""]; -} -- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger - messageChannelSuffix:(nullable NSString *)messageChannelSuffix { - self = [self init]; - if (self) { - _binaryMessenger = binaryMessenger; - _messageChannelSuffix = [messageChannelSuffix length] == 0 - ? @"" - : [NSString stringWithFormat:@".%@", messageChannelSuffix]; - } - return self; -} -- (void)createWithIdentifier:(NSInteger)arg_identifier - completion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationFlutterApi.create", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FWFWKWebViewConfigurationFlutterApiGetCodec()]; - [channel sendMessage:@[ @(arg_identifier) ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -@end - -@interface FWFWKUserContentControllerHostApiCodecReader : FlutterStandardReader -@end -@implementation FWFWKUserContentControllerHostApiCodecReader -- (nullable id)readValueOfType:(UInt8)type { - switch (type) { - case 128: - return [FWFWKUserScriptData fromList:[self readValue]]; - case 129: - return [FWFWKUserScriptInjectionTimeEnumData fromList:[self readValue]]; - default: - return [super readValueOfType:type]; - } -} -@end - -@interface FWFWKUserContentControllerHostApiCodecWriter : FlutterStandardWriter -@end -@implementation FWFWKUserContentControllerHostApiCodecWriter -- (void)writeValue:(id)value { - if ([value isKindOfClass:[FWFWKUserScriptData class]]) { - [self writeByte:128]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FWFWKUserScriptInjectionTimeEnumData class]]) { - [self writeByte:129]; - [self writeValue:[value toList]]; - } else { - [super writeValue:value]; - } -} -@end - -@interface FWFWKUserContentControllerHostApiCodecReaderWriter : FlutterStandardReaderWriter -@end -@implementation FWFWKUserContentControllerHostApiCodecReaderWriter -- (FlutterStandardWriter *)writerWithData:(NSMutableData *)data { - return [[FWFWKUserContentControllerHostApiCodecWriter alloc] initWithData:data]; -} -- (FlutterStandardReader *)readerWithData:(NSData *)data { - return [[FWFWKUserContentControllerHostApiCodecReader alloc] initWithData:data]; -} -@end - -NSObject *FWFWKUserContentControllerHostApiGetCodec(void) { - static FlutterStandardMessageCodec *sSharedObject = nil; - static dispatch_once_t sPred = 0; - dispatch_once(&sPred, ^{ - FWFWKUserContentControllerHostApiCodecReaderWriter *readerWriter = - [[FWFWKUserContentControllerHostApiCodecReaderWriter alloc] init]; - sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; - }); - return sSharedObject; -} - -void SetUpFWFWKUserContentControllerHostApi(id binaryMessenger, - NSObject *api) { - SetUpFWFWKUserContentControllerHostApiWithSuffix(binaryMessenger, api, @""); -} - -void SetUpFWFWKUserContentControllerHostApiWithSuffix( - id binaryMessenger, NSObject *api, - NSString *messageChannelSuffix) { - messageChannelSuffix = messageChannelSuffix.length > 0 - ? [NSString stringWithFormat:@".%@", messageChannelSuffix] - : @""; - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKUserContentControllerHostApi.createFromWebViewConfiguration", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFWKUserContentControllerHostApiGetCodec()]; - if (api) { - NSCAssert( - [api respondsToSelector:@selector(createFromWebViewConfigurationWithIdentifier: - configurationIdentifier:error:)], - @"FWFWKUserContentControllerHostApi api (%@) doesn't respond to " - @"@selector(createFromWebViewConfigurationWithIdentifier:configurationIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - NSInteger arg_configurationIdentifier = [GetNullableObjectAtIndex(args, 1) integerValue]; - FlutterError *error; - [api createFromWebViewConfigurationWithIdentifier:arg_identifier - configurationIdentifier:arg_configurationIdentifier - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKUserContentControllerHostApi.addScriptMessageHandler", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFWKUserContentControllerHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector - (addScriptMessageHandlerForControllerWithIdentifier: - handlerIdentifier:ofName:error:)], - @"FWFWKUserContentControllerHostApi api (%@) doesn't respond to " - @"@selector(addScriptMessageHandlerForControllerWithIdentifier:handlerIdentifier:" - @"ofName:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - NSInteger arg_handlerIdentifier = [GetNullableObjectAtIndex(args, 1) integerValue]; - NSString *arg_name = GetNullableObjectAtIndex(args, 2); - FlutterError *error; - [api addScriptMessageHandlerForControllerWithIdentifier:arg_identifier - handlerIdentifier:arg_handlerIdentifier - ofName:arg_name - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKUserContentControllerHostApi.removeScriptMessageHandler", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFWKUserContentControllerHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector - (removeScriptMessageHandlerForControllerWithIdentifier:name:error:)], - @"FWFWKUserContentControllerHostApi api (%@) doesn't respond to " - @"@selector(removeScriptMessageHandlerForControllerWithIdentifier:name:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - NSString *arg_name = GetNullableObjectAtIndex(args, 1); - FlutterError *error; - [api removeScriptMessageHandlerForControllerWithIdentifier:arg_identifier - name:arg_name - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKUserContentControllerHostApi.removeAllScriptMessageHandlers", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFWKUserContentControllerHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector - (removeAllScriptMessageHandlersForControllerWithIdentifier:error:)], - @"FWFWKUserContentControllerHostApi api (%@) doesn't respond to " - @"@selector(removeAllScriptMessageHandlersForControllerWithIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - FlutterError *error; - [api removeAllScriptMessageHandlersForControllerWithIdentifier:arg_identifier error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKUserContentControllerHostApi.addUserScript", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFWKUserContentControllerHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(addUserScriptForControllerWithIdentifier: - userScript:error:)], - @"FWFWKUserContentControllerHostApi api (%@) doesn't respond to " - @"@selector(addUserScriptForControllerWithIdentifier:userScript:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - FWFWKUserScriptData *arg_userScript = GetNullableObjectAtIndex(args, 1); - FlutterError *error; - [api addUserScriptForControllerWithIdentifier:arg_identifier - userScript:arg_userScript - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKUserContentControllerHostApi.removeAllUserScripts", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFWKUserContentControllerHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector - (removeAllUserScriptsForControllerWithIdentifier:error:)], - @"FWFWKUserContentControllerHostApi api (%@) doesn't respond to " - @"@selector(removeAllUserScriptsForControllerWithIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - FlutterError *error; - [api removeAllUserScriptsForControllerWithIdentifier:arg_identifier error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } -} -NSObject *FWFWKPreferencesHostApiGetCodec(void) { - static FlutterStandardMessageCodec *sSharedObject = nil; - sSharedObject = [FlutterStandardMessageCodec sharedInstance]; - return sSharedObject; -} - -void SetUpFWFWKPreferencesHostApi(id binaryMessenger, - NSObject *api) { - SetUpFWFWKPreferencesHostApiWithSuffix(binaryMessenger, api, @""); -} - -void SetUpFWFWKPreferencesHostApiWithSuffix(id binaryMessenger, - NSObject *api, - NSString *messageChannelSuffix) { - messageChannelSuffix = messageChannelSuffix.length > 0 - ? [NSString stringWithFormat:@".%@", messageChannelSuffix] - : @""; - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKPreferencesHostApi.createFromWebViewConfiguration", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFWKPreferencesHostApiGetCodec()]; - if (api) { - NSCAssert( - [api respondsToSelector:@selector(createFromWebViewConfigurationWithIdentifier: - configurationIdentifier:error:)], - @"FWFWKPreferencesHostApi api (%@) doesn't respond to " - @"@selector(createFromWebViewConfigurationWithIdentifier:configurationIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - NSInteger arg_configurationIdentifier = [GetNullableObjectAtIndex(args, 1) integerValue]; - FlutterError *error; - [api createFromWebViewConfigurationWithIdentifier:arg_identifier - configurationIdentifier:arg_configurationIdentifier - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKPreferencesHostApi.setJavaScriptEnabled", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFWKPreferencesHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector - (setJavaScriptEnabledForPreferencesWithIdentifier:isEnabled:error:)], - @"FWFWKPreferencesHostApi api (%@) doesn't respond to " - @"@selector(setJavaScriptEnabledForPreferencesWithIdentifier:isEnabled:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - BOOL arg_enabled = [GetNullableObjectAtIndex(args, 1) boolValue]; - FlutterError *error; - [api setJavaScriptEnabledForPreferencesWithIdentifier:arg_identifier - isEnabled:arg_enabled - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } -} -NSObject *FWFWKScriptMessageHandlerHostApiGetCodec(void) { - static FlutterStandardMessageCodec *sSharedObject = nil; - sSharedObject = [FlutterStandardMessageCodec sharedInstance]; - return sSharedObject; -} - -void SetUpFWFWKScriptMessageHandlerHostApi(id binaryMessenger, - NSObject *api) { - SetUpFWFWKScriptMessageHandlerHostApiWithSuffix(binaryMessenger, api, @""); -} - -void SetUpFWFWKScriptMessageHandlerHostApiWithSuffix( - id binaryMessenger, NSObject *api, - NSString *messageChannelSuffix) { - messageChannelSuffix = messageChannelSuffix.length > 0 - ? [NSString stringWithFormat:@".%@", messageChannelSuffix] - : @""; - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKScriptMessageHandlerHostApi.create", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFWKScriptMessageHandlerHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(createWithIdentifier:error:)], - @"FWFWKScriptMessageHandlerHostApi api (%@) doesn't respond to " - @"@selector(createWithIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - FlutterError *error; - [api createWithIdentifier:arg_identifier error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } -} -@interface FWFWKScriptMessageHandlerFlutterApiCodecReader : FlutterStandardReader -@end -@implementation FWFWKScriptMessageHandlerFlutterApiCodecReader -- (nullable id)readValueOfType:(UInt8)type { - switch (type) { - case 128: - return [FWFWKScriptMessageData fromList:[self readValue]]; - default: - return [super readValueOfType:type]; - } -} -@end - -@interface FWFWKScriptMessageHandlerFlutterApiCodecWriter : FlutterStandardWriter -@end -@implementation FWFWKScriptMessageHandlerFlutterApiCodecWriter -- (void)writeValue:(id)value { - if ([value isKindOfClass:[FWFWKScriptMessageData class]]) { - [self writeByte:128]; - [self writeValue:[value toList]]; - } else { - [super writeValue:value]; - } -} -@end - -@interface FWFWKScriptMessageHandlerFlutterApiCodecReaderWriter : FlutterStandardReaderWriter -@end -@implementation FWFWKScriptMessageHandlerFlutterApiCodecReaderWriter -- (FlutterStandardWriter *)writerWithData:(NSMutableData *)data { - return [[FWFWKScriptMessageHandlerFlutterApiCodecWriter alloc] initWithData:data]; -} -- (FlutterStandardReader *)readerWithData:(NSData *)data { - return [[FWFWKScriptMessageHandlerFlutterApiCodecReader alloc] initWithData:data]; -} -@end - -NSObject *FWFWKScriptMessageHandlerFlutterApiGetCodec(void) { - static FlutterStandardMessageCodec *sSharedObject = nil; - static dispatch_once_t sPred = 0; - dispatch_once(&sPred, ^{ - FWFWKScriptMessageHandlerFlutterApiCodecReaderWriter *readerWriter = - [[FWFWKScriptMessageHandlerFlutterApiCodecReaderWriter alloc] init]; - sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; - }); - return sSharedObject; -} - -@interface FWFWKScriptMessageHandlerFlutterApi () -@property(nonatomic, strong) NSObject *binaryMessenger; -@property(nonatomic, strong) NSString *messageChannelSuffix; -@end - -@implementation FWFWKScriptMessageHandlerFlutterApi - -- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger { - return [self initWithBinaryMessenger:binaryMessenger messageChannelSuffix:@""]; -} -- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger - messageChannelSuffix:(nullable NSString *)messageChannelSuffix { - self = [self init]; - if (self) { - _binaryMessenger = binaryMessenger; - _messageChannelSuffix = [messageChannelSuffix length] == 0 - ? @"" - : [NSString stringWithFormat:@".%@", messageChannelSuffix]; - } - return self; -} -- (void) - didReceiveScriptMessageForHandlerWithIdentifier:(NSInteger)arg_identifier - userContentControllerIdentifier:(NSInteger)arg_userContentControllerIdentifier - message:(FWFWKScriptMessageData *)arg_message - completion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKScriptMessageHandlerFlutterApi.didReceiveScriptMessage", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FWFWKScriptMessageHandlerFlutterApiGetCodec()]; - [channel sendMessage:@[ - @(arg_identifier), @(arg_userContentControllerIdentifier), arg_message ?: [NSNull null] - ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -@end - -NSObject *FWFWKNavigationDelegateHostApiGetCodec(void) { - static FlutterStandardMessageCodec *sSharedObject = nil; - sSharedObject = [FlutterStandardMessageCodec sharedInstance]; - return sSharedObject; -} - -void SetUpFWFWKNavigationDelegateHostApi(id binaryMessenger, - NSObject *api) { - SetUpFWFWKNavigationDelegateHostApiWithSuffix(binaryMessenger, api, @""); -} - -void SetUpFWFWKNavigationDelegateHostApiWithSuffix(id binaryMessenger, - NSObject *api, - NSString *messageChannelSuffix) { - messageChannelSuffix = messageChannelSuffix.length > 0 - ? [NSString stringWithFormat:@".%@", messageChannelSuffix] - : @""; - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKNavigationDelegateHostApi.create", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFWKNavigationDelegateHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(createWithIdentifier:error:)], - @"FWFWKNavigationDelegateHostApi api (%@) doesn't respond to " - @"@selector(createWithIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - FlutterError *error; - [api createWithIdentifier:arg_identifier error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } -} -@interface FWFWKNavigationDelegateFlutterApiCodecReader : FlutterStandardReader -@end -@implementation FWFWKNavigationDelegateFlutterApiCodecReader -- (nullable id)readValueOfType:(UInt8)type { - switch (type) { - case 128: - return [FWFAuthenticationChallengeResponse fromList:[self readValue]]; - case 129: - return [FWFNSErrorData fromList:[self readValue]]; - case 130: - return [FWFNSHttpUrlResponseData fromList:[self readValue]]; - case 131: - return [FWFNSUrlRequestData fromList:[self readValue]]; - case 132: - return [FWFWKFrameInfoData fromList:[self readValue]]; - case 133: - return [FWFWKNavigationActionData fromList:[self readValue]]; - case 134: - return [FWFWKNavigationActionPolicyEnumData fromList:[self readValue]]; - case 135: - return [FWFWKNavigationResponseData fromList:[self readValue]]; - default: - return [super readValueOfType:type]; - } -} -@end - -@interface FWFWKNavigationDelegateFlutterApiCodecWriter : FlutterStandardWriter -@end -@implementation FWFWKNavigationDelegateFlutterApiCodecWriter -- (void)writeValue:(id)value { - if ([value isKindOfClass:[FWFAuthenticationChallengeResponse class]]) { - [self writeByte:128]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FWFNSErrorData class]]) { - [self writeByte:129]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FWFNSHttpUrlResponseData class]]) { - [self writeByte:130]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FWFNSUrlRequestData class]]) { - [self writeByte:131]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FWFWKFrameInfoData class]]) { - [self writeByte:132]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FWFWKNavigationActionData class]]) { - [self writeByte:133]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FWFWKNavigationActionPolicyEnumData class]]) { - [self writeByte:134]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FWFWKNavigationResponseData class]]) { - [self writeByte:135]; - [self writeValue:[value toList]]; - } else { - [super writeValue:value]; - } -} -@end - -@interface FWFWKNavigationDelegateFlutterApiCodecReaderWriter : FlutterStandardReaderWriter -@end -@implementation FWFWKNavigationDelegateFlutterApiCodecReaderWriter -- (FlutterStandardWriter *)writerWithData:(NSMutableData *)data { - return [[FWFWKNavigationDelegateFlutterApiCodecWriter alloc] initWithData:data]; -} -- (FlutterStandardReader *)readerWithData:(NSData *)data { - return [[FWFWKNavigationDelegateFlutterApiCodecReader alloc] initWithData:data]; -} -@end - -NSObject *FWFWKNavigationDelegateFlutterApiGetCodec(void) { - static FlutterStandardMessageCodec *sSharedObject = nil; - static dispatch_once_t sPred = 0; - dispatch_once(&sPred, ^{ - FWFWKNavigationDelegateFlutterApiCodecReaderWriter *readerWriter = - [[FWFWKNavigationDelegateFlutterApiCodecReaderWriter alloc] init]; - sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; - }); - return sSharedObject; -} - -@interface FWFWKNavigationDelegateFlutterApi () -@property(nonatomic, strong) NSObject *binaryMessenger; -@property(nonatomic, strong) NSString *messageChannelSuffix; -@end - -@implementation FWFWKNavigationDelegateFlutterApi - -- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger { - return [self initWithBinaryMessenger:binaryMessenger messageChannelSuffix:@""]; -} -- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger - messageChannelSuffix:(nullable NSString *)messageChannelSuffix { - self = [self init]; - if (self) { - _binaryMessenger = binaryMessenger; - _messageChannelSuffix = [messageChannelSuffix length] == 0 - ? @"" - : [NSString stringWithFormat:@".%@", messageChannelSuffix]; - } - return self; -} -- (void)didFinishNavigationForDelegateWithIdentifier:(NSInteger)arg_identifier - webViewIdentifier:(NSInteger)arg_webViewIdentifier - URL:(nullable NSString *)arg_url - completion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKNavigationDelegateFlutterApi.didFinishNavigation", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FWFWKNavigationDelegateFlutterApiGetCodec()]; - [channel sendMessage:@[ @(arg_identifier), @(arg_webViewIdentifier), arg_url ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)didStartProvisionalNavigationForDelegateWithIdentifier:(NSInteger)arg_identifier - webViewIdentifier:(NSInteger)arg_webViewIdentifier - URL:(nullable NSString *)arg_url - completion:(void (^)(FlutterError *_Nullable)) - completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKNavigationDelegateFlutterApi.didStartProvisionalNavigation", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FWFWKNavigationDelegateFlutterApiGetCodec()]; - [channel sendMessage:@[ @(arg_identifier), @(arg_webViewIdentifier), arg_url ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)decidePolicyForNavigationActionForDelegateWithIdentifier:(NSInteger)arg_identifier - webViewIdentifier:(NSInteger)arg_webViewIdentifier - navigationAction:(FWFWKNavigationActionData *) - arg_navigationAction - completion: - (void (^)( - FWFWKNavigationActionPolicyEnumData - *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKNavigationDelegateFlutterApi.decidePolicyForNavigationAction", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FWFWKNavigationDelegateFlutterApiGetCodec()]; - [channel sendMessage:@[ - @(arg_identifier), @(arg_webViewIdentifier), arg_navigationAction ?: [NSNull null] - ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - FWFWKNavigationActionPolicyEnumData *output = - reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)decidePolicyForNavigationResponseForDelegateWithIdentifier:(NSInteger)arg_identifier - webViewIdentifier:(NSInteger)arg_webViewIdentifier - navigationResponse:(FWFWKNavigationResponseData *) - arg_navigationResponse - completion: - (void (^)( - FWFWKNavigationResponsePolicyEnumBox - *_Nullable, - FlutterError *_Nullable)) - completion { - NSString *channelName = [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKNavigationDelegateFlutterApi.decidePolicyForNavigationResponse", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FWFWKNavigationDelegateFlutterApiGetCodec()]; - [channel sendMessage:@[ - @(arg_identifier), @(arg_webViewIdentifier), arg_navigationResponse ?: [NSNull null] - ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSNumber *outputAsNumber = reply[0] == [NSNull null] ? nil : reply[0]; - FWFWKNavigationResponsePolicyEnumBox *output = - outputAsNumber == nil ? nil - : [[FWFWKNavigationResponsePolicyEnumBox alloc] - initWithValue:[outputAsNumber integerValue]]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)didFailNavigationForDelegateWithIdentifier:(NSInteger)arg_identifier - webViewIdentifier:(NSInteger)arg_webViewIdentifier - error:(FWFNSErrorData *)arg_error - completion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKNavigationDelegateFlutterApi.didFailNavigation", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FWFWKNavigationDelegateFlutterApiGetCodec()]; - [channel sendMessage:@[ @(arg_identifier), @(arg_webViewIdentifier), arg_error ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)didFailProvisionalNavigationForDelegateWithIdentifier:(NSInteger)arg_identifier - webViewIdentifier:(NSInteger)arg_webViewIdentifier - error:(FWFNSErrorData *)arg_error - completion:(void (^)(FlutterError *_Nullable)) - completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKNavigationDelegateFlutterApi.didFailProvisionalNavigation", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FWFWKNavigationDelegateFlutterApiGetCodec()]; - [channel sendMessage:@[ @(arg_identifier), @(arg_webViewIdentifier), arg_error ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)webViewWebContentProcessDidTerminateForDelegateWithIdentifier:(NSInteger)arg_identifier - webViewIdentifier: - (NSInteger)arg_webViewIdentifier - completion: - (void (^)(FlutterError *_Nullable)) - completion { - NSString *channelName = [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKNavigationDelegateFlutterApi.webViewWebContentProcessDidTerminate", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FWFWKNavigationDelegateFlutterApiGetCodec()]; - [channel sendMessage:@[ @(arg_identifier), @(arg_webViewIdentifier) ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void) - didReceiveAuthenticationChallengeForDelegateWithIdentifier:(NSInteger)arg_identifier - webViewIdentifier:(NSInteger)arg_webViewIdentifier - challengeIdentifier:(NSInteger)arg_challengeIdentifier - completion: - (void (^)(FWFAuthenticationChallengeResponse - *_Nullable, - FlutterError *_Nullable)) - completion { - NSString *channelName = [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKNavigationDelegateFlutterApi.didReceiveAuthenticationChallenge", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FWFWKNavigationDelegateFlutterApiGetCodec()]; - [channel sendMessage:@[ @(arg_identifier), @(arg_webViewIdentifier), @(arg_challengeIdentifier) ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - FWFAuthenticationChallengeResponse *output = - reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -@end - -@interface FWFNSObjectHostApiCodecReader : FlutterStandardReader -@end -@implementation FWFNSObjectHostApiCodecReader -- (nullable id)readValueOfType:(UInt8)type { - switch (type) { - case 128: - return [FWFNSKeyValueObservingOptionsEnumData fromList:[self readValue]]; - default: - return [super readValueOfType:type]; - } -} -@end - -@interface FWFNSObjectHostApiCodecWriter : FlutterStandardWriter -@end -@implementation FWFNSObjectHostApiCodecWriter -- (void)writeValue:(id)value { - if ([value isKindOfClass:[FWFNSKeyValueObservingOptionsEnumData class]]) { - [self writeByte:128]; - [self writeValue:[value toList]]; - } else { - [super writeValue:value]; - } -} -@end - -@interface FWFNSObjectHostApiCodecReaderWriter : FlutterStandardReaderWriter -@end -@implementation FWFNSObjectHostApiCodecReaderWriter -- (FlutterStandardWriter *)writerWithData:(NSMutableData *)data { - return [[FWFNSObjectHostApiCodecWriter alloc] initWithData:data]; -} -- (FlutterStandardReader *)readerWithData:(NSData *)data { - return [[FWFNSObjectHostApiCodecReader alloc] initWithData:data]; -} -@end - -NSObject *FWFNSObjectHostApiGetCodec(void) { - static FlutterStandardMessageCodec *sSharedObject = nil; - static dispatch_once_t sPred = 0; - dispatch_once(&sPred, ^{ - FWFNSObjectHostApiCodecReaderWriter *readerWriter = - [[FWFNSObjectHostApiCodecReaderWriter alloc] init]; - sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; - }); - return sSharedObject; -} - -void SetUpFWFNSObjectHostApi(id binaryMessenger, - NSObject *api) { - SetUpFWFNSObjectHostApiWithSuffix(binaryMessenger, api, @""); -} - -void SetUpFWFNSObjectHostApiWithSuffix(id binaryMessenger, - NSObject *api, - NSString *messageChannelSuffix) { - messageChannelSuffix = messageChannelSuffix.length > 0 - ? [NSString stringWithFormat:@".%@", messageChannelSuffix] - : @""; - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"NSObjectHostApi.dispose", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFNSObjectHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(disposeObjectWithIdentifier:error:)], - @"FWFNSObjectHostApi api (%@) doesn't respond to " - @"@selector(disposeObjectWithIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - FlutterError *error; - [api disposeObjectWithIdentifier:arg_identifier error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"NSObjectHostApi.addObserver", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFNSObjectHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector - (addObserverForObjectWithIdentifier: - observerIdentifier:keyPath:options:error:)], - @"FWFNSObjectHostApi api (%@) doesn't respond to " - @"@selector(addObserverForObjectWithIdentifier:observerIdentifier:keyPath:options:" - @"error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - NSInteger arg_observerIdentifier = [GetNullableObjectAtIndex(args, 1) integerValue]; - NSString *arg_keyPath = GetNullableObjectAtIndex(args, 2); - NSArray *arg_options = - GetNullableObjectAtIndex(args, 3); - FlutterError *error; - [api addObserverForObjectWithIdentifier:arg_identifier - observerIdentifier:arg_observerIdentifier - keyPath:arg_keyPath - options:arg_options - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"NSObjectHostApi.removeObserver", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFNSObjectHostApiGetCodec()]; - if (api) { - NSCAssert( - [api respondsToSelector:@selector(removeObserverForObjectWithIdentifier: - observerIdentifier:keyPath:error:)], - @"FWFNSObjectHostApi api (%@) doesn't respond to " - @"@selector(removeObserverForObjectWithIdentifier:observerIdentifier:keyPath:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - NSInteger arg_observerIdentifier = [GetNullableObjectAtIndex(args, 1) integerValue]; - NSString *arg_keyPath = GetNullableObjectAtIndex(args, 2); - FlutterError *error; - [api removeObserverForObjectWithIdentifier:arg_identifier - observerIdentifier:arg_observerIdentifier - keyPath:arg_keyPath - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } -} -@interface FWFNSObjectFlutterApiCodecReader : FlutterStandardReader -@end -@implementation FWFNSObjectFlutterApiCodecReader -- (nullable id)readValueOfType:(UInt8)type { - switch (type) { - case 128: - return [FWFNSKeyValueChangeKeyEnumData fromList:[self readValue]]; - case 129: - return [FWFObjectOrIdentifier fromList:[self readValue]]; - default: - return [super readValueOfType:type]; - } -} -@end - -@interface FWFNSObjectFlutterApiCodecWriter : FlutterStandardWriter -@end -@implementation FWFNSObjectFlutterApiCodecWriter -- (void)writeValue:(id)value { - if ([value isKindOfClass:[FWFNSKeyValueChangeKeyEnumData class]]) { - [self writeByte:128]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FWFObjectOrIdentifier class]]) { - [self writeByte:129]; - [self writeValue:[value toList]]; - } else { - [super writeValue:value]; - } -} -@end - -@interface FWFNSObjectFlutterApiCodecReaderWriter : FlutterStandardReaderWriter -@end -@implementation FWFNSObjectFlutterApiCodecReaderWriter -- (FlutterStandardWriter *)writerWithData:(NSMutableData *)data { - return [[FWFNSObjectFlutterApiCodecWriter alloc] initWithData:data]; -} -- (FlutterStandardReader *)readerWithData:(NSData *)data { - return [[FWFNSObjectFlutterApiCodecReader alloc] initWithData:data]; -} -@end - -NSObject *FWFNSObjectFlutterApiGetCodec(void) { - static FlutterStandardMessageCodec *sSharedObject = nil; - static dispatch_once_t sPred = 0; - dispatch_once(&sPred, ^{ - FWFNSObjectFlutterApiCodecReaderWriter *readerWriter = - [[FWFNSObjectFlutterApiCodecReaderWriter alloc] init]; - sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; - }); - return sSharedObject; -} - -@interface FWFNSObjectFlutterApi () -@property(nonatomic, strong) NSObject *binaryMessenger; -@property(nonatomic, strong) NSString *messageChannelSuffix; -@end - -@implementation FWFNSObjectFlutterApi - -- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger { - return [self initWithBinaryMessenger:binaryMessenger messageChannelSuffix:@""]; -} -- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger - messageChannelSuffix:(nullable NSString *)messageChannelSuffix { - self = [self init]; - if (self) { - _binaryMessenger = binaryMessenger; - _messageChannelSuffix = [messageChannelSuffix length] == 0 - ? @"" - : [NSString stringWithFormat:@".%@", messageChannelSuffix]; - } - return self; -} -- (void)observeValueForObjectWithIdentifier:(NSInteger)arg_identifier - keyPath:(NSString *)arg_keyPath - objectIdentifier:(NSInteger)arg_objectIdentifier - changeKeys: - (NSArray *)arg_changeKeys - changeValues:(NSArray *)arg_changeValues - completion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", @"dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectFlutterApi.observeValue", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FWFNSObjectFlutterApiGetCodec()]; - [channel sendMessage:@[ - @(arg_identifier), arg_keyPath ?: [NSNull null], @(arg_objectIdentifier), - arg_changeKeys ?: [NSNull null], arg_changeValues ?: [NSNull null] - ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)disposeObjectWithIdentifier:(NSInteger)arg_identifier - completion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectFlutterApi.dispose", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FWFNSObjectFlutterApiGetCodec()]; - [channel sendMessage:@[ @(arg_identifier) ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -@end - -@interface FWFWKWebViewHostApiCodecReader : FlutterStandardReader -@end -@implementation FWFWKWebViewHostApiCodecReader -- (nullable id)readValueOfType:(UInt8)type { - switch (type) { - case 128: - return [FWFAuthenticationChallengeResponse fromList:[self readValue]]; - case 129: - return [FWFNSErrorData fromList:[self readValue]]; - case 130: - return [FWFNSHttpCookieData fromList:[self readValue]]; - case 131: - return [FWFNSHttpCookiePropertyKeyEnumData fromList:[self readValue]]; - case 132: - return [FWFNSHttpUrlResponseData fromList:[self readValue]]; - case 133: - return [FWFNSKeyValueChangeKeyEnumData fromList:[self readValue]]; - case 134: - return [FWFNSKeyValueObservingOptionsEnumData fromList:[self readValue]]; - case 135: - return [FWFNSUrlRequestData fromList:[self readValue]]; - case 136: - return [FWFObjectOrIdentifier fromList:[self readValue]]; - case 137: - return [FWFWKAudiovisualMediaTypeEnumData fromList:[self readValue]]; - case 138: - return [FWFWKFrameInfoData fromList:[self readValue]]; - case 139: - return [FWFWKMediaCaptureTypeData fromList:[self readValue]]; - case 140: - return [FWFWKNavigationActionData fromList:[self readValue]]; - case 141: - return [FWFWKNavigationActionPolicyEnumData fromList:[self readValue]]; - case 142: - return [FWFWKNavigationResponseData fromList:[self readValue]]; - case 143: - return [FWFWKPermissionDecisionData fromList:[self readValue]]; - case 144: - return [FWFWKScriptMessageData fromList:[self readValue]]; - case 145: - return [FWFWKSecurityOriginData fromList:[self readValue]]; - case 146: - return [FWFWKUserScriptData fromList:[self readValue]]; - case 147: - return [FWFWKUserScriptInjectionTimeEnumData fromList:[self readValue]]; - case 148: - return [FWFWKWebsiteDataTypeEnumData fromList:[self readValue]]; - default: - return [super readValueOfType:type]; - } -} -@end - -@interface FWFWKWebViewHostApiCodecWriter : FlutterStandardWriter -@end -@implementation FWFWKWebViewHostApiCodecWriter -- (void)writeValue:(id)value { - if ([value isKindOfClass:[FWFAuthenticationChallengeResponse class]]) { - [self writeByte:128]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FWFNSErrorData class]]) { - [self writeByte:129]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FWFNSHttpCookieData class]]) { - [self writeByte:130]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FWFNSHttpCookiePropertyKeyEnumData class]]) { - [self writeByte:131]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FWFNSHttpUrlResponseData class]]) { - [self writeByte:132]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FWFNSKeyValueChangeKeyEnumData class]]) { - [self writeByte:133]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FWFNSKeyValueObservingOptionsEnumData class]]) { - [self writeByte:134]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FWFNSUrlRequestData class]]) { - [self writeByte:135]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FWFObjectOrIdentifier class]]) { - [self writeByte:136]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FWFWKAudiovisualMediaTypeEnumData class]]) { - [self writeByte:137]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FWFWKFrameInfoData class]]) { - [self writeByte:138]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FWFWKMediaCaptureTypeData class]]) { - [self writeByte:139]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FWFWKNavigationActionData class]]) { - [self writeByte:140]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FWFWKNavigationActionPolicyEnumData class]]) { - [self writeByte:141]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FWFWKNavigationResponseData class]]) { - [self writeByte:142]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FWFWKPermissionDecisionData class]]) { - [self writeByte:143]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FWFWKScriptMessageData class]]) { - [self writeByte:144]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FWFWKSecurityOriginData class]]) { - [self writeByte:145]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FWFWKUserScriptData class]]) { - [self writeByte:146]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FWFWKUserScriptInjectionTimeEnumData class]]) { - [self writeByte:147]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FWFWKWebsiteDataTypeEnumData class]]) { - [self writeByte:148]; - [self writeValue:[value toList]]; - } else { - [super writeValue:value]; - } -} -@end - -@interface FWFWKWebViewHostApiCodecReaderWriter : FlutterStandardReaderWriter -@end -@implementation FWFWKWebViewHostApiCodecReaderWriter -- (FlutterStandardWriter *)writerWithData:(NSMutableData *)data { - return [[FWFWKWebViewHostApiCodecWriter alloc] initWithData:data]; -} -- (FlutterStandardReader *)readerWithData:(NSData *)data { - return [[FWFWKWebViewHostApiCodecReader alloc] initWithData:data]; -} -@end - -NSObject *FWFWKWebViewHostApiGetCodec(void) { - static FlutterStandardMessageCodec *sSharedObject = nil; - static dispatch_once_t sPred = 0; - dispatch_once(&sPred, ^{ - FWFWKWebViewHostApiCodecReaderWriter *readerWriter = - [[FWFWKWebViewHostApiCodecReaderWriter alloc] init]; - sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; - }); - return sSharedObject; -} - -void SetUpFWFWKWebViewHostApi(id binaryMessenger, - NSObject *api) { - SetUpFWFWKWebViewHostApiWithSuffix(binaryMessenger, api, @""); -} - -void SetUpFWFWKWebViewHostApiWithSuffix(id binaryMessenger, - NSObject *api, - NSString *messageChannelSuffix) { - messageChannelSuffix = messageChannelSuffix.length > 0 - ? [NSString stringWithFormat:@".%@", messageChannelSuffix] - : @""; - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKWebViewHostApi.create", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFWKWebViewHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(createWithIdentifier: - configurationIdentifier:error:)], - @"FWFWKWebViewHostApi api (%@) doesn't respond to " - @"@selector(createWithIdentifier:configurationIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - NSInteger arg_configurationIdentifier = [GetNullableObjectAtIndex(args, 1) integerValue]; - FlutterError *error; - [api createWithIdentifier:arg_identifier - configurationIdentifier:arg_configurationIdentifier - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKWebViewHostApi.setUIDelegate", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFWKWebViewHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(setUIDelegateForWebViewWithIdentifier: - delegateIdentifier:error:)], - @"FWFWKWebViewHostApi api (%@) doesn't respond to " - @"@selector(setUIDelegateForWebViewWithIdentifier:delegateIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - NSNumber *arg_uiDelegateIdentifier = GetNullableObjectAtIndex(args, 1); - FlutterError *error; - [api setUIDelegateForWebViewWithIdentifier:arg_identifier - delegateIdentifier:arg_uiDelegateIdentifier - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKWebViewHostApi.setNavigationDelegate", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFWKWebViewHostApiGetCodec()]; - if (api) { - NSCAssert( - [api respondsToSelector:@selector(setNavigationDelegateForWebViewWithIdentifier: - delegateIdentifier:error:)], - @"FWFWKWebViewHostApi api (%@) doesn't respond to " - @"@selector(setNavigationDelegateForWebViewWithIdentifier:delegateIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - NSNumber *arg_navigationDelegateIdentifier = GetNullableObjectAtIndex(args, 1); - FlutterError *error; - [api setNavigationDelegateForWebViewWithIdentifier:arg_identifier - delegateIdentifier:arg_navigationDelegateIdentifier - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKWebViewHostApi.getUrl", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFWKWebViewHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(URLForWebViewWithIdentifier:error:)], - @"FWFWKWebViewHostApi api (%@) doesn't respond to " - @"@selector(URLForWebViewWithIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - FlutterError *error; - NSString *output = [api URLForWebViewWithIdentifier:arg_identifier error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKWebViewHostApi.getEstimatedProgress", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFWKWebViewHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(estimatedProgressForWebViewWithIdentifier: - error:)], - @"FWFWKWebViewHostApi api (%@) doesn't respond to " - @"@selector(estimatedProgressForWebViewWithIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - FlutterError *error; - NSNumber *output = [api estimatedProgressForWebViewWithIdentifier:arg_identifier - error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKWebViewHostApi.loadRequest", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFWKWebViewHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(loadRequestForWebViewWithIdentifier: - request:error:)], - @"FWFWKWebViewHostApi api (%@) doesn't respond to " - @"@selector(loadRequestForWebViewWithIdentifier:request:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - FWFNSUrlRequestData *arg_request = GetNullableObjectAtIndex(args, 1); - FlutterError *error; - [api loadRequestForWebViewWithIdentifier:arg_identifier request:arg_request error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKWebViewHostApi.loadHtmlString", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFWKWebViewHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(loadHTMLForWebViewWithIdentifier: - HTMLString:baseURL:error:)], - @"FWFWKWebViewHostApi api (%@) doesn't respond to " - @"@selector(loadHTMLForWebViewWithIdentifier:HTMLString:baseURL:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - NSString *arg_string = GetNullableObjectAtIndex(args, 1); - NSString *arg_baseUrl = GetNullableObjectAtIndex(args, 2); - FlutterError *error; - [api loadHTMLForWebViewWithIdentifier:arg_identifier - HTMLString:arg_string - baseURL:arg_baseUrl - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKWebViewHostApi.loadFileUrl", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFWKWebViewHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector - (loadFileForWebViewWithIdentifier:fileURL:readAccessURL:error:)], - @"FWFWKWebViewHostApi api (%@) doesn't respond to " - @"@selector(loadFileForWebViewWithIdentifier:fileURL:readAccessURL:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - NSString *arg_url = GetNullableObjectAtIndex(args, 1); - NSString *arg_readAccessUrl = GetNullableObjectAtIndex(args, 2); - FlutterError *error; - [api loadFileForWebViewWithIdentifier:arg_identifier - fileURL:arg_url - readAccessURL:arg_readAccessUrl - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKWebViewHostApi.loadFlutterAsset", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFWKWebViewHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(loadAssetForWebViewWithIdentifier: - assetKey:error:)], - @"FWFWKWebViewHostApi api (%@) doesn't respond to " - @"@selector(loadAssetForWebViewWithIdentifier:assetKey:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - NSString *arg_key = GetNullableObjectAtIndex(args, 1); - FlutterError *error; - [api loadAssetForWebViewWithIdentifier:arg_identifier assetKey:arg_key error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKWebViewHostApi.canGoBack", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFWKWebViewHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(canGoBackForWebViewWithIdentifier:error:)], - @"FWFWKWebViewHostApi api (%@) doesn't respond to " - @"@selector(canGoBackForWebViewWithIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - FlutterError *error; - NSNumber *output = [api canGoBackForWebViewWithIdentifier:arg_identifier error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKWebViewHostApi.canGoForward", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFWKWebViewHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(canGoForwardForWebViewWithIdentifier:error:)], - @"FWFWKWebViewHostApi api (%@) doesn't respond to " - @"@selector(canGoForwardForWebViewWithIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - FlutterError *error; - NSNumber *output = [api canGoForwardForWebViewWithIdentifier:arg_identifier error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKWebViewHostApi.goBack", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFWKWebViewHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(goBackForWebViewWithIdentifier:error:)], - @"FWFWKWebViewHostApi api (%@) doesn't respond to " - @"@selector(goBackForWebViewWithIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - FlutterError *error; - [api goBackForWebViewWithIdentifier:arg_identifier error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKWebViewHostApi.goForward", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFWKWebViewHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(goForwardForWebViewWithIdentifier:error:)], - @"FWFWKWebViewHostApi api (%@) doesn't respond to " - @"@selector(goForwardForWebViewWithIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - FlutterError *error; - [api goForwardForWebViewWithIdentifier:arg_identifier error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKWebViewHostApi.reload", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFWKWebViewHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(reloadWebViewWithIdentifier:error:)], - @"FWFWKWebViewHostApi api (%@) doesn't respond to " - @"@selector(reloadWebViewWithIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - FlutterError *error; - [api reloadWebViewWithIdentifier:arg_identifier error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKWebViewHostApi.getTitle", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFWKWebViewHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(titleForWebViewWithIdentifier:error:)], - @"FWFWKWebViewHostApi api (%@) doesn't respond to " - @"@selector(titleForWebViewWithIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - FlutterError *error; - NSString *output = [api titleForWebViewWithIdentifier:arg_identifier error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKWebViewHostApi.setAllowsBackForwardNavigationGestures", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFWKWebViewHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector - (setAllowsBackForwardForWebViewWithIdentifier:isAllowed:error:)], - @"FWFWKWebViewHostApi api (%@) doesn't respond to " - @"@selector(setAllowsBackForwardForWebViewWithIdentifier:isAllowed:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - BOOL arg_allow = [GetNullableObjectAtIndex(args, 1) boolValue]; - FlutterError *error; - [api setAllowsBackForwardForWebViewWithIdentifier:arg_identifier - isAllowed:arg_allow - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKWebViewHostApi.setCustomUserAgent", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFWKWebViewHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector - (setCustomUserAgentForWebViewWithIdentifier:userAgent:error:)], - @"FWFWKWebViewHostApi api (%@) doesn't respond to " - @"@selector(setCustomUserAgentForWebViewWithIdentifier:userAgent:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - NSString *arg_userAgent = GetNullableObjectAtIndex(args, 1); - FlutterError *error; - [api setCustomUserAgentForWebViewWithIdentifier:arg_identifier - userAgent:arg_userAgent - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKWebViewHostApi.evaluateJavaScript", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFWKWebViewHostApiGetCodec()]; - if (api) { - NSCAssert( - [api respondsToSelector:@selector - (evaluateJavaScriptForWebViewWithIdentifier:javaScriptString:completion:)], - @"FWFWKWebViewHostApi api (%@) doesn't respond to " - @"@selector(evaluateJavaScriptForWebViewWithIdentifier:javaScriptString:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - NSString *arg_javaScriptString = GetNullableObjectAtIndex(args, 1); - [api evaluateJavaScriptForWebViewWithIdentifier:arg_identifier - javaScriptString:arg_javaScriptString - completion:^(id _Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKWebViewHostApi.setInspectable", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFWKWebViewHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(setInspectableForWebViewWithIdentifier: - inspectable:error:)], - @"FWFWKWebViewHostApi api (%@) doesn't respond to " - @"@selector(setInspectableForWebViewWithIdentifier:inspectable:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - BOOL arg_inspectable = [GetNullableObjectAtIndex(args, 1) boolValue]; - FlutterError *error; - [api setInspectableForWebViewWithIdentifier:arg_identifier - inspectable:arg_inspectable - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKWebViewHostApi.getCustomUserAgent", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFWKWebViewHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(customUserAgentForWebViewWithIdentifier:error:)], - @"FWFWKWebViewHostApi api (%@) doesn't respond to " - @"@selector(customUserAgentForWebViewWithIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - FlutterError *error; - NSString *output = [api customUserAgentForWebViewWithIdentifier:arg_identifier - error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } -} -NSObject *FWFWKUIDelegateHostApiGetCodec(void) { - static FlutterStandardMessageCodec *sSharedObject = nil; - sSharedObject = [FlutterStandardMessageCodec sharedInstance]; - return sSharedObject; -} - -void SetUpFWFWKUIDelegateHostApi(id binaryMessenger, - NSObject *api) { - SetUpFWFWKUIDelegateHostApiWithSuffix(binaryMessenger, api, @""); -} - -void SetUpFWFWKUIDelegateHostApiWithSuffix(id binaryMessenger, - NSObject *api, - NSString *messageChannelSuffix) { - messageChannelSuffix = messageChannelSuffix.length > 0 - ? [NSString stringWithFormat:@".%@", messageChannelSuffix] - : @""; - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKUIDelegateHostApi.create", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFWKUIDelegateHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(createWithIdentifier:error:)], - @"FWFWKUIDelegateHostApi api (%@) doesn't respond to " - @"@selector(createWithIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - FlutterError *error; - [api createWithIdentifier:arg_identifier error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } -} -@interface FWFWKUIDelegateFlutterApiCodecReader : FlutterStandardReader -@end -@implementation FWFWKUIDelegateFlutterApiCodecReader -- (nullable id)readValueOfType:(UInt8)type { - switch (type) { - case 128: - return [FWFNSUrlRequestData fromList:[self readValue]]; - case 129: - return [FWFWKFrameInfoData fromList:[self readValue]]; - case 130: - return [FWFWKMediaCaptureTypeData fromList:[self readValue]]; - case 131: - return [FWFWKNavigationActionData fromList:[self readValue]]; - case 132: - return [FWFWKPermissionDecisionData fromList:[self readValue]]; - case 133: - return [FWFWKSecurityOriginData fromList:[self readValue]]; - default: - return [super readValueOfType:type]; - } -} -@end - -@interface FWFWKUIDelegateFlutterApiCodecWriter : FlutterStandardWriter -@end -@implementation FWFWKUIDelegateFlutterApiCodecWriter -- (void)writeValue:(id)value { - if ([value isKindOfClass:[FWFNSUrlRequestData class]]) { - [self writeByte:128]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FWFWKFrameInfoData class]]) { - [self writeByte:129]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FWFWKMediaCaptureTypeData class]]) { - [self writeByte:130]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FWFWKNavigationActionData class]]) { - [self writeByte:131]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FWFWKPermissionDecisionData class]]) { - [self writeByte:132]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FWFWKSecurityOriginData class]]) { - [self writeByte:133]; - [self writeValue:[value toList]]; - } else { - [super writeValue:value]; - } -} -@end - -@interface FWFWKUIDelegateFlutterApiCodecReaderWriter : FlutterStandardReaderWriter -@end -@implementation FWFWKUIDelegateFlutterApiCodecReaderWriter -- (FlutterStandardWriter *)writerWithData:(NSMutableData *)data { - return [[FWFWKUIDelegateFlutterApiCodecWriter alloc] initWithData:data]; -} -- (FlutterStandardReader *)readerWithData:(NSData *)data { - return [[FWFWKUIDelegateFlutterApiCodecReader alloc] initWithData:data]; -} -@end - -NSObject *FWFWKUIDelegateFlutterApiGetCodec(void) { - static FlutterStandardMessageCodec *sSharedObject = nil; - static dispatch_once_t sPred = 0; - dispatch_once(&sPred, ^{ - FWFWKUIDelegateFlutterApiCodecReaderWriter *readerWriter = - [[FWFWKUIDelegateFlutterApiCodecReaderWriter alloc] init]; - sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; - }); - return sSharedObject; -} - -@interface FWFWKUIDelegateFlutterApi () -@property(nonatomic, strong) NSObject *binaryMessenger; -@property(nonatomic, strong) NSString *messageChannelSuffix; -@end - -@implementation FWFWKUIDelegateFlutterApi - -- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger { - return [self initWithBinaryMessenger:binaryMessenger messageChannelSuffix:@""]; -} -- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger - messageChannelSuffix:(nullable NSString *)messageChannelSuffix { - self = [self init]; - if (self) { - _binaryMessenger = binaryMessenger; - _messageChannelSuffix = [messageChannelSuffix length] == 0 - ? @"" - : [NSString stringWithFormat:@".%@", messageChannelSuffix]; - } - return self; -} -- (void)onCreateWebViewForDelegateWithIdentifier:(NSInteger)arg_identifier - webViewIdentifier:(NSInteger)arg_webViewIdentifier - configurationIdentifier:(NSInteger)arg_configurationIdentifier - navigationAction:(FWFWKNavigationActionData *)arg_navigationAction - completion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateFlutterApi.onCreateWebView", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FWFWKUIDelegateFlutterApiGetCodec()]; - [channel sendMessage:@[ - @(arg_identifier), @(arg_webViewIdentifier), @(arg_configurationIdentifier), - arg_navigationAction ?: [NSNull null] - ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)requestMediaCapturePermissionForDelegateWithIdentifier:(NSInteger)arg_identifier - webViewIdentifier:(NSInteger)arg_webViewIdentifier - origin:(FWFWKSecurityOriginData *)arg_origin - frame:(FWFWKFrameInfoData *)arg_frame - type:(FWFWKMediaCaptureTypeData *)arg_type - completion: - (void (^)( - FWFWKPermissionDecisionData *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKUIDelegateFlutterApi.requestMediaCapturePermission", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FWFWKUIDelegateFlutterApiGetCodec()]; - [channel sendMessage:@[ - @(arg_identifier), @(arg_webViewIdentifier), arg_origin ?: [NSNull null], - arg_frame ?: [NSNull null], arg_type ?: [NSNull null] - ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - FWFWKPermissionDecisionData *output = - reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)runJavaScriptAlertPanelForDelegateWithIdentifier:(NSInteger)arg_identifier - message:(NSString *)arg_message - frame:(FWFWKFrameInfoData *)arg_frame - completion: - (void (^)(FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKUIDelegateFlutterApi.runJavaScriptAlertPanel", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FWFWKUIDelegateFlutterApiGetCodec()]; - [channel - sendMessage:@[ @(arg_identifier), arg_message ?: [NSNull null], arg_frame ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)runJavaScriptConfirmPanelForDelegateWithIdentifier:(NSInteger)arg_identifier - message:(NSString *)arg_message - frame:(FWFWKFrameInfoData *)arg_frame - completion: - (void (^)(NSNumber *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKUIDelegateFlutterApi.runJavaScriptConfirmPanel", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FWFWKUIDelegateFlutterApiGetCodec()]; - [channel - sendMessage:@[ @(arg_identifier), arg_message ?: [NSNull null], arg_frame ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)runJavaScriptTextInputPanelForDelegateWithIdentifier:(NSInteger)arg_identifier - prompt:(NSString *)arg_prompt - defaultText:(NSString *)arg_defaultText - frame:(FWFWKFrameInfoData *)arg_frame - completion:(void (^)(NSString *_Nullable, - FlutterError *_Nullable)) - completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKUIDelegateFlutterApi.runJavaScriptTextInputPanel", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FWFWKUIDelegateFlutterApiGetCodec()]; - [channel sendMessage:@[ - @(arg_identifier), arg_prompt ?: [NSNull null], arg_defaultText ?: [NSNull null], - arg_frame ?: [NSNull null] - ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -@end - -@interface FWFWKHttpCookieStoreHostApiCodecReader : FlutterStandardReader -@end -@implementation FWFWKHttpCookieStoreHostApiCodecReader -- (nullable id)readValueOfType:(UInt8)type { - switch (type) { - case 128: - return [FWFNSHttpCookieData fromList:[self readValue]]; - case 129: - return [FWFNSHttpCookiePropertyKeyEnumData fromList:[self readValue]]; - default: - return [super readValueOfType:type]; - } -} -@end - -@interface FWFWKHttpCookieStoreHostApiCodecWriter : FlutterStandardWriter -@end -@implementation FWFWKHttpCookieStoreHostApiCodecWriter -- (void)writeValue:(id)value { - if ([value isKindOfClass:[FWFNSHttpCookieData class]]) { - [self writeByte:128]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FWFNSHttpCookiePropertyKeyEnumData class]]) { - [self writeByte:129]; - [self writeValue:[value toList]]; - } else { - [super writeValue:value]; - } -} -@end - -@interface FWFWKHttpCookieStoreHostApiCodecReaderWriter : FlutterStandardReaderWriter -@end -@implementation FWFWKHttpCookieStoreHostApiCodecReaderWriter -- (FlutterStandardWriter *)writerWithData:(NSMutableData *)data { - return [[FWFWKHttpCookieStoreHostApiCodecWriter alloc] initWithData:data]; -} -- (FlutterStandardReader *)readerWithData:(NSData *)data { - return [[FWFWKHttpCookieStoreHostApiCodecReader alloc] initWithData:data]; -} -@end - -NSObject *FWFWKHttpCookieStoreHostApiGetCodec(void) { - static FlutterStandardMessageCodec *sSharedObject = nil; - static dispatch_once_t sPred = 0; - dispatch_once(&sPred, ^{ - FWFWKHttpCookieStoreHostApiCodecReaderWriter *readerWriter = - [[FWFWKHttpCookieStoreHostApiCodecReaderWriter alloc] init]; - sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; - }); - return sSharedObject; -} - -void SetUpFWFWKHttpCookieStoreHostApi(id binaryMessenger, - NSObject *api) { - SetUpFWFWKHttpCookieStoreHostApiWithSuffix(binaryMessenger, api, @""); -} - -void SetUpFWFWKHttpCookieStoreHostApiWithSuffix(id binaryMessenger, - NSObject *api, - NSString *messageChannelSuffix) { - messageChannelSuffix = messageChannelSuffix.length > 0 - ? [NSString stringWithFormat:@".%@", messageChannelSuffix] - : @""; - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKHttpCookieStoreHostApi.createFromWebsiteDataStore", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFWKHttpCookieStoreHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(createFromWebsiteDataStoreWithIdentifier: - dataStoreIdentifier:error:)], - @"FWFWKHttpCookieStoreHostApi api (%@) doesn't respond to " - @"@selector(createFromWebsiteDataStoreWithIdentifier:dataStoreIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - NSInteger arg_websiteDataStoreIdentifier = [GetNullableObjectAtIndex(args, 1) integerValue]; - FlutterError *error; - [api createFromWebsiteDataStoreWithIdentifier:arg_identifier - dataStoreIdentifier:arg_websiteDataStoreIdentifier - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKHttpCookieStoreHostApi.setCookie", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFWKHttpCookieStoreHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(setCookieForStoreWithIdentifier: - cookie:completion:)], - @"FWFWKHttpCookieStoreHostApi api (%@) doesn't respond to " - @"@selector(setCookieForStoreWithIdentifier:cookie:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - FWFNSHttpCookieData *arg_cookie = GetNullableObjectAtIndex(args, 1); - [api setCookieForStoreWithIdentifier:arg_identifier - cookie:arg_cookie - completion:^(FlutterError *_Nullable error) { - callback(wrapResult(nil, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } -} -NSObject *FWFNSUrlHostApiGetCodec(void) { - static FlutterStandardMessageCodec *sSharedObject = nil; - sSharedObject = [FlutterStandardMessageCodec sharedInstance]; - return sSharedObject; -} - -void SetUpFWFNSUrlHostApi(id binaryMessenger, - NSObject *api) { - SetUpFWFNSUrlHostApiWithSuffix(binaryMessenger, api, @""); -} - -void SetUpFWFNSUrlHostApiWithSuffix(id binaryMessenger, - NSObject *api, - NSString *messageChannelSuffix) { - messageChannelSuffix = messageChannelSuffix.length > 0 - ? [NSString stringWithFormat:@".%@", messageChannelSuffix] - : @""; - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"NSUrlHostApi.getAbsoluteString", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFNSUrlHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(absoluteStringForNSURLWithIdentifier:error:)], - @"FWFNSUrlHostApi api (%@) doesn't respond to " - @"@selector(absoluteStringForNSURLWithIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - FlutterError *error; - NSString *output = [api absoluteStringForNSURLWithIdentifier:arg_identifier error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } -} -NSObject *FWFNSUrlFlutterApiGetCodec(void) { - static FlutterStandardMessageCodec *sSharedObject = nil; - sSharedObject = [FlutterStandardMessageCodec sharedInstance]; - return sSharedObject; -} - -@interface FWFNSUrlFlutterApi () -@property(nonatomic, strong) NSObject *binaryMessenger; -@property(nonatomic, strong) NSString *messageChannelSuffix; -@end - -@implementation FWFNSUrlFlutterApi - -- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger { - return [self initWithBinaryMessenger:binaryMessenger messageChannelSuffix:@""]; -} -- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger - messageChannelSuffix:(nullable NSString *)messageChannelSuffix { - self = [self init]; - if (self) { - _binaryMessenger = binaryMessenger; - _messageChannelSuffix = [messageChannelSuffix length] == 0 - ? @"" - : [NSString stringWithFormat:@".%@", messageChannelSuffix]; - } - return self; -} -- (void)createWithIdentifier:(NSInteger)arg_identifier - completion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview.NSUrlFlutterApi.create", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FWFNSUrlFlutterApiGetCodec()]; - [channel sendMessage:@[ @(arg_identifier) ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -@end - -NSObject *FWFUIScrollViewDelegateHostApiGetCodec(void) { - static FlutterStandardMessageCodec *sSharedObject = nil; - sSharedObject = [FlutterStandardMessageCodec sharedInstance]; - return sSharedObject; -} - -void SetUpFWFUIScrollViewDelegateHostApi(id binaryMessenger, - NSObject *api) { - SetUpFWFUIScrollViewDelegateHostApiWithSuffix(binaryMessenger, api, @""); -} - -void SetUpFWFUIScrollViewDelegateHostApiWithSuffix(id binaryMessenger, - NSObject *api, - NSString *messageChannelSuffix) { - messageChannelSuffix = messageChannelSuffix.length > 0 - ? [NSString stringWithFormat:@".%@", messageChannelSuffix] - : @""; - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"UIScrollViewDelegateHostApi.create", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFUIScrollViewDelegateHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(createWithIdentifier:error:)], - @"FWFUIScrollViewDelegateHostApi api (%@) doesn't respond to " - @"@selector(createWithIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - FlutterError *error; - [api createWithIdentifier:arg_identifier error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } -} -NSObject *FWFUIScrollViewDelegateFlutterApiGetCodec(void) { - static FlutterStandardMessageCodec *sSharedObject = nil; - sSharedObject = [FlutterStandardMessageCodec sharedInstance]; - return sSharedObject; -} - -@interface FWFUIScrollViewDelegateFlutterApi () -@property(nonatomic, strong) NSObject *binaryMessenger; -@property(nonatomic, strong) NSString *messageChannelSuffix; -@end - -@implementation FWFUIScrollViewDelegateFlutterApi - -- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger { - return [self initWithBinaryMessenger:binaryMessenger messageChannelSuffix:@""]; -} -- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger - messageChannelSuffix:(nullable NSString *)messageChannelSuffix { - self = [self init]; - if (self) { - _binaryMessenger = binaryMessenger; - _messageChannelSuffix = [messageChannelSuffix length] == 0 - ? @"" - : [NSString stringWithFormat:@".%@", messageChannelSuffix]; - } - return self; -} -- (void)scrollViewDidScrollWithIdentifier:(NSInteger)arg_identifier - UIScrollViewIdentifier:(NSInteger)arg_uiScrollViewIdentifier - x:(double)arg_x - y:(double)arg_y - completion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"UIScrollViewDelegateFlutterApi.scrollViewDidScroll", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FWFUIScrollViewDelegateFlutterApiGetCodec()]; - [channel sendMessage:@[ @(arg_identifier), @(arg_uiScrollViewIdentifier), @(arg_x), @(arg_y) ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -@end - -NSObject *FWFNSUrlCredentialHostApiGetCodec(void) { - static FlutterStandardMessageCodec *sSharedObject = nil; - sSharedObject = [FlutterStandardMessageCodec sharedInstance]; - return sSharedObject; -} - -void SetUpFWFNSUrlCredentialHostApi(id binaryMessenger, - NSObject *api) { - SetUpFWFNSUrlCredentialHostApiWithSuffix(binaryMessenger, api, @""); -} - -void SetUpFWFNSUrlCredentialHostApiWithSuffix(id binaryMessenger, - NSObject *api, - NSString *messageChannelSuffix) { - messageChannelSuffix = messageChannelSuffix.length > 0 - ? [NSString stringWithFormat:@".%@", messageChannelSuffix] - : @""; - /// Create a new native instance and add it to the `InstanceManager`. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"NSUrlCredentialHostApi.createWithUser", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FWFNSUrlCredentialHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector - (createWithUserWithIdentifier:user:password:persistence:error:)], - @"FWFNSUrlCredentialHostApi api (%@) doesn't respond to " - @"@selector(createWithUserWithIdentifier:user:password:persistence:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_identifier = [GetNullableObjectAtIndex(args, 0) integerValue]; - NSString *arg_user = GetNullableObjectAtIndex(args, 1); - NSString *arg_password = GetNullableObjectAtIndex(args, 2); - FWFNSUrlCredentialPersistence arg_persistence = - [GetNullableObjectAtIndex(args, 3) integerValue]; - FlutterError *error; - [api createWithUserWithIdentifier:arg_identifier - user:arg_user - password:arg_password - persistence:arg_persistence - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } -} -NSObject *FWFNSUrlProtectionSpaceFlutterApiGetCodec(void) { - static FlutterStandardMessageCodec *sSharedObject = nil; - sSharedObject = [FlutterStandardMessageCodec sharedInstance]; - return sSharedObject; -} - -@interface FWFNSUrlProtectionSpaceFlutterApi () -@property(nonatomic, strong) NSObject *binaryMessenger; -@property(nonatomic, strong) NSString *messageChannelSuffix; -@end - -@implementation FWFNSUrlProtectionSpaceFlutterApi - -- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger { - return [self initWithBinaryMessenger:binaryMessenger messageChannelSuffix:@""]; -} -- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger - messageChannelSuffix:(nullable NSString *)messageChannelSuffix { - self = [self init]; - if (self) { - _binaryMessenger = binaryMessenger; - _messageChannelSuffix = [messageChannelSuffix length] == 0 - ? @"" - : [NSString stringWithFormat:@".%@", messageChannelSuffix]; - } - return self; -} -- (void)createWithIdentifier:(NSInteger)arg_identifier - host:(nullable NSString *)arg_host - realm:(nullable NSString *)arg_realm - authenticationMethod:(nullable NSString *)arg_authenticationMethod - completion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview.NSUrlProtectionSpaceFlutterApi.create", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FWFNSUrlProtectionSpaceFlutterApiGetCodec()]; - [channel sendMessage:@[ - @(arg_identifier), arg_host ?: [NSNull null], arg_realm ?: [NSNull null], - arg_authenticationMethod ?: [NSNull null] - ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -@end - -NSObject *FWFNSUrlAuthenticationChallengeFlutterApiGetCodec(void) { - static FlutterStandardMessageCodec *sSharedObject = nil; - sSharedObject = [FlutterStandardMessageCodec sharedInstance]; - return sSharedObject; -} - -@interface FWFNSUrlAuthenticationChallengeFlutterApi () -@property(nonatomic, strong) NSObject *binaryMessenger; -@property(nonatomic, strong) NSString *messageChannelSuffix; -@end - -@implementation FWFNSUrlAuthenticationChallengeFlutterApi - -- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger { - return [self initWithBinaryMessenger:binaryMessenger messageChannelSuffix:@""]; -} -- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger - messageChannelSuffix:(nullable NSString *)messageChannelSuffix { - self = [self init]; - if (self) { - _binaryMessenger = binaryMessenger; - _messageChannelSuffix = [messageChannelSuffix length] == 0 - ? @"" - : [NSString stringWithFormat:@".%@", messageChannelSuffix]; - } - return self; -} -- (void)createWithIdentifier:(NSInteger)arg_identifier - protectionSpaceIdentifier:(NSInteger)arg_protectionSpaceIdentifier - completion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.webview_flutter_wkwebview." - @"NSUrlAuthenticationChallengeFlutterApi.create", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FWFNSUrlAuthenticationChallengeFlutterApiGetCodec()]; - [channel sendMessage:@[ @(arg_identifier), @(arg_protectionSpaceIdentifier) ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -@end diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFHTTPCookieStoreHostApi.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFHTTPCookieStoreHostApi.m deleted file mode 100644 index a2eb675286a..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFHTTPCookieStoreHostApi.m +++ /dev/null @@ -1,46 +0,0 @@ -// 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 "./include/webview_flutter_wkwebview/FWFHTTPCookieStoreHostApi.h" -#import "./include/webview_flutter_wkwebview/FWFDataConverters.h" -#import "./include/webview_flutter_wkwebview/FWFWebsiteDataStoreHostApi.h" - -@interface FWFHTTPCookieStoreHostApiImpl () -// InstanceManager must be weak to prevent a circular reference with the object it stores. -@property(nonatomic, weak) FWFInstanceManager *instanceManager; -@end - -@implementation FWFHTTPCookieStoreHostApiImpl -- (instancetype)initWithInstanceManager:(FWFInstanceManager *)instanceManager { - self = [self init]; - if (self) { - _instanceManager = instanceManager; - } - return self; -} - -- (WKHTTPCookieStore *)HTTPCookieStoreForIdentifier:(NSInteger)identifier { - return (WKHTTPCookieStore *)[self.instanceManager instanceForIdentifier:identifier]; -} - -- (void)createFromWebsiteDataStoreWithIdentifier:(NSInteger)identifier - dataStoreIdentifier:(NSInteger)websiteDataStoreIdentifier - error:(FlutterError *_Nullable __autoreleasing *_Nonnull) - error { - WKWebsiteDataStore *dataStore = - (WKWebsiteDataStore *)[self.instanceManager instanceForIdentifier:websiteDataStoreIdentifier]; - [self.instanceManager addDartCreatedInstance:dataStore.httpCookieStore withIdentifier:identifier]; -} - -- (void)setCookieForStoreWithIdentifier:(NSInteger)identifier - cookie:(nonnull FWFNSHttpCookieData *)cookie - completion:(nonnull void (^)(FlutterError *_Nullable))completion { - NSHTTPCookie *nsCookie = FWFNativeNSHTTPCookieFromCookieData(cookie); - - [[self HTTPCookieStoreForIdentifier:identifier] setCookie:nsCookie - completionHandler:^{ - completion(nil); - }]; -} -@end diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFInstanceManager.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFInstanceManager.m deleted file mode 100644 index 26182be6391..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFInstanceManager.m +++ /dev/null @@ -1,173 +0,0 @@ -// 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 "./include/webview_flutter_wkwebview/FWFInstanceManager.h" -#import "./include/webview_flutter_wkwebview/FWFInstanceManager_Test.h" - -#import - -// Attaches to an object to receive a callback when the object is deallocated. -@interface FWFFinalizer : NSObject -@end - -// Attaches to an object to receive a callback when the object is deallocated. -@implementation FWFFinalizer { - long _identifier; - // Callbacks are no longer made once FWFInstanceManager is inaccessible. - FWFOnDeallocCallback __weak _callback; -} - -- (instancetype)initWithIdentifier:(long)identifier callback:(FWFOnDeallocCallback)callback { - self = [self init]; - if (self) { - _identifier = identifier; - _callback = callback; - } - return self; -} - -+ (void)attachToInstance:(NSObject *)instance - withIdentifier:(long)identifier - callback:(FWFOnDeallocCallback)callback { - FWFFinalizer *finalizer = [[FWFFinalizer alloc] initWithIdentifier:identifier callback:callback]; - objc_setAssociatedObject(instance, _cmd, finalizer, OBJC_ASSOCIATION_RETAIN); -} - -+ (void)detachFromInstance:(NSObject *)instance { - objc_setAssociatedObject(instance, @selector(attachToInstance:withIdentifier:callback:), nil, - OBJC_ASSOCIATION_ASSIGN); -} - -- (void)dealloc { - if (_callback) { - _callback(_identifier); - } -} -@end - -@interface FWFInstanceManager () -@property dispatch_queue_t lockQueue; -@property NSMapTable *identifiers; -@property NSMapTable *weakInstances; -@property NSMapTable *strongInstances; -@end - -@implementation FWFInstanceManager -// Identifiers are locked to a specific range to avoid collisions with objects -// created simultaneously from Dart. -// Host uses identifiers >= 2^16 and Dart is expected to use values n where, -// 0 <= n < 2^16. -static long const FWFMinHostCreatedIdentifier = 65536; - -- (instancetype)init { - self = [super init]; - if (self) { - _deallocCallback = _deallocCallback ? _deallocCallback : ^(long identifier) { - }; - _lockQueue = dispatch_queue_create("FWFInstanceManager", DISPATCH_QUEUE_SERIAL); - // Pointer equality is used to prevent collisions of objects that override the `isEqualTo:` - // method. - _identifiers = - [NSMapTable mapTableWithKeyOptions:NSMapTableWeakMemory | NSMapTableObjectPointerPersonality - valueOptions:NSMapTableStrongMemory]; - _weakInstances = [NSMapTable - mapTableWithKeyOptions:NSMapTableStrongMemory - valueOptions:NSMapTableWeakMemory | NSMapTableObjectPointerPersonality]; - _strongInstances = [NSMapTable - mapTableWithKeyOptions:NSMapTableStrongMemory - valueOptions:NSMapTableStrongMemory | NSMapTableObjectPointerPersonality]; - _nextIdentifier = FWFMinHostCreatedIdentifier; - } - return self; -} - -- (instancetype)initWithDeallocCallback:(FWFOnDeallocCallback)callback { - self = [self init]; - if (self) { - _deallocCallback = callback; - } - return self; -} - -- (void)addDartCreatedInstance:(NSObject *)instance withIdentifier:(long)instanceIdentifier { - NSParameterAssert(instance); - NSParameterAssert(instanceIdentifier >= 0); - dispatch_async(_lockQueue, ^{ - [self addInstance:instance withIdentifier:instanceIdentifier]; - }); -} - -- (long)addHostCreatedInstance:(nonnull NSObject *)instance { - NSParameterAssert(instance); - long __block identifier = -1; - dispatch_sync(_lockQueue, ^{ - identifier = self.nextIdentifier++; - [self addInstance:instance withIdentifier:identifier]; - }); - return identifier; -} - -- (nullable NSObject *)removeInstanceWithIdentifier:(long)instanceIdentifier { - NSObject *__block instance = nil; - dispatch_sync(_lockQueue, ^{ - instance = [self.strongInstances objectForKey:@(instanceIdentifier)]; - if (instance) { - [self.strongInstances removeObjectForKey:@(instanceIdentifier)]; - } - }); - return instance; -} - -- (nullable NSObject *)instanceForIdentifier:(long)instanceIdentifier { - NSObject *__block instance = nil; - dispatch_sync(_lockQueue, ^{ - instance = [self.weakInstances objectForKey:@(instanceIdentifier)]; - }); - return instance; -} - -- (void)addInstance:(nonnull NSObject *)instance withIdentifier:(long)instanceIdentifier { - [self.identifiers setObject:@(instanceIdentifier) forKey:instance]; - [self.weakInstances setObject:instance forKey:@(instanceIdentifier)]; - [self.strongInstances setObject:instance forKey:@(instanceIdentifier)]; - [FWFFinalizer attachToInstance:instance - withIdentifier:instanceIdentifier - callback:self.deallocCallback]; -} - -- (long)identifierWithStrongReferenceForInstance:(nonnull NSObject *)instance { - NSNumber *__block identifierNumber = nil; - dispatch_sync(_lockQueue, ^{ - identifierNumber = [self.identifiers objectForKey:instance]; - if (identifierNumber != nil) { - [self.strongInstances setObject:instance forKey:identifierNumber]; - } - }); - return identifierNumber != nil ? identifierNumber.longValue : NSNotFound; -} - -- (BOOL)containsInstance:(nonnull NSObject *)instance { - BOOL __block containsInstance; - dispatch_sync(_lockQueue, ^{ - containsInstance = [self.identifiers objectForKey:instance] != nil; - }); - return containsInstance; -} - -- (NSUInteger)strongInstanceCount { - NSUInteger __block count = -1; - dispatch_sync(_lockQueue, ^{ - count = self.strongInstances.count; - }); - return count; -} - -- (NSUInteger)weakInstanceCount { - NSUInteger __block count = -1; - dispatch_sync(_lockQueue, ^{ - count = self.weakInstances.count; - }); - return count; -} -@end diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFNavigationDelegateHostApi.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFNavigationDelegateHostApi.m deleted file mode 100644 index d862de22620..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFNavigationDelegateHostApi.m +++ /dev/null @@ -1,327 +0,0 @@ -// 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 "./include/webview_flutter_wkwebview/FWFNavigationDelegateHostApi.h" -#import "./include/webview_flutter_wkwebview/FWFDataConverters.h" -#import "./include/webview_flutter_wkwebview/FWFURLAuthenticationChallengeHostApi.h" -#import "./include/webview_flutter_wkwebview/FWFWebViewConfigurationHostApi.h" - -@interface FWFNavigationDelegateFlutterApiImpl () -// BinaryMessenger must be weak to prevent a circular reference with the host API it -// references. -@property(nonatomic, weak) id binaryMessenger; -// InstanceManager must be weak to prevent a circular reference with the object it stores. -@property(nonatomic, weak) FWFInstanceManager *instanceManager; -@end - -@implementation FWFNavigationDelegateFlutterApiImpl -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - instanceManager:(FWFInstanceManager *)instanceManager { - self = [self initWithBinaryMessenger:binaryMessenger]; - if (self) { - _binaryMessenger = binaryMessenger; - _instanceManager = instanceManager; - } - return self; -} - -- (long)identifierForDelegate:(FWFNavigationDelegate *)instance { - return [self.instanceManager identifierWithStrongReferenceForInstance:instance]; -} - -- (void)didFinishNavigationForDelegate:(FWFNavigationDelegate *)instance - webView:(WKWebView *)webView - URL:(NSString *)URL - completion:(void (^)(FlutterError *_Nullable))completion { - NSInteger webViewIdentifier = - [self.instanceManager identifierWithStrongReferenceForInstance:webView]; - [self didFinishNavigationForDelegateWithIdentifier:[self identifierForDelegate:instance] - webViewIdentifier:webViewIdentifier - URL:URL - completion:completion]; -} - -- (void)didStartProvisionalNavigationForDelegate:(FWFNavigationDelegate *)instance - webView:(WKWebView *)webView - URL:(NSString *)URL - completion:(void (^)(FlutterError *_Nullable))completion { - NSInteger webViewIdentifier = - [self.instanceManager identifierWithStrongReferenceForInstance:webView]; - [self didStartProvisionalNavigationForDelegateWithIdentifier:[self identifierForDelegate:instance] - webViewIdentifier:webViewIdentifier - URL:URL - completion:completion]; -} - -- (void) - decidePolicyForNavigationActionForDelegate:(FWFNavigationDelegate *)instance - webView:(WKWebView *)webView - navigationAction:(WKNavigationAction *)navigationAction - completion: - (void (^)(FWFWKNavigationActionPolicyEnumData *_Nullable, - FlutterError *_Nullable))completion { - NSInteger webViewIdentifier = - [self.instanceManager identifierWithStrongReferenceForInstance:webView]; - FWFWKNavigationActionData *navigationActionData = - FWFWKNavigationActionDataFromNativeWKNavigationAction(navigationAction); - [self - decidePolicyForNavigationActionForDelegateWithIdentifier:[self identifierForDelegate:instance] - webViewIdentifier:webViewIdentifier - navigationAction:navigationActionData - completion:completion]; -} - -- (void)decidePolicyForNavigationResponseForDelegate:(FWFNavigationDelegate *)instance - webView:(WKWebView *)webView - navigationResponse:(WKNavigationResponse *)navigationResponse - completion: - (void (^)(FWFWKNavigationResponsePolicyEnumBox *, - FlutterError *_Nullable))completion { - NSInteger webViewIdentifier = - [self.instanceManager identifierWithStrongReferenceForInstance:webView]; - FWFWKNavigationResponseData *navigationResponseData = - FWFWKNavigationResponseDataFromNativeNavigationResponse(navigationResponse); - [self - decidePolicyForNavigationResponseForDelegateWithIdentifier:[self - identifierForDelegate:instance] - webViewIdentifier:webViewIdentifier - navigationResponse:navigationResponseData - completion:completion]; -} - -- (void)didFailNavigationForDelegate:(FWFNavigationDelegate *)instance - webView:(WKWebView *)webView - error:(NSError *)error - completion:(void (^)(FlutterError *_Nullable))completion { - NSInteger webViewIdentifier = - [self.instanceManager identifierWithStrongReferenceForInstance:webView]; - [self didFailNavigationForDelegateWithIdentifier:[self identifierForDelegate:instance] - webViewIdentifier:webViewIdentifier - error:FWFNSErrorDataFromNativeNSError(error) - completion:completion]; -} - -- (void)didFailProvisionalNavigationForDelegate:(FWFNavigationDelegate *)instance - webView:(WKWebView *)webView - error:(NSError *)error - completion:(void (^)(FlutterError *_Nullable))completion { - NSInteger webViewIdentifier = - [self.instanceManager identifierWithStrongReferenceForInstance:webView]; - [self didFailProvisionalNavigationForDelegateWithIdentifier:[self identifierForDelegate:instance] - webViewIdentifier:webViewIdentifier - error:FWFNSErrorDataFromNativeNSError(error) - completion:completion]; -} - -- (void)webViewWebContentProcessDidTerminateForDelegate:(FWFNavigationDelegate *)instance - webView:(WKWebView *)webView - completion: - (void (^)(FlutterError *_Nullable))completion { - NSInteger webViewIdentifier = - [self.instanceManager identifierWithStrongReferenceForInstance:webView]; - [self webViewWebContentProcessDidTerminateForDelegateWithIdentifier: - [self identifierForDelegate:instance] - webViewIdentifier:webViewIdentifier - completion:completion]; -} - -- (void) - didReceiveAuthenticationChallengeForDelegate:(FWFNavigationDelegate *)instance - webView:(WKWebView *)webView - challenge:(NSURLAuthenticationChallenge *)challenge - completion: - (void (^)(FWFAuthenticationChallengeResponse *_Nullable, - FlutterError *_Nullable))completion { - NSInteger webViewIdentifier = - [self.instanceManager identifierWithStrongReferenceForInstance:webView]; - - FWFURLAuthenticationChallengeFlutterApiImpl *challengeApi = - [[FWFURLAuthenticationChallengeFlutterApiImpl alloc] - initWithBinaryMessenger:self.binaryMessenger - instanceManager:self.instanceManager]; - [challengeApi createWithInstance:challenge - protectionSpace:challenge.protectionSpace - completion:^(FlutterError *error) { - NSAssert(!error, @"%@", error); - }]; - - [self - didReceiveAuthenticationChallengeForDelegateWithIdentifier:[self - identifierForDelegate:instance] - webViewIdentifier:webViewIdentifier - challengeIdentifier: - [self.instanceManager - identifierWithStrongReferenceForInstance: - challenge] - completion:completion]; -} -@end - -@implementation FWFNavigationDelegate -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - instanceManager:(FWFInstanceManager *)instanceManager { - self = [super initWithBinaryMessenger:binaryMessenger instanceManager:instanceManager]; - if (self) { - _navigationDelegateAPI = - [[FWFNavigationDelegateFlutterApiImpl alloc] initWithBinaryMessenger:binaryMessenger - instanceManager:instanceManager]; - } - return self; -} - -- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation { - [self.navigationDelegateAPI didFinishNavigationForDelegate:self - webView:webView - URL:webView.URL.absoluteString - completion:^(FlutterError *error) { - NSAssert(!error, @"%@", error); - }]; -} - -- (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation { - [self.navigationDelegateAPI didStartProvisionalNavigationForDelegate:self - webView:webView - URL:webView.URL.absoluteString - completion:^(FlutterError *error) { - NSAssert(!error, @"%@", error); - }]; -} - -- (void)webView:(WKWebView *)webView - decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction - decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler { - [self.navigationDelegateAPI - decidePolicyForNavigationActionForDelegate:self - webView:webView - navigationAction:navigationAction - completion:^(FWFWKNavigationActionPolicyEnumData *policy, - FlutterError *error) { - NSAssert(!error, @"%@", error); - if (!error) { - decisionHandler( - FWFNativeWKNavigationActionPolicyFromEnumData( - policy)); - } else { - decisionHandler(WKNavigationActionPolicyCancel); - } - }]; -} - -- (void)webView:(WKWebView *)webView - decidePolicyForNavigationResponse:(WKNavigationResponse *)navigationResponse - decisionHandler:(void (^)(WKNavigationResponsePolicy))decisionHandler { - [self.navigationDelegateAPI - decidePolicyForNavigationResponseForDelegate:self - webView:webView - navigationResponse:navigationResponse - completion:^(FWFWKNavigationResponsePolicyEnumBox *policy, - FlutterError *error) { - NSAssert(!error, @"%@", error); - if (!error) { - decisionHandler( - FWFNativeWKNavigationResponsePolicyFromEnum( - policy.value)); - } else { - decisionHandler(WKNavigationResponsePolicyCancel); - } - }]; -} - -- (void)webView:(WKWebView *)webView - didFailNavigation:(WKNavigation *)navigation - withError:(NSError *)error { - [self.navigationDelegateAPI didFailNavigationForDelegate:self - webView:webView - error:error - completion:^(FlutterError *error) { - NSAssert(!error, @"%@", error); - }]; -} - -- (void)webView:(WKWebView *)webView - didFailProvisionalNavigation:(WKNavigation *)navigation - withError:(NSError *)error { - [self.navigationDelegateAPI didFailProvisionalNavigationForDelegate:self - webView:webView - error:error - completion:^(FlutterError *error) { - NSAssert(!error, @"%@", error); - }]; -} - -- (void)webViewWebContentProcessDidTerminate:(WKWebView *)webView { - [self.navigationDelegateAPI - webViewWebContentProcessDidTerminateForDelegate:self - webView:webView - completion:^(FlutterError *error) { - NSAssert(!error, @"%@", error); - }]; -} - -- (void)webView:(WKWebView *)webView - didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge - completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition, - NSURLCredential *_Nullable))completionHandler { - [self.navigationDelegateAPI - didReceiveAuthenticationChallengeForDelegate:self - webView:webView - challenge:challenge - completion:^(FWFAuthenticationChallengeResponse *response, - FlutterError *error) { - NSAssert(!error, @"%@", error); - if (!error) { - NSURLSessionAuthChallengeDisposition disposition = - FWFNativeNSURLSessionAuthChallengeDispositionFromFWFNSUrlSessionAuthChallengeDisposition( - response.disposition); - - NSURLCredential *credential = - response.credentialIdentifier != nil - ? (NSURLCredential *)[self.navigationDelegateAPI - .instanceManager - instanceForIdentifier: - response.credentialIdentifier - .longValue] - : nil; - - completionHandler(disposition, credential); - } else { - completionHandler( - NSURLSessionAuthChallengeCancelAuthenticationChallenge, - nil); - } - }]; -} -@end - -@interface FWFNavigationDelegateHostApiImpl () -// BinaryMessenger must be weak to prevent a circular reference with the host API it -// references. -@property(nonatomic, weak) id binaryMessenger; -// InstanceManager must be weak to prevent a circular reference with the object it stores. -@property(nonatomic, weak) FWFInstanceManager *instanceManager; -@end - -@implementation FWFNavigationDelegateHostApiImpl -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - instanceManager:(FWFInstanceManager *)instanceManager { - self = [self init]; - if (self) { - _binaryMessenger = binaryMessenger; - _instanceManager = instanceManager; - } - return self; -} - -- (FWFNavigationDelegate *)navigationDelegateForIdentifier:(NSInteger)identifier { - return (FWFNavigationDelegate *)[self.instanceManager instanceForIdentifier:identifier]; -} - -- (void)createWithIdentifier:(NSInteger)identifier - error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { - FWFNavigationDelegate *navigationDelegate = - [[FWFNavigationDelegate alloc] initWithBinaryMessenger:self.binaryMessenger - instanceManager:self.instanceManager]; - [self.instanceManager addDartCreatedInstance:navigationDelegate withIdentifier:identifier]; -} -@end diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFObjectHostApi.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFObjectHostApi.m deleted file mode 100644 index 81e26a2f7d8..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFObjectHostApi.m +++ /dev/null @@ -1,147 +0,0 @@ -// 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 "./include/webview_flutter_wkwebview/FWFObjectHostApi.h" -#import -#import "./include/webview_flutter_wkwebview/FWFDataConverters.h" -#import "./include/webview_flutter_wkwebview/FWFURLHostApi.h" - -@interface FWFObjectFlutterApiImpl () -// BinaryMessenger must be weak to prevent a circular reference with the host API it -// references. -@property(nonatomic, weak) id binaryMessenger; -// InstanceManager must be weak to prevent a circular reference with the object it stores. -@property(nonatomic, weak) FWFInstanceManager *instanceManager; -@end - -@implementation FWFObjectFlutterApiImpl -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - instanceManager:(FWFInstanceManager *)instanceManager { - self = [self initWithBinaryMessenger:binaryMessenger]; - if (self) { - _binaryMessenger = binaryMessenger; - _instanceManager = instanceManager; - } - return self; -} - -- (long)identifierForObject:(NSObject *)instance { - return [self.instanceManager identifierWithStrongReferenceForInstance:instance]; -} - -- (void)observeValueForObject:(NSObject *)instance - keyPath:(NSString *)keyPath - object:(NSObject *)object - change:(NSDictionary *)change - completion:(void (^)(FlutterError *_Nullable))completion { - NSMutableArray *changeKeys = [NSMutableArray array]; - NSMutableArray *changeValues = [NSMutableArray array]; - - [change enumerateKeysAndObjectsUsingBlock:^(NSKeyValueChangeKey key, id value, BOOL *stop) { - [changeKeys addObject:FWFNSKeyValueChangeKeyEnumDataFromNativeNSKeyValueChangeKey(key)]; - BOOL isIdentifier = NO; - if ([self.instanceManager containsInstance:value]) { - isIdentifier = YES; - } else if (object_getClass(value) == [NSURL class]) { - FWFURLFlutterApiImpl *flutterApi = - [[FWFURLFlutterApiImpl alloc] initWithBinaryMessenger:self.binaryMessenger - instanceManager:self.instanceManager]; - [flutterApi create:value - completion:^(FlutterError *error) { - NSAssert(!error, @"%@", error); - }]; - isIdentifier = YES; - } - - id returnValue = isIdentifier - ? @([self.instanceManager identifierWithStrongReferenceForInstance:value]) - : value; - [changeValues addObject:[FWFObjectOrIdentifier makeWithValue:returnValue - isIdentifier:isIdentifier]]; - }]; - - NSInteger objectIdentifier = - [self.instanceManager identifierWithStrongReferenceForInstance:object]; - [self observeValueForObjectWithIdentifier:[self identifierForObject:instance] - keyPath:keyPath - objectIdentifier:objectIdentifier - changeKeys:changeKeys - changeValues:changeValues - completion:completion]; -} -@end - -@implementation FWFObject -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - instanceManager:(FWFInstanceManager *)instanceManager { - self = [self init]; - if (self) { - _objectApi = [[FWFObjectFlutterApiImpl alloc] initWithBinaryMessenger:binaryMessenger - instanceManager:instanceManager]; - } - return self; -} - -- (void)observeValueForKeyPath:(NSString *)keyPath - ofObject:(id)object - change:(NSDictionary *)change - context:(void *)context { - [self.objectApi observeValueForObject:self - keyPath:keyPath - object:object - change:change - completion:^(FlutterError *error) { - NSAssert(!error, @"%@", error); - }]; -} -@end - -@interface FWFObjectHostApiImpl () -// InstanceManager must be weak to prevent a circular reference with the object it stores. -@property(nonatomic, weak) FWFInstanceManager *instanceManager; -@end - -@implementation FWFObjectHostApiImpl -- (instancetype)initWithInstanceManager:(FWFInstanceManager *)instanceManager { - self = [self init]; - if (self) { - _instanceManager = instanceManager; - } - return self; -} - -- (NSObject *)objectForIdentifier:(NSInteger)identifier { - return (NSObject *)[self.instanceManager instanceForIdentifier:identifier]; -} - -- (void)addObserverForObjectWithIdentifier:(NSInteger)identifier - observerIdentifier:(NSInteger)observer - keyPath:(nonnull NSString *)keyPath - options: - (nonnull NSArray *) - options - error:(FlutterError *_Nullable *_Nonnull)error { - NSKeyValueObservingOptions optionsInt = 0; - for (FWFNSKeyValueObservingOptionsEnumData *data in options) { - optionsInt |= FWFNativeNSKeyValueObservingOptionsFromEnumData(data); - } - [[self objectForIdentifier:identifier] addObserver:[self objectForIdentifier:observer] - forKeyPath:keyPath - options:optionsInt - context:nil]; -} - -- (void)removeObserverForObjectWithIdentifier:(NSInteger)identifier - observerIdentifier:(NSInteger)observer - keyPath:(nonnull NSString *)keyPath - error:(FlutterError *_Nullable *_Nonnull)error { - [[self objectForIdentifier:identifier] removeObserver:[self objectForIdentifier:observer] - forKeyPath:keyPath]; -} - -- (void)disposeObjectWithIdentifier:(NSInteger)identifier - error:(FlutterError *_Nullable *_Nonnull)error { - [self.instanceManager removeInstanceWithIdentifier:identifier]; -} -@end diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFPreferencesHostApi.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFPreferencesHostApi.m deleted file mode 100644 index b2b442b3ffa..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFPreferencesHostApi.m +++ /dev/null @@ -1,48 +0,0 @@ -// 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 "./include/webview_flutter_wkwebview/FWFPreferencesHostApi.h" -#import "./include/webview_flutter_wkwebview/FWFWebViewConfigurationHostApi.h" - -@interface FWFPreferencesHostApiImpl () -// InstanceManager must be weak to prevent a circular reference with the object it stores. -@property(nonatomic, weak) FWFInstanceManager *instanceManager; -@end - -@implementation FWFPreferencesHostApiImpl -- (instancetype)initWithInstanceManager:(FWFInstanceManager *)instanceManager { - self = [self init]; - if (self) { - _instanceManager = instanceManager; - } - return self; -} - -- (WKPreferences *)preferencesForIdentifier:(NSInteger)identifier { - return (WKPreferences *)[self.instanceManager instanceForIdentifier:identifier]; -} - -- (void)createWithIdentifier:(NSInteger)identifier error:(FlutterError *_Nullable *_Nonnull)error { - WKPreferences *preferences = [[WKPreferences alloc] init]; - [self.instanceManager addDartCreatedInstance:preferences withIdentifier:identifier]; -} - -- (void)createFromWebViewConfigurationWithIdentifier:(NSInteger)identifier - configurationIdentifier:(NSInteger)configurationIdentifier - error:(FlutterError *_Nullable *_Nonnull)error { - WKWebViewConfiguration *configuration = (WKWebViewConfiguration *)[self.instanceManager - instanceForIdentifier:configurationIdentifier]; - [self.instanceManager addDartCreatedInstance:configuration.preferences withIdentifier:identifier]; -} - -- (void)setJavaScriptEnabledForPreferencesWithIdentifier:(NSInteger)identifier - isEnabled:(BOOL)enabled - error:(FlutterError *_Nullable *_Nonnull)error { -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - // TODO(stuartmorgan): Replace with new API. See https://github.com/flutter/flutter/issues/125901 - [[self preferencesForIdentifier:identifier] setJavaScriptEnabled:enabled]; -#pragma clang diagnostic pop -} -@end diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFScriptMessageHandlerHostApi.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFScriptMessageHandlerHostApi.m deleted file mode 100644 index 2b44e5e397f..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFScriptMessageHandlerHostApi.m +++ /dev/null @@ -1,94 +0,0 @@ -// 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 "./include/webview_flutter_wkwebview/FWFScriptMessageHandlerHostApi.h" -#import "./include/webview_flutter_wkwebview/FWFDataConverters.h" - -@interface FWFScriptMessageHandlerFlutterApiImpl () -// InstanceManager must be weak to prevent a circular reference with the object it stores. -@property(nonatomic, weak) FWFInstanceManager *instanceManager; -@end - -@implementation FWFScriptMessageHandlerFlutterApiImpl -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - instanceManager:(FWFInstanceManager *)instanceManager { - self = [self initWithBinaryMessenger:binaryMessenger]; - if (self) { - _instanceManager = instanceManager; - } - return self; -} - -- (long)identifierForHandler:(FWFScriptMessageHandler *)instance { - return [self.instanceManager identifierWithStrongReferenceForInstance:instance]; -} - -- (void)didReceiveScriptMessageForHandler:(FWFScriptMessageHandler *)instance - userContentController:(WKUserContentController *)userContentController - message:(WKScriptMessage *)message - completion:(void (^)(FlutterError *_Nullable))completion { - NSInteger userContentControllerIdentifier = - [self.instanceManager identifierWithStrongReferenceForInstance:userContentController]; - FWFWKScriptMessageData *messageData = FWFWKScriptMessageDataFromNativeWKScriptMessage(message); - [self didReceiveScriptMessageForHandlerWithIdentifier:[self identifierForHandler:instance] - userContentControllerIdentifier:userContentControllerIdentifier - message:messageData - completion:completion]; -} -@end - -@implementation FWFScriptMessageHandler -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - instanceManager:(FWFInstanceManager *)instanceManager { - self = [super initWithBinaryMessenger:binaryMessenger instanceManager:instanceManager]; - if (self) { - _scriptMessageHandlerAPI = - [[FWFScriptMessageHandlerFlutterApiImpl alloc] initWithBinaryMessenger:binaryMessenger - instanceManager:instanceManager]; - } - return self; -} - -- (void)userContentController:(nonnull WKUserContentController *)userContentController - didReceiveScriptMessage:(nonnull WKScriptMessage *)message { - [self.scriptMessageHandlerAPI didReceiveScriptMessageForHandler:self - userContentController:userContentController - message:message - completion:^(FlutterError *error) { - NSAssert(!error, @"%@", error); - }]; -} -@end - -@interface FWFScriptMessageHandlerHostApiImpl () -// BinaryMessenger must be weak to prevent a circular reference with the host API it -// references. -@property(nonatomic, weak) id binaryMessenger; -// InstanceManager must be weak to prevent a circular reference with the object it stores. -@property(nonatomic, weak) FWFInstanceManager *instanceManager; -@end - -@implementation FWFScriptMessageHandlerHostApiImpl -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - instanceManager:(FWFInstanceManager *)instanceManager { - self = [self init]; - if (self) { - _binaryMessenger = binaryMessenger; - _instanceManager = instanceManager; - } - return self; -} - -- (FWFScriptMessageHandler *)scriptMessageHandlerForIdentifier:(NSNumber *)identifier { - return (FWFScriptMessageHandler *)[self.instanceManager - instanceForIdentifier:identifier.longValue]; -} - -- (void)createWithIdentifier:(NSInteger)identifier error:(FlutterError *_Nullable *_Nonnull)error { - FWFScriptMessageHandler *scriptMessageHandler = - [[FWFScriptMessageHandler alloc] initWithBinaryMessenger:self.binaryMessenger - instanceManager:self.instanceManager]; - [self.instanceManager addDartCreatedInstance:scriptMessageHandler withIdentifier:identifier]; -} -@end diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFScrollViewDelegateHostApi.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFScrollViewDelegateHostApi.m deleted file mode 100644 index ec5e55587dc..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFScrollViewDelegateHostApi.m +++ /dev/null @@ -1,97 +0,0 @@ -// 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. - -// Using directory structure to remove platform-specific files doesn't work -// well with umbrella headers and module maps, so just no-op the file for -// other platforms instead. -#if TARGET_OS_IOS - -#import "./include/webview_flutter_wkwebview/FWFScrollViewDelegateHostApi.h" -#import "./include/webview_flutter_wkwebview/FWFWebViewHostApi.h" - -@interface FWFScrollViewDelegateFlutterApiImpl () -// BinaryMessenger must be weak to prevent a circular reference with the host API it -// references. -@property(nonatomic, weak) id binaryMessenger; -// InstanceManager must be weak to prevent a circular reference with the object it stores. -@property(nonatomic, weak) FWFInstanceManager *instanceManager; -@end - -@implementation FWFScrollViewDelegateFlutterApiImpl - -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - instanceManager:(FWFInstanceManager *)instanceManager { - self = [self initWithBinaryMessenger:binaryMessenger]; - if (self) { - _binaryMessenger = binaryMessenger; - _instanceManager = instanceManager; - } - return self; -} -- (long)identifierForDelegate:(FWFScrollViewDelegate *)instance { - return [self.instanceManager identifierWithStrongReferenceForInstance:instance]; -} - -- (void)scrollViewDidScrollForDelegate:(FWFScrollViewDelegate *)instance - uiScrollView:(UIScrollView *)scrollView - completion:(void (^)(FlutterError *_Nullable))completion { - [self scrollViewDidScrollWithIdentifier:[self identifierForDelegate:instance] - UIScrollViewIdentifier:[self.instanceManager - identifierWithStrongReferenceForInstance:scrollView] - x:scrollView.contentOffset.x - y:scrollView.contentOffset.y - completion:completion]; -} -@end - -@implementation FWFScrollViewDelegate - -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - instanceManager:(FWFInstanceManager *)instanceManager { - self = [super initWithBinaryMessenger:binaryMessenger instanceManager:instanceManager]; - if (self) { - _scrollViewDelegateAPI = - [[FWFScrollViewDelegateFlutterApiImpl alloc] initWithBinaryMessenger:binaryMessenger - instanceManager:instanceManager]; - } - return self; -} - -- (void)scrollViewDidScroll:(UIScrollView *)scrollView { - [self.scrollViewDelegateAPI scrollViewDidScrollForDelegate:self - uiScrollView:scrollView - completion:^(FlutterError *error) { - NSAssert(!error, @"%@", error); - }]; -} -@end - -@interface FWFScrollViewDelegateHostApiImpl () -// BinaryMessenger must be weak to prevent a circular reference with the host API it -// references. -@property(nonatomic, weak) id binaryMessenger; -// InstanceManager must be weak to prevent a circular reference with the object it stores. -@property(nonatomic, weak) FWFInstanceManager *instanceManager; -@end - -@implementation FWFScrollViewDelegateHostApiImpl -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - instanceManager:(FWFInstanceManager *)instanceManager { - self = [self init]; - if (self) { - _binaryMessenger = binaryMessenger; - _instanceManager = instanceManager; - } - return self; -} - -- (void)createWithIdentifier:(NSInteger)identifier error:(FlutterError *_Nullable *_Nonnull)error { - FWFScrollViewDelegate *uiScrollViewDelegate = - [[FWFScrollViewDelegate alloc] initWithBinaryMessenger:self.binaryMessenger - instanceManager:self.instanceManager]; - [self.instanceManager addDartCreatedInstance:uiScrollViewDelegate withIdentifier:identifier]; -} -@end - -#endif diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFScrollViewHostApi.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFScrollViewHostApi.m deleted file mode 100644 index 33b0fe7a145..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFScrollViewHostApi.m +++ /dev/null @@ -1,104 +0,0 @@ -// 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 "./include/webview_flutter_wkwebview/FWFScrollViewHostApi.h" -#import "./include/webview_flutter_wkwebview/FWFScrollViewDelegateHostApi.h" -#import "./include/webview_flutter_wkwebview/FWFWebViewHostApi.h" - -@interface FWFScrollViewHostApiImpl () -// BinaryMessenger must be weak to prevent a circular reference with the host API it -// references. -@property(nonatomic, weak) id binaryMessenger; - -// InstanceManager must be weak to prevent a circular reference with the object it stores. -@property(nonatomic, weak) FWFInstanceManager *instanceManager; -@end - -@implementation FWFScrollViewHostApiImpl -- (instancetype)initWithInstanceManager:(FWFInstanceManager *)instanceManager { - self = [self init]; - if (self) { - _instanceManager = instanceManager; - } - return self; -} - -#if TARGET_OS_IOS -- (UIScrollView *)scrollViewForIdentifier:(NSInteger)identifier { - return (UIScrollView *)[self.instanceManager instanceForIdentifier:identifier]; -} -#endif - -- (void)createFromWebViewWithIdentifier:(NSInteger)identifier - webViewIdentifier:(NSInteger)webViewIdentifier - error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { -#if TARGET_OS_IOS - WKWebView *webView = (WKWebView *)[self.instanceManager instanceForIdentifier:webViewIdentifier]; - [self.instanceManager addDartCreatedInstance:webView.scrollView withIdentifier:identifier]; -#else - *error = [FlutterError errorWithCode:@"UnavailableApi" - message:@"scrollView is unavailable on macOS" - details:nil]; -#endif -} - -- (NSArray *) - contentOffsetForScrollViewWithIdentifier:(NSInteger)identifier - error:(FlutterError *_Nullable *_Nonnull)error { -#if TARGET_OS_IOS - CGPoint point = [[self scrollViewForIdentifier:identifier] contentOffset]; - return @[ @(point.x), @(point.y) ]; -#else - return @[ @(0), @(0) ]; -#endif -} - -- (void)scrollByForScrollViewWithIdentifier:(NSInteger)identifier - x:(double)x - y:(double)y - error:(FlutterError *_Nullable *_Nonnull)error { -#if TARGET_OS_IOS - UIScrollView *scrollView = [self scrollViewForIdentifier:identifier]; - CGPoint contentOffset = scrollView.contentOffset; - [scrollView setContentOffset:CGPointMake(contentOffset.x + x, contentOffset.y + y)]; -#endif -} - -- (void)verticalScrollBarEnabledForScrollViewWithIdentifier:(NSInteger)identifier - isEnabled:(BOOL)enabled - error:(FlutterError *_Nullable *_Nonnull)error { -#if TARGET_OS_IOS - [[self scrollViewForIdentifier:identifier] setShowsVerticalScrollIndicator:enabled]; -#endif -} - -- (void)horizontalScrollBarEnabledForScrollViewWithIdentifier:(NSInteger)identifier - isEnabled:(BOOL)enabled - error:(FlutterError *_Nullable *_Nonnull)error { -#if TARGET_OS_IOS - [[self scrollViewForIdentifier:identifier] setShowsHorizontalScrollIndicator:enabled]; -#endif -} - -- (void)setContentOffsetForScrollViewWithIdentifier:(NSInteger)identifier - toX:(double)x - y:(double)y - error:(FlutterError *_Nullable *_Nonnull)error { -#if TARGET_OS_IOS - [[self scrollViewForIdentifier:identifier] setContentOffset:CGPointMake(x, y)]; -#endif -} - -- (void)setDelegateForScrollViewWithIdentifier:(NSInteger)identifier - uiScrollViewDelegateIdentifier:(nullable NSNumber *)uiScrollViewDelegateIdentifier - error:(FlutterError *_Nullable *_Nonnull)error { -#if TARGET_OS_IOS - [[self scrollViewForIdentifier:identifier] - setDelegate:uiScrollViewDelegateIdentifier - ? (FWFScrollViewDelegate *)[self.instanceManager - instanceForIdentifier:uiScrollViewDelegateIdentifier.longValue] - : nil]; -#endif -} -@end diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFUIDelegateHostApi.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFUIDelegateHostApi.m deleted file mode 100644 index e38635a3d21..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFUIDelegateHostApi.m +++ /dev/null @@ -1,255 +0,0 @@ -// 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 "./include/webview_flutter_wkwebview/FWFUIDelegateHostApi.h" -#import "./include/webview_flutter_wkwebview/FWFDataConverters.h" - -@interface FWFUIDelegateFlutterApiImpl () -// BinaryMessenger must be weak to prevent a circular reference with the host API it -// references. -@property(nonatomic, weak) id binaryMessenger; -// InstanceManager must be weak to prevent a circular reference with the object it stores. -@property(nonatomic, weak) FWFInstanceManager *instanceManager; -@end - -@implementation FWFUIDelegateFlutterApiImpl -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - instanceManager:(FWFInstanceManager *)instanceManager { - self = [self initWithBinaryMessenger:binaryMessenger]; - if (self) { - _binaryMessenger = binaryMessenger; - _instanceManager = instanceManager; - _webViewConfigurationFlutterApi = - [[FWFWebViewConfigurationFlutterApiImpl alloc] initWithBinaryMessenger:binaryMessenger - instanceManager:instanceManager]; - } - return self; -} - -- (long)identifierForDelegate:(FWFUIDelegate *)instance { - return [self.instanceManager identifierWithStrongReferenceForInstance:instance]; -} - -- (void)onCreateWebViewForDelegate:(FWFUIDelegate *)instance - webView:(WKWebView *)webView - configuration:(WKWebViewConfiguration *)configuration - navigationAction:(WKNavigationAction *)navigationAction - completion:(void (^)(FlutterError *_Nullable))completion { - if (![self.instanceManager containsInstance:configuration]) { - [self.webViewConfigurationFlutterApi createWithConfiguration:configuration - completion:^(FlutterError *error) { - NSAssert(!error, @"%@", error); - }]; - } - - NSInteger configurationIdentifier = - [self.instanceManager identifierWithStrongReferenceForInstance:configuration]; - FWFWKNavigationActionData *navigationActionData = - FWFWKNavigationActionDataFromNativeWKNavigationAction(navigationAction); - - [self - onCreateWebViewForDelegateWithIdentifier:[self identifierForDelegate:instance] - webViewIdentifier:[self.instanceManager - identifierWithStrongReferenceForInstance:webView] - configurationIdentifier:configurationIdentifier - navigationAction:navigationActionData - completion:completion]; -} - -- (void)requestMediaCapturePermissionForDelegateWithIdentifier:(FWFUIDelegate *)instance - webView:(WKWebView *)webView - origin:(WKSecurityOrigin *)origin - frame:(WKFrameInfo *)frame - type:(WKMediaCaptureType)type - completion: - (void (^)(WKPermissionDecision))completion - API_AVAILABLE(ios(15.0), macos(12)) { - [self - requestMediaCapturePermissionForDelegateWithIdentifier:[self identifierForDelegate:instance] - webViewIdentifier: - [self.instanceManager - identifierWithStrongReferenceForInstance:webView] - origin: - FWFWKSecurityOriginDataFromNativeWKSecurityOrigin( - origin) - frame: - FWFWKFrameInfoDataFromNativeWKFrameInfo( - frame) - type: - FWFWKMediaCaptureTypeDataFromNativeWKMediaCaptureType( - type) - completion:^( - FWFWKPermissionDecisionData *decision, - FlutterError *error) { - NSAssert(!error, @"%@", error); - completion( - FWFNativeWKPermissionDecisionFromData( - decision)); - }]; -} - -- (void)runJavaScriptAlertPanelForDelegateWithIdentifier:(FWFUIDelegate *)instance - message:(NSString *)message - frame:(WKFrameInfo *)frame - completionHandler:(void (^)(void))completionHandler { - [self runJavaScriptAlertPanelForDelegateWithIdentifier:[self identifierForDelegate:instance] - message:message - frame:FWFWKFrameInfoDataFromNativeWKFrameInfo( - frame) - completion:^(FlutterError *error) { - NSAssert(!error, @"%@", error); - completionHandler(); - }]; -} - -- (void)runJavaScriptConfirmPanelForDelegateWithIdentifier:(FWFUIDelegate *)instance - message:(NSString *)message - frame:(WKFrameInfo *)frame - completionHandler:(void (^)(BOOL))completionHandler { - [self runJavaScriptConfirmPanelForDelegateWithIdentifier:[self identifierForDelegate:instance] - message:message - frame:FWFWKFrameInfoDataFromNativeWKFrameInfo( - frame) - completion:^(NSNumber *isConfirmed, - FlutterError *error) { - NSAssert(!error, @"%@", error); - if (error) { - completionHandler(NO); - } else { - completionHandler(isConfirmed.boolValue); - } - }]; -} - -- (void)runJavaScriptTextInputPanelForDelegateWithIdentifier:(FWFUIDelegate *)instance - prompt:(NSString *)prompt - defaultText:(NSString *)defaultText - frame:(WKFrameInfo *)frame - completionHandler: - (void (^)(NSString *_Nullable))completionHandler { - [self - runJavaScriptTextInputPanelForDelegateWithIdentifier:[self identifierForDelegate:instance] - prompt:prompt - defaultText:defaultText - frame:FWFWKFrameInfoDataFromNativeWKFrameInfo( - frame) - completion:^(NSString *inputText, - FlutterError *error) { - NSAssert(!error, @"%@", error); - if (error) { - completionHandler(nil); - } else { - completionHandler(inputText); - } - }]; -} - -@end - -@implementation FWFUIDelegate -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - instanceManager:(FWFInstanceManager *)instanceManager { - self = [super initWithBinaryMessenger:binaryMessenger instanceManager:instanceManager]; - if (self) { - _UIDelegateAPI = [[FWFUIDelegateFlutterApiImpl alloc] initWithBinaryMessenger:binaryMessenger - instanceManager:instanceManager]; - } - return self; -} - -- (WKWebView *)webView:(WKWebView *)webView - createWebViewWithConfiguration:(WKWebViewConfiguration *)configuration - forNavigationAction:(WKNavigationAction *)navigationAction - windowFeatures:(WKWindowFeatures *)windowFeatures { - [self.UIDelegateAPI onCreateWebViewForDelegate:self - webView:webView - configuration:configuration - navigationAction:navigationAction - completion:^(FlutterError *error) { - NSAssert(!error, @"%@", error); - }]; - return nil; -} - -- (void)webView:(WKWebView *)webView - requestMediaCapturePermissionForOrigin:(WKSecurityOrigin *)origin - initiatedByFrame:(WKFrameInfo *)frame - type:(WKMediaCaptureType)type - decisionHandler:(void (^)(WKPermissionDecision))decisionHandler - API_AVAILABLE(ios(15.0), macos(12)) { - [self.UIDelegateAPI - requestMediaCapturePermissionForDelegateWithIdentifier:self - webView:webView - origin:origin - frame:frame - type:type - completion:^(WKPermissionDecision decision) { - decisionHandler(decision); - }]; -} - -- (void)webView:(WKWebView *)webView - runJavaScriptAlertPanelWithMessage:(NSString *)message - initiatedByFrame:(WKFrameInfo *)frame - completionHandler:(void (^)(void))completionHandler { - [self.UIDelegateAPI runJavaScriptAlertPanelForDelegateWithIdentifier:self - message:message - frame:frame - completionHandler:completionHandler]; -} - -- (void)webView:(WKWebView *)webView - runJavaScriptConfirmPanelWithMessage:(NSString *)message - initiatedByFrame:(WKFrameInfo *)frame - completionHandler:(void (^)(BOOL))completionHandler { - [self.UIDelegateAPI runJavaScriptConfirmPanelForDelegateWithIdentifier:self - message:message - frame:frame - completionHandler:completionHandler]; -} - -- (void)webView:(WKWebView *)webView - runJavaScriptTextInputPanelWithPrompt:(NSString *)prompt - defaultText:(NSString *)defaultText - initiatedByFrame:(WKFrameInfo *)frame - completionHandler:(void (^)(NSString *_Nullable))completionHandler { - [self.UIDelegateAPI runJavaScriptTextInputPanelForDelegateWithIdentifier:self - prompt:prompt - defaultText:defaultText - frame:frame - completionHandler:completionHandler]; -} - -@end - -@interface FWFUIDelegateHostApiImpl () -// BinaryMessenger must be weak to prevent a circular reference with the host API it -// references. -@property(nonatomic, weak) id binaryMessenger; -// InstanceManager must be weak to prevent a circular reference with the object it stores. -@property(nonatomic, weak) FWFInstanceManager *instanceManager; -@end - -@implementation FWFUIDelegateHostApiImpl -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - instanceManager:(FWFInstanceManager *)instanceManager { - self = [self init]; - if (self) { - _binaryMessenger = binaryMessenger; - _instanceManager = instanceManager; - } - return self; -} - -- (FWFUIDelegate *)delegateForIdentifier:(NSNumber *)identifier { - return (FWFUIDelegate *)[self.instanceManager instanceForIdentifier:identifier.longValue]; -} - -- (void)createWithIdentifier:(NSInteger)identifier error:(FlutterError *_Nullable *_Nonnull)error { - FWFUIDelegate *uIDelegate = [[FWFUIDelegate alloc] initWithBinaryMessenger:self.binaryMessenger - instanceManager:self.instanceManager]; - [self.instanceManager addDartCreatedInstance:uIDelegate withIdentifier:identifier]; -} - -@end diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFUIViewHostApi.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFUIViewHostApi.m deleted file mode 100644 index 0a2c0dcc36f..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFUIViewHostApi.m +++ /dev/null @@ -1,51 +0,0 @@ -// 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. - -// Using directory structure to remove platform-specific files doesn't work -// well with umbrella headers and module maps, so just no-op the file for -// other platforms instead. -#if TARGET_OS_IOS - -#import "./include/webview_flutter_wkwebview/FWFUIViewHostApi.h" - -@interface FWFUIViewHostApiImpl () -// InstanceManager must be weak to prevent a circular reference with the object it stores. -@property(nonatomic, weak) FWFInstanceManager *instanceManager; -@end - -@implementation FWFUIViewHostApiImpl -- (instancetype)initWithInstanceManager:(FWFInstanceManager *)instanceManager { - self = [self init]; - if (self) { - _instanceManager = instanceManager; - } - return self; -} - -- (UIView *)viewForIdentifier:(NSInteger)identifier { - return (UIView *)[self.instanceManager instanceForIdentifier:identifier]; -} - -- (void)setBackgroundColorForViewWithIdentifier:(NSInteger)identifier - toValue:(nullable NSNumber *)color - error:(FlutterError *_Nullable *_Nonnull)error { - if (color == nil) { - [[self viewForIdentifier:identifier] setBackgroundColor:nil]; - } - int colorInt = color.intValue; - UIColor *colorObject = [UIColor colorWithRed:(colorInt >> 16 & 0xff) / 255.0 - green:(colorInt >> 8 & 0xff) / 255.0 - blue:(colorInt & 0xff) / 255.0 - alpha:(colorInt >> 24 & 0xff) / 255.0]; - [[self viewForIdentifier:identifier] setBackgroundColor:colorObject]; -} - -- (void)setOpaqueForViewWithIdentifier:(NSInteger)identifier - isOpaque:(BOOL)opaque - error:(FlutterError *_Nullable *_Nonnull)error { - [[self viewForIdentifier:identifier] setOpaque:opaque]; -} -@end - -#endif diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFURLAuthenticationChallengeHostApi.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFURLAuthenticationChallengeHostApi.m deleted file mode 100644 index ac374b786c7..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFURLAuthenticationChallengeHostApi.m +++ /dev/null @@ -1,52 +0,0 @@ -// 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 "./include/webview_flutter_wkwebview/FWFURLAuthenticationChallengeHostApi.h" -#import "./include/webview_flutter_wkwebview/FWFURLProtectionSpaceHostApi.h" - -@interface FWFURLAuthenticationChallengeFlutterApiImpl () -// BinaryMessenger must be weak to prevent a circular reference with the host API it -// references. -@property(nonatomic, weak) id binaryMessenger; -// InstanceManager must be weak to prevent a circular reference with the object it stores. -@property(nonatomic, weak) FWFInstanceManager *instanceManager; -@end - -@implementation FWFURLAuthenticationChallengeFlutterApiImpl -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - instanceManager:(FWFInstanceManager *)instanceManager { - self = [self init]; - if (self) { - _binaryMessenger = binaryMessenger; - _instanceManager = instanceManager; - _api = - [[FWFNSUrlAuthenticationChallengeFlutterApi alloc] initWithBinaryMessenger:binaryMessenger]; - } - return self; -} - -- (void)createWithInstance:(NSURLAuthenticationChallenge *)instance - protectionSpace:(NSURLProtectionSpace *)protectionSpace - completion:(void (^)(FlutterError *_Nullable))completion { - if ([self.instanceManager containsInstance:instance]) { - return; - } - - FWFURLProtectionSpaceFlutterApiImpl *protectionSpaceApi = - [[FWFURLProtectionSpaceFlutterApiImpl alloc] initWithBinaryMessenger:self.binaryMessenger - instanceManager:self.instanceManager]; - [protectionSpaceApi createWithInstance:protectionSpace - host:protectionSpace.host - realm:protectionSpace.realm - authenticationMethod:protectionSpace.authenticationMethod - completion:^(FlutterError *error) { - NSAssert(!error, @"%@", error); - }]; - - [self.api createWithIdentifier:[self.instanceManager addHostCreatedInstance:instance] - protectionSpaceIdentifier:[self.instanceManager - identifierWithStrongReferenceForInstance:protectionSpace] - completion:completion]; -} -@end diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFURLCredentialHostApi.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFURLCredentialHostApi.m deleted file mode 100644 index 7ac0647a8f9..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFURLCredentialHostApi.m +++ /dev/null @@ -1,58 +0,0 @@ -// 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 "./include/webview_flutter_wkwebview/FWFURLCredentialHostApi.h" - -@interface FWFURLCredentialHostApiImpl () -// BinaryMessenger must be weak to prevent a circular reference with the host API it -// references. -@property(nonatomic, weak) id binaryMessenger; -// InstanceManager must be weak to prevent a circular reference with the object it stores. -@property(nonatomic, weak) FWFInstanceManager *instanceManager; -@end - -@implementation FWFURLCredentialHostApiImpl -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - instanceManager:(FWFInstanceManager *)instanceManager { - self = [self init]; - if (self) { - _binaryMessenger = binaryMessenger; - _instanceManager = instanceManager; - } - return self; -} - -- (void)createWithUserWithIdentifier:(NSInteger)identifier - user:(nonnull NSString *)user - password:(nonnull NSString *)password - persistence:(FWFNSUrlCredentialPersistence)persistence - error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { - [self.instanceManager - addDartCreatedInstance: - [NSURLCredential - credentialWithUser:user - password:password - persistence: - FWFNativeNSURLCredentialPersistenceFromFWFNSUrlCredentialPersistence( - persistence)] - withIdentifier:identifier]; -} - -- (nullable NSURL *)credentialForIdentifier:(NSNumber *)identifier - error: - (FlutterError *_Nullable __autoreleasing *_Nonnull)error { - NSURL *instance = (NSURL *)[self.instanceManager instanceForIdentifier:identifier.longValue]; - - if (!instance) { - NSString *message = - [NSString stringWithFormat:@"InstanceManager does not contain an NSURL with identifier: %@", - identifier]; - *error = [FlutterError errorWithCode:NSInternalInconsistencyException - message:message - details:nil]; - } - - return instance; -} -@end diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFURLHostApi.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFURLHostApi.m deleted file mode 100644 index 3ed6474efc2..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFURLHostApi.m +++ /dev/null @@ -1,74 +0,0 @@ -// 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 "./include/webview_flutter_wkwebview/FWFURLHostApi.h" - -@interface FWFURLHostApiImpl () -// BinaryMessenger must be weak to prevent a circular reference with the host API it -// references. -@property(nonatomic, weak) id binaryMessenger; -// InstanceManager must be weak to prevent a circular reference with the object it stores. -@property(nonatomic, weak) FWFInstanceManager *instanceManager; -@end - -@interface FWFURLFlutterApiImpl () -// InstanceManager must be weak to prevent a circular reference with the object it stores. -@property(nonatomic, weak) FWFInstanceManager *instanceManager; -@end - -@implementation FWFURLHostApiImpl -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - instanceManager:(FWFInstanceManager *)instanceManager { - self = [self init]; - if (self) { - _binaryMessenger = binaryMessenger; - _instanceManager = instanceManager; - } - return self; -} - -- (nullable NSString *) - absoluteStringForNSURLWithIdentifier:(NSInteger)identifier - error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { - NSURL *instance = [self urlForIdentifier:identifier error:error]; - if (*error) { - return nil; - } - - return instance.absoluteString; -} - -- (nullable NSURL *)urlForIdentifier:(NSInteger)identifier - error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { - NSURL *instance = (NSURL *)[self.instanceManager instanceForIdentifier:identifier]; - - if (!instance) { - NSString *message = [NSString - stringWithFormat:@"InstanceManager does not contain an NSURL with identifier: %li", - (long)identifier]; - *error = [FlutterError errorWithCode:NSInternalInconsistencyException - message:message - details:nil]; - } - - return instance; -} -@end - -@implementation FWFURLFlutterApiImpl -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - instanceManager:(FWFInstanceManager *)instanceManager { - self = [self init]; - if (self) { - _instanceManager = instanceManager; - _api = [[FWFNSUrlFlutterApi alloc] initWithBinaryMessenger:binaryMessenger]; - } - return self; -} - -- (void)create:(NSURL *)instance completion:(void (^)(FlutterError *_Nullable))completion { - [self.api createWithIdentifier:[self.instanceManager addHostCreatedInstance:instance] - completion:completion]; -} -@end diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFURLProtectionSpaceHostApi.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFURLProtectionSpaceHostApi.m deleted file mode 100644 index f83889979df..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFURLProtectionSpaceHostApi.m +++ /dev/null @@ -1,36 +0,0 @@ -// 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 "./include/webview_flutter_wkwebview/FWFURLProtectionSpaceHostApi.h" - -@interface FWFURLProtectionSpaceFlutterApiImpl () -// InstanceManager must be weak to prevent a circular reference with the object it stores. -@property(nonatomic, weak) FWFInstanceManager *instanceManager; -@end - -@implementation FWFURLProtectionSpaceFlutterApiImpl -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - instanceManager:(FWFInstanceManager *)instanceManager { - self = [self init]; - if (self) { - _instanceManager = instanceManager; - _api = [[FWFNSUrlProtectionSpaceFlutterApi alloc] initWithBinaryMessenger:binaryMessenger]; - } - return self; -} - -- (void)createWithInstance:(NSURLProtectionSpace *)instance - host:(nullable NSString *)host - realm:(nullable NSString *)realm - authenticationMethod:(nullable NSString *)authenticationMethod - completion:(void (^)(FlutterError *_Nullable))completion { - if (![self.instanceManager containsInstance:instance]) { - [self.api createWithIdentifier:[self.instanceManager addHostCreatedInstance:instance] - host:host - realm:realm - authenticationMethod:authenticationMethod - completion:completion]; - } -} -@end diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFUserContentControllerHostApi.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFUserContentControllerHostApi.m deleted file mode 100644 index 1cd80344e7f..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFUserContentControllerHostApi.m +++ /dev/null @@ -1,80 +0,0 @@ -// 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 "./include/webview_flutter_wkwebview/FWFUserContentControllerHostApi.h" -#import "./include/webview_flutter_wkwebview/FWFDataConverters.h" -#import "./include/webview_flutter_wkwebview/FWFWebViewConfigurationHostApi.h" - -@interface FWFUserContentControllerHostApiImpl () -// InstanceManager must be weak to prevent a circular reference with the object it stores. -@property(nonatomic, weak) FWFInstanceManager *instanceManager; -@end - -@implementation FWFUserContentControllerHostApiImpl -- (instancetype)initWithInstanceManager:(FWFInstanceManager *)instanceManager { - self = [self init]; - if (self) { - _instanceManager = instanceManager; - } - return self; -} - -- (WKUserContentController *)userContentControllerForIdentifier:(NSInteger)identifier { - return (WKUserContentController *)[self.instanceManager instanceForIdentifier:identifier]; -} - -- (void)createFromWebViewConfigurationWithIdentifier:(NSInteger)identifier - configurationIdentifier:(NSInteger)configurationIdentifier - error:(FlutterError *_Nullable *_Nonnull)error { - WKWebViewConfiguration *configuration = (WKWebViewConfiguration *)[self.instanceManager - instanceForIdentifier:configurationIdentifier]; - [self.instanceManager addDartCreatedInstance:configuration.userContentController - withIdentifier:identifier]; -} - -- (void)addScriptMessageHandlerForControllerWithIdentifier:(NSInteger)identifier - handlerIdentifier:(NSInteger)handler - ofName:(nonnull NSString *)name - error: - (FlutterError *_Nullable *_Nonnull)error { - [[self userContentControllerForIdentifier:identifier] - addScriptMessageHandler:(id)[self.instanceManager - instanceForIdentifier:handler] - name:name]; -} - -- (void)removeScriptMessageHandlerForControllerWithIdentifier:(NSInteger)identifier - name:(nonnull NSString *)name - error:(FlutterError *_Nullable *_Nonnull) - error { - [[self userContentControllerForIdentifier:identifier] removeScriptMessageHandlerForName:name]; -} - -- (void)removeAllScriptMessageHandlersForControllerWithIdentifier:(NSInteger)identifier - error: - (FlutterError *_Nullable *_Nonnull) - error { - if (@available(iOS 14.0, macOS 11, *)) { - [[self userContentControllerForIdentifier:identifier] removeAllScriptMessageHandlers]; - } else { - *error = [FlutterError - errorWithCode:@"FWFUnsupportedVersionError" - message:@"removeAllScriptMessageHandlers is only supported on iOS 14+ and macOS 11+." - details:nil]; - } -} - -- (void)addUserScriptForControllerWithIdentifier:(NSInteger)identifier - userScript:(nonnull FWFWKUserScriptData *)userScript - error:(FlutterError *_Nullable *_Nonnull)error { - [[self userContentControllerForIdentifier:identifier] - addUserScript:FWFNativeWKUserScriptFromScriptData(userScript)]; -} - -- (void)removeAllUserScriptsForControllerWithIdentifier:(NSInteger)identifier - error:(FlutterError *_Nullable *_Nonnull)error { - [[self userContentControllerForIdentifier:identifier] removeAllUserScripts]; -} - -@end diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFWebViewConfigurationHostApi.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFWebViewConfigurationHostApi.m deleted file mode 100644 index d97bf9bfe6e..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFWebViewConfigurationHostApi.m +++ /dev/null @@ -1,139 +0,0 @@ -// 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 "./include/webview_flutter_wkwebview/FWFWebViewConfigurationHostApi.h" -#import "./include/webview_flutter_wkwebview/FWFDataConverters.h" -#import "./include/webview_flutter_wkwebview/FWFWebViewConfigurationHostApi.h" - -@interface FWFWebViewConfigurationFlutterApiImpl () -// InstanceManager must be weak to prevent a circular reference with the object it stores. -@property(nonatomic, weak) FWFInstanceManager *instanceManager; -@end - -@implementation FWFWebViewConfigurationFlutterApiImpl -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - instanceManager:(FWFInstanceManager *)instanceManager { - self = [self initWithBinaryMessenger:binaryMessenger]; - if (self) { - _instanceManager = instanceManager; - } - return self; -} - -- (void)createWithConfiguration:(WKWebViewConfiguration *)configuration - completion:(void (^)(FlutterError *_Nullable))completion { - long identifier = [self.instanceManager addHostCreatedInstance:configuration]; - [self createWithIdentifier:identifier completion:completion]; -} -@end - -@implementation FWFWebViewConfiguration -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - instanceManager:(FWFInstanceManager *)instanceManager { - self = [self init]; - if (self) { - _objectApi = [[FWFObjectFlutterApiImpl alloc] initWithBinaryMessenger:binaryMessenger - instanceManager:instanceManager]; - } - return self; -} - -- (void)observeValueForKeyPath:(NSString *)keyPath - ofObject:(id)object - change:(NSDictionary *)change - context:(void *)context { - [self.objectApi observeValueForObject:self - keyPath:keyPath - object:object - change:change - completion:^(FlutterError *error) { - NSAssert(!error, @"%@", error); - }]; -} -@end - -@interface FWFWebViewConfigurationHostApiImpl () -// BinaryMessenger must be weak to prevent a circular reference with the host API it -// references. -@property(nonatomic, weak) id binaryMessenger; -// InstanceManager must be weak to prevent a circular reference with the object it stores. -@property(nonatomic, weak) FWFInstanceManager *instanceManager; -@end - -@implementation FWFWebViewConfigurationHostApiImpl -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - instanceManager:(FWFInstanceManager *)instanceManager { - self = [self init]; - if (self) { - _binaryMessenger = binaryMessenger; - _instanceManager = instanceManager; - } - return self; -} - -- (WKWebViewConfiguration *)webViewConfigurationForIdentifier:(NSInteger)identifier { - return (WKWebViewConfiguration *)[self.instanceManager instanceForIdentifier:identifier]; -} - -- (void)createWithIdentifier:(NSInteger)identifier error:(FlutterError *_Nullable *_Nonnull)error { - FWFWebViewConfiguration *webViewConfiguration = - [[FWFWebViewConfiguration alloc] initWithBinaryMessenger:self.binaryMessenger - instanceManager:self.instanceManager]; - [self.instanceManager addDartCreatedInstance:webViewConfiguration withIdentifier:identifier]; -} - -- (void)createFromWebViewWithIdentifier:(NSInteger)identifier - webViewIdentifier:(NSInteger)webViewIdentifier - error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { - WKWebView *webView = (WKWebView *)[self.instanceManager instanceForIdentifier:webViewIdentifier]; - [self.instanceManager addDartCreatedInstance:webView.configuration withIdentifier:identifier]; -} - -- (void)setAllowsInlineMediaPlaybackForConfigurationWithIdentifier:(NSInteger)identifier - isAllowed:(BOOL)allow - error: - (FlutterError *_Nullable *_Nonnull) - error { -#if TARGET_OS_IOS - [[self webViewConfigurationForIdentifier:identifier] setAllowsInlineMediaPlayback:allow]; -#endif - // No-op, rather than error out, on macOS, since it's not a meaningful option on macOS and it's - // easier for clients if it's just ignored. -} - -- (void)setLimitsNavigationsToAppBoundDomainsForConfigurationWithIdentifier:(NSInteger)identifier - isLimited:(BOOL)limit - error:(FlutterError *_Nullable - *_Nonnull)error { - if (@available(iOS 14, macOS 11, *)) { - [[self webViewConfigurationForIdentifier:identifier] - setLimitsNavigationsToAppBoundDomains:limit]; - } else { - *error = [FlutterError errorWithCode:@"FWFUnsupportedVersionError" - message:@"setLimitsNavigationsToAppBoundDomains is only supported " - @"on iOS 14+ and macOS 11+." - details:nil]; - } -} - -- (void) - setMediaTypesRequiresUserActionForConfigurationWithIdentifier:(NSInteger)identifier - forTypes: - (nonnull NSArray< - FWFWKAudiovisualMediaTypeEnumData - *> *)types - error: - (FlutterError *_Nullable *_Nonnull) - error { - NSAssert(types.count, @"Types must not be empty."); - - WKWebViewConfiguration *configuration = - (WKWebViewConfiguration *)[self webViewConfigurationForIdentifier:identifier]; - WKAudiovisualMediaTypes typesInt = 0; - for (FWFWKAudiovisualMediaTypeEnumData *data in types) { - typesInt |= FWFNativeWKAudiovisualMediaTypeFromEnumData(data); - } - [configuration setMediaTypesRequiringUserActionForPlayback:typesInt]; -} -@end diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFWebViewFlutterWKWebViewExternalAPI.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFWebViewFlutterWKWebViewExternalAPI.m deleted file mode 100644 index 8cf93183b8a..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFWebViewFlutterWKWebViewExternalAPI.m +++ /dev/null @@ -1,21 +0,0 @@ -// 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 "./include/webview_flutter_wkwebview/FWFWebViewFlutterWKWebViewExternalAPI.h" -#import "./include/webview_flutter_wkwebview/FWFInstanceManager.h" - -@implementation FWFWebViewFlutterWKWebViewExternalAPI -+ (nullable WKWebView *)webViewForIdentifier:(long)identifier - withPluginRegistry:(id)registry { - FWFInstanceManager *instanceManager = - (FWFInstanceManager *)[registry valuePublishedByPlugin:@"FLTWebViewFlutterPlugin"]; - - id instance = [instanceManager instanceForIdentifier:identifier]; - if ([instance isKindOfClass:[WKWebView class]]) { - return instance; - } - - return nil; -} -@end diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFWebViewHostApi.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFWebViewHostApi.m deleted file mode 100644 index 2a937435c91..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFWebViewHostApi.m +++ /dev/null @@ -1,318 +0,0 @@ -// 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 "./include/webview_flutter_wkwebview/FWFWebViewHostApi.h" -#import "./include/webview_flutter_wkwebview/FWFDataConverters.h" - -@implementation FWFAssetManager -- (NSString *)lookupKeyForAsset:(NSString *)asset { - return [FlutterDartProject lookupKeyForAsset:asset]; -} -@end - -@implementation FWFWebView -- (instancetype)initWithFrame:(CGRect)frame - configuration:(nonnull WKWebViewConfiguration *)configuration - binaryMessenger:(id)binaryMessenger - instanceManager:(FWFInstanceManager *)instanceManager { - self = [self initWithFrame:frame configuration:configuration]; - if (self) { - _objectApi = [[FWFObjectFlutterApiImpl alloc] initWithBinaryMessenger:binaryMessenger - instanceManager:instanceManager]; - -#if TARGET_OS_IOS - self.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; - if (@available(iOS 13.0, *)) { - self.scrollView.automaticallyAdjustsScrollIndicatorInsets = NO; - } -#endif - } - return self; -} - -- (void)setFrame:(CGRect)frame { - [super setFrame:frame]; -#if TARGET_OS_IOS - // Prevents the contentInsets from being adjusted by iOS and gives control to Flutter. - self.scrollView.contentInset = UIEdgeInsetsZero; - - // Adjust contentInset to compensate the adjustedContentInset so the sum will - // always be 0. - if (UIEdgeInsetsEqualToEdgeInsets(self.scrollView.adjustedContentInset, UIEdgeInsetsZero)) { - return; - } - UIEdgeInsets insetToAdjust = self.scrollView.adjustedContentInset; - self.scrollView.contentInset = UIEdgeInsetsMake(-insetToAdjust.top, -insetToAdjust.left, - -insetToAdjust.bottom, -insetToAdjust.right); -#endif -} - -- (void)observeValueForKeyPath:(NSString *)keyPath - ofObject:(id)object - change:(NSDictionary *)change - context:(void *)context { - [self.objectApi observeValueForObject:self - keyPath:keyPath - object:object - change:change - completion:^(FlutterError *error) { - NSAssert(!error, @"%@", error); - }]; -} - -#pragma mark FlutterPlatformView - -#if TARGET_OS_IOS -- (nonnull UIView *)view { - return self; -} -#endif -@end - -@interface FWFWebViewHostApiImpl () -// BinaryMessenger must be weak to prevent a circular reference with the host API it -// references. -@property(nonatomic, weak) id binaryMessenger; -// InstanceManager must be weak to prevent a circular reference with the object it stores. -@property(nonatomic, weak) FWFInstanceManager *instanceManager; -@property NSBundle *bundle; -@property FWFAssetManager *assetManager; -@end - -@implementation FWFWebViewHostApiImpl -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - instanceManager:(FWFInstanceManager *)instanceManager { - return [self initWithBinaryMessenger:binaryMessenger - instanceManager:instanceManager - bundle:[NSBundle mainBundle] - assetManager:[[FWFAssetManager alloc] init]]; -} - -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - instanceManager:(FWFInstanceManager *)instanceManager - bundle:(NSBundle *)bundle - assetManager:(FWFAssetManager *)assetManager { - self = [self init]; - if (self) { - _binaryMessenger = binaryMessenger; - _instanceManager = instanceManager; - _bundle = bundle; - _assetManager = assetManager; - } - return self; -} - -- (FWFWebView *)webViewForIdentifier:(NSInteger)identifier { - return (FWFWebView *)[self.instanceManager instanceForIdentifier:identifier]; -} - -+ (nonnull FlutterError *)errorForURLString:(nonnull NSString *)string { - NSString *errorDetails = [NSString stringWithFormat:@"Initializing NSURL with the supplied " - @"'%@' path resulted in a nil value.", - string]; - return [FlutterError errorWithCode:@"FWFURLParsingError" - message:@"Failed parsing file path." - details:errorDetails]; -} - -- (void)createWithIdentifier:(NSInteger)identifier - configurationIdentifier:(NSInteger)configurationIdentifier - error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { - WKWebViewConfiguration *configuration = (WKWebViewConfiguration *)[self.instanceManager - instanceForIdentifier:configurationIdentifier]; - FWFWebView *webView = [[FWFWebView alloc] initWithFrame:CGRectMake(0, 0, 0, 0) - configuration:configuration - binaryMessenger:self.binaryMessenger - instanceManager:self.instanceManager]; - [self.instanceManager addDartCreatedInstance:webView withIdentifier:identifier]; -} - -- (void)loadRequestForWebViewWithIdentifier:(NSInteger)identifier - request:(nonnull FWFNSUrlRequestData *)request - error: - (FlutterError *_Nullable __autoreleasing *_Nonnull)error { - NSURLRequest *urlRequest = FWFNativeNSURLRequestFromRequestData(request); - if (!urlRequest) { - *error = [FlutterError errorWithCode:@"FWFURLRequestParsingError" - message:@"Failed instantiating an NSURLRequest." - details:[NSString stringWithFormat:@"URL was: '%@'", request.url]]; - return; - } - [[self webViewForIdentifier:identifier] loadRequest:urlRequest]; -} - -- (void)setCustomUserAgentForWebViewWithIdentifier:(NSInteger)identifier - userAgent:(nullable NSString *)userAgent - error: - (FlutterError *_Nullable __autoreleasing *_Nonnull) - error { - [[self webViewForIdentifier:identifier] setCustomUserAgent:userAgent]; -} - -- (nullable NSNumber *) - canGoBackForWebViewWithIdentifier:(NSInteger)identifier - error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { - return @([self webViewForIdentifier:identifier].canGoBack); -} - -- (nullable NSString *) - URLForWebViewWithIdentifier:(NSInteger)identifier - error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { - return [self webViewForIdentifier:identifier].URL.absoluteString; -} - -- (nullable NSNumber *) - canGoForwardForWebViewWithIdentifier:(NSInteger)identifier - error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { - return @([[self webViewForIdentifier:identifier] canGoForward]); -} - -- (nullable NSNumber *) - estimatedProgressForWebViewWithIdentifier:(NSInteger)identifier - error:(FlutterError *_Nullable __autoreleasing *_Nonnull) - error { - return @([[self webViewForIdentifier:identifier] estimatedProgress]); -} - -- (void)evaluateJavaScriptForWebViewWithIdentifier:(NSInteger)identifier - javaScriptString:(nonnull NSString *)javaScriptString - completion: - (nonnull void (^)(id _Nullable, - FlutterError *_Nullable))completion { - [[self webViewForIdentifier:identifier] - evaluateJavaScript:javaScriptString - completionHandler:^(id _Nullable result, NSError *_Nullable error) { - id returnValue = nil; - FlutterError *flutterError = nil; - if (!error) { - if (!result || [result isKindOfClass:[NSString class]] || - [result isKindOfClass:[NSNumber class]]) { - returnValue = result; - } else if (![result isKindOfClass:[NSNull class]]) { - NSString *className = NSStringFromClass([result class]); - NSLog(@"Return type of evaluateJavaScript is not directly supported: %@. Returned " - @"description of value.", - className); - returnValue = [result description]; - } - } else { - flutterError = [FlutterError errorWithCode:@"FWFEvaluateJavaScriptError" - message:@"Failed evaluating JavaScript." - details:FWFNSErrorDataFromNativeNSError(error)]; - } - - completion(returnValue, flutterError); - }]; -} - -- (void)setInspectableForWebViewWithIdentifier:(NSInteger)identifier - inspectable:(BOOL)inspectable - error:(FlutterError *_Nullable *_Nonnull)error { - if (@available(macOS 13.3, iOS 16.4, tvOS 16.4, *)) { -#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 130300 || __IPHONE_OS_VERSION_MAX_ALLOWED >= 160400 - [[self webViewForIdentifier:identifier] setInspectable:inspectable]; -#endif - } else { - *error = [FlutterError errorWithCode:@"FWFUnsupportedVersionError" - message:@"setInspectable is only supported on versions 16.4+." - details:nil]; - } -} - -- (void)goBackForWebViewWithIdentifier:(NSInteger)identifier - error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { - [[self webViewForIdentifier:identifier] goBack]; -} - -- (void)goForwardForWebViewWithIdentifier:(NSInteger)identifier - error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { - [[self webViewForIdentifier:identifier] goForward]; -} - -- (void)loadAssetForWebViewWithIdentifier:(NSInteger)identifier - assetKey:(nonnull NSString *)key - error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { - NSString *assetFilePath = [self.assetManager lookupKeyForAsset:key]; - - NSURL *url = [self.bundle URLForResource:[assetFilePath stringByDeletingPathExtension] - withExtension:assetFilePath.pathExtension]; - if (!url) { - *error = [FWFWebViewHostApiImpl errorForURLString:assetFilePath]; - } else { - [[self webViewForIdentifier:identifier] loadFileURL:url - allowingReadAccessToURL:[url URLByDeletingLastPathComponent]]; - } -} - -- (void)loadFileForWebViewWithIdentifier:(NSInteger)identifier - fileURL:(nonnull NSString *)url - readAccessURL:(nonnull NSString *)readAccessUrl - error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { - NSURL *fileURL = [NSURL fileURLWithPath:url isDirectory:NO]; - NSURL *readAccessNSURL = [NSURL fileURLWithPath:readAccessUrl isDirectory:YES]; - - if (!fileURL) { - *error = [FWFWebViewHostApiImpl errorForURLString:url]; - } else if (!readAccessNSURL) { - *error = [FWFWebViewHostApiImpl errorForURLString:readAccessUrl]; - } else { - [[self webViewForIdentifier:identifier] loadFileURL:fileURL - allowingReadAccessToURL:readAccessNSURL]; - } -} - -- (void)loadHTMLForWebViewWithIdentifier:(NSInteger)identifier - HTMLString:(nonnull NSString *)string - baseURL:(nullable NSString *)baseUrl - error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { - [[self webViewForIdentifier:identifier] loadHTMLString:string - baseURL:[NSURL URLWithString:baseUrl]]; -} - -- (void)reloadWebViewWithIdentifier:(NSInteger)identifier - error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { - [[self webViewForIdentifier:identifier] reload]; -} - -- (void) - setAllowsBackForwardForWebViewWithIdentifier:(NSInteger)identifier - isAllowed:(BOOL)allow - error:(FlutterError *_Nullable __autoreleasing *_Nonnull) - error { - [[self webViewForIdentifier:identifier] setAllowsBackForwardNavigationGestures:allow]; -} - -- (void) - setNavigationDelegateForWebViewWithIdentifier:(NSInteger)identifier - delegateIdentifier:(nullable NSNumber *)navigationDelegateIdentifier - error: - (FlutterError *_Nullable __autoreleasing *_Nonnull) - error { - id navigationDelegate = (id)[self.instanceManager - instanceForIdentifier:navigationDelegateIdentifier.longValue]; - [[self webViewForIdentifier:identifier] setNavigationDelegate:navigationDelegate]; -} - -- (void)setUIDelegateForWebViewWithIdentifier:(NSInteger)identifier - delegateIdentifier:(nullable NSNumber *)uiDelegateIdentifier - error:(FlutterError *_Nullable __autoreleasing *_Nonnull) - error { - id navigationDelegate = - (id)[self.instanceManager instanceForIdentifier:uiDelegateIdentifier.longValue]; - [[self webViewForIdentifier:identifier] setUIDelegate:navigationDelegate]; -} - -- (nullable NSString *) - titleForWebViewWithIdentifier:(NSInteger)identifier - error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { - return [[self webViewForIdentifier:identifier] title]; -} - -- (nullable NSString *) - customUserAgentForWebViewWithIdentifier:(NSInteger)identifier - error: - (FlutterError *_Nullable __autoreleasing *_Nonnull)error { - return [[self webViewForIdentifier:identifier] customUserAgent]; -} -@end diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFWebsiteDataStoreHostApi.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFWebsiteDataStoreHostApi.m deleted file mode 100644 index 7e7ead760ef..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFWebsiteDataStoreHostApi.m +++ /dev/null @@ -1,66 +0,0 @@ -// 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 "./include/webview_flutter_wkwebview/FWFWebsiteDataStoreHostApi.h" -#import "./include/webview_flutter_wkwebview/FWFDataConverters.h" -#import "./include/webview_flutter_wkwebview/FWFWebViewConfigurationHostApi.h" - -@interface FWFWebsiteDataStoreHostApiImpl () -// InstanceManager must be weak to prevent a circular reference with the object it stores. -@property(nonatomic, weak) FWFInstanceManager *instanceManager; -@end - -@implementation FWFWebsiteDataStoreHostApiImpl -- (instancetype)initWithInstanceManager:(FWFInstanceManager *)instanceManager { - self = [self init]; - if (self) { - _instanceManager = instanceManager; - } - return self; -} - -- (WKWebsiteDataStore *)websiteDataStoreForIdentifier:(NSInteger)identifier { - return (WKWebsiteDataStore *)[self.instanceManager instanceForIdentifier:identifier]; -} - -- (void)createFromWebViewConfigurationWithIdentifier:(NSInteger)identifier - configurationIdentifier:(NSInteger)configurationIdentifier - error:(FlutterError *_Nullable *_Nonnull)error { - WKWebViewConfiguration *configuration = (WKWebViewConfiguration *)[self.instanceManager - instanceForIdentifier:configurationIdentifier]; - [self.instanceManager addDartCreatedInstance:configuration.websiteDataStore - withIdentifier:identifier]; -} - -- (void)createDefaultDataStoreWithIdentifier:(NSInteger)identifier - error:(FlutterError *_Nullable __autoreleasing *_Nonnull) - error { - [self.instanceManager addDartCreatedInstance:[WKWebsiteDataStore defaultDataStore] - withIdentifier:identifier]; -} - -- (void)removeDataFromDataStoreWithIdentifier:(NSInteger)identifier - ofTypes:(nonnull NSArray *) - dataTypes - modifiedSince:(double)modificationTimeInSecondsSinceEpoch - completion: - (nonnull void (^)(NSNumber *_Nullable, - FlutterError *_Nullable))completion { - NSMutableSet *stringDataTypes = [NSMutableSet set]; - for (FWFWKWebsiteDataTypeEnumData *type in dataTypes) { - [stringDataTypes addObject:FWFNativeWKWebsiteDataTypeFromEnumData(type)]; - } - - WKWebsiteDataStore *dataStore = [self websiteDataStoreForIdentifier:identifier]; - [dataStore fetchDataRecordsOfTypes:stringDataTypes - completionHandler:^(NSArray *records) { - [dataStore removeDataOfTypes:stringDataTypes - modifiedSince:[NSDate dateWithTimeIntervalSince1970: - modificationTimeInSecondsSinceEpoch] - completionHandler:^{ - completion([NSNumber numberWithBool:(records.count > 0)], nil); - }]; - }]; -} -@end diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FlutterAssetManager.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FlutterAssetManager.swift new file mode 100644 index 00000000000..2c66d735a46 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FlutterAssetManager.swift @@ -0,0 +1,17 @@ +// 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. + +#if os(iOS) + import Flutter +#elseif os(macOS) + import FlutterMacOS +#else + #error("Unsupported platform.") +#endif + +open class FlutterAssetManager { + func lookupKeyForAsset(_ asset: String) -> String { + return FlutterDartProject.lookupKey(forAsset: asset) + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FlutterViewFactory.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FlutterViewFactory.swift new file mode 100644 index 00000000000..ca8a8aa7f27 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FlutterViewFactory.swift @@ -0,0 +1,74 @@ +// 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 Foundation + +#if os(iOS) + import Flutter + import UIKit +#elseif os(macOS) + import FlutterMacOS +#else + #error("Unsupported platform.") +#endif + +/// Implementation of `FlutterPlatformViewFactory` that retrieves the view from the `WebKitLibraryPigeonInstanceManager`. +class FlutterViewFactory: NSObject, FlutterPlatformViewFactory { + unowned let instanceManager: WebKitLibraryPigeonInstanceManager + + #if os(iOS) + class PlatformViewImpl: NSObject, FlutterPlatformView { + let uiView: UIView + + init(uiView: UIView) { + self.uiView = uiView + } + + func view() -> UIView { + return uiView + } + } + #endif + + init(instanceManager: WebKitLibraryPigeonInstanceManager) { + self.instanceManager = instanceManager + } + + #if os(iOS) + func create(withFrame frame: CGRect, viewIdentifier viewId: Int64, arguments args: Any?) + -> FlutterPlatformView + { + let identifier: Int64 = args is Int64 ? args as! Int64 : Int64(args as! Int32) + let instance: AnyObject? = instanceManager.instance(forIdentifier: identifier) + + if let instance = instance as? FlutterPlatformView { + instance.view().frame = frame + return instance + } else { + let view = instance as! UIView + view.frame = frame + return PlatformViewImpl(uiView: view) + } + } + #elseif os(macOS) + func create( + withViewIdentifier viewId: Int64, + arguments args: Any? + ) -> NSView { + let identifier: Int64 = args is Int64 ? args as! Int64 : Int64(args as! Int32) + let instance: AnyObject? = instanceManager.instance(forIdentifier: identifier) + return instance as! NSView + } + #endif + + #if os(iOS) + func createArgsCodec() -> FlutterMessageCodec & NSObjectProtocol { + return FlutterStandardMessageCodec.sharedInstance() + } + #elseif os(macOS) + func createArgsCodec() -> (FlutterMessageCodec & NSObjectProtocol)? { + return FlutterStandardMessageCodec.sharedInstance() + } + #endif +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FrameInfoProxyAPIDelegate.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FrameInfoProxyAPIDelegate.swift new file mode 100644 index 00000000000..5fd11474f80 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FrameInfoProxyAPIDelegate.swift @@ -0,0 +1,37 @@ +// 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 + +extension WKFrameInfo { + // It's possible that `WKFrameInfo.request` can be a nil value despite the Swift code considering + // it to be nonnull. This causes a crash when accessing the value with Swift. Accessing the value + // this way prevents the crash when the value is nil. + // + // See https://github.com/flutter/flutter/issues/163549 and https://developer.apple.com/forums/thread/77888. + var maybeRequest: URLRequest? { + return self.perform(#selector(getter:WKFrameInfo.request))?.takeUnretainedValue() + as! URLRequest? + } +} + +/// ProxyApi implementation for `WKFrameInfo`. +/// +/// 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 FrameInfoProxyAPIDelegate: PigeonApiDelegateWKFrameInfo { + func isMainFrame(pigeonApi: PigeonApiWKFrameInfo, pigeonInstance: WKFrameInfo) throws -> Bool { + return pigeonInstance.isMainFrame + } + + func request(pigeonApi: PigeonApiWKFrameInfo, pigeonInstance: WKFrameInfo) throws + -> URLRequestWrapper? + { + let request = pigeonInstance.maybeRequest + if let request = request { + return URLRequestWrapper(request) + } + return nil + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/HTTPCookieProxyAPIDelegate.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/HTTPCookieProxyAPIDelegate.swift new file mode 100644 index 00000000000..0b6fca238a4 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/HTTPCookieProxyAPIDelegate.swift @@ -0,0 +1,125 @@ +// 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 Foundation + +/// ProxyApi implementation for `HTTPCookie`. +/// +/// 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 HTTPCookieProxyAPIDelegate: PigeonApiDelegateHTTPCookie { + func pigeonDefaultConstructor( + pigeonApi: PigeonApiHTTPCookie, properties: [HttpCookiePropertyKey: Any] + ) throws -> HTTPCookie { + let registrar = pigeonApi.pigeonRegistrar as! ProxyAPIRegistrar + + let keyValueTuples = try! properties.map<[(HTTPCookiePropertyKey, Any)], PigeonError> { + key, value in + + let newKey: HTTPCookiePropertyKey + switch key { + case .comment: + newKey = .comment + case .commentUrl: + newKey = .commentURL + case .discard: + newKey = .discard + case .domain: + newKey = .domain + case .expires: + newKey = .expires + case .maximumAge: + newKey = .maximumAge + case .name: + newKey = .name + case .originUrl: + newKey = .originURL + case .path: + newKey = .path + case .port: + newKey = .port + case .secure: + newKey = .secure + case .value: + newKey = .value + case .version: + newKey = .version + case .sameSitePolicy: + if #available(iOS 13.0, macOS 10.15, *) { + newKey = .sameSitePolicy + } else { + throw + registrar + .createUnsupportedVersionError( + method: "HTTPCookiePropertyKey.sameSitePolicy", + versionRequirements: "iOS 13.0, macOS 10.15") + } + case .unknown: + throw registrar.createUnknownEnumError( + withEnum: key) + } + + return (newKey, value) + } + + let nativeProperties = Dictionary(uniqueKeysWithValues: keyValueTuples) + let cookie = HTTPCookie(properties: nativeProperties) + if let cookie = cookie { + return cookie + } else { + throw registrar.createConstructorNullError( + type: HTTPCookie.self, parameters: ["properties": nativeProperties]) + } + } + + func getProperties(pigeonApi: PigeonApiHTTPCookie, pigeonInstance: HTTPCookie) throws + -> [HttpCookiePropertyKey: Any]? + { + if pigeonInstance.properties == nil { + return nil + } + + let keyValueTuples = pigeonInstance.properties!.map { key, value in + let newKey: HttpCookiePropertyKey + if #available(iOS 13.0, macOS 10.15, *), key == .sameSitePolicy { + newKey = .sameSitePolicy + } else { + switch key { + case .comment: + newKey = .comment + case .commentURL: + newKey = .commentUrl + case .discard: + newKey = .discard + case .domain: + newKey = .domain + case .expires: + newKey = .expires + case .maximumAge: + newKey = .maximumAge + case .name: + newKey = .name + case .originURL: + newKey = .originUrl + case .path: + newKey = .path + case .port: + newKey = .port + case .secure: + newKey = .secure + case .value: + newKey = .value + case .version: + newKey = .version + default: + newKey = .unknown + } + } + + return (newKey, value) + } + + return Dictionary(uniqueKeysWithValues: keyValueTuples) + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/HTTPCookieStoreProxyAPIDelegate.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/HTTPCookieStoreProxyAPIDelegate.swift new file mode 100644 index 00000000000..5026783b3b2 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/HTTPCookieStoreProxyAPIDelegate.swift @@ -0,0 +1,21 @@ +// 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 Foundation +import WebKit + +/// ProxyApi implementation for `WKHTTPCookieStore`. +/// +/// 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 HTTPCookieStoreProxyAPIDelegate: PigeonApiDelegateWKHTTPCookieStore { + func setCookie( + pigeonApi: PigeonApiWKHTTPCookieStore, pigeonInstance: WKHTTPCookieStore, cookie: HTTPCookie, + completion: @escaping (Result) -> Void + ) { + pigeonInstance.setCookie(cookie) { + completion(.success(Void())) + } + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/HTTPURLResponseProxyAPIDelegate.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/HTTPURLResponseProxyAPIDelegate.swift new file mode 100644 index 00000000000..ed73f9a2130 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/HTTPURLResponseProxyAPIDelegate.swift @@ -0,0 +1,17 @@ +// 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 Foundation + +/// ProxyApi implementation for `HTTPURLResponse`. +/// +/// 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 HTTPURLResponseProxyAPIDelegate: PigeonApiDelegateHTTPURLResponse { + func statusCode(pigeonApi: PigeonApiHTTPURLResponse, pigeonInstance: HTTPURLResponse) throws + -> Int64 + { + return Int64(pigeonInstance.statusCode) + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/NSObjectProxyAPIDelegate.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/NSObjectProxyAPIDelegate.swift new file mode 100644 index 00000000000..5cde55b97ac --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/NSObjectProxyAPIDelegate.swift @@ -0,0 +1,107 @@ +// 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 Foundation + +/// Implementation of `NSObject` that calls to Dart in callback methods. +class NSObjectImpl: NSObject { + let api: PigeonApiProtocolNSObject + unowned let registrar: ProxyAPIRegistrar + + init(api: PigeonApiProtocolNSObject, registrar: ProxyAPIRegistrar) { + self.api = api + self.registrar = registrar + } + + static func handleObserveValue( + withApi api: PigeonApiProtocolNSObject, registrar: ProxyAPIRegistrar, instance: NSObject, + forKeyPath keyPath: String?, + of object: Any?, change: [NSKeyValueChangeKey: Any]?, context: UnsafeMutableRawPointer? + ) { + let wrapperKeys: [KeyValueChangeKey: Any]? + if change != nil { + let keyValueTuples = change!.map { key, value in + let newKey: KeyValueChangeKey + switch key { + case .kindKey: + newKey = .kind + case .indexesKey: + newKey = .indexes + case .newKey: + newKey = .newValue + case .oldKey: + newKey = .oldValue + case .notificationIsPriorKey: + newKey = .notificationIsPrior + default: + newKey = .unknown + } + + return (newKey, value) + } + + wrapperKeys = Dictionary(uniqueKeysWithValues: keyValueTuples) + } else { + wrapperKeys = nil + } + + registrar.dispatchOnMainThread { onFailure in + api.observeValue( + pigeonInstance: instance, keyPath: keyPath, object: object as? NSObject, change: wrapperKeys + ) { result in + if case .failure(let error) = result { + onFailure("NSObject.observeValue", error) + } + } + } + } + + override func observeValue( + forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey: Any]?, + context: UnsafeMutableRawPointer? + ) { + NSObjectImpl.handleObserveValue( + withApi: api, registrar: registrar, instance: self as NSObject, forKeyPath: keyPath, + of: object, change: change, + context: context) + } +} + +/// ProxyApi implementation for `NSObject`. +/// +/// 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 NSObjectProxyAPIDelegate: PigeonApiDelegateNSObject { + func pigeonDefaultConstructor(pigeonApi: PigeonApiNSObject) throws -> NSObject { + return NSObjectImpl(api: pigeonApi, registrar: pigeonApi.pigeonRegistrar as! ProxyAPIRegistrar) + } + + func addObserver( + pigeonApi: PigeonApiNSObject, pigeonInstance: NSObject, observer: NSObject, keyPath: String, + options: [KeyValueObservingOptions] + ) throws { + var nativeOptions: NSKeyValueObservingOptions = [] + + for option in options { + switch option { + case .newValue: + nativeOptions.insert(.new) + case .oldValue: + nativeOptions.insert(.old) + case .initialValue: + nativeOptions.insert(.initial) + case .priorNotification: + nativeOptions.insert(.prior) + } + } + + pigeonInstance.addObserver(observer, forKeyPath: keyPath, options: nativeOptions, context: nil) + } + + func removeObserver( + pigeonApi: PigeonApiNSObject, pigeonInstance: NSObject, observer: NSObject, keyPath: String + ) throws { + pigeonInstance.removeObserver(observer, forKeyPath: keyPath) + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/NavigationActionProxyAPIDelegate.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/NavigationActionProxyAPIDelegate.swift new file mode 100644 index 00000000000..752884eca3c --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/NavigationActionProxyAPIDelegate.swift @@ -0,0 +1,44 @@ +// 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 [WKNavigationAction]. +/// +/// 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 NavigationActionProxyAPIDelegate: PigeonApiDelegateWKNavigationAction { + func request(pigeonApi: PigeonApiWKNavigationAction, pigeonInstance: WKNavigationAction) throws + -> URLRequestWrapper + { + return URLRequestWrapper(pigeonInstance.request) + } + + func targetFrame(pigeonApi: PigeonApiWKNavigationAction, pigeonInstance: WKNavigationAction) + throws -> WKFrameInfo? + { + return pigeonInstance.targetFrame + } + + func navigationType(pigeonApi: PigeonApiWKNavigationAction, pigeonInstance: WKNavigationAction) + throws -> NavigationType + { + switch pigeonInstance.navigationType { + case .linkActivated: + return .linkActivated + case .formSubmitted: + return .formSubmitted + case .backForward: + return .backForward + case .reload: + return .reload + case .formResubmitted: + return .formResubmitted + case .other: + return .other + @unknown default: + return .unknown + } + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/NavigationDelegateProxyAPIDelegate.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/NavigationDelegateProxyAPIDelegate.swift new file mode 100644 index 00000000000..8735fddf4c6 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/NavigationDelegateProxyAPIDelegate.swift @@ -0,0 +1,334 @@ +// 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 + +/// Implementation of `WKNavigationDelegate` that calls to Dart in callback methods. +public class NavigationDelegateImpl: NSObject, WKNavigationDelegate { + let api: PigeonApiProtocolWKNavigationDelegate + unowned let registrar: ProxyAPIRegistrar + + init(api: PigeonApiProtocolWKNavigationDelegate, registrar: ProxyAPIRegistrar) { + self.api = api + self.registrar = registrar + } + + public func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) { + registrar.dispatchOnMainThread { onFailure in + self.api.didFinishNavigation( + pigeonInstance: self, webView: webView, url: webView.url?.absoluteString + ) { result in + if case .failure(let error) = result { + onFailure("WKNavigationDelegate.didFinishNavigation", error) + } + } + } + } + + public func webView(_ webView: WKWebView, didStartProvisionalNavigation navigation: WKNavigation!) + { + registrar.dispatchOnMainThread { onFailure in + self.api.didStartProvisionalNavigation( + pigeonInstance: self, webView: webView, url: webView.url?.absoluteString + ) { result in + if case .failure(let error) = result { + onFailure("WKNavigationDelegate.didStartProvisionalNavigation", error) + } + } + } + } + + public func webView( + _ webView: WKWebView, didFail navigation: WKNavigation!, withError error: Error + ) { + registrar.dispatchOnMainThread { onFailure in + self.api.didFailNavigation(pigeonInstance: self, webView: webView, error: error as NSError) { + result in + if case .failure(let error) = result { + onFailure("WKNavigationDelegate.didFailNavigation", error) + } + } + } + } + + public func webView( + _ webView: WKWebView, didFailProvisionalNavigation navigation: WKNavigation!, + withError error: Error + ) { + registrar.dispatchOnMainThread { onFailure in + self.api.didFailProvisionalNavigation( + pigeonInstance: self, webView: webView, error: error as NSError + ) { result in + if case .failure(let error) = result { + onFailure("WKNavigationDelegate.didFailProvisionalNavigation", error) + } + } + } + } + + public func webViewWebContentProcessDidTerminate(_ webView: WKWebView) { + registrar.dispatchOnMainThread { onFailure in + self.api.webViewWebContentProcessDidTerminate(pigeonInstance: self, webView: webView) { + result in + if case .failure(let error) = result { + onFailure("WKNavigationDelegate.webViewWebContentProcessDidTerminate", error) + } + } + } + } + + #if compiler(>=6.0) + public func webView( + _ webView: WKWebView, decidePolicyFor navigationAction: WebKit.WKNavigationAction, + decisionHandler: @escaping @MainActor (WebKit.WKNavigationActionPolicy) -> Void + ) { + registrar.dispatchOnMainThread { onFailure in + self.api.decidePolicyForNavigationAction( + pigeonInstance: self, webView: webView, navigationAction: navigationAction + ) { result in + DispatchQueue.main.async { + switch result { + case .success(let policy): + switch policy { + case .allow: + decisionHandler(.allow) + case .cancel: + decisionHandler(.cancel) + case .download: + if #available(iOS 14.5, macOS 11.3, *) { + decisionHandler(.download) + } else { + decisionHandler(.cancel) + assertionFailure( + self.registrar.createUnsupportedVersionMessage( + "WKNavigationActionPolicy.download", + versionRequirements: "iOS 14.5, macOS 11.3" + )) + } + } + case .failure(let error): + decisionHandler(.cancel) + onFailure("WKNavigationDelegate.decidePolicyForNavigationAction", error) + } + } + } + } + } + #else + public func webView( + _ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, + decisionHandler: @escaping (WKNavigationActionPolicy) -> Void + ) { + registrar.dispatchOnMainThread { onFailure in + self.api.decidePolicyForNavigationAction( + pigeonInstance: self, webView: webView, navigationAction: navigationAction + ) { result in + DispatchQueue.main.async { + switch result { + case .success(let policy): + switch policy { + case .allow: + decisionHandler(.allow) + case .cancel: + decisionHandler(.cancel) + case .download: + if #available(iOS 14.5, macOS 11.3, *) { + decisionHandler(.download) + } else { + decisionHandler(.cancel) + assertionFailure( + self.registrar.createUnsupportedVersionMessage( + "WKNavigationActionPolicy.download", + versionRequirements: "iOS 14.5, macOS 11.3" + )) + } + } + case .failure(let error): + decisionHandler(.cancel) + onFailure("WKNavigationDelegate.decidePolicyForNavigationAction", error) + } + } + } + } + } + #endif + + #if compiler(>=6.0) + public func webView( + _ webView: WKWebView, decidePolicyFor navigationResponse: WKNavigationResponse, + decisionHandler: @escaping @MainActor (WKNavigationResponsePolicy) -> Void + ) { + registrar.dispatchOnMainThread { onFailure in + self.api.decidePolicyForNavigationResponse( + pigeonInstance: self, webView: webView, navigationResponse: navigationResponse + ) { result in + DispatchQueue.main.async { + switch result { + case .success(let policy): + switch policy { + case .allow: + decisionHandler(.allow) + case .cancel: + decisionHandler(.cancel) + case .download: + if #available(iOS 14.5, macOS 11.3, *) { + decisionHandler(.download) + } else { + decisionHandler(.cancel) + assertionFailure( + self.registrar.createUnsupportedVersionMessage( + "WKNavigationResponsePolicy.download", + versionRequirements: "iOS 14.5, macOS 11.3" + )) + } + } + case .failure(let error): + decisionHandler(.cancel) + onFailure("WKNavigationDelegate.decidePolicyForNavigationResponse", error) + } + } + } + } + } + #else + public func webView( + _ webView: WKWebView, decidePolicyFor navigationResponse: WKNavigationResponse, + decisionHandler: @escaping (WKNavigationResponsePolicy) -> Void + ) { + registrar.dispatchOnMainThread { onFailure in + self.api.decidePolicyForNavigationResponse( + pigeonInstance: self, webView: webView, navigationResponse: navigationResponse + ) { result in + DispatchQueue.main.async { + switch result { + case .success(let policy): + switch policy { + case .allow: + decisionHandler(.allow) + case .cancel: + decisionHandler(.cancel) + case .download: + if #available(iOS 14.5, macOS 11.3, *) { + decisionHandler(.download) + } else { + decisionHandler(.cancel) + assertionFailure( + self.registrar.createUnsupportedVersionMessage( + "WKNavigationResponsePolicy.download", + versionRequirements: "iOS 14.5, macOS 11.3" + )) + } + } + case .failure(let error): + decisionHandler(.cancel) + onFailure("WKNavigationDelegate.decidePolicyForNavigationResponse", error) + } + } + } + } + } + #endif + + func handleAuthChallengeSuccessResponse(_ response: [Any?]) -> ( + URLSession.AuthChallengeDisposition, URLCredential? + ) { + let disposition = response[0] as! UrlSessionAuthChallengeDisposition + var nativeDisposition: URLSession.AuthChallengeDisposition + switch disposition { + case .useCredential: + nativeDisposition = .useCredential + case .performDefaultHandling: + nativeDisposition = .performDefaultHandling + case .cancelAuthenticationChallenge: + nativeDisposition = .cancelAuthenticationChallenge + case .rejectProtectionSpace: + nativeDisposition = .rejectProtectionSpace + case .unknown: + print( + self.registrar.createUnknownEnumError(withEnum: disposition).localizedDescription) + nativeDisposition = .cancelAuthenticationChallenge + } + let credentialMap = response[1] as? [AnyHashable?: AnyHashable?] + var credential: URLCredential? + if let credentialMap = credentialMap { + let nativePersistence: URLCredential.Persistence + switch credentialMap["persistence"] as! UrlCredentialPersistence { + case .none: + nativePersistence = .none + case .forSession: + nativePersistence = .forSession + case .permanent: + nativePersistence = .permanent + case .synchronizable: + nativePersistence = .synchronizable + } + credential = URLCredential( + user: credentialMap["user"] as! String, + password: credentialMap["password"] as! String, persistence: nativePersistence) + } + return (nativeDisposition, credential) + } + + #if compiler(>=6.0) + public func webView( + _ webView: WKWebView, didReceive challenge: URLAuthenticationChallenge, + completionHandler: @escaping @MainActor (URLSession.AuthChallengeDisposition, URLCredential?) + -> + Void + ) { + registrar.dispatchOnMainThread { onFailure in + self.api.didReceiveAuthenticationChallenge( + pigeonInstance: self, webView: webView, challenge: challenge + ) { result in + DispatchQueue.main.async { + switch result { + case .success(let response): + let nativeValues = self.handleAuthChallengeSuccessResponse(response) + completionHandler(nativeValues.0, nativeValues.1) + case .failure(let error): + completionHandler(.cancelAuthenticationChallenge, nil) + onFailure("WKNavigationDelegate.didReceiveAuthenticationChallenge", error) + } + } + } + } + } + #else + public func webView( + _ webView: WKWebView, didReceive challenge: URLAuthenticationChallenge, + completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> + Void + ) { + registrar.dispatchOnMainThread { onFailure in + self.api.didReceiveAuthenticationChallenge( + pigeonInstance: self, webView: webView, challenge: challenge + ) { result in + DispatchQueue.main.async { + switch result { + case .success(let response): + let nativeValues = self.handleAuthChallengeSuccessResponse(response) + completionHandler(nativeValues.0, nativeValues.1) + case .failure(let error): + completionHandler(.cancelAuthenticationChallenge, nil) + onFailure("WKNavigationDelegate.didReceiveAuthenticationChallenge", error) + } + } + } + } + } + #endif +} + +/// ProxyApi implementation for `WKNavigationDelegate`. +/// +/// 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 NavigationDelegateProxyAPIDelegate: PigeonApiDelegateWKNavigationDelegate { + func pigeonDefaultConstructor(pigeonApi: PigeonApiWKNavigationDelegate) throws + -> WKNavigationDelegate + { + return NavigationDelegateImpl( + api: pigeonApi, registrar: pigeonApi.pigeonRegistrar as! ProxyAPIRegistrar) + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/NavigationResponseProxyAPIDelegate.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/NavigationResponseProxyAPIDelegate.swift new file mode 100644 index 00000000000..9cd75f80e39 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/NavigationResponseProxyAPIDelegate.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 + +/// ProxyApi implementation for `WKNavigationResponse`. +/// +/// 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 NavigationResponseProxyAPIDelegate: PigeonApiDelegateWKNavigationResponse { + func response(pigeonApi: PigeonApiWKNavigationResponse, pigeonInstance: WKNavigationResponse) + throws -> URLResponse + { + return pigeonInstance.response + } + + func isForMainFrame( + pigeonApi: PigeonApiWKNavigationResponse, pigeonInstance: WKNavigationResponse + ) throws -> Bool { + return pigeonInstance.isForMainFrame + } +} 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 new file mode 100644 index 00000000000..aca8f398ace --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/PreferencesProxyAPIDelegate.swift @@ -0,0 +1,26 @@ +// 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 `WKPreferences`. +/// +/// 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 PreferencesProxyAPIDelegate: PigeonApiDelegateWKPreferences { + func setJavaScriptEnabled( + 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", + versionRequirements: "< iOS 14.0, macOS 11.0") + } else { + pigeonInstance.javaScriptEnabled = enabled + } + } +} 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 new file mode 100644 index 00000000000..607001b2bc5 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/ProxyAPIRegistrar.swift @@ -0,0 +1,283 @@ +// 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 Foundation + +#if os(iOS) + import Flutter + import UIKit +#elseif os(macOS) + import FlutterMacOS + import Foundation +#else + #error("Unsupported platform.") +#endif + +/// Implementation of `WebKitLibraryPigeonProxyApiRegistrar` that provides any additional resources needed by API implementations. +open class ProxyAPIRegistrar: WebKitLibraryPigeonProxyApiRegistrar { + let assetManager = FlutterAssetManager() + let bundle: Bundle + + init(binaryMessenger: FlutterBinaryMessenger, bundle: Bundle = Bundle.main) { + self.bundle = bundle + super.init(binaryMessenger: binaryMessenger, apiDelegate: ProxyAPIDelegate()) + } + + /// Creates an error when the `unknown` enum value is passed to a host method. + func createUnknownEnumError(withEnum enumValue: Any) -> PigeonError { + return PigeonError( + code: "UnknownEnumError", message: "\(enumValue) doesn't represent a native value.", + details: nil) + } + + /// Creates an error when a method is called on an unsupported version. + func createUnsupportedVersionError(method: String, versionRequirements: String) -> PigeonError { + return PigeonError( + code: "FWFUnsupportedVersionError", + message: createUnsupportedVersionMessage(method, versionRequirements: versionRequirements), + details: nil) + } + + /// Creates the error message when a method is called on an unsupported version. + func createUnsupportedVersionMessage(_ method: String, versionRequirements: String) -> String { + return "`\(method)` requires \(versionRequirements)." + } + + // Creates an error when the constructor of a URL returns null. + // + // New methods should use `createConstructorNullError`, but this stays + // to keep error code consistent with previous plugin versions. + fileprivate func createNullURLError(url: String) -> PigeonError { + return PigeonError( + code: "FWFURLParsingError", message: "Failed parsing file path.", + details: "Initializing URL with the supplied '\(url)' path resulted in a nil value.") + } + + /// Creates an error when the constructor of a class returns null. + func createConstructorNullError(type: Any.Type, parameters: [String: Any?]) -> PigeonError { + if type == URL.self && parameters["string"] != nil { + return createNullURLError(url: parameters["string"] as! String) + } + + return PigeonError( + code: "ConstructorReturnedNullError", + message: "Failed to instantiate `\(String(describing: type))` with parameters: \(parameters)", + details: nil) + } + + // Creates an assertion failure when a Flutter method receives an error from Dart. + fileprivate func assertFlutterMethodFailure(_ error: PigeonError, methodName: String) { + assertionFailure( + "\(String(describing: error)): Error returned from calling \(methodName): \(String(describing: error.message))" + ) + } + + /// Handles calling a Flutter method on the main thread. + func dispatchOnMainThread( + execute work: @escaping ( + _ onFailure: @escaping (_ methodName: String, _ error: PigeonError) -> Void + ) -> Void + ) { + DispatchQueue.main.async { + work { methodName, error in + self.assertFlutterMethodFailure(error, methodName: methodName) + } + } + } +} + +/// Implementation of `WebKitLibraryPigeonProxyApiDelegate` that provides each ProxyApi delegate implementation. +class ProxyAPIDelegate: WebKitLibraryPigeonProxyApiDelegate { + func pigeonApiURLRequest(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiURLRequest + { + return PigeonApiURLRequest(pigeonRegistrar: registrar, delegate: URLRequestProxyAPIDelegate()) + } + + func pigeonApiHTTPURLResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiHTTPURLResponse + { + return PigeonApiHTTPURLResponse( + pigeonRegistrar: registrar, delegate: HTTPURLResponseProxyAPIDelegate()) + } + + func pigeonApiWKUserScript(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKUserScript + { + return PigeonApiWKUserScript(pigeonRegistrar: registrar, delegate: UserScriptProxyAPIDelegate()) + } + + func pigeonApiWKNavigationAction(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKNavigationAction + { + return PigeonApiWKNavigationAction( + pigeonRegistrar: registrar, delegate: NavigationActionProxyAPIDelegate()) + } + + func pigeonApiWKNavigationResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKNavigationResponse + { + return PigeonApiWKNavigationResponse( + pigeonRegistrar: registrar, delegate: NavigationResponseProxyAPIDelegate()) + } + + func pigeonApiWKFrameInfo(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKFrameInfo + { + return PigeonApiWKFrameInfo(pigeonRegistrar: registrar, delegate: FrameInfoProxyAPIDelegate()) + } + + func pigeonApiNSError(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiNSError { + return PigeonApiNSError(pigeonRegistrar: registrar, delegate: ErrorProxyAPIDelegate()) + } + + func pigeonApiWKScriptMessage(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKScriptMessage + { + return PigeonApiWKScriptMessage( + pigeonRegistrar: registrar, delegate: ScriptMessageProxyAPIDelegate()) + } + + func pigeonApiWKSecurityOrigin(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKSecurityOrigin + { + return PigeonApiWKSecurityOrigin( + pigeonRegistrar: registrar, delegate: SecurityOriginProxyAPIDelegate()) + } + + func pigeonApiHTTPCookie(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiHTTPCookie + { + return PigeonApiHTTPCookie(pigeonRegistrar: registrar, delegate: HTTPCookieProxyAPIDelegate()) + } + + func pigeonApiAuthenticationChallengeResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiAuthenticationChallengeResponse + { + return PigeonApiAuthenticationChallengeResponse( + pigeonRegistrar: registrar, delegate: AuthenticationChallengeResponseProxyAPIDelegate()) + } + + func pigeonApiWKWebsiteDataStore(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKWebsiteDataStore + { + return PigeonApiWKWebsiteDataStore( + pigeonRegistrar: registrar, delegate: WebsiteDataStoreProxyAPIDelegate()) + } + + func pigeonApiUIView(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiUIView { + return PigeonApiUIView(pigeonRegistrar: registrar, delegate: UIViewProxyAPIDelegate()) + } + + func pigeonApiUIScrollView(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiUIScrollView + { + return PigeonApiUIScrollView(pigeonRegistrar: registrar, delegate: ScrollViewProxyAPIDelegate()) + } + + func pigeonApiWKWebViewConfiguration(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKWebViewConfiguration + { + return PigeonApiWKWebViewConfiguration( + pigeonRegistrar: registrar, delegate: WebViewConfigurationProxyAPIDelegate()) + } + + func pigeonApiWKUserContentController(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKUserContentController + { + return PigeonApiWKUserContentController( + pigeonRegistrar: registrar, delegate: UserContentControllerProxyAPIDelegate()) + } + + func pigeonApiWKPreferences(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKPreferences + { + return PigeonApiWKPreferences( + pigeonRegistrar: registrar, delegate: PreferencesProxyAPIDelegate()) + } + + func pigeonApiWKScriptMessageHandler(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKScriptMessageHandler + { + return PigeonApiWKScriptMessageHandler( + pigeonRegistrar: registrar, delegate: ScriptMessageHandlerProxyAPIDelegate()) + } + + func pigeonApiWKNavigationDelegate(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKNavigationDelegate + { + return PigeonApiWKNavigationDelegate( + pigeonRegistrar: registrar, delegate: NavigationDelegateProxyAPIDelegate()) + } + + func pigeonApiNSObject(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiNSObject { + return PigeonApiNSObject(pigeonRegistrar: registrar, delegate: NSObjectProxyAPIDelegate()) + } + + func pigeonApiUIViewWKWebView(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiUIViewWKWebView + { + return PigeonApiUIViewWKWebView(pigeonRegistrar: registrar, delegate: WebViewProxyAPIDelegate()) + } + + func pigeonApiNSViewWKWebView(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiNSViewWKWebView + { + return PigeonApiNSViewWKWebView(pigeonRegistrar: registrar, delegate: WebViewProxyAPIDelegate()) + } + + func pigeonApiWKWebView(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKWebView { + return PigeonApiWKWebView(pigeonRegistrar: registrar, delegate: WebViewProxyAPIDelegate()) + } + + func pigeonApiWKUIDelegate(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKUIDelegate + { + return PigeonApiWKUIDelegate(pigeonRegistrar: registrar, delegate: UIDelegateProxyAPIDelegate()) + } + + func pigeonApiWKHTTPCookieStore(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKHTTPCookieStore + { + return PigeonApiWKHTTPCookieStore( + pigeonRegistrar: registrar, delegate: HTTPCookieStoreProxyAPIDelegate()) + } + + func pigeonApiUIScrollViewDelegate(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiUIScrollViewDelegate + { + return PigeonApiUIScrollViewDelegate( + pigeonRegistrar: registrar, delegate: ScrollViewDelegateProxyAPIDelegate()) + } + + func pigeonApiURLCredential(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiURLCredential + { + return PigeonApiURLCredential( + pigeonRegistrar: registrar, delegate: URLCredentialProxyAPIDelegate()) + } + + func pigeonApiURLProtectionSpace(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiURLProtectionSpace + { + return PigeonApiURLProtectionSpace( + pigeonRegistrar: registrar, delegate: URLProtectionSpaceProxyAPIDelegate()) + } + + func pigeonApiURLAuthenticationChallenge(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiURLAuthenticationChallenge + { + return PigeonApiURLAuthenticationChallenge( + pigeonRegistrar: registrar, delegate: URLAuthenticationChallengeProxyAPIDelegate()) + } + + 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/ScriptMessageHandlerProxyAPIDelegate.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/ScriptMessageHandlerProxyAPIDelegate.swift new file mode 100644 index 00000000000..c34018a1ef1 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/ScriptMessageHandlerProxyAPIDelegate.swift @@ -0,0 +1,43 @@ +// 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 + +/// Implementation of `WKScriptMessageHandler` that calls to Dart in callback methods. +class ScriptMessageHandlerImpl: NSObject, WKScriptMessageHandler { + let api: PigeonApiProtocolWKScriptMessageHandler + unowned let registrar: ProxyAPIRegistrar + + init(api: PigeonApiProtocolWKScriptMessageHandler, registrar: ProxyAPIRegistrar) { + self.api = api + self.registrar = registrar + } + + func userContentController( + _ userContentController: WKUserContentController, didReceive message: WKScriptMessage + ) { + registrar.dispatchOnMainThread { onFailure in + self.api.didReceiveScriptMessage( + pigeonInstance: self, controller: userContentController, message: message + ) { result in + if case .failure(let error) = result { + onFailure("WKScriptMessageHandler.didReceiveScriptMessage", error) + } + } + } + } +} + +/// ProxyApi implementation for `WKScriptMessageHandler`. +/// +/// 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 ScriptMessageHandlerProxyAPIDelegate: PigeonApiDelegateWKScriptMessageHandler { + func pigeonDefaultConstructor(pigeonApi: PigeonApiWKScriptMessageHandler) throws + -> WKScriptMessageHandler + { + return ScriptMessageHandlerImpl( + api: pigeonApi, registrar: pigeonApi.pigeonRegistrar as! ProxyAPIRegistrar) + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/ScriptMessageProxyAPIDelegate.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/ScriptMessageProxyAPIDelegate.swift new file mode 100644 index 00000000000..9707b9156be --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/ScriptMessageProxyAPIDelegate.swift @@ -0,0 +1,19 @@ +// 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 `WKScriptMessage`. +/// +/// 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 ScriptMessageProxyAPIDelegate: PigeonApiDelegateWKScriptMessage { + func name(pigeonApi: PigeonApiWKScriptMessage, pigeonInstance: WKScriptMessage) throws -> String { + return pigeonInstance.name + } + + func body(pigeonApi: PigeonApiWKScriptMessage, pigeonInstance: WKScriptMessage) throws -> Any? { + return pigeonInstance.body + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/ScrollViewDelegateProxyAPIDelegate.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/ScrollViewDelegateProxyAPIDelegate.swift new file mode 100644 index 00000000000..dcbca1356dc --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/ScrollViewDelegateProxyAPIDelegate.swift @@ -0,0 +1,48 @@ +// 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. + +#if os(iOS) + import UIKit +#endif + +#if os(iOS) + /// Implementation of `UIScrollViewDelegate` that calls to Dart in callback methods. + class ScrollViewDelegateImpl: NSObject, UIScrollViewDelegate { + let api: PigeonApiProtocolUIScrollViewDelegate + unowned let registrar: ProxyAPIRegistrar + + init(api: PigeonApiProtocolUIScrollViewDelegate, registrar: ProxyAPIRegistrar) { + self.api = api + self.registrar = registrar + } + + func scrollViewDidScroll(_ scrollView: UIScrollView) { + registrar.dispatchOnMainThread { onFailure in + self.api.scrollViewDidScroll( + pigeonInstance: self, scrollView: scrollView, x: scrollView.contentOffset.x, + y: scrollView.contentOffset.y + ) { result in + if case .failure(let error) = result { + onFailure("UIScrollViewDelegate.scrollViewDidScroll", error) + } + } + } + } + } +#endif + +/// ProxyApi implementation for `UIScrollViewDelegate`. +/// +/// 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 ScrollViewDelegateProxyAPIDelegate: PigeonApiDelegateUIScrollViewDelegate { + #if os(iOS) + func pigeonDefaultConstructor(pigeonApi: PigeonApiUIScrollViewDelegate) throws + -> UIScrollViewDelegate + { + return ScrollViewDelegateImpl( + api: pigeonApi, registrar: pigeonApi.pigeonRegistrar as! ProxyAPIRegistrar) + } + #endif +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/ScrollViewProxyAPIDelegate.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/ScrollViewProxyAPIDelegate.swift new file mode 100644 index 00000000000..bb098a29a0c --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/ScrollViewProxyAPIDelegate.swift @@ -0,0 +1,92 @@ +// 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. + +#if os(iOS) + import UIKit +#endif + +/// ProxyApi implementation for `UIScrollView`. +/// +/// 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 ScrollViewProxyAPIDelegate: PigeonApiDelegateUIScrollView { + #if os(iOS) + func getContentOffset(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView) throws + -> [Double] + { + let offset = pigeonInstance.contentOffset + return [offset.x, offset.y] + } + + func scrollBy( + pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, x: Double, y: Double + ) throws { + let offset = pigeonInstance.contentOffset + pigeonInstance.contentOffset = CGPoint(x: offset.x + x, y: offset.y + y) + } + + func setContentOffset( + pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, x: Double, y: Double + ) throws { + pigeonInstance.contentOffset = CGPoint(x: x, y: y) + } + + func setDelegate( + pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, + delegate: UIScrollViewDelegate? + ) throws { + pigeonInstance.delegate = delegate + } + + func setBounces(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) + throws + { + pigeonInstance.bounces = value + } + + func setBouncesHorizontally( + pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool + ) throws { + if #available(iOS 17.4, *) { + #if compiler(>=6.0) + pigeonInstance.bouncesHorizontally = value + #else + throw (pigeonApi.pigeonRegistrar as! ProxyAPIRegistrar).createUnsupportedVersionError( + method: "UIScrollView.bouncesHorizontally", versionRequirements: "compiler>=6.0") + #endif + } else { + throw (pigeonApi.pigeonRegistrar as! ProxyAPIRegistrar).createUnsupportedVersionError( + method: "UIScrollView.bouncesHorizontally", versionRequirements: "iOS 17.4") + } + } + + func setBouncesVertically( + pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool + ) throws { + if #available(iOS 17.4, *) { + #if compiler(>=6.0) + pigeonInstance.bouncesVertically = value + #else + throw (pigeonApi.pigeonRegistrar as! ProxyAPIRegistrar).createUnsupportedVersionError( + method: "UIScrollView.bouncesVertically", versionRequirements: "compiler>=6.0") + #endif + } else { + throw (pigeonApi.pigeonRegistrar as! ProxyAPIRegistrar).createUnsupportedVersionError( + method: "UIScrollView.bouncesVertically", versionRequirements: "iOS 17.4") + } + } + + func setAlwaysBounceVertical( + pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool + ) throws { + pigeonInstance.alwaysBounceVertical = value + } + + func setAlwaysBounceHorizontal( + pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool + ) throws { + pigeonInstance.alwaysBounceHorizontal = value + } + #endif +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/SecurityOriginProxyAPIDelegate.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/SecurityOriginProxyAPIDelegate.swift new file mode 100644 index 00000000000..de02e4bcde1 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/SecurityOriginProxyAPIDelegate.swift @@ -0,0 +1,27 @@ +// 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 `WKSecurityOrigin`. +/// +/// 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 SecurityOriginProxyAPIDelegate: PigeonApiDelegateWKSecurityOrigin { + func host(pigeonApi: PigeonApiWKSecurityOrigin, pigeonInstance: WKSecurityOrigin) throws -> String + { + return pigeonInstance.host + } + + func port(pigeonApi: PigeonApiWKSecurityOrigin, pigeonInstance: WKSecurityOrigin) throws -> Int64 + { + return Int64(pigeonInstance.port) + } + + func securityProtocol(pigeonApi: PigeonApiWKSecurityOrigin, pigeonInstance: WKSecurityOrigin) + throws -> String + { + return pigeonInstance.protocol + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/StructWrappers.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/StructWrappers.swift new file mode 100644 index 00000000000..a1af899fce4 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/StructWrappers.swift @@ -0,0 +1,17 @@ +// 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 Foundation + +/// Wrapper around `URLRequest`. +/// +/// Since `URLRequest` is a struct, it is pass by value instead of pass by reference. This makes +/// it not possible to modify the properties of a struct with the typical ProxyAPI system. +class URLRequestWrapper { + var value: URLRequest + + init(_ value: URLRequest) { + self.value = value + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/UIDelegateProxyAPIDelegate.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/UIDelegateProxyAPIDelegate.swift new file mode 100644 index 00000000000..9fe50286e5c --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/UIDelegateProxyAPIDelegate.swift @@ -0,0 +1,262 @@ +// 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 + +/// Implementation of `WKUIDelegate` that calls to Dart in callback methods. +class UIDelegateImpl: NSObject, WKUIDelegate { + let api: PigeonApiProtocolWKUIDelegate + unowned let registrar: ProxyAPIRegistrar + + init(api: PigeonApiProtocolWKUIDelegate, registrar: ProxyAPIRegistrar) { + self.api = api + self.registrar = registrar + } + + func webView( + _ webView: WKWebView, createWebViewWith configuration: WKWebViewConfiguration, + for navigationAction: WKNavigationAction, windowFeatures: WKWindowFeatures + ) -> WKWebView? { + registrar.dispatchOnMainThread { onFailure in + self.api.onCreateWebView( + pigeonInstance: self, webView: webView, configuration: configuration, + navigationAction: navigationAction + ) { result in + if case .failure(let error) = result { + onFailure("WKUIDelegate.onCreateWebView", error) + } + } + } + return nil + } + + #if compiler(>=6.0) + @available(iOS 15.0, macOS 12.0, *) + func webView( + _ webView: WKWebView, requestMediaCapturePermissionFor origin: WKSecurityOrigin, + initiatedByFrame frame: WKFrameInfo, type: WKMediaCaptureType, + decisionHandler: @escaping @MainActor (WKPermissionDecision) -> Void + ) { + let wrapperCaptureType: MediaCaptureType + switch type { + case .camera: + wrapperCaptureType = .camera + case .microphone: + wrapperCaptureType = .microphone + case .cameraAndMicrophone: + wrapperCaptureType = .cameraAndMicrophone + @unknown default: + wrapperCaptureType = .unknown + } + + registrar.dispatchOnMainThread { onFailure in + self.api.requestMediaCapturePermission( + pigeonInstance: self, webView: webView, origin: origin, frame: frame, + type: wrapperCaptureType + ) { result in + DispatchQueue.main.async { + switch result { + case .success(let decision): + switch decision { + case .deny: + decisionHandler(.deny) + case .grant: + decisionHandler(.grant) + case .prompt: + decisionHandler(.prompt) + } + case .failure(let error): + decisionHandler(.deny) + onFailure("WKUIDelegate.requestMediaCapturePermission", error) + } + } + } + } + } + #else + @available(iOS 15.0, macOS 12.0, *) + func webView( + _ webView: WKWebView, requestMediaCapturePermissionFor origin: WKSecurityOrigin, + initiatedByFrame frame: WKFrameInfo, type: WKMediaCaptureType, + decisionHandler: @escaping (WKPermissionDecision) -> Void + ) { + let wrapperCaptureType: MediaCaptureType + switch type { + case .camera: + wrapperCaptureType = .camera + case .microphone: + wrapperCaptureType = .microphone + case .cameraAndMicrophone: + wrapperCaptureType = .cameraAndMicrophone + @unknown default: + wrapperCaptureType = .unknown + } + + registrar.dispatchOnMainThread { onFailure in + self.api.requestMediaCapturePermission( + pigeonInstance: self, webView: webView, origin: origin, frame: frame, + type: wrapperCaptureType + ) { result in + DispatchQueue.main.async { + switch result { + case .success(let decision): + switch decision { + case .deny: + decisionHandler(.deny) + case .grant: + decisionHandler(.grant) + case .prompt: + decisionHandler(.prompt) + } + case .failure(let error): + decisionHandler(.deny) + onFailure("WKUIDelegate.requestMediaCapturePermission", error) + } + } + } + } + } + #endif + + #if compiler(>=6.0) + func webView( + _ webView: WKWebView, runJavaScriptAlertPanelWithMessage message: String, + initiatedByFrame frame: WKFrameInfo, completionHandler: @escaping @MainActor () -> Void + ) { + registrar.dispatchOnMainThread { onFailure in + self.api.runJavaScriptAlertPanel( + pigeonInstance: self, webView: webView, message: message, frame: frame + ) { result in + DispatchQueue.main.async { + if case .failure(let error) = result { + onFailure("WKUIDelegate.runJavaScriptAlertPanel", error) + } + completionHandler() + } + } + } + } + #else + func webView( + _ webView: WKWebView, runJavaScriptAlertPanelWithMessage message: String, + initiatedByFrame frame: WKFrameInfo, completionHandler: @escaping () -> Void + ) { + registrar.dispatchOnMainThread { onFailure in + self.api.runJavaScriptAlertPanel( + pigeonInstance: self, webView: webView, message: message, frame: frame + ) { result in + DispatchQueue.main.async { + if case .failure(let error) = result { + onFailure("WKUIDelegate.runJavaScriptAlertPanel", error) + } + completionHandler() + } + } + } + } + #endif + + #if compiler(>=6.0) + func webView( + _ webView: WKWebView, runJavaScriptConfirmPanelWithMessage message: String, + initiatedByFrame frame: WKFrameInfo, completionHandler: @escaping @MainActor (Bool) -> Void + ) { + registrar.dispatchOnMainThread { onFailure in + self.api.runJavaScriptConfirmPanel( + pigeonInstance: self, webView: webView, message: message, frame: frame + ) { result in + DispatchQueue.main.async { + switch result { + case .success(let confirmed): + completionHandler(confirmed) + case .failure(let error): + completionHandler(false) + onFailure("WKUIDelegate.runJavaScriptConfirmPanel", error) + } + } + } + } + } + #else + func webView( + _ webView: WKWebView, runJavaScriptConfirmPanelWithMessage message: String, + initiatedByFrame frame: WKFrameInfo, completionHandler: @escaping (Bool) -> Void + ) { + registrar.dispatchOnMainThread { onFailure in + self.api.runJavaScriptConfirmPanel( + pigeonInstance: self, webView: webView, message: message, frame: frame + ) { result in + DispatchQueue.main.async { + switch result { + case .success(let confirmed): + completionHandler(confirmed) + case .failure(let error): + completionHandler(false) + onFailure("WKUIDelegate.runJavaScriptConfirmPanel", error) + } + } + } + } + } + #endif + + #if compiler(>=6.0) + func webView( + _ webView: WKWebView, runJavaScriptTextInputPanelWithPrompt prompt: String, + defaultText: String?, initiatedByFrame frame: WKFrameInfo, + completionHandler: @escaping @MainActor (String?) -> Void + ) { + registrar.dispatchOnMainThread { onFailure in + self.api.runJavaScriptTextInputPanel( + pigeonInstance: self, webView: webView, prompt: prompt, defaultText: defaultText, + frame: frame + ) { result in + DispatchQueue.main.async { + switch result { + case .success(let response): + completionHandler(response) + case .failure(let error): + completionHandler(nil) + onFailure("WKUIDelegate.runJavaScriptTextInputPanel", error) + } + } + } + } + } + #else + func webView( + _ webView: WKWebView, runJavaScriptTextInputPanelWithPrompt prompt: String, + defaultText: String?, initiatedByFrame frame: WKFrameInfo, + completionHandler: @escaping (String?) -> Void + ) { + registrar.dispatchOnMainThread { onFailure in + self.api.runJavaScriptTextInputPanel( + pigeonInstance: self, webView: webView, prompt: prompt, defaultText: defaultText, + frame: frame + ) { result in + DispatchQueue.main.async { + switch result { + case .success(let response): + completionHandler(response) + case .failure(let error): + completionHandler(nil) + onFailure("WKUIDelegate.runJavaScriptTextInputPanel", error) + } + } + } + } + } + #endif +} + +/// ProxyApi implementation for `WKUIDelegate`. +/// +/// 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 UIDelegateProxyAPIDelegate: PigeonApiDelegateWKUIDelegate { + func pigeonDefaultConstructor(pigeonApi: PigeonApiWKUIDelegate) throws -> WKUIDelegate { + return UIDelegateImpl( + api: pigeonApi, registrar: pigeonApi.pigeonRegistrar as! ProxyAPIRegistrar) + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/UIViewProxyAPIDelegate.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/UIViewProxyAPIDelegate.swift new file mode 100644 index 00000000000..6ebc5589f13 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/UIViewProxyAPIDelegate.swift @@ -0,0 +1,34 @@ +// 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. + +#if os(iOS) + import UIKit +#endif + +/// ProxyApi implementation for `UIView`. +/// +/// 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 UIViewProxyAPIDelegate: PigeonApiDelegateUIView { + #if os(iOS) + func setBackgroundColor(pigeonApi: PigeonApiUIView, pigeonInstance: UIView, value: Int64?) + throws + { + if value == nil { + pigeonInstance.backgroundColor = nil + } else { + let red = CGFloat(Double((value! >> 16 & 0xff)) / 255.0) + let green = CGFloat(Double(value! >> 8 & 0xff) / 255.0) + let blue = CGFloat(Double(value! & 0xff) / 255.0) + let alpha = CGFloat(Double(value! >> 24 & 0xff) / 255.0) + + pigeonInstance.backgroundColor = UIColor(red: red, green: green, blue: blue, alpha: alpha) + } + } + + func setOpaque(pigeonApi: PigeonApiUIView, pigeonInstance: UIView, opaque: Bool) throws { + pigeonInstance.isOpaque = opaque + } + #endif +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/URLAuthenticationChallengeProxyAPIDelegate.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/URLAuthenticationChallengeProxyAPIDelegate.swift new file mode 100644 index 00000000000..b934e467d7b --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/URLAuthenticationChallengeProxyAPIDelegate.swift @@ -0,0 +1,17 @@ +// 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 Foundation + +/// ProxyApi implementation for `URLAuthenticationChallenge`. +/// +/// 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 URLAuthenticationChallengeProxyAPIDelegate: PigeonApiDelegateURLAuthenticationChallenge { + func getProtectionSpace( + pigeonApi: PigeonApiURLAuthenticationChallenge, pigeonInstance: URLAuthenticationChallenge + ) throws -> URLProtectionSpace { + return pigeonInstance.protectionSpace + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/URLCredentialProxyAPIDelegate.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/URLCredentialProxyAPIDelegate.swift new file mode 100644 index 00000000000..d19f89bc334 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/URLCredentialProxyAPIDelegate.swift @@ -0,0 +1,29 @@ +// 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 Foundation + +/// ProxyApi implementation for `URLCredential`. +/// +/// 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 URLCredentialProxyAPIDelegate: PigeonApiDelegateURLCredential { + func withUser( + pigeonApi: PigeonApiURLCredential, user: String, password: String, + persistence: UrlCredentialPersistence + ) throws -> URLCredential { + let nativePersistence: URLCredential.Persistence + switch persistence { + case .none: + nativePersistence = .none + case .forSession: + nativePersistence = .forSession + case .permanent: + nativePersistence = .permanent + case .synchronizable: + nativePersistence = .synchronizable + } + return URLCredential(user: user, password: password, persistence: nativePersistence) + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/URLProtectionSpaceProxyAPIDelegate.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/URLProtectionSpaceProxyAPIDelegate.swift new file mode 100644 index 00000000000..d7c59c67f28 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/URLProtectionSpaceProxyAPIDelegate.swift @@ -0,0 +1,35 @@ +// 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 Foundation + +/// ProxyApi implementation for `URLProtectionSpace`. +/// +/// 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 URLProtectionSpaceProxyAPIDelegate: PigeonApiDelegateURLProtectionSpace { + func host(pigeonApi: PigeonApiURLProtectionSpace, pigeonInstance: URLProtectionSpace) throws + -> String + { + return pigeonInstance.host + } + + func port(pigeonApi: PigeonApiURLProtectionSpace, pigeonInstance: URLProtectionSpace) throws + -> Int64 + { + return Int64(pigeonInstance.port) + } + + func realm(pigeonApi: PigeonApiURLProtectionSpace, pigeonInstance: URLProtectionSpace) throws + -> String? + { + return pigeonInstance.realm + } + + func authenticationMethod( + pigeonApi: PigeonApiURLProtectionSpace, pigeonInstance: URLProtectionSpace + ) throws -> String? { + return pigeonInstance.authenticationMethod + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/URLProxyAPIDelegate.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/URLProxyAPIDelegate.swift new file mode 100644 index 00000000000..61fb522a3d1 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/URLProxyAPIDelegate.swift @@ -0,0 +1,15 @@ +// 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 Foundation + +/// ProxyApi implementation for `URL`. +/// +/// 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 URLProxyAPIDelegate: PigeonApiDelegateURL { + func getAbsoluteString(pigeonApi: PigeonApiURL, pigeonInstance: URL) throws -> String { + return pigeonInstance.absoluteString + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/URLRequestProxyAPIDelegate.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/URLRequestProxyAPIDelegate.swift new file mode 100644 index 00000000000..62cb3ccf7d3 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/URLRequestProxyAPIDelegate.swift @@ -0,0 +1,78 @@ +// 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 Foundation + +#if os(iOS) + import Flutter + import UIKit +#elseif os(macOS) + import FlutterMacOS + import Foundation +#else + #error("Unsupported platform.") +#endif + +/// ProxyApi implementation for `URLRequest`. +/// +/// 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 URLRequestProxyAPIDelegate: PigeonApiDelegateURLRequest { + func pigeonDefaultConstructor(pigeonApi: PigeonApiURLRequest, url: String) throws + -> URLRequestWrapper + { + let urlObject = URL(string: url) + if let urlObject = urlObject { + return URLRequestWrapper(URLRequest(url: urlObject)) + } else { + let registrar = pigeonApi.pigeonRegistrar as! ProxyAPIRegistrar + throw registrar.createConstructorNullError(type: NSURL.self, parameters: ["string": url]) + } + } + + func setHttpMethod( + pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper, method: String? + ) throws { + pigeonInstance.value.httpMethod = method + } + + func setHttpBody( + pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper, + body: FlutterStandardTypedData? + ) throws { + pigeonInstance.value.httpBody = body?.data + } + + func setAllHttpHeaderFields( + pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper, fields: [String: String]? + ) throws { + pigeonInstance.value.allHTTPHeaderFields = fields + } + + func getUrl(pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper) throws -> String? { + return pigeonInstance.value.url?.absoluteString + } + + func getHttpMethod(pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper) throws + -> String? + { + return pigeonInstance.value.httpMethod + } + + func getHttpBody(pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper) throws + -> FlutterStandardTypedData? + { + if let httpBody = pigeonInstance.value.httpBody { + return FlutterStandardTypedData(bytes: httpBody) + } + + return nil + } + + func getAllHttpHeaderFields(pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper) + throws -> [String: String]? + { + return pigeonInstance.value.allHTTPHeaderFields + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/UserContentControllerProxyAPIDelegate.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/UserContentControllerProxyAPIDelegate.swift new file mode 100644 index 00000000000..c5cd9eedf7b --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/UserContentControllerProxyAPIDelegate.swift @@ -0,0 +1,51 @@ +// 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 `WKUserContentController`. +/// +/// 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 UserContentControllerProxyAPIDelegate: PigeonApiDelegateWKUserContentController { + func addScriptMessageHandler( + pigeonApi: PigeonApiWKUserContentController, pigeonInstance: WKUserContentController, + handler: WKScriptMessageHandler, name: String + ) throws { + pigeonInstance.add(handler, name: name) + } + + func removeScriptMessageHandler( + pigeonApi: PigeonApiWKUserContentController, pigeonInstance: WKUserContentController, + name: String + ) throws { + pigeonInstance.removeScriptMessageHandler(forName: name) + } + + func removeAllScriptMessageHandlers( + pigeonApi: PigeonApiWKUserContentController, pigeonInstance: WKUserContentController + ) throws { + if #available(iOS 14.0, macOS 11.0, *) { + pigeonInstance.removeAllScriptMessageHandlers() + } else { + throw (pigeonApi.pigeonRegistrar as! ProxyAPIRegistrar) + .createUnsupportedVersionError( + method: "WKUserContentController.removeAllScriptMessageHandlers", + versionRequirements: "iOS 14.0, macOS 11.0") + } + } + + func addUserScript( + pigeonApi: PigeonApiWKUserContentController, pigeonInstance: WKUserContentController, + userScript: WKUserScript + ) throws { + pigeonInstance.addUserScript(userScript) + } + + func removeAllUserScripts( + pigeonApi: PigeonApiWKUserContentController, pigeonInstance: WKUserContentController + ) throws { + pigeonInstance.removeAllUserScripts() + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/UserScriptProxyAPIDelegate.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/UserScriptProxyAPIDelegate.swift new file mode 100644 index 00000000000..9cd0ae1ea08 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/UserScriptProxyAPIDelegate.swift @@ -0,0 +1,52 @@ +// 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 `WKUserScript`. +/// +/// 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 UserScriptProxyAPIDelegate: PigeonApiDelegateWKUserScript { + func pigeonDefaultConstructor( + pigeonApi: PigeonApiWKUserScript, source: String, injectionTime: UserScriptInjectionTime, + isForMainFrameOnly: Bool + ) throws -> WKUserScript { + var nativeInjectionTime: WKUserScriptInjectionTime + switch injectionTime { + case .atDocumentStart: + nativeInjectionTime = .atDocumentStart + case .atDocumentEnd: + nativeInjectionTime = .atDocumentEnd + case .unknown: + throw (pigeonApi.pigeonRegistrar as! ProxyAPIRegistrar).createUnknownEnumError( + withEnum: injectionTime) + } + return WKUserScript( + source: source, injectionTime: nativeInjectionTime, forMainFrameOnly: isForMainFrameOnly) + } + + func source(pigeonApi: PigeonApiWKUserScript, pigeonInstance: WKUserScript) throws -> String { + return pigeonInstance.source + } + + func injectionTime(pigeonApi: PigeonApiWKUserScript, pigeonInstance: WKUserScript) throws + -> UserScriptInjectionTime + { + switch pigeonInstance.injectionTime { + case .atDocumentStart: + return .atDocumentStart + case .atDocumentEnd: + return .atDocumentEnd + @unknown default: + return .unknown + } + } + + func isForMainFrameOnly(pigeonApi: PigeonApiWKUserScript, pigeonInstance: WKUserScript) throws + -> Bool + { + return pigeonInstance.isForMainFrameOnly + } +} 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 new file mode 100644 index 00000000000..177b66a2e6c --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebKitLibrary.g.swift @@ -0,0 +1,6945 @@ +// 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.2.1), do not edit directly. +// See also: https://pub.dev/packages/pigeon + +import Foundation +import WebKit + +#if !os(macOS) + import UIKit +#endif + +#if os(iOS) + import Flutter +#elseif os(macOS) + import FlutterMacOS +#else + #error("Unsupported platform.") +#endif + +/// Error class for passing custom error details to Dart side. +final class PigeonError: Error { + let code: String + let message: String? + let details: Sendable? + + init(code: String, message: String?, details: Sendable?) { + self.code = code + self.message = message + self.details = details + } + + var localizedDescription: String { + return + "PigeonError(code: \(code), message: \(message ?? ""), details: \(details ?? "")" + } +} + +private func wrapResult(_ result: Any?) -> [Any?] { + return [result] +} + +private func wrapError(_ error: Any) -> [Any?] { + if let pigeonError = error as? PigeonError { + return [ + pigeonError.code, + pigeonError.message, + pigeonError.details, + ] + } + if let flutterError = error as? FlutterError { + return [ + flutterError.code, + flutterError.message, + flutterError.details, + ] + } + return [ + "\(error)", + "\(type(of: error))", + "Stacktrace: \(Thread.callStackSymbols)", + ] +} + +private func createConnectionError(withChannelName channelName: String) -> PigeonError { + return PigeonError( + code: "channel-error", message: "Unable to establish connection on channel: '\(channelName)'.", + details: "") +} + +private func isNullish(_ value: Any?) -> Bool { + return value is NSNull || value == nil +} + +private func nilOrValue(_ value: Any?) -> T? { + if value is NSNull { return nil } + return value as! T? +} +/// Handles the callback when an object is deallocated. +protocol WebKitLibraryPigeonInternalFinalizerDelegate: AnyObject { + /// Invoked when the strong reference of an object is deallocated in an `InstanceManager`. + func onDeinit(identifier: Int64) +} + +// Attaches to an object to receive a callback when the object is deallocated. +internal final class WebKitLibraryPigeonInternalFinalizer { + private static let associatedObjectKey = malloc(1)! + + private let identifier: Int64 + // Reference to the delegate is weak because the callback should be ignored if the + // `InstanceManager` is deallocated. + private weak var delegate: WebKitLibraryPigeonInternalFinalizerDelegate? + + private init(identifier: Int64, delegate: WebKitLibraryPigeonInternalFinalizerDelegate) { + self.identifier = identifier + self.delegate = delegate + } + + internal static func attach( + to instance: AnyObject, identifier: Int64, + delegate: WebKitLibraryPigeonInternalFinalizerDelegate + ) { + let finalizer = WebKitLibraryPigeonInternalFinalizer(identifier: identifier, delegate: delegate) + objc_setAssociatedObject(instance, associatedObjectKey, finalizer, .OBJC_ASSOCIATION_RETAIN) + } + + static func detach(from instance: AnyObject) { + objc_setAssociatedObject(instance, associatedObjectKey, nil, .OBJC_ASSOCIATION_ASSIGN) + } + + deinit { + delegate?.onDeinit(identifier: identifier) + } +} + +/// Maintains instances used to communicate with the corresponding objects in Dart. +/// +/// Objects stored in this container are represented by an object in Dart that is also stored in +/// an InstanceManager with the same identifier. +/// +/// When an instance is added with an identifier, either can be used to retrieve the other. +/// +/// Added instances are added as a weak reference and a strong reference. When the strong +/// reference is removed and the weak reference is deallocated,`WebKitLibraryPigeonInternalFinalizerDelegate.onDeinit` +/// is called with the instance's identifier. However, if the strong reference is removed and then the identifier is +/// retrieved with the intention to pass the identifier to Dart (e.g. by calling `identifierWithStrongReference`), +/// the strong reference to the instance is re-added. The strong reference will then need to be removed manually +/// again. +/// +/// Accessing and inserting to an InstanceManager is thread safe. +final class WebKitLibraryPigeonInstanceManager { + // Identifiers are locked to a specific range to avoid collisions with objects + // created simultaneously from Dart. + // Host uses identifiers >= 2^16 and Dart is expected to use values n where, + // 0 <= n < 2^16. + private static let minHostCreatedIdentifier: Int64 = 65536 + + private let lockQueue = DispatchQueue(label: "WebKitLibraryPigeonInstanceManager") + private let identifiers: NSMapTable = NSMapTable( + keyOptions: [.weakMemory, .objectPointerPersonality], valueOptions: .strongMemory) + private let weakInstances: NSMapTable = NSMapTable( + keyOptions: .strongMemory, valueOptions: [.weakMemory, .objectPointerPersonality]) + private let strongInstances: NSMapTable = NSMapTable( + keyOptions: .strongMemory, valueOptions: [.strongMemory, .objectPointerPersonality]) + private let finalizerDelegate: WebKitLibraryPigeonInternalFinalizerDelegate + private var nextIdentifier: Int64 = minHostCreatedIdentifier + + public init(finalizerDelegate: WebKitLibraryPigeonInternalFinalizerDelegate) { + self.finalizerDelegate = finalizerDelegate + } + + /// Adds a new instance that was instantiated from Dart. + /// + /// The same instance can be added multiple times, but each identifier must be unique. This allows + /// two objects that are equivalent (e.g. conforms to `Equatable`) to both be added. + /// + /// - Parameters: + /// - instance: the instance to be stored + /// - identifier: the identifier to be paired with instance. This value must be >= 0 and unique + func addDartCreatedInstance(_ instance: AnyObject, withIdentifier identifier: Int64) { + lockQueue.async { + self.addInstance(instance, withIdentifier: identifier) + } + } + + /// Adds a new instance that was instantiated from the host platform. + /// + /// - Parameters: + /// - instance: the instance to be stored. This must be unique to all other added instances. + /// - Returns: the unique identifier (>= 0) stored with instance + func addHostCreatedInstance(_ instance: AnyObject) -> Int64 { + assert(!containsInstance(instance), "Instance of \(instance) has already been added.") + var identifier: Int64 = -1 + lockQueue.sync { + identifier = nextIdentifier + nextIdentifier += 1 + self.addInstance(instance, withIdentifier: identifier) + } + return identifier + } + + /// Removes `instanceIdentifier` and its associated strongly referenced instance, if present, from the manager. + /// + /// - Parameters: + /// - instanceIdentifier: the identifier paired to an instance. + /// - Returns: removed instance if the manager contains the given identifier, otherwise `nil` if + /// the manager doesn't contain the value + func removeInstance(withIdentifier instanceIdentifier: Int64) throws -> T? { + var instance: AnyObject? = nil + lockQueue.sync { + instance = strongInstances.object(forKey: NSNumber(value: instanceIdentifier)) + strongInstances.removeObject(forKey: NSNumber(value: instanceIdentifier)) + } + return instance as? T + } + + /// Retrieves the instance associated with identifier. + /// + /// - Parameters: + /// - instanceIdentifier: the identifier associated with an instance + /// - Returns: the instance associated with `instanceIdentifier` if the manager contains the value, otherwise + /// `nil` if the manager doesn't contain the value + func instance(forIdentifier instanceIdentifier: Int64) -> T? { + var instance: AnyObject? = nil + lockQueue.sync { + instance = weakInstances.object(forKey: NSNumber(value: instanceIdentifier)) + } + return instance as? T + } + + private func addInstance(_ instance: AnyObject, withIdentifier identifier: Int64) { + assert(identifier >= 0) + assert( + weakInstances.object(forKey: identifier as NSNumber) == nil, + "Identifier has already been added: \(identifier)") + identifiers.setObject(NSNumber(value: identifier), forKey: instance) + weakInstances.setObject(instance, forKey: NSNumber(value: identifier)) + strongInstances.setObject(instance, forKey: NSNumber(value: identifier)) + WebKitLibraryPigeonInternalFinalizer.attach( + to: instance, identifier: identifier, delegate: finalizerDelegate) + } + + /// Retrieves the identifier paired with an instance. + /// + /// If the manager contains a strong reference to `instance`, it will return the identifier + /// associated with `instance`. If the manager contains only a weak reference to `instance`, a new + /// strong reference to `instance` will be added and will need to be removed again with `removeInstance`. + /// + /// If this method returns a nonnull identifier, this method also expects the Dart + /// `WebKitLibraryPigeonInstanceManager` to have, or recreate, a weak reference to the Dart instance the + /// identifier is associated with. + /// + /// - Parameters: + /// - instance: an instance that may be stored in the manager + /// - Returns: the identifier associated with `instance` if the manager contains the value, otherwise + /// `nil` if the manager doesn't contain the value + func identifierWithStrongReference(forInstance instance: AnyObject) -> Int64? { + var identifier: Int64? = nil + lockQueue.sync { + if let existingIdentifier = identifiers.object(forKey: instance)?.int64Value { + strongInstances.setObject(instance, forKey: NSNumber(value: existingIdentifier)) + identifier = existingIdentifier + } + } + return identifier + } + + /// Whether this manager contains the given `instance`. + /// + /// - Parameters: + /// - instance: the instance whose presence in this manager is to be tested + /// - Returns: whether this manager contains the given `instance` + func containsInstance(_ instance: AnyObject) -> Bool { + var containsInstance = false + lockQueue.sync { + containsInstance = identifiers.object(forKey: instance) != nil + } + return containsInstance + } + + /// Removes all of the instances from this manager. + /// + /// The manager will be empty after this call returns. + func removeAllObjects() throws { + lockQueue.sync { + identifiers.removeAllObjects() + weakInstances.removeAllObjects() + strongInstances.removeAllObjects() + nextIdentifier = WebKitLibraryPigeonInstanceManager.minHostCreatedIdentifier + } + } + + /// The number of instances stored as a strong reference. + /// + /// For debugging and testing purposes. + internal var strongInstanceCount: Int { + var count: Int = 0 + lockQueue.sync { + count = strongInstances.count + } + return count + } + + /// The number of instances stored as a weak reference. + /// + /// For debugging and testing purposes. NSMapTables that store keys or objects as weak + /// reference will be reclaimed non-deterministically. + internal var weakInstanceCount: Int { + var count: Int = 0 + lockQueue.sync { + count = weakInstances.count + } + return count + } +} + +private class WebKitLibraryPigeonInstanceManagerApi { + /// The codec used for serializing messages. + var codec: FlutterStandardMessageCodec { WebKitLibraryPigeonCodec.shared } + + /// Handles sending and receiving messages with Dart. + unowned let binaryMessenger: FlutterBinaryMessenger + + init(binaryMessenger: FlutterBinaryMessenger) { + self.binaryMessenger = binaryMessenger + } + + /// Sets up an instance of `WebKitLibraryPigeonInstanceManagerApi` to handle messages through the `binaryMessenger`. + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, instanceManager: WebKitLibraryPigeonInstanceManager? + ) { + let codec = WebKitLibraryPigeonCodec.shared + let removeStrongReferenceChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.PigeonInternalInstanceManager.removeStrongReference", + binaryMessenger: binaryMessenger, codec: codec) + if let instanceManager = instanceManager { + removeStrongReferenceChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let identifierArg = args[0] as! Int64 + do { + let _: AnyObject? = try instanceManager.removeInstance(withIdentifier: identifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + removeStrongReferenceChannel.setMessageHandler(nil) + } + let clearChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.PigeonInternalInstanceManager.clear", + binaryMessenger: binaryMessenger, codec: codec) + if let instanceManager = instanceManager { + clearChannel.setMessageHandler { _, reply in + do { + try instanceManager.removeAllObjects() + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + clearChannel.setMessageHandler(nil) + } + } + + /// Sends a message to the Dart `InstanceManager` to remove the strong reference of the instance associated with `identifier`. + func removeStrongReference( + identifier identifierArg: Int64, completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.PigeonInternalInstanceManager.removeStrongReference" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([identifierArg] 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(())) + } + } + } +} +protocol WebKitLibraryPigeonProxyApiDelegate { + /// An implementation of [PigeonApiURLRequest] used to add a new Dart instance of + /// `URLRequest` to the Dart `InstanceManager` and make calls to Dart. + func pigeonApiURLRequest(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiURLRequest + /// An implementation of [PigeonApiHTTPURLResponse] used to add a new Dart instance of + /// `HTTPURLResponse` to the Dart `InstanceManager` and make calls to Dart. + func pigeonApiHTTPURLResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiHTTPURLResponse + /// An implementation of [PigeonApiURLResponse] used to add a new Dart instance of + /// `URLResponse` to the Dart `InstanceManager` and make calls to Dart. + func pigeonApiURLResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiURLResponse + /// An implementation of [PigeonApiWKUserScript] used to add a new Dart instance of + /// `WKUserScript` to the Dart `InstanceManager` and make calls to Dart. + func pigeonApiWKUserScript(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKUserScript + /// An implementation of [PigeonApiWKNavigationAction] used to add a new Dart instance of + /// `WKNavigationAction` to the Dart `InstanceManager` and make calls to Dart. + func pigeonApiWKNavigationAction(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKNavigationAction + /// An implementation of [PigeonApiWKNavigationResponse] used to add a new Dart instance of + /// `WKNavigationResponse` to the Dart `InstanceManager` and make calls to Dart. + func pigeonApiWKNavigationResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKNavigationResponse + /// An implementation of [PigeonApiWKFrameInfo] used to add a new Dart instance of + /// `WKFrameInfo` to the Dart `InstanceManager` and make calls to Dart. + func pigeonApiWKFrameInfo(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKFrameInfo + /// An implementation of [PigeonApiNSError] used to add a new Dart instance of + /// `NSError` to the Dart `InstanceManager` and make calls to Dart. + func pigeonApiNSError(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiNSError + /// An implementation of [PigeonApiWKScriptMessage] used to add a new Dart instance of + /// `WKScriptMessage` to the Dart `InstanceManager` and make calls to Dart. + func pigeonApiWKScriptMessage(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKScriptMessage + /// An implementation of [PigeonApiWKSecurityOrigin] used to add a new Dart instance of + /// `WKSecurityOrigin` to the Dart `InstanceManager` and make calls to Dart. + func pigeonApiWKSecurityOrigin(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKSecurityOrigin + /// An implementation of [PigeonApiHTTPCookie] used to add a new Dart instance of + /// `HTTPCookie` to the Dart `InstanceManager` and make calls to Dart. + func pigeonApiHTTPCookie(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiHTTPCookie + /// An implementation of [PigeonApiAuthenticationChallengeResponse] used to add a new Dart instance of + /// `AuthenticationChallengeResponse` to the Dart `InstanceManager` and make calls to Dart. + func pigeonApiAuthenticationChallengeResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiAuthenticationChallengeResponse + /// An implementation of [PigeonApiWKWebsiteDataStore] used to add a new Dart instance of + /// `WKWebsiteDataStore` to the Dart `InstanceManager` and make calls to Dart. + func pigeonApiWKWebsiteDataStore(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKWebsiteDataStore + /// An implementation of [PigeonApiUIView] used to add a new Dart instance of + /// `UIView` to the Dart `InstanceManager` and make calls to Dart. + func pigeonApiUIView(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiUIView + /// An implementation of [PigeonApiUIScrollView] used to add a new Dart instance of + /// `UIScrollView` to the Dart `InstanceManager` and make calls to Dart. + func pigeonApiUIScrollView(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiUIScrollView + /// An implementation of [PigeonApiWKWebViewConfiguration] used to add a new Dart instance of + /// `WKWebViewConfiguration` to the Dart `InstanceManager` and make calls to Dart. + func pigeonApiWKWebViewConfiguration(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKWebViewConfiguration + /// An implementation of [PigeonApiWKUserContentController] used to add a new Dart instance of + /// `WKUserContentController` to the Dart `InstanceManager` and make calls to Dart. + func pigeonApiWKUserContentController(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKUserContentController + /// An implementation of [PigeonApiWKPreferences] used to add a new Dart instance of + /// `WKPreferences` to the Dart `InstanceManager` and make calls to Dart. + func pigeonApiWKPreferences(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKPreferences + /// An implementation of [PigeonApiWKScriptMessageHandler] used to add a new Dart instance of + /// `WKScriptMessageHandler` to the Dart `InstanceManager` and make calls to Dart. + func pigeonApiWKScriptMessageHandler(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKScriptMessageHandler + /// An implementation of [PigeonApiWKNavigationDelegate] used to add a new Dart instance of + /// `WKNavigationDelegate` to the Dart `InstanceManager` and make calls to Dart. + func pigeonApiWKNavigationDelegate(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKNavigationDelegate + /// An implementation of [PigeonApiNSObject] used to add a new Dart instance of + /// `NSObject` to the Dart `InstanceManager` and make calls to Dart. + func pigeonApiNSObject(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiNSObject + /// An implementation of [PigeonApiUIViewWKWebView] used to add a new Dart instance of + /// `UIViewWKWebView` to the Dart `InstanceManager` and make calls to Dart. + func pigeonApiUIViewWKWebView(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiUIViewWKWebView + /// An implementation of [PigeonApiNSViewWKWebView] used to add a new Dart instance of + /// `NSViewWKWebView` to the Dart `InstanceManager` and make calls to Dart. + func pigeonApiNSViewWKWebView(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiNSViewWKWebView + /// An implementation of [PigeonApiWKWebView] used to add a new Dart instance of + /// `WKWebView` to the Dart `InstanceManager` and make calls to Dart. + func pigeonApiWKWebView(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKWebView + /// An implementation of [PigeonApiWKUIDelegate] used to add a new Dart instance of + /// `WKUIDelegate` to the Dart `InstanceManager` and make calls to Dart. + func pigeonApiWKUIDelegate(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKUIDelegate + /// An implementation of [PigeonApiWKHTTPCookieStore] used to add a new Dart instance of + /// `WKHTTPCookieStore` to the Dart `InstanceManager` and make calls to Dart. + func pigeonApiWKHTTPCookieStore(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKHTTPCookieStore + /// An implementation of [PigeonApiUIScrollViewDelegate] used to add a new Dart instance of + /// `UIScrollViewDelegate` to the Dart `InstanceManager` and make calls to Dart. + func pigeonApiUIScrollViewDelegate(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiUIScrollViewDelegate + /// An implementation of [PigeonApiURLCredential] used to add a new Dart instance of + /// `URLCredential` to the Dart `InstanceManager` and make calls to Dart. + func pigeonApiURLCredential(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiURLCredential + /// An implementation of [PigeonApiURLProtectionSpace] used to add a new Dart instance of + /// `URLProtectionSpace` to the Dart `InstanceManager` and make calls to Dart. + func pigeonApiURLProtectionSpace(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiURLProtectionSpace + /// An implementation of [PigeonApiURLAuthenticationChallenge] used to add a new Dart instance of + /// `URLAuthenticationChallenge` to the Dart `InstanceManager` and make calls to Dart. + func pigeonApiURLAuthenticationChallenge(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiURLAuthenticationChallenge + /// 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 { + func pigeonApiURLResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiURLResponse + { + return PigeonApiURLResponse( + pigeonRegistrar: registrar, delegate: PigeonApiDelegateURLResponse()) + } + func pigeonApiWKWebView(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKWebView { + return PigeonApiWKWebView(pigeonRegistrar: registrar, delegate: PigeonApiDelegateWKWebView()) + } +} + +open class WebKitLibraryPigeonProxyApiRegistrar { + let binaryMessenger: FlutterBinaryMessenger + let apiDelegate: WebKitLibraryPigeonProxyApiDelegate + let instanceManager: WebKitLibraryPigeonInstanceManager + /// Whether APIs should ignore calling to Dart. + public var ignoreCallsToDart = false + private var _codec: FlutterStandardMessageCodec? + var codec: FlutterStandardMessageCodec { + if _codec == nil { + _codec = FlutterStandardMessageCodec( + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: self)) + } + return _codec! + } + + private class InstanceManagerApiFinalizerDelegate: WebKitLibraryPigeonInternalFinalizerDelegate { + let api: WebKitLibraryPigeonInstanceManagerApi + + init(_ api: WebKitLibraryPigeonInstanceManagerApi) { + self.api = api + } + + public func onDeinit(identifier: Int64) { + api.removeStrongReference(identifier: identifier) { + _ in + } + } + } + + init(binaryMessenger: FlutterBinaryMessenger, apiDelegate: WebKitLibraryPigeonProxyApiDelegate) { + self.binaryMessenger = binaryMessenger + self.apiDelegate = apiDelegate + self.instanceManager = WebKitLibraryPigeonInstanceManager( + finalizerDelegate: InstanceManagerApiFinalizerDelegate( + WebKitLibraryPigeonInstanceManagerApi(binaryMessenger: binaryMessenger))) + } + + func setUp() { + WebKitLibraryPigeonInstanceManagerApi.setUpMessageHandlers( + binaryMessenger: binaryMessenger, instanceManager: instanceManager) + PigeonApiURLRequest.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiURLRequest(self)) + PigeonApiWKUserScript.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKUserScript(self)) + PigeonApiHTTPCookie.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiHTTPCookie(self)) + PigeonApiAuthenticationChallengeResponse.setUpMessageHandlers( + binaryMessenger: binaryMessenger, + api: apiDelegate.pigeonApiAuthenticationChallengeResponse(self)) + PigeonApiWKWebsiteDataStore.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKWebsiteDataStore(self)) + PigeonApiUIView.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiUIView(self)) + PigeonApiUIScrollView.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiUIScrollView(self)) + PigeonApiWKWebViewConfiguration.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKWebViewConfiguration(self)) + PigeonApiWKUserContentController.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKUserContentController(self)) + PigeonApiWKPreferences.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKPreferences(self)) + PigeonApiWKScriptMessageHandler.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKScriptMessageHandler(self)) + PigeonApiWKNavigationDelegate.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKNavigationDelegate(self)) + PigeonApiNSObject.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiNSObject(self)) + PigeonApiUIViewWKWebView.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiUIViewWKWebView(self)) + PigeonApiNSViewWKWebView.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiNSViewWKWebView(self)) + PigeonApiWKUIDelegate.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKUIDelegate(self)) + PigeonApiWKHTTPCookieStore.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKHTTPCookieStore(self)) + PigeonApiUIScrollViewDelegate.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiUIScrollViewDelegate(self)) + PigeonApiURLCredential.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiURLCredential(self)) + PigeonApiURLAuthenticationChallenge.setUpMessageHandlers( + 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( + binaryMessenger: binaryMessenger, instanceManager: nil) + PigeonApiURLRequest.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) + PigeonApiWKUserScript.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) + PigeonApiHTTPCookie.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) + PigeonApiAuthenticationChallengeResponse.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: nil) + PigeonApiWKWebsiteDataStore.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) + PigeonApiUIView.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) + PigeonApiUIScrollView.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) + PigeonApiWKWebViewConfiguration.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) + PigeonApiWKUserContentController.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: nil) + PigeonApiWKPreferences.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) + PigeonApiWKScriptMessageHandler.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) + PigeonApiWKNavigationDelegate.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) + PigeonApiNSObject.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) + PigeonApiUIViewWKWebView.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) + PigeonApiNSViewWKWebView.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) + PigeonApiWKUIDelegate.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) + PigeonApiWKHTTPCookieStore.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) + PigeonApiUIScrollViewDelegate.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) + PigeonApiURLCredential.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) + PigeonApiURLAuthenticationChallenge.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: nil) + PigeonApiURL.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) + PigeonApiWKWebpagePreferences.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) + } +} +private class WebKitLibraryPigeonInternalProxyApiCodecReaderWriter: FlutterStandardReaderWriter { + unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar + + private class WebKitLibraryPigeonInternalProxyApiCodecReader: WebKitLibraryPigeonCodecReader { + unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar + + init(data: Data, pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar) { + self.pigeonRegistrar = pigeonRegistrar + super.init(data: data) + } + + override func readValue(ofType type: UInt8) -> Any? { + switch type { + case 128: + 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) + } + } + } + + private class WebKitLibraryPigeonInternalProxyApiCodecWriter: WebKitLibraryPigeonCodecWriter { + unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar + + init(data: NSMutableData, pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar) { + self.pigeonRegistrar = pigeonRegistrar + super.init(data: data) + } + + override func writeValue(_ value: Any) { + if value is [Any] || value is Bool || value is Data || value is [AnyHashable: Any] + || value is Double || value is FlutterStandardTypedData || value is Int64 || value is String + || value is KeyValueObservingOptions || value is KeyValueChange + || value is KeyValueChangeKey || value is UserScriptInjectionTime + || value is AudiovisualMediaType || value is WebsiteDataType + || value is NavigationActionPolicy || value is NavigationResponsePolicy + || value is HttpCookiePropertyKey || value is NavigationType || value is PermissionDecision + || value is MediaCaptureType || value is UrlSessionAuthChallengeDisposition + || value is UrlCredentialPersistence + { + super.writeValue(value) + return + } + + if let instance = value as? URLRequestWrapper { + pigeonRegistrar.apiDelegate.pigeonApiURLRequest(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + return + } + + if let instance = value as? HTTPURLResponse { + pigeonRegistrar.apiDelegate.pigeonApiHTTPURLResponse(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + return + } + + if let instance = value as? URLResponse { + pigeonRegistrar.apiDelegate.pigeonApiURLResponse(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + return + } + + if let instance = value as? WKUserScript { + pigeonRegistrar.apiDelegate.pigeonApiWKUserScript(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + return + } + + if let instance = value as? WKNavigationAction { + pigeonRegistrar.apiDelegate.pigeonApiWKNavigationAction(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + return + } + + if let instance = value as? WKNavigationResponse { + pigeonRegistrar.apiDelegate.pigeonApiWKNavigationResponse(pigeonRegistrar) + .pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + return + } + + if let instance = value as? WKFrameInfo { + pigeonRegistrar.apiDelegate.pigeonApiWKFrameInfo(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + return + } + + if let instance = value as? NSError { + pigeonRegistrar.apiDelegate.pigeonApiNSError(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + return + } + + if let instance = value as? WKScriptMessage { + pigeonRegistrar.apiDelegate.pigeonApiWKScriptMessage(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + return + } + + if let instance = value as? WKSecurityOrigin { + pigeonRegistrar.apiDelegate.pigeonApiWKSecurityOrigin(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + return + } + + if let instance = value as? HTTPCookie { + pigeonRegistrar.apiDelegate.pigeonApiHTTPCookie(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + return + } + + if let instance = value as? AuthenticationChallengeResponse { + pigeonRegistrar.apiDelegate.pigeonApiAuthenticationChallengeResponse(pigeonRegistrar) + .pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + return + } + + if let instance = value as? WKWebsiteDataStore { + pigeonRegistrar.apiDelegate.pigeonApiWKWebsiteDataStore(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + return + } + + #if !os(macOS) + if let instance = value as? UIScrollView { + pigeonRegistrar.apiDelegate.pigeonApiUIScrollView(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + return + } + #endif + + if let instance = value as? WKWebViewConfiguration { + pigeonRegistrar.apiDelegate.pigeonApiWKWebViewConfiguration(pigeonRegistrar) + .pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + return + } + + if let instance = value as? WKUserContentController { + pigeonRegistrar.apiDelegate.pigeonApiWKUserContentController(pigeonRegistrar) + .pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + return + } + + if let instance = value as? WKPreferences { + pigeonRegistrar.apiDelegate.pigeonApiWKPreferences(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + return + } + + if let instance = value as? WKScriptMessageHandler { + pigeonRegistrar.apiDelegate.pigeonApiWKScriptMessageHandler(pigeonRegistrar) + .pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + return + } + + if let instance = value as? WKNavigationDelegate { + pigeonRegistrar.apiDelegate.pigeonApiWKNavigationDelegate(pigeonRegistrar) + .pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + return + } + + #if !os(macOS) + if let instance = value as? WKWebView { + pigeonRegistrar.apiDelegate.pigeonApiUIViewWKWebView(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + return + } + #endif + #if !os(macOS) + if let instance = value as? UIView { + pigeonRegistrar.apiDelegate.pigeonApiUIView(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + return + } + #endif + #if !os(iOS) + if let instance = value as? WKWebView { + pigeonRegistrar.apiDelegate.pigeonApiNSViewWKWebView(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + return + } + #endif + + if let instance = value as? WKWebView { + pigeonRegistrar.apiDelegate.pigeonApiWKWebView(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + return + } + + if let instance = value as? WKUIDelegate { + pigeonRegistrar.apiDelegate.pigeonApiWKUIDelegate(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + return + } + + if let instance = value as? WKHTTPCookieStore { + pigeonRegistrar.apiDelegate.pigeonApiWKHTTPCookieStore(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + return + } + + #if !os(macOS) + if let instance = value as? UIScrollViewDelegate { + pigeonRegistrar.apiDelegate.pigeonApiUIScrollViewDelegate(pigeonRegistrar) + .pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + return + } + #endif + + if let instance = value as? URLCredential { + pigeonRegistrar.apiDelegate.pigeonApiURLCredential(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + return + } + + if let instance = value as? URLProtectionSpace { + pigeonRegistrar.apiDelegate.pigeonApiURLProtectionSpace(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + return + } + + if let instance = value as? URLAuthenticationChallenge { + pigeonRegistrar.apiDelegate.pigeonApiURLAuthenticationChallenge(pigeonRegistrar) + .pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + return + } + + if let instance = value as? URL { + pigeonRegistrar.apiDelegate.pigeonApiURL(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + 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 + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + return + } + + if let instance = value as AnyObject?, + pigeonRegistrar.instanceManager.containsInstance(instance) + { + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance)!) + } else { + print("Unsupported value: \(value) of \(type(of: value))") + assert(false, "Unsupported value for WebKitLibraryPigeonInternalProxyApiCodecWriter") + } + + } + } + + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar) { + self.pigeonRegistrar = pigeonRegistrar + } + + override func reader(with data: Data) -> FlutterStandardReader { + return WebKitLibraryPigeonInternalProxyApiCodecReader( + data: data, pigeonRegistrar: pigeonRegistrar) + } + + override func writer(with data: NSMutableData) -> FlutterStandardWriter { + return WebKitLibraryPigeonInternalProxyApiCodecWriter( + data: data, pigeonRegistrar: pigeonRegistrar) + } +} + +/// The values that can be returned in a change dictionary. +/// +/// See https://developer.apple.com/documentation/foundation/nskeyvalueobservingoptions. +enum KeyValueObservingOptions: Int { + /// Indicates that the change dictionary should provide the new attribute + /// value, if applicable. + case newValue = 0 + /// Indicates that the change dictionary should contain the old attribute + /// value, if applicable. + case oldValue = 1 + /// If specified, a notification should be sent to the observer immediately, + /// before the observer registration method even returns. + case initialValue = 2 + /// Whether separate notifications should be sent to the observer before and + /// after each change, instead of a single notification after the change. + case priorNotification = 3 +} + +/// The kinds of changes that can be observed. +/// +/// See https://developer.apple.com/documentation/foundation/nskeyvaluechange. +enum KeyValueChange: Int { + /// Indicates that the value of the observed key path was set to a new value. + case setting = 0 + /// Indicates that an object has been inserted into the to-many relationship + /// that is being observed. + case insertion = 1 + /// Indicates that an object has been removed from the to-many relationship + /// that is being observed. + case removal = 2 + /// Indicates that an object has been replaced in the to-many relationship + /// that is being observed. + case replacement = 3 + /// The value is not recognized by the wrapper. + case unknown = 4 +} + +/// The keys that can appear in the change dictionary. +/// +/// See https://developer.apple.com/documentation/foundation/nskeyvaluechangekey. +enum KeyValueChangeKey: Int { + /// If the value of the `KeyValueChangeKey.kind` entry is + /// `KeyValueChange.insertion`, `KeyValueChange.removal`, or + /// `KeyValueChange.replacement`, the value of this key is a Set object that + /// contains the indexes of the inserted, removed, or replaced objects. + case indexes = 0 + /// An object that contains a value corresponding to one of the + /// `KeyValueChange` enum, indicating what sort of change has occurred. + case kind = 1 + /// If the value of the `KeyValueChange.kind` entry is + /// `KeyValueChange.setting, and `KeyValueObservingOptions.newValue` was + /// specified when the observer was registered, the value of this key is the + /// new value for the attribute. + case newValue = 2 + /// If the `KeyValueObservingOptions.priorNotification` option was specified + /// when the observer was registered this notification is sent prior to a + /// change. + case notificationIsPrior = 3 + /// If the value of the `KeyValueChange.kind` entry is + /// `KeyValueChange.setting`, and `KeyValueObservingOptions.old` was specified + /// when the observer was registered, the value of this key is the value + /// before the attribute was changed. + case oldValue = 4 + /// The value is not recognized by the wrapper. + case unknown = 5 +} + +/// Constants for the times at which to inject script content into a webpage. +/// +/// See https://developer.apple.com/documentation/webkit/wkuserscriptinjectiontime. +enum UserScriptInjectionTime: Int { + /// A constant to inject the script after the creation of the webpage’s + /// document element, but before loading any other content. + case atDocumentStart = 0 + /// A constant to inject the script after the document finishes loading, but + /// before loading any other subresources. + case atDocumentEnd = 1 + /// The value is not recognized by the wrapper. + case unknown = 2 +} + +/// The media types that require a user gesture to begin playing. +/// +/// See https://developer.apple.com/documentation/webkit/wkaudiovisualmediatypes. +enum AudiovisualMediaType: Int { + /// No media types require a user gesture to begin playing. + case none = 0 + /// Media types that contain audio require a user gesture to begin playing. + case audio = 1 + /// Media types that contain video require a user gesture to begin playing. + case video = 2 + /// All media types require a user gesture to begin playing. + case all = 3 +} + +/// A `WKWebsiteDataRecord` object includes these constants in its dataTypes +/// property. +/// +/// See https://developer.apple.com/documentation/webkit/wkwebsitedatarecord/data_store_record_types. +enum WebsiteDataType: Int { + /// Cookies. + case cookies = 0 + /// In-memory caches. + case memoryCache = 1 + /// On-disk caches. + case diskCache = 2 + /// HTML offline web app caches. + case offlineWebApplicationCache = 3 + /// HTML local storage. + case localStorage = 4 + /// HTML session storage. + case sessionStorage = 5 + /// WebSQL databases. + case webSQLDatabases = 6 + /// IndexedDB databases. + case indexedDBDatabases = 7 +} + +/// Constants that indicate whether to allow or cancel navigation to a webpage +/// from an action. +/// +/// See https://developer.apple.com/documentation/webkit/wknavigationactionpolicy. +enum NavigationActionPolicy: Int { + /// Allow the navigation to continue. + case allow = 0 + /// Cancel the navigation. + case cancel = 1 + /// Allow the download to proceed. + case download = 2 +} + +/// Constants that indicate whether to allow or cancel navigation to a webpage +/// from a response. +/// +/// See https://developer.apple.com/documentation/webkit/wknavigationresponsepolicy. +enum NavigationResponsePolicy: Int { + /// Allow the navigation to continue. + case allow = 0 + /// Cancel the navigation. + case cancel = 1 + /// Allow the download to proceed. + case download = 2 +} + +/// Constants that define the supported keys in a cookie attributes dictionary. +/// +/// See https://developer.apple.com/documentation/foundation/httpcookiepropertykey. +enum HttpCookiePropertyKey: Int { + /// A String object containing the comment for the cookie. + case comment = 0 + /// An Uri object or String object containing the comment URL for the cookie. + case commentUrl = 1 + /// Aa String object stating whether the cookie should be discarded at the end + /// of the session. + case discard = 2 + /// An String object containing the domain for the cookie. + case domain = 3 + /// An Date object or String object specifying the expiration date for the + /// cookie. + case expires = 4 + /// An String object containing an integer value stating how long in seconds + /// the cookie should be kept, at most. + case maximumAge = 5 + /// An String object containing the name of the cookie (required). + case name = 6 + /// A URL or String object containing the URL that set this cookie. + case originUrl = 7 + /// A String object containing the path for the cookie. + case path = 8 + /// An String object containing comma-separated integer values specifying the + /// ports for the cookie. + case port = 9 + /// A string indicating the same-site policy for the cookie. + case sameSitePolicy = 10 + /// A String object indicating that the cookie should be transmitted only over + /// secure channels. + case secure = 11 + /// A String object containing the value of the cookie. + case value = 12 + /// A String object that specifies the version of the cookie. + case version = 13 + /// The value is not recognized by the wrapper. + case unknown = 14 +} + +/// The type of action that triggered the navigation. +/// +/// See https://developer.apple.com/documentation/webkit/wknavigationtype. +enum NavigationType: Int { + /// A link activation. + case linkActivated = 0 + /// A request to submit a form. + case formSubmitted = 1 + /// A request for the frame’s next or previous item. + case backForward = 2 + /// A request to reload the webpage. + case reload = 3 + /// A request to resubmit a form. + case formResubmitted = 4 + /// A navigation request that originates for some other reason. + case other = 5 + /// The value is not recognized by the wrapper. + case unknown = 6 +} + +/// Possible permission decisions for device resource access. +/// +/// See https://developer.apple.com/documentation/webkit/wkpermissiondecision. +enum PermissionDecision: Int { + /// Deny permission for the requested resource. + case deny = 0 + /// Deny permission for the requested resource. + case grant = 1 + /// Prompt the user for permission for the requested resource. + case prompt = 2 +} + +/// List of the types of media devices that can capture audio, video, or both. +/// +/// See https://developer.apple.com/documentation/webkit/wkmediacapturetype. +enum MediaCaptureType: Int { + /// A media device that can capture video. + case camera = 0 + /// A media device or devices that can capture audio and video. + case cameraAndMicrophone = 1 + /// A media device that can capture audio. + case microphone = 2 + /// The value is not recognized by the wrapper. + case unknown = 3 +} + +/// Responses to an authentication challenge. +/// +/// See https://developer.apple.com/documentation/foundation/urlsession/authchallengedisposition. +enum UrlSessionAuthChallengeDisposition: Int { + /// Use the specified credential, which may be nil. + case useCredential = 0 + /// Use the default handling for the challenge as though this delegate method + /// were not implemented. + case performDefaultHandling = 1 + /// Cancel the entire request. + case cancelAuthenticationChallenge = 2 + /// Reject this challenge, and call the authentication delegate method again + /// with the next authentication protection space. + case rejectProtectionSpace = 3 + /// The value is not recognized by the wrapper. + case unknown = 4 +} + +/// Specifies how long a credential will be kept. +/// +/// See https://developer.apple.com/documentation/foundation/nsurlcredentialpersistence. +enum UrlCredentialPersistence: Int { + /// The credential should not be stored. + case none = 0 + /// The credential should be stored only for this session. + case forSession = 1 + /// The credential should be stored in the keychain. + case permanent = 2 + /// The credential should be stored permanently in the keychain, and in + /// addition should be distributed to other devices based on the owning Apple + /// ID. + case synchronizable = 3 +} + +private class WebKitLibraryPigeonCodecReader: FlutterStandardReader { + override func readValue(ofType type: UInt8) -> Any? { + switch type { + case 129: + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) + if let enumResultAsInt = enumResultAsInt { + return KeyValueObservingOptions(rawValue: enumResultAsInt) + } + return nil + case 130: + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) + if let enumResultAsInt = enumResultAsInt { + return KeyValueChange(rawValue: enumResultAsInt) + } + return nil + case 131: + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) + if let enumResultAsInt = enumResultAsInt { + return KeyValueChangeKey(rawValue: enumResultAsInt) + } + return nil + case 132: + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) + if let enumResultAsInt = enumResultAsInt { + return UserScriptInjectionTime(rawValue: enumResultAsInt) + } + return nil + case 133: + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) + if let enumResultAsInt = enumResultAsInt { + return AudiovisualMediaType(rawValue: enumResultAsInt) + } + return nil + case 134: + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) + if let enumResultAsInt = enumResultAsInt { + return WebsiteDataType(rawValue: enumResultAsInt) + } + return nil + case 135: + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) + if let enumResultAsInt = enumResultAsInt { + return NavigationActionPolicy(rawValue: enumResultAsInt) + } + return nil + case 136: + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) + if let enumResultAsInt = enumResultAsInt { + return NavigationResponsePolicy(rawValue: enumResultAsInt) + } + return nil + case 137: + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) + if let enumResultAsInt = enumResultAsInt { + return HttpCookiePropertyKey(rawValue: enumResultAsInt) + } + return nil + case 138: + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) + if let enumResultAsInt = enumResultAsInt { + return NavigationType(rawValue: enumResultAsInt) + } + return nil + case 139: + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) + if let enumResultAsInt = enumResultAsInt { + return PermissionDecision(rawValue: enumResultAsInt) + } + return nil + case 140: + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) + if let enumResultAsInt = enumResultAsInt { + return MediaCaptureType(rawValue: enumResultAsInt) + } + return nil + case 141: + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) + if let enumResultAsInt = enumResultAsInt { + return UrlSessionAuthChallengeDisposition(rawValue: enumResultAsInt) + } + return nil + case 142: + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) + if let enumResultAsInt = enumResultAsInt { + return UrlCredentialPersistence(rawValue: enumResultAsInt) + } + return nil + default: + return super.readValue(ofType: type) + } + } +} + +private class WebKitLibraryPigeonCodecWriter: FlutterStandardWriter { + override func writeValue(_ value: Any) { + if let value = value as? KeyValueObservingOptions { + super.writeByte(129) + super.writeValue(value.rawValue) + } else if let value = value as? KeyValueChange { + super.writeByte(130) + super.writeValue(value.rawValue) + } else if let value = value as? KeyValueChangeKey { + super.writeByte(131) + super.writeValue(value.rawValue) + } else if let value = value as? UserScriptInjectionTime { + super.writeByte(132) + super.writeValue(value.rawValue) + } else if let value = value as? AudiovisualMediaType { + super.writeByte(133) + super.writeValue(value.rawValue) + } else if let value = value as? WebsiteDataType { + super.writeByte(134) + super.writeValue(value.rawValue) + } else if let value = value as? NavigationActionPolicy { + super.writeByte(135) + super.writeValue(value.rawValue) + } else if let value = value as? NavigationResponsePolicy { + super.writeByte(136) + super.writeValue(value.rawValue) + } else if let value = value as? HttpCookiePropertyKey { + super.writeByte(137) + super.writeValue(value.rawValue) + } else if let value = value as? NavigationType { + super.writeByte(138) + super.writeValue(value.rawValue) + } else if let value = value as? PermissionDecision { + super.writeByte(139) + super.writeValue(value.rawValue) + } else if let value = value as? MediaCaptureType { + super.writeByte(140) + super.writeValue(value.rawValue) + } else if let value = value as? UrlSessionAuthChallengeDisposition { + super.writeByte(141) + super.writeValue(value.rawValue) + } else if let value = value as? UrlCredentialPersistence { + super.writeByte(142) + super.writeValue(value.rawValue) + } else { + super.writeValue(value) + } + } +} + +private class WebKitLibraryPigeonCodecReaderWriter: FlutterStandardReaderWriter { + override func reader(with data: Data) -> FlutterStandardReader { + return WebKitLibraryPigeonCodecReader(data: data) + } + + override func writer(with data: NSMutableData) -> FlutterStandardWriter { + return WebKitLibraryPigeonCodecWriter(data: data) + } +} + +class WebKitLibraryPigeonCodec: FlutterStandardMessageCodec, @unchecked Sendable { + static let shared = WebKitLibraryPigeonCodec(readerWriter: WebKitLibraryPigeonCodecReaderWriter()) +} + +protocol PigeonApiDelegateURLRequest { + func pigeonDefaultConstructor(pigeonApi: PigeonApiURLRequest, url: String) throws + -> URLRequestWrapper + /// The URL being requested. + func getUrl(pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper) throws -> String? + /// The HTTP request method. + func setHttpMethod( + pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper, method: String?) throws + /// The HTTP request method. + func getHttpMethod(pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper) throws + -> String? + /// The request body. + func setHttpBody( + pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper, + body: FlutterStandardTypedData?) throws + /// The request body. + func getHttpBody(pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper) throws + -> FlutterStandardTypedData? + /// A dictionary containing all of the HTTP header fields for a request. + func setAllHttpHeaderFields( + pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper, fields: [String: String]?) + throws + /// A dictionary containing all of the HTTP header fields for a request. + func getAllHttpHeaderFields(pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper) + throws -> [String: String]? +} + +protocol PigeonApiProtocolURLRequest { +} + +final class PigeonApiURLRequest: PigeonApiProtocolURLRequest { + unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar + let pigeonDelegate: PigeonApiDelegateURLRequest + ///An implementation of [NSObject] used to access callback methods + var pigeonApiNSObject: PigeonApiNSObject { + return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) + } + + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateURLRequest) + { + self.pigeonRegistrar = pigeonRegistrar + self.pigeonDelegate = delegate + } + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiURLRequest? + ) { + let codec: FlutterStandardMessageCodec = + api != nil + ? FlutterStandardMessageCodec( + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) + : FlutterStandardMessageCodec.sharedInstance() + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.pigeon_defaultConstructor", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + pigeonDefaultConstructorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonIdentifierArg = args[0] as! Int64 + let urlArg = args[1] as! String + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api, url: urlArg), + withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + pigeonDefaultConstructorChannel.setMessageHandler(nil) + } + let getUrlChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.getUrl", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getUrlChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! URLRequestWrapper + do { + let result = try api.pigeonDelegate.getUrl( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getUrlChannel.setMessageHandler(nil) + } + let setHttpMethodChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.setHttpMethod", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setHttpMethodChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! URLRequestWrapper + let methodArg: String? = nilOrValue(args[1]) + do { + try api.pigeonDelegate.setHttpMethod( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, method: methodArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + setHttpMethodChannel.setMessageHandler(nil) + } + let getHttpMethodChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.getHttpMethod", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getHttpMethodChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! URLRequestWrapper + do { + let result = try api.pigeonDelegate.getHttpMethod( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getHttpMethodChannel.setMessageHandler(nil) + } + let setHttpBodyChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.setHttpBody", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setHttpBodyChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! URLRequestWrapper + let bodyArg: FlutterStandardTypedData? = nilOrValue(args[1]) + do { + try api.pigeonDelegate.setHttpBody( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, body: bodyArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + setHttpBodyChannel.setMessageHandler(nil) + } + let getHttpBodyChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.getHttpBody", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getHttpBodyChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! URLRequestWrapper + do { + let result = try api.pigeonDelegate.getHttpBody( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getHttpBodyChannel.setMessageHandler(nil) + } + let setAllHttpHeaderFieldsChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.setAllHttpHeaderFields", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setAllHttpHeaderFieldsChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! URLRequestWrapper + let fieldsArg: [String: String]? = nilOrValue(args[1]) + do { + try api.pigeonDelegate.setAllHttpHeaderFields( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, fields: fieldsArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + setAllHttpHeaderFieldsChannel.setMessageHandler(nil) + } + let getAllHttpHeaderFieldsChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.getAllHttpHeaderFields", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getAllHttpHeaderFieldsChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! URLRequestWrapper + do { + let result = try api.pigeonDelegate.getAllHttpHeaderFields( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getAllHttpHeaderFieldsChannel.setMessageHandler(nil) + } + } + + ///Creates a Dart instance of URLRequest and attaches it to [pigeonInstance]. + func pigeonNewInstance( + pigeonInstance: URLRequestWrapper, 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.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(())) + } + } + } + } +} +protocol PigeonApiDelegateHTTPURLResponse { + /// The response’s HTTP status code. + func statusCode(pigeonApi: PigeonApiHTTPURLResponse, pigeonInstance: HTTPURLResponse) throws + -> Int64 +} + +protocol PigeonApiProtocolHTTPURLResponse { +} + +final class PigeonApiHTTPURLResponse: PigeonApiProtocolHTTPURLResponse { + unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar + let pigeonDelegate: PigeonApiDelegateHTTPURLResponse + ///An implementation of [URLResponse] used to access callback methods + var pigeonApiURLResponse: PigeonApiURLResponse { + return pigeonRegistrar.apiDelegate.pigeonApiURLResponse(pigeonRegistrar) + } + + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateHTTPURLResponse + ) { + self.pigeonRegistrar = pigeonRegistrar + self.pigeonDelegate = delegate + } + ///Creates a Dart instance of HTTPURLResponse and attaches it to [pigeonInstance]. + func pigeonNewInstance( + pigeonInstance: HTTPURLResponse, 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 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(())) + } + } + } + } +} +open class PigeonApiDelegateURLResponse { +} + +protocol PigeonApiProtocolURLResponse { +} + +final class PigeonApiURLResponse: PigeonApiProtocolURLResponse { + unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar + let pigeonDelegate: PigeonApiDelegateURLResponse + ///An implementation of [NSObject] used to access callback methods + var pigeonApiNSObject: PigeonApiNSObject { + return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) + } + + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateURLResponse + ) { + self.pigeonRegistrar = pigeonRegistrar + self.pigeonDelegate = delegate + } + ///Creates a Dart instance of URLResponse and attaches it to [pigeonInstance]. + func pigeonNewInstance( + pigeonInstance: URLResponse, 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.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(())) + } + } + } + } +} +protocol PigeonApiDelegateWKUserScript { + /// Creates a user script object that contains the specified source code and + /// attributes. + func pigeonDefaultConstructor( + pigeonApi: PigeonApiWKUserScript, source: String, injectionTime: UserScriptInjectionTime, + isForMainFrameOnly: Bool + ) throws -> WKUserScript + /// The script’s source code. + func source(pigeonApi: PigeonApiWKUserScript, pigeonInstance: WKUserScript) throws -> String + /// The time at which to inject the script into the webpage. + func injectionTime(pigeonApi: PigeonApiWKUserScript, pigeonInstance: WKUserScript) throws + -> UserScriptInjectionTime + /// A Boolean value that indicates whether to inject the script into the main + /// frame or all frames. + func isForMainFrameOnly(pigeonApi: PigeonApiWKUserScript, pigeonInstance: WKUserScript) throws + -> Bool +} + +protocol PigeonApiProtocolWKUserScript { +} + +final class PigeonApiWKUserScript: PigeonApiProtocolWKUserScript { + unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar + let pigeonDelegate: PigeonApiDelegateWKUserScript + ///An implementation of [NSObject] used to access callback methods + var pigeonApiNSObject: PigeonApiNSObject { + return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) + } + + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKUserScript + ) { + self.pigeonRegistrar = pigeonRegistrar + self.pigeonDelegate = delegate + } + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKUserScript? + ) { + let codec: FlutterStandardMessageCodec = + api != nil + ? FlutterStandardMessageCodec( + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) + : FlutterStandardMessageCodec.sharedInstance() + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserScript.pigeon_defaultConstructor", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + pigeonDefaultConstructorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonIdentifierArg = args[0] as! Int64 + let sourceArg = args[1] as! String + let injectionTimeArg = args[2] as! UserScriptInjectionTime + let isForMainFrameOnlyArg = args[3] as! Bool + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + try api.pigeonDelegate.pigeonDefaultConstructor( + pigeonApi: api, source: sourceArg, injectionTime: injectionTimeArg, + isForMainFrameOnly: isForMainFrameOnlyArg), + withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + pigeonDefaultConstructorChannel.setMessageHandler(nil) + } + } + + ///Creates a Dart instance of WKUserScript and attaches it to [pigeonInstance]. + func pigeonNewInstance( + pigeonInstance: WKUserScript, 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 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(())) + } + } + } + } +} +protocol PigeonApiDelegateWKNavigationAction { + /// The URL request object associated with the navigation action. + func request(pigeonApi: PigeonApiWKNavigationAction, pigeonInstance: WKNavigationAction) throws + -> URLRequestWrapper + /// The frame in which to display the new content. + /// + /// If the target of the navigation is a new window, this property is nil. + func targetFrame(pigeonApi: PigeonApiWKNavigationAction, pigeonInstance: WKNavigationAction) + throws -> WKFrameInfo? + /// The type of action that triggered the navigation. + func navigationType(pigeonApi: PigeonApiWKNavigationAction, pigeonInstance: WKNavigationAction) + throws -> NavigationType +} + +protocol PigeonApiProtocolWKNavigationAction { +} + +final class PigeonApiWKNavigationAction: PigeonApiProtocolWKNavigationAction { + unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar + let pigeonDelegate: PigeonApiDelegateWKNavigationAction + ///An implementation of [NSObject] used to access callback methods + var pigeonApiNSObject: PigeonApiNSObject { + return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) + } + + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateWKNavigationAction + ) { + self.pigeonRegistrar = pigeonRegistrar + self.pigeonDelegate = delegate + } + ///Creates a Dart instance of WKNavigationAction and attaches it to [pigeonInstance]. + func pigeonNewInstance( + pigeonInstance: WKNavigationAction, 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 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(())) + } + } + } + } +} +protocol PigeonApiDelegateWKNavigationResponse { + /// The frame’s response. + func response(pigeonApi: PigeonApiWKNavigationResponse, pigeonInstance: WKNavigationResponse) + throws -> URLResponse + /// A Boolean value that indicates whether the response targets the web view’s + /// main frame. + func isForMainFrame( + pigeonApi: PigeonApiWKNavigationResponse, pigeonInstance: WKNavigationResponse + ) throws -> Bool +} + +protocol PigeonApiProtocolWKNavigationResponse { +} + +final class PigeonApiWKNavigationResponse: PigeonApiProtocolWKNavigationResponse { + unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar + let pigeonDelegate: PigeonApiDelegateWKNavigationResponse + ///An implementation of [NSObject] used to access callback methods + var pigeonApiNSObject: PigeonApiNSObject { + return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) + } + + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateWKNavigationResponse + ) { + self.pigeonRegistrar = pigeonRegistrar + self.pigeonDelegate = delegate + } + ///Creates a Dart instance of WKNavigationResponse and attaches it to [pigeonInstance]. + func pigeonNewInstance( + pigeonInstance: WKNavigationResponse, 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 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(())) + } + } + } + } +} +protocol PigeonApiDelegateWKFrameInfo { + /// A Boolean value indicating whether the frame is the web site's main frame + /// or a subframe. + func isMainFrame(pigeonApi: PigeonApiWKFrameInfo, pigeonInstance: WKFrameInfo) throws -> Bool + /// The frame’s current request. + func request(pigeonApi: PigeonApiWKFrameInfo, pigeonInstance: WKFrameInfo) throws + -> URLRequestWrapper? +} + +protocol PigeonApiProtocolWKFrameInfo { +} + +final class PigeonApiWKFrameInfo: PigeonApiProtocolWKFrameInfo { + unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar + let pigeonDelegate: PigeonApiDelegateWKFrameInfo + ///An implementation of [NSObject] used to access callback methods + var pigeonApiNSObject: PigeonApiNSObject { + return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) + } + + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKFrameInfo + ) { + self.pigeonRegistrar = pigeonRegistrar + self.pigeonDelegate = delegate + } + ///Creates a Dart instance of WKFrameInfo and attaches it to [pigeonInstance]. + func pigeonNewInstance( + pigeonInstance: WKFrameInfo, 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 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(())) + } + } + } + } +} +protocol PigeonApiDelegateNSError { + /// The error code. + func code(pigeonApi: PigeonApiNSError, pigeonInstance: NSError) throws -> Int64 + /// A string containing the error domain. + func domain(pigeonApi: PigeonApiNSError, pigeonInstance: NSError) throws -> String + /// The user info dictionary. + func userInfo(pigeonApi: PigeonApiNSError, pigeonInstance: NSError) throws -> [String: Any?] +} + +protocol PigeonApiProtocolNSError { +} + +final class PigeonApiNSError: PigeonApiProtocolNSError { + unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar + let pigeonDelegate: PigeonApiDelegateNSError + ///An implementation of [NSObject] used to access callback methods + var pigeonApiNSObject: PigeonApiNSObject { + return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) + } + + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateNSError) { + self.pigeonRegistrar = pigeonRegistrar + self.pigeonDelegate = delegate + } + ///Creates a Dart instance of NSError and attaches it to [pigeonInstance]. + func pigeonNewInstance( + pigeonInstance: NSError, 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 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(())) + } + } + } + } +} +protocol PigeonApiDelegateWKScriptMessage { + /// The name of the message handler to which the message is sent. + func name(pigeonApi: PigeonApiWKScriptMessage, pigeonInstance: WKScriptMessage) throws -> String + /// The body of the message. + func body(pigeonApi: PigeonApiWKScriptMessage, pigeonInstance: WKScriptMessage) throws -> Any? +} + +protocol PigeonApiProtocolWKScriptMessage { +} + +final class PigeonApiWKScriptMessage: PigeonApiProtocolWKScriptMessage { + unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar + let pigeonDelegate: PigeonApiDelegateWKScriptMessage + ///An implementation of [NSObject] used to access callback methods + var pigeonApiNSObject: PigeonApiNSObject { + return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) + } + + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateWKScriptMessage + ) { + self.pigeonRegistrar = pigeonRegistrar + self.pigeonDelegate = delegate + } + ///Creates a Dart instance of WKScriptMessage and attaches it to [pigeonInstance]. + func pigeonNewInstance( + pigeonInstance: WKScriptMessage, 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 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(())) + } + } + } + } +} +protocol PigeonApiDelegateWKSecurityOrigin { + /// The security origin’s host. + func host(pigeonApi: PigeonApiWKSecurityOrigin, pigeonInstance: WKSecurityOrigin) throws -> String + /// The security origin's port. + func port(pigeonApi: PigeonApiWKSecurityOrigin, pigeonInstance: WKSecurityOrigin) throws -> Int64 + /// The security origin's protocol. + func securityProtocol(pigeonApi: PigeonApiWKSecurityOrigin, pigeonInstance: WKSecurityOrigin) + throws -> String +} + +protocol PigeonApiProtocolWKSecurityOrigin { +} + +final class PigeonApiWKSecurityOrigin: PigeonApiProtocolWKSecurityOrigin { + unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar + let pigeonDelegate: PigeonApiDelegateWKSecurityOrigin + ///An implementation of [NSObject] used to access callback methods + var pigeonApiNSObject: PigeonApiNSObject { + return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) + } + + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateWKSecurityOrigin + ) { + self.pigeonRegistrar = pigeonRegistrar + self.pigeonDelegate = delegate + } + ///Creates a Dart instance of WKSecurityOrigin and attaches it to [pigeonInstance]. + func pigeonNewInstance( + pigeonInstance: WKSecurityOrigin, 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 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(())) + } + } + } + } +} +protocol PigeonApiDelegateHTTPCookie { + func pigeonDefaultConstructor( + pigeonApi: PigeonApiHTTPCookie, properties: [HttpCookiePropertyKey: Any] + ) throws -> HTTPCookie + /// The cookie’s properties. + func getProperties(pigeonApi: PigeonApiHTTPCookie, pigeonInstance: HTTPCookie) throws + -> [HttpCookiePropertyKey: Any]? +} + +protocol PigeonApiProtocolHTTPCookie { +} + +final class PigeonApiHTTPCookie: PigeonApiProtocolHTTPCookie { + unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar + let pigeonDelegate: PigeonApiDelegateHTTPCookie + ///An implementation of [NSObject] used to access callback methods + var pigeonApiNSObject: PigeonApiNSObject { + return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) + } + + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateHTTPCookie) + { + self.pigeonRegistrar = pigeonRegistrar + self.pigeonDelegate = delegate + } + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiHTTPCookie? + ) { + let codec: FlutterStandardMessageCodec = + api != nil + ? FlutterStandardMessageCodec( + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) + : FlutterStandardMessageCodec.sharedInstance() + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.HTTPCookie.pigeon_defaultConstructor", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + pigeonDefaultConstructorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonIdentifierArg = args[0] as! Int64 + let propertiesArg = args[1] as? [HttpCookiePropertyKey: Any] + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + try api.pigeonDelegate.pigeonDefaultConstructor( + pigeonApi: api, properties: propertiesArg!), + withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + pigeonDefaultConstructorChannel.setMessageHandler(nil) + } + let getPropertiesChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.HTTPCookie.getProperties", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getPropertiesChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! HTTPCookie + do { + let result = try api.pigeonDelegate.getProperties( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getPropertiesChannel.setMessageHandler(nil) + } + } + + ///Creates a Dart instance of HTTPCookie and attaches it to [pigeonInstance]. + func pigeonNewInstance( + pigeonInstance: HTTPCookie, 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.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(())) + } + } + } + } +} +protocol PigeonApiDelegateAuthenticationChallengeResponse { + func pigeonDefaultConstructor( + pigeonApi: PigeonApiAuthenticationChallengeResponse, + disposition: UrlSessionAuthChallengeDisposition, credential: URLCredential? + ) throws -> AuthenticationChallengeResponse + /// The option to use to handle the challenge. + func disposition( + pigeonApi: PigeonApiAuthenticationChallengeResponse, + pigeonInstance: AuthenticationChallengeResponse + ) throws -> UrlSessionAuthChallengeDisposition + /// The credential to use for authentication when the disposition parameter + /// contains the value URLSession.AuthChallengeDisposition.useCredential. + func credential( + pigeonApi: PigeonApiAuthenticationChallengeResponse, + pigeonInstance: AuthenticationChallengeResponse + ) throws -> URLCredential? +} + +protocol PigeonApiProtocolAuthenticationChallengeResponse { +} + +final class PigeonApiAuthenticationChallengeResponse: + PigeonApiProtocolAuthenticationChallengeResponse +{ + unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar + let pigeonDelegate: PigeonApiDelegateAuthenticationChallengeResponse + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateAuthenticationChallengeResponse + ) { + self.pigeonRegistrar = pigeonRegistrar + self.pigeonDelegate = delegate + } + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiAuthenticationChallengeResponse? + ) { + let codec: FlutterStandardMessageCodec = + api != nil + ? FlutterStandardMessageCodec( + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) + : FlutterStandardMessageCodec.sharedInstance() + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.AuthenticationChallengeResponse.pigeon_defaultConstructor", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + pigeonDefaultConstructorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonIdentifierArg = args[0] as! Int64 + let dispositionArg = args[1] as! UrlSessionAuthChallengeDisposition + let credentialArg: URLCredential? = nilOrValue(args[2]) + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + try api.pigeonDelegate.pigeonDefaultConstructor( + pigeonApi: api, disposition: dispositionArg, credential: credentialArg), + withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + pigeonDefaultConstructorChannel.setMessageHandler(nil) + } + } + + ///Creates a Dart instance of AuthenticationChallengeResponse and attaches it to [pigeonInstance]. + func pigeonNewInstance( + pigeonInstance: AuthenticationChallengeResponse, + 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 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(())) + } + } + } + } +} +protocol PigeonApiDelegateWKWebsiteDataStore { + /// The default data store, which stores data persistently to disk. + func defaultDataStore(pigeonApi: PigeonApiWKWebsiteDataStore) throws -> WKWebsiteDataStore + /// The object that manages the HTTP cookies for your website. + func httpCookieStore(pigeonApi: PigeonApiWKWebsiteDataStore, pigeonInstance: WKWebsiteDataStore) + throws -> WKHTTPCookieStore + /// Removes the specified types of website data from one or more data records. + func removeDataOfTypes( + pigeonApi: PigeonApiWKWebsiteDataStore, pigeonInstance: WKWebsiteDataStore, + dataTypes: [WebsiteDataType], modificationTimeInSecondsSinceEpoch: Double, + completion: @escaping (Result) -> Void) +} + +protocol PigeonApiProtocolWKWebsiteDataStore { +} + +final class PigeonApiWKWebsiteDataStore: PigeonApiProtocolWKWebsiteDataStore { + unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar + let pigeonDelegate: PigeonApiDelegateWKWebsiteDataStore + ///An implementation of [NSObject] used to access callback methods + var pigeonApiNSObject: PigeonApiNSObject { + return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) + } + + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateWKWebsiteDataStore + ) { + self.pigeonRegistrar = pigeonRegistrar + self.pigeonDelegate = delegate + } + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKWebsiteDataStore? + ) { + let codec: FlutterStandardMessageCodec = + api != nil + ? FlutterStandardMessageCodec( + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) + : FlutterStandardMessageCodec.sharedInstance() + let defaultDataStoreChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStore.defaultDataStore", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + defaultDataStoreChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonIdentifierArg = args[0] as! Int64 + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + try api.pigeonDelegate.defaultDataStore(pigeonApi: api), + withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + defaultDataStoreChannel.setMessageHandler(nil) + } + let httpCookieStoreChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStore.httpCookieStore", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + httpCookieStoreChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebsiteDataStore + let pigeonIdentifierArg = args[1] as! Int64 + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + try api.pigeonDelegate.httpCookieStore( + pigeonApi: api, pigeonInstance: pigeonInstanceArg), + withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + httpCookieStoreChannel.setMessageHandler(nil) + } + let removeDataOfTypesChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStore.removeDataOfTypes", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + removeDataOfTypesChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebsiteDataStore + let dataTypesArg = args[1] as! [WebsiteDataType] + let modificationTimeInSecondsSinceEpochArg = args[2] as! Double + api.pigeonDelegate.removeDataOfTypes( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, dataTypes: dataTypesArg, + modificationTimeInSecondsSinceEpoch: modificationTimeInSecondsSinceEpochArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + removeDataOfTypesChannel.setMessageHandler(nil) + } + } + + ///Creates a Dart instance of WKWebsiteDataStore and attaches it to [pigeonInstance]. + func pigeonNewInstance( + pigeonInstance: WKWebsiteDataStore, 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.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(())) + } + } + } + } +} +protocol PigeonApiDelegateUIView { + #if !os(macOS) + /// The view’s background color. + func setBackgroundColor(pigeonApi: PigeonApiUIView, pigeonInstance: UIView, value: Int64?) + throws + #endif + #if !os(macOS) + /// A Boolean value that determines whether the view is opaque. + func setOpaque(pigeonApi: PigeonApiUIView, pigeonInstance: UIView, opaque: Bool) throws + #endif +} + +protocol PigeonApiProtocolUIView { +} + +final class PigeonApiUIView: PigeonApiProtocolUIView { + unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar + let pigeonDelegate: PigeonApiDelegateUIView + ///An implementation of [NSObject] used to access callback methods + var pigeonApiNSObject: PigeonApiNSObject { + return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) + } + + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateUIView) { + self.pigeonRegistrar = pigeonRegistrar + self.pigeonDelegate = delegate + } + static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiUIView?) { + let codec: FlutterStandardMessageCodec = + api != nil + ? FlutterStandardMessageCodec( + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) + : FlutterStandardMessageCodec.sharedInstance() + #if !os(macOS) + let setBackgroundColorChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIView.setBackgroundColor", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setBackgroundColorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIView + let valueArg: Int64? = nilOrValue(args[1]) + do { + try api.pigeonDelegate.setBackgroundColor( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + setBackgroundColorChannel.setMessageHandler(nil) + } + #endif + #if !os(macOS) + let setOpaqueChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIView.setOpaque", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setOpaqueChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIView + let opaqueArg = args[1] as! Bool + do { + try api.pigeonDelegate.setOpaque( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, opaque: opaqueArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + setOpaqueChannel.setMessageHandler(nil) + } + #endif + } + + #if !os(macOS) + ///Creates a Dart instance of UIView and attaches it to [pigeonInstance]. + func pigeonNewInstance( + pigeonInstance: UIView, 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.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(())) + } + } + } + } + #endif +} +protocol PigeonApiDelegateUIScrollView { + #if !os(macOS) + /// The point at which the origin of the content view is offset from the + /// origin of the scroll view. + func getContentOffset(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView) throws + -> [Double] + #endif + #if !os(macOS) + /// Move the scrolled position of your view. + /// + /// Convenience method to synchronize change to the x and y scroll position. + func scrollBy( + pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, x: Double, y: Double) throws + #endif + #if !os(macOS) + /// The point at which the origin of the content view is offset from the + /// origin of the scroll view. + func setContentOffset( + pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, x: Double, y: Double) throws + #endif + #if !os(macOS) + /// The delegate of the scroll view. + func setDelegate( + pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, + delegate: UIScrollViewDelegate?) throws + #endif + #if !os(macOS) + /// Whether the scroll view bounces past the edge of content and back again. + func setBounces(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) + throws + #endif + #if !os(macOS) + /// Whether the scroll view bounces when it reaches the ends of its horizontal + /// axis. + func setBouncesHorizontally( + pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws + #endif + #if !os(macOS) + /// Whether the scroll view bounces when it reaches the ends of its vertical + /// axis. + func setBouncesVertically( + pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws + #endif + #if !os(macOS) + /// Whether bouncing always occurs when vertical scrolling reaches the end of + /// the content. + /// + /// If the value of this property is true and `bouncesVertically` is true, the + /// scroll view allows vertical dragging even if the content is smaller than + /// the bounds of the scroll view. + func setAlwaysBounceVertical( + pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws + #endif + #if !os(macOS) + /// Whether bouncing always occurs when horizontal scrolling reaches the end + /// of the content view. + /// + /// If the value of this property is true and `bouncesHorizontally` is true, + /// the scroll view allows horizontal dragging even if the content is smaller + /// than the bounds of the scroll view. + func setAlwaysBounceHorizontal( + pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws + #endif +} + +protocol PigeonApiProtocolUIScrollView { +} + +final class PigeonApiUIScrollView: PigeonApiProtocolUIScrollView { + unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar + let pigeonDelegate: PigeonApiDelegateUIScrollView + ///An implementation of [UIView] used to access callback methods + var pigeonApiUIView: PigeonApiUIView { + return pigeonRegistrar.apiDelegate.pigeonApiUIView(pigeonRegistrar) + } + + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateUIScrollView + ) { + self.pigeonRegistrar = pigeonRegistrar + self.pigeonDelegate = delegate + } + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiUIScrollView? + ) { + let codec: FlutterStandardMessageCodec = + api != nil + ? FlutterStandardMessageCodec( + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) + : FlutterStandardMessageCodec.sharedInstance() + #if !os(macOS) + let getContentOffsetChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.getContentOffset", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getContentOffsetChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + do { + let result = try api.pigeonDelegate.getContentOffset( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getContentOffsetChannel.setMessageHandler(nil) + } + #endif + #if !os(macOS) + let scrollByChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.scrollBy", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + scrollByChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + let xArg = args[1] as! Double + let yArg = args[2] as! Double + do { + try api.pigeonDelegate.scrollBy( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, x: xArg, y: yArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + scrollByChannel.setMessageHandler(nil) + } + #endif + #if !os(macOS) + let setContentOffsetChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setContentOffset", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setContentOffsetChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + let xArg = args[1] as! Double + let yArg = args[2] as! Double + do { + try api.pigeonDelegate.setContentOffset( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, x: xArg, y: yArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + setContentOffsetChannel.setMessageHandler(nil) + } + #endif + #if !os(macOS) + let setDelegateChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setDelegate", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setDelegateChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + let delegateArg: UIScrollViewDelegate? = nilOrValue(args[1]) + do { + try api.pigeonDelegate.setDelegate( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, delegate: delegateArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + setDelegateChannel.setMessageHandler(nil) + } + #endif + #if !os(macOS) + let setBouncesChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setBounces", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setBouncesChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + let valueArg = args[1] as! Bool + do { + try api.pigeonDelegate.setBounces( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + setBouncesChannel.setMessageHandler(nil) + } + #endif + #if !os(macOS) + let setBouncesHorizontallyChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setBouncesHorizontally", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setBouncesHorizontallyChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + let valueArg = args[1] as! Bool + do { + try api.pigeonDelegate.setBouncesHorizontally( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + setBouncesHorizontallyChannel.setMessageHandler(nil) + } + #endif + #if !os(macOS) + let setBouncesVerticallyChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setBouncesVertically", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setBouncesVerticallyChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + let valueArg = args[1] as! Bool + do { + try api.pigeonDelegate.setBouncesVertically( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + setBouncesVerticallyChannel.setMessageHandler(nil) + } + #endif + #if !os(macOS) + let setAlwaysBounceVerticalChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setAlwaysBounceVertical", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setAlwaysBounceVerticalChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + let valueArg = args[1] as! Bool + do { + try api.pigeonDelegate.setAlwaysBounceVertical( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + setAlwaysBounceVerticalChannel.setMessageHandler(nil) + } + #endif + #if !os(macOS) + let setAlwaysBounceHorizontalChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setAlwaysBounceHorizontal", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setAlwaysBounceHorizontalChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + let valueArg = args[1] as! Bool + do { + try api.pigeonDelegate.setAlwaysBounceHorizontal( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + setAlwaysBounceHorizontalChannel.setMessageHandler(nil) + } + #endif + } + + #if !os(macOS) + ///Creates a Dart instance of UIScrollView and attaches it to [pigeonInstance]. + func pigeonNewInstance( + pigeonInstance: UIScrollView, 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.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(())) + } + } + } + } + #endif +} +protocol PigeonApiDelegateWKWebViewConfiguration { + func pigeonDefaultConstructor(pigeonApi: PigeonApiWKWebViewConfiguration) throws + -> WKWebViewConfiguration + /// The object that coordinates interactions between your app’s native code + /// and the webpage’s scripts and other content. + func setUserContentController( + pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, + controller: WKUserContentController) throws + /// The object that coordinates interactions between your app’s native code + /// and the webpage’s scripts and other content. + func getUserContentController( + pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration + ) throws -> WKUserContentController + /// The object you use to get and set the site’s cookies and to track the + /// cached data objects. + func setWebsiteDataStore( + pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, + dataStore: WKWebsiteDataStore) throws + /// The object you use to get and set the site’s cookies and to track the + /// cached data objects. + func getWebsiteDataStore( + pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration + ) throws -> WKWebsiteDataStore + /// The object that manages the preference-related settings for the web view. + func setPreferences( + pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, + preferences: WKPreferences) throws + /// The object that manages the preference-related settings for the web view. + func getPreferences( + pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration + ) throws -> WKPreferences + /// A Boolean value that indicates whether HTML5 videos play inline or use the + /// native full-screen controller. + func setAllowsInlineMediaPlayback( + pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, allow: Bool) + throws + /// A Boolean value that indicates whether the web view limits navigation to + /// pages within the app’s domain. + func setLimitsNavigationsToAppBoundDomains( + pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, limit: Bool) + throws + /// The media types that require a user gesture to begin playing. + 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 { +} + +final class PigeonApiWKWebViewConfiguration: PigeonApiProtocolWKWebViewConfiguration { + unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar + let pigeonDelegate: PigeonApiDelegateWKWebViewConfiguration + ///An implementation of [NSObject] used to access callback methods + var pigeonApiNSObject: PigeonApiNSObject { + return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) + } + + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateWKWebViewConfiguration + ) { + self.pigeonRegistrar = pigeonRegistrar + self.pigeonDelegate = delegate + } + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKWebViewConfiguration? + ) { + let codec: FlutterStandardMessageCodec = + api != nil + ? FlutterStandardMessageCodec( + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) + : FlutterStandardMessageCodec.sharedInstance() + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.pigeon_defaultConstructor", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + pigeonDefaultConstructorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonIdentifierArg = args[0] as! Int64 + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), + withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + pigeonDefaultConstructorChannel.setMessageHandler(nil) + } + let setUserContentControllerChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setUserContentController", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setUserContentControllerChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebViewConfiguration + let controllerArg = args[1] as! WKUserContentController + do { + try api.pigeonDelegate.setUserContentController( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, controller: controllerArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + setUserContentControllerChannel.setMessageHandler(nil) + } + let getUserContentControllerChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.getUserContentController", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getUserContentControllerChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebViewConfiguration + do { + let result = try api.pigeonDelegate.getUserContentController( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getUserContentControllerChannel.setMessageHandler(nil) + } + let setWebsiteDataStoreChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setWebsiteDataStore", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setWebsiteDataStoreChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebViewConfiguration + let dataStoreArg = args[1] as! WKWebsiteDataStore + do { + try api.pigeonDelegate.setWebsiteDataStore( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, dataStore: dataStoreArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + setWebsiteDataStoreChannel.setMessageHandler(nil) + } + let getWebsiteDataStoreChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.getWebsiteDataStore", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getWebsiteDataStoreChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebViewConfiguration + do { + let result = try api.pigeonDelegate.getWebsiteDataStore( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getWebsiteDataStoreChannel.setMessageHandler(nil) + } + let setPreferencesChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setPreferences", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setPreferencesChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebViewConfiguration + let preferencesArg = args[1] as! WKPreferences + do { + try api.pigeonDelegate.setPreferences( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, preferences: preferencesArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + setPreferencesChannel.setMessageHandler(nil) + } + let getPreferencesChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.getPreferences", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getPreferencesChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebViewConfiguration + do { + let result = try api.pigeonDelegate.getPreferences( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getPreferencesChannel.setMessageHandler(nil) + } + let setAllowsInlineMediaPlaybackChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setAllowsInlineMediaPlayback", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setAllowsInlineMediaPlaybackChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebViewConfiguration + let allowArg = args[1] as! Bool + do { + try api.pigeonDelegate.setAllowsInlineMediaPlayback( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, allow: allowArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + setAllowsInlineMediaPlaybackChannel.setMessageHandler(nil) + } + let setLimitsNavigationsToAppBoundDomainsChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setLimitsNavigationsToAppBoundDomains", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setLimitsNavigationsToAppBoundDomainsChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebViewConfiguration + let limitArg = args[1] as! Bool + do { + try api.pigeonDelegate.setLimitsNavigationsToAppBoundDomains( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, limit: limitArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + setLimitsNavigationsToAppBoundDomainsChannel.setMessageHandler(nil) + } + let setMediaTypesRequiringUserActionForPlaybackChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setMediaTypesRequiringUserActionForPlayback", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setMediaTypesRequiringUserActionForPlaybackChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebViewConfiguration + let typeArg = args[1] as! AudiovisualMediaType + do { + try api.pigeonDelegate.setMediaTypesRequiringUserActionForPlayback( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, type: typeArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } 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]. + func pigeonNewInstance( + pigeonInstance: WKWebViewConfiguration, + 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.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(())) + } + } + } + } +} +protocol PigeonApiDelegateWKUserContentController { + /// Installs a message handler that you can call from your JavaScript code. + func addScriptMessageHandler( + pigeonApi: PigeonApiWKUserContentController, pigeonInstance: WKUserContentController, + handler: WKScriptMessageHandler, name: String) throws + /// Uninstalls the custom message handler with the specified name from your + /// JavaScript code. + func removeScriptMessageHandler( + pigeonApi: PigeonApiWKUserContentController, pigeonInstance: WKUserContentController, + name: String) throws + /// Uninstalls all custom message handlers associated with the user content + /// controller. + func removeAllScriptMessageHandlers( + pigeonApi: PigeonApiWKUserContentController, pigeonInstance: WKUserContentController) throws + /// Injects the specified script into the webpage’s content. + func addUserScript( + pigeonApi: PigeonApiWKUserContentController, pigeonInstance: WKUserContentController, + userScript: WKUserScript) throws + /// Removes all user scripts from the web view. + func removeAllUserScripts( + pigeonApi: PigeonApiWKUserContentController, pigeonInstance: WKUserContentController) throws +} + +protocol PigeonApiProtocolWKUserContentController { +} + +final class PigeonApiWKUserContentController: PigeonApiProtocolWKUserContentController { + unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar + let pigeonDelegate: PigeonApiDelegateWKUserContentController + ///An implementation of [NSObject] used to access callback methods + var pigeonApiNSObject: PigeonApiNSObject { + return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) + } + + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateWKUserContentController + ) { + self.pigeonRegistrar = pigeonRegistrar + self.pigeonDelegate = delegate + } + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKUserContentController? + ) { + let codec: FlutterStandardMessageCodec = + api != nil + ? FlutterStandardMessageCodec( + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) + : FlutterStandardMessageCodec.sharedInstance() + let addScriptMessageHandlerChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.addScriptMessageHandler", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + addScriptMessageHandlerChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKUserContentController + let handlerArg = args[1] as! WKScriptMessageHandler + let nameArg = args[2] as! String + do { + try api.pigeonDelegate.addScriptMessageHandler( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, handler: handlerArg, name: nameArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + addScriptMessageHandlerChannel.setMessageHandler(nil) + } + let removeScriptMessageHandlerChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.removeScriptMessageHandler", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + removeScriptMessageHandlerChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKUserContentController + let nameArg = args[1] as! String + do { + try api.pigeonDelegate.removeScriptMessageHandler( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, name: nameArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + removeScriptMessageHandlerChannel.setMessageHandler(nil) + } + let removeAllScriptMessageHandlersChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.removeAllScriptMessageHandlers", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + removeAllScriptMessageHandlersChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKUserContentController + do { + try api.pigeonDelegate.removeAllScriptMessageHandlers( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + removeAllScriptMessageHandlersChannel.setMessageHandler(nil) + } + let addUserScriptChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.addUserScript", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + addUserScriptChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKUserContentController + let userScriptArg = args[1] as! WKUserScript + do { + try api.pigeonDelegate.addUserScript( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, userScript: userScriptArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + addUserScriptChannel.setMessageHandler(nil) + } + let removeAllUserScriptsChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.removeAllUserScripts", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + removeAllUserScriptsChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKUserContentController + do { + try api.pigeonDelegate.removeAllUserScripts( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + removeAllUserScriptsChannel.setMessageHandler(nil) + } + } + + ///Creates a Dart instance of WKUserContentController and attaches it to [pigeonInstance]. + func pigeonNewInstance( + pigeonInstance: WKUserContentController, + 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.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(())) + } + } + } + } +} +protocol PigeonApiDelegateWKPreferences { + /// A Boolean value that indicates whether JavaScript is enabled. + func setJavaScriptEnabled( + pigeonApi: PigeonApiWKPreferences, pigeonInstance: WKPreferences, enabled: Bool) throws +} + +protocol PigeonApiProtocolWKPreferences { +} + +final class PigeonApiWKPreferences: PigeonApiProtocolWKPreferences { + unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar + let pigeonDelegate: PigeonApiDelegateWKPreferences + ///An implementation of [NSObject] used to access callback methods + var pigeonApiNSObject: PigeonApiNSObject { + return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) + } + + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKPreferences + ) { + self.pigeonRegistrar = pigeonRegistrar + self.pigeonDelegate = delegate + } + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKPreferences? + ) { + let codec: FlutterStandardMessageCodec = + api != nil + ? FlutterStandardMessageCodec( + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) + : FlutterStandardMessageCodec.sharedInstance() + let setJavaScriptEnabledChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKPreferences.setJavaScriptEnabled", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setJavaScriptEnabledChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKPreferences + let enabledArg = args[1] as! Bool + do { + try api.pigeonDelegate.setJavaScriptEnabled( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, enabled: enabledArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + setJavaScriptEnabledChannel.setMessageHandler(nil) + } + } + + ///Creates a Dart instance of WKPreferences and attaches it to [pigeonInstance]. + func pigeonNewInstance( + pigeonInstance: WKPreferences, 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.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(())) + } + } + } + } +} +protocol PigeonApiDelegateWKScriptMessageHandler { + func pigeonDefaultConstructor(pigeonApi: PigeonApiWKScriptMessageHandler) throws + -> WKScriptMessageHandler +} + +protocol PigeonApiProtocolWKScriptMessageHandler { + /// Tells the handler that a webpage sent a script message. + func didReceiveScriptMessage( + pigeonInstance pigeonInstanceArg: WKScriptMessageHandler, + controller controllerArg: WKUserContentController, message messageArg: WKScriptMessage, + completion: @escaping (Result) -> Void) +} + +final class PigeonApiWKScriptMessageHandler: PigeonApiProtocolWKScriptMessageHandler { + unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar + let pigeonDelegate: PigeonApiDelegateWKScriptMessageHandler + ///An implementation of [NSObject] used to access callback methods + var pigeonApiNSObject: PigeonApiNSObject { + return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) + } + + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateWKScriptMessageHandler + ) { + self.pigeonRegistrar = pigeonRegistrar + self.pigeonDelegate = delegate + } + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKScriptMessageHandler? + ) { + let codec: FlutterStandardMessageCodec = + api != nil + ? FlutterStandardMessageCodec( + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) + : FlutterStandardMessageCodec.sharedInstance() + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.WKScriptMessageHandler.pigeon_defaultConstructor", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + pigeonDefaultConstructorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonIdentifierArg = args[0] as! Int64 + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), + withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + pigeonDefaultConstructorChannel.setMessageHandler(nil) + } + } + + ///Creates a Dart instance of WKScriptMessageHandler and attaches it to [pigeonInstance]. + func pigeonNewInstance( + pigeonInstance: WKScriptMessageHandler, + 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 { + 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: ""))) + } + } + /// Tells the handler that a webpage sent a script message. + func didReceiveScriptMessage( + pigeonInstance pigeonInstanceArg: WKScriptMessageHandler, + controller controllerArg: WKUserContentController, message messageArg: WKScriptMessage, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + PigeonError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKScriptMessageHandler.didReceiveScriptMessage" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, controllerArg, messageArg] 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(())) + } + } + } + +} +protocol PigeonApiDelegateWKNavigationDelegate { + func pigeonDefaultConstructor(pigeonApi: PigeonApiWKNavigationDelegate) throws + -> WKNavigationDelegate +} + +protocol PigeonApiProtocolWKNavigationDelegate { + /// Tells the delegate that navigation is complete. + func didFinishNavigation( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + url urlArg: String?, completion: @escaping (Result) -> Void) + /// Tells the delegate that navigation from the main frame has started. + func didStartProvisionalNavigation( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + url urlArg: String?, completion: @escaping (Result) -> Void) + /// Asks the delegate for permission to navigate to new content based on the + /// specified action information. + func decidePolicyForNavigationAction( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + navigationAction navigationActionArg: WKNavigationAction, + completion: @escaping (Result) -> Void) + /// Asks the delegate for permission to navigate to new content after the + /// response to the navigation request is known. + func decidePolicyForNavigationResponse( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + navigationResponse navigationResponseArg: WKNavigationResponse, + completion: @escaping (Result) -> Void) + /// Tells the delegate that an error occurred during navigation. + func didFailNavigation( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + error errorArg: NSError, completion: @escaping (Result) -> Void) + /// Tells the delegate that an error occurred during the early navigation + /// process. + func didFailProvisionalNavigation( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + error errorArg: NSError, completion: @escaping (Result) -> Void) + /// Tells the delegate that the web view’s content process was terminated. + func webViewWebContentProcessDidTerminate( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + completion: @escaping (Result) -> Void) + /// Asks the delegate to respond to an authentication challenge. + /// + /// This return value expects a List with: + /// + /// 1. `UrlSessionAuthChallengeDisposition` + /// 2. A nullable map to instantiate a `URLCredential`. The map structure is + /// [ + /// "user": "", + /// "password": "", + /// "persistence": , + /// ] + func didReceiveAuthenticationChallenge( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + challenge challengeArg: URLAuthenticationChallenge, + completion: @escaping (Result<[Any?], PigeonError>) -> Void) +} + +final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate { + unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar + let pigeonDelegate: PigeonApiDelegateWKNavigationDelegate + ///An implementation of [NSObject] used to access callback methods + var pigeonApiNSObject: PigeonApiNSObject { + return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) + } + + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateWKNavigationDelegate + ) { + self.pigeonRegistrar = pigeonRegistrar + self.pigeonDelegate = delegate + } + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKNavigationDelegate? + ) { + let codec: FlutterStandardMessageCodec = + api != nil + ? FlutterStandardMessageCodec( + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) + : FlutterStandardMessageCodec.sharedInstance() + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.pigeon_defaultConstructor", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + pigeonDefaultConstructorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonIdentifierArg = args[0] as! Int64 + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), + withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + pigeonDefaultConstructorChannel.setMessageHandler(nil) + } + } + + ///Creates a Dart instance of WKNavigationDelegate and attaches it to [pigeonInstance]. + func pigeonNewInstance( + pigeonInstance: WKNavigationDelegate, 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 { + 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: ""))) + } + } + /// Tells the delegate that navigation is complete. + func didFinishNavigation( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + url urlArg: String?, completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + PigeonError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didFinishNavigation" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, webViewArg, urlArg] 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(())) + } + } + } + + /// Tells the delegate that navigation from the main frame has started. + func didStartProvisionalNavigation( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + url urlArg: String?, completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + PigeonError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didStartProvisionalNavigation" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, webViewArg, urlArg] 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(())) + } + } + } + + /// Asks the delegate for permission to navigate to new content based on the + /// specified action information. + func decidePolicyForNavigationAction( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + navigationAction navigationActionArg: WKNavigationAction, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + PigeonError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.decidePolicyForNavigationAction" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, webViewArg, navigationActionArg] 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 if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! NavigationActionPolicy + completion(.success(result)) + } + } + } + + /// Asks the delegate for permission to navigate to new content after the + /// response to the navigation request is known. + func decidePolicyForNavigationResponse( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + navigationResponse navigationResponseArg: WKNavigationResponse, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + PigeonError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.decidePolicyForNavigationResponse" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, webViewArg, navigationResponseArg] 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 if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! NavigationResponsePolicy + completion(.success(result)) + } + } + } + + /// Tells the delegate that an error occurred during navigation. + func didFailNavigation( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + error errorArg: NSError, completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + PigeonError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didFailNavigation" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, webViewArg, errorArg] 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(())) + } + } + } + + /// Tells the delegate that an error occurred during the early navigation + /// process. + func didFailProvisionalNavigation( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + error errorArg: NSError, completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + PigeonError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didFailProvisionalNavigation" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, webViewArg, errorArg] 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(())) + } + } + } + + /// Tells the delegate that the web view’s content process was terminated. + func webViewWebContentProcessDidTerminate( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + PigeonError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.webViewWebContentProcessDidTerminate" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, webViewArg] 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(())) + } + } + } + + /// Asks the delegate to respond to an authentication challenge. + /// + /// This return value expects a List with: + /// + /// 1. `UrlSessionAuthChallengeDisposition` + /// 2. A nullable map to instantiate a `URLCredential`. The map structure is + /// [ + /// "user": "", + /// "password": "", + /// "persistence": , + /// ] + func didReceiveAuthenticationChallenge( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + challenge challengeArg: URLAuthenticationChallenge, + completion: @escaping (Result<[Any?], PigeonError>) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + PigeonError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didReceiveAuthenticationChallenge" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, webViewArg, challengeArg] 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 if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! [Any?] + completion(.success(result)) + } + } + } + +} +protocol PigeonApiDelegateNSObject { + func pigeonDefaultConstructor(pigeonApi: PigeonApiNSObject) throws -> NSObject + /// Registers the observer object to receive KVO notifications for the key + /// path relative to the object receiving this message. + func addObserver( + pigeonApi: PigeonApiNSObject, pigeonInstance: NSObject, observer: NSObject, keyPath: String, + options: [KeyValueObservingOptions]) throws + /// Stops the observer object from receiving change notifications for the + /// property specified by the key path relative to the object receiving this + /// message. + func removeObserver( + pigeonApi: PigeonApiNSObject, pigeonInstance: NSObject, observer: NSObject, keyPath: String) + throws +} + +protocol PigeonApiProtocolNSObject { + /// Informs the observing object when the value at the specified key path + /// relative to the observed object has changed. + func observeValue( + pigeonInstance pigeonInstanceArg: NSObject, keyPath keyPathArg: String?, + object objectArg: NSObject?, change changeArg: [KeyValueChangeKey: Any?]?, + completion: @escaping (Result) -> Void) +} + +final class PigeonApiNSObject: PigeonApiProtocolNSObject { + unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar + let pigeonDelegate: PigeonApiDelegateNSObject + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateNSObject) { + self.pigeonRegistrar = pigeonRegistrar + self.pigeonDelegate = delegate + } + static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiNSObject?) + { + let codec: FlutterStandardMessageCodec = + api != nil + ? FlutterStandardMessageCodec( + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) + : FlutterStandardMessageCodec.sharedInstance() + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSObject.pigeon_defaultConstructor", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + pigeonDefaultConstructorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonIdentifierArg = args[0] as! Int64 + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), + withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + pigeonDefaultConstructorChannel.setMessageHandler(nil) + } + let addObserverChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSObject.addObserver", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + addObserverChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! NSObject + let observerArg = args[1] as! NSObject + let keyPathArg = args[2] as! String + let optionsArg = args[3] as! [KeyValueObservingOptions] + do { + try api.pigeonDelegate.addObserver( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, observer: observerArg, + keyPath: keyPathArg, options: optionsArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + addObserverChannel.setMessageHandler(nil) + } + let removeObserverChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSObject.removeObserver", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + removeObserverChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! NSObject + let observerArg = args[1] as! NSObject + let keyPathArg = args[2] as! String + do { + try api.pigeonDelegate.removeObserver( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, observer: observerArg, + keyPath: keyPathArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + removeObserverChannel.setMessageHandler(nil) + } + } + + ///Creates a Dart instance of NSObject and attaches it to [pigeonInstance]. + func pigeonNewInstance( + pigeonInstance: NSObject, 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.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(())) + } + } + } + } + /// Informs the observing object when the value at the specified key path + /// relative to the observed object has changed. + func observeValue( + pigeonInstance pigeonInstanceArg: NSObject, keyPath keyPathArg: String?, + object objectArg: NSObject?, change changeArg: [KeyValueChangeKey: Any?]?, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + PigeonError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.NSObject.observeValue" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, keyPathArg, objectArg, changeArg] 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(())) + } + } + } + +} +protocol PigeonApiDelegateUIViewWKWebView { + #if !os(macOS) + func pigeonDefaultConstructor( + pigeonApi: PigeonApiUIViewWKWebView, initialConfiguration: WKWebViewConfiguration + ) throws -> WKWebView + #endif + #if !os(macOS) + /// The object that contains the configuration details for the web view. + func configuration(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws + -> WKWebViewConfiguration + #endif + #if !os(macOS) + /// The scroll view associated with the web view. + func scrollView(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws + -> UIScrollView + #endif + #if !os(macOS) + /// The object you use to integrate custom user interface elements, such as + /// contextual menus or panels, into web view interactions. + func setUIDelegate( + pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, delegate: WKUIDelegate) throws + #endif + #if !os(macOS) + /// The object you use to manage navigation behavior for the web view. + func setNavigationDelegate( + pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, delegate: WKNavigationDelegate + ) throws + #endif + #if !os(macOS) + /// The URL for the current webpage. + func getUrl(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> String? + #endif + #if !os(macOS) + /// An estimate of what fraction of the current navigation has been loaded. + func getEstimatedProgress(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws + -> Double + #endif + #if !os(macOS) + /// Loads the web content that the specified URL request object references and + /// navigates to that content. + func load( + pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, request: URLRequestWrapper) + throws + #endif + #if !os(macOS) + /// Loads the contents of the specified HTML string and navigates to it. + func loadHtmlString( + pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, string: String, + baseUrl: String?) throws + #endif + #if !os(macOS) + /// Loads the web content from the specified file and navigates to it. + func loadFileUrl( + pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, url: String, + readAccessUrl: String) throws + #endif + #if !os(macOS) + /// Convenience method to load a Flutter asset. + func loadFlutterAsset( + pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, key: String) throws + #endif + #if !os(macOS) + /// A Boolean value that indicates whether there is a valid back item in the + /// back-forward list. + func canGoBack(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> Bool + #endif + #if !os(macOS) + /// A Boolean value that indicates whether there is a valid forward item in + /// the back-forward list. + func canGoForward(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> Bool + #endif + #if !os(macOS) + /// Navigates to the back item in the back-forward list. + func goBack(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws + #endif + #if !os(macOS) + /// Navigates to the forward item in the back-forward list. + func goForward(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws + #endif + #if !os(macOS) + /// Reloads the current webpage. + func reload(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws + #endif + #if !os(macOS) + /// The page title. + func getTitle(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> String? + #endif + #if !os(macOS) + /// A Boolean value that indicates whether horizontal swipe gestures trigger + /// backward and forward page navigation. + func setAllowsBackForwardNavigationGestures( + pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, allow: Bool) throws + #endif + #if !os(macOS) + /// The custom user agent string. + func setCustomUserAgent( + pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, userAgent: String?) throws + #endif + #if !os(macOS) + /// Evaluates the specified JavaScript string. + func evaluateJavaScript( + pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, javaScriptString: String, + completion: @escaping (Result) -> Void) + #endif + #if !os(macOS) + /// A Boolean value that indicates whether you can inspect the view with + /// Safari Web Inspector. + func setInspectable( + pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, inspectable: Bool) throws + #endif + #if !os(macOS) + /// The custom user agent string. + func getCustomUserAgent(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws + -> String? + #endif +} + +protocol PigeonApiProtocolUIViewWKWebView { +} + +final class PigeonApiUIViewWKWebView: PigeonApiProtocolUIViewWKWebView { + unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar + let pigeonDelegate: PigeonApiDelegateUIViewWKWebView + ///An implementation of [UIView] used to access callback methods + var pigeonApiUIView: PigeonApiUIView { + return pigeonRegistrar.apiDelegate.pigeonApiUIView(pigeonRegistrar) + } + + ///An implementation of [WKWebView] used to access callback methods + var pigeonApiWKWebView: PigeonApiWKWebView { + return pigeonRegistrar.apiDelegate.pigeonApiWKWebView(pigeonRegistrar) + } + + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateUIViewWKWebView + ) { + self.pigeonRegistrar = pigeonRegistrar + self.pigeonDelegate = delegate + } + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiUIViewWKWebView? + ) { + let codec: FlutterStandardMessageCodec = + api != nil + ? FlutterStandardMessageCodec( + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) + : FlutterStandardMessageCodec.sharedInstance() + #if !os(macOS) + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.pigeon_defaultConstructor", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + pigeonDefaultConstructorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonIdentifierArg = args[0] as! Int64 + let initialConfigurationArg = args[1] as! WKWebViewConfiguration + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + try api.pigeonDelegate.pigeonDefaultConstructor( + pigeonApi: api, initialConfiguration: initialConfigurationArg), + withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + pigeonDefaultConstructorChannel.setMessageHandler(nil) + } + #endif + #if !os(macOS) + let configurationChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.configuration", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + configurationChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let pigeonIdentifierArg = args[1] as! Int64 + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + try api.pigeonDelegate.configuration( + pigeonApi: api, pigeonInstance: pigeonInstanceArg), + withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + configurationChannel.setMessageHandler(nil) + } + #endif + #if !os(macOS) + let scrollViewChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.scrollView", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + scrollViewChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let pigeonIdentifierArg = args[1] as! Int64 + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + try api.pigeonDelegate.scrollView(pigeonApi: api, pigeonInstance: pigeonInstanceArg), + withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + scrollViewChannel.setMessageHandler(nil) + } + #endif + #if !os(macOS) + let setUIDelegateChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setUIDelegate", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setUIDelegateChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let delegateArg = args[1] as! WKUIDelegate + do { + try api.pigeonDelegate.setUIDelegate( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, delegate: delegateArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + setUIDelegateChannel.setMessageHandler(nil) + } + #endif + #if !os(macOS) + let setNavigationDelegateChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setNavigationDelegate", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setNavigationDelegateChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let delegateArg = args[1] as! WKNavigationDelegate + do { + try api.pigeonDelegate.setNavigationDelegate( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, delegate: delegateArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + setNavigationDelegateChannel.setMessageHandler(nil) + } + #endif + #if !os(macOS) + let getUrlChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.getUrl", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getUrlChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.getUrl( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getUrlChannel.setMessageHandler(nil) + } + #endif + #if !os(macOS) + let getEstimatedProgressChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.getEstimatedProgress", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getEstimatedProgressChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.getEstimatedProgress( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getEstimatedProgressChannel.setMessageHandler(nil) + } + #endif + #if !os(macOS) + let loadChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.load", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + loadChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let requestArg = args[1] as! URLRequestWrapper + do { + try api.pigeonDelegate.load( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, request: requestArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + loadChannel.setMessageHandler(nil) + } + #endif + #if !os(macOS) + let loadHtmlStringChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.loadHtmlString", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + loadHtmlStringChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let stringArg = args[1] as! String + let baseUrlArg: String? = nilOrValue(args[2]) + do { + try api.pigeonDelegate.loadHtmlString( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, string: stringArg, + baseUrl: baseUrlArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + loadHtmlStringChannel.setMessageHandler(nil) + } + #endif + #if !os(macOS) + let loadFileUrlChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.loadFileUrl", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + loadFileUrlChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let urlArg = args[1] as! String + let readAccessUrlArg = args[2] as! String + do { + try api.pigeonDelegate.loadFileUrl( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, url: urlArg, + readAccessUrl: readAccessUrlArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + loadFileUrlChannel.setMessageHandler(nil) + } + #endif + #if !os(macOS) + let loadFlutterAssetChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.loadFlutterAsset", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + loadFlutterAssetChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let keyArg = args[1] as! String + do { + try api.pigeonDelegate.loadFlutterAsset( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, key: keyArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + loadFlutterAssetChannel.setMessageHandler(nil) + } + #endif + #if !os(macOS) + let canGoBackChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.canGoBack", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + canGoBackChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.canGoBack( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + canGoBackChannel.setMessageHandler(nil) + } + #endif + #if !os(macOS) + let canGoForwardChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.canGoForward", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + canGoForwardChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.canGoForward( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + canGoForwardChannel.setMessageHandler(nil) + } + #endif + #if !os(macOS) + let goBackChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.goBack", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + goBackChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + try api.pigeonDelegate.goBack(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + goBackChannel.setMessageHandler(nil) + } + #endif + #if !os(macOS) + let goForwardChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.goForward", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + goForwardChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + try api.pigeonDelegate.goForward(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + goForwardChannel.setMessageHandler(nil) + } + #endif + #if !os(macOS) + let reloadChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.reload", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + reloadChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + try api.pigeonDelegate.reload(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + reloadChannel.setMessageHandler(nil) + } + #endif + #if !os(macOS) + let getTitleChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.getTitle", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getTitleChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.getTitle( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getTitleChannel.setMessageHandler(nil) + } + #endif + #if !os(macOS) + let setAllowsBackForwardNavigationGesturesChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setAllowsBackForwardNavigationGestures", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setAllowsBackForwardNavigationGesturesChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let allowArg = args[1] as! Bool + do { + try api.pigeonDelegate.setAllowsBackForwardNavigationGestures( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, allow: allowArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + setAllowsBackForwardNavigationGesturesChannel.setMessageHandler(nil) + } + #endif + #if !os(macOS) + let setCustomUserAgentChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setCustomUserAgent", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setCustomUserAgentChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let userAgentArg: String? = nilOrValue(args[1]) + do { + try api.pigeonDelegate.setCustomUserAgent( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, userAgent: userAgentArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + setCustomUserAgentChannel.setMessageHandler(nil) + } + #endif + #if !os(macOS) + let evaluateJavaScriptChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.evaluateJavaScript", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + evaluateJavaScriptChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let javaScriptStringArg = args[1] as! String + api.pigeonDelegate.evaluateJavaScript( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, javaScriptString: javaScriptStringArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + evaluateJavaScriptChannel.setMessageHandler(nil) + } + #endif + #if !os(macOS) + let setInspectableChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setInspectable", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setInspectableChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let inspectableArg = args[1] as! Bool + do { + try api.pigeonDelegate.setInspectable( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, inspectable: inspectableArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + setInspectableChannel.setMessageHandler(nil) + } + #endif + #if !os(macOS) + let getCustomUserAgentChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.getCustomUserAgent", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getCustomUserAgentChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.getCustomUserAgent( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getCustomUserAgentChannel.setMessageHandler(nil) + } + #endif + } + + #if !os(macOS) + ///Creates a Dart instance of UIViewWKWebView 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: ""))) + } 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(())) + } + } + } + } + #endif +} +protocol PigeonApiDelegateNSViewWKWebView { + #if !os(iOS) + func pigeonDefaultConstructor( + pigeonApi: PigeonApiNSViewWKWebView, initialConfiguration: WKWebViewConfiguration + ) throws -> WKWebView + #endif + #if !os(iOS) + /// The object that contains the configuration details for the web view. + func configuration(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws + -> WKWebViewConfiguration + #endif + #if !os(iOS) + /// The object you use to integrate custom user interface elements, such as + /// contextual menus or panels, into web view interactions. + func setUIDelegate( + pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, delegate: WKUIDelegate) throws + #endif + #if !os(iOS) + /// The object you use to manage navigation behavior for the web view. + func setNavigationDelegate( + pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, delegate: WKNavigationDelegate + ) throws + #endif + #if !os(iOS) + /// The URL for the current webpage. + func getUrl(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> String? + #endif + #if !os(iOS) + /// An estimate of what fraction of the current navigation has been loaded. + func getEstimatedProgress(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws + -> Double + #endif + #if !os(iOS) + /// Loads the web content that the specified URL request object references and + /// navigates to that content. + func load( + pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, request: URLRequestWrapper) + throws + #endif + #if !os(iOS) + /// Loads the contents of the specified HTML string and navigates to it. + func loadHtmlString( + pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, string: String, + baseUrl: String?) throws + #endif + #if !os(iOS) + /// Loads the web content from the specified file and navigates to it. + func loadFileUrl( + pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, url: String, + readAccessUrl: String) throws + #endif + #if !os(iOS) + /// Convenience method to load a Flutter asset. + func loadFlutterAsset( + pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, key: String) throws + #endif + #if !os(iOS) + /// A Boolean value that indicates whether there is a valid back item in the + /// back-forward list. + func canGoBack(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> Bool + #endif + #if !os(iOS) + /// A Boolean value that indicates whether there is a valid forward item in + /// the back-forward list. + func canGoForward(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> Bool + #endif + #if !os(iOS) + /// Navigates to the back item in the back-forward list. + func goBack(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws + #endif + #if !os(iOS) + /// Navigates to the forward item in the back-forward list. + func goForward(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws + #endif + #if !os(iOS) + /// Reloads the current webpage. + func reload(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws + #endif + #if !os(iOS) + /// The page title. + func getTitle(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> String? + #endif + #if !os(iOS) + /// A Boolean value that indicates whether horizontal swipe gestures trigger + /// backward and forward page navigation. + func setAllowsBackForwardNavigationGestures( + pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, allow: Bool) throws + #endif + #if !os(iOS) + /// The custom user agent string. + func setCustomUserAgent( + pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, userAgent: String?) throws + #endif + #if !os(iOS) + /// Evaluates the specified JavaScript string. + func evaluateJavaScript( + pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, javaScriptString: String, + completion: @escaping (Result) -> Void) + #endif + #if !os(iOS) + /// A Boolean value that indicates whether you can inspect the view with + /// Safari Web Inspector. + func setInspectable( + pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, inspectable: Bool) throws + #endif + #if !os(iOS) + /// The custom user agent string. + func getCustomUserAgent(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws + -> String? + #endif +} + +protocol PigeonApiProtocolNSViewWKWebView { +} + +final class PigeonApiNSViewWKWebView: PigeonApiProtocolNSViewWKWebView { + unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar + let pigeonDelegate: PigeonApiDelegateNSViewWKWebView + ///An implementation of [NSObject] used to access callback methods + var pigeonApiNSObject: PigeonApiNSObject { + return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) + } + + ///An implementation of [WKWebView] used to access callback methods + var pigeonApiWKWebView: PigeonApiWKWebView { + return pigeonRegistrar.apiDelegate.pigeonApiWKWebView(pigeonRegistrar) + } + + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateNSViewWKWebView + ) { + self.pigeonRegistrar = pigeonRegistrar + self.pigeonDelegate = delegate + } + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiNSViewWKWebView? + ) { + let codec: FlutterStandardMessageCodec = + api != nil + ? FlutterStandardMessageCodec( + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) + : FlutterStandardMessageCodec.sharedInstance() + #if !os(iOS) + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.pigeon_defaultConstructor", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + pigeonDefaultConstructorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonIdentifierArg = args[0] as! Int64 + let initialConfigurationArg = args[1] as! WKWebViewConfiguration + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + try api.pigeonDelegate.pigeonDefaultConstructor( + pigeonApi: api, initialConfiguration: initialConfigurationArg), + withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + pigeonDefaultConstructorChannel.setMessageHandler(nil) + } + #endif + #if !os(iOS) + let configurationChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.configuration", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + configurationChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let pigeonIdentifierArg = args[1] as! Int64 + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + try api.pigeonDelegate.configuration( + pigeonApi: api, pigeonInstance: pigeonInstanceArg), + withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + configurationChannel.setMessageHandler(nil) + } + #endif + #if !os(iOS) + let setUIDelegateChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setUIDelegate", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setUIDelegateChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let delegateArg = args[1] as! WKUIDelegate + do { + try api.pigeonDelegate.setUIDelegate( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, delegate: delegateArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + setUIDelegateChannel.setMessageHandler(nil) + } + #endif + #if !os(iOS) + let setNavigationDelegateChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setNavigationDelegate", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setNavigationDelegateChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let delegateArg = args[1] as! WKNavigationDelegate + do { + try api.pigeonDelegate.setNavigationDelegate( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, delegate: delegateArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + setNavigationDelegateChannel.setMessageHandler(nil) + } + #endif + #if !os(iOS) + let getUrlChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.getUrl", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getUrlChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.getUrl( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getUrlChannel.setMessageHandler(nil) + } + #endif + #if !os(iOS) + let getEstimatedProgressChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.getEstimatedProgress", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getEstimatedProgressChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.getEstimatedProgress( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getEstimatedProgressChannel.setMessageHandler(nil) + } + #endif + #if !os(iOS) + let loadChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.load", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + loadChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let requestArg = args[1] as! URLRequestWrapper + do { + try api.pigeonDelegate.load( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, request: requestArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + loadChannel.setMessageHandler(nil) + } + #endif + #if !os(iOS) + let loadHtmlStringChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.loadHtmlString", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + loadHtmlStringChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let stringArg = args[1] as! String + let baseUrlArg: String? = nilOrValue(args[2]) + do { + try api.pigeonDelegate.loadHtmlString( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, string: stringArg, + baseUrl: baseUrlArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + loadHtmlStringChannel.setMessageHandler(nil) + } + #endif + #if !os(iOS) + let loadFileUrlChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.loadFileUrl", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + loadFileUrlChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let urlArg = args[1] as! String + let readAccessUrlArg = args[2] as! String + do { + try api.pigeonDelegate.loadFileUrl( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, url: urlArg, + readAccessUrl: readAccessUrlArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + loadFileUrlChannel.setMessageHandler(nil) + } + #endif + #if !os(iOS) + let loadFlutterAssetChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.loadFlutterAsset", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + loadFlutterAssetChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let keyArg = args[1] as! String + do { + try api.pigeonDelegate.loadFlutterAsset( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, key: keyArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + loadFlutterAssetChannel.setMessageHandler(nil) + } + #endif + #if !os(iOS) + let canGoBackChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.canGoBack", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + canGoBackChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.canGoBack( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + canGoBackChannel.setMessageHandler(nil) + } + #endif + #if !os(iOS) + let canGoForwardChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.canGoForward", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + canGoForwardChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.canGoForward( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + canGoForwardChannel.setMessageHandler(nil) + } + #endif + #if !os(iOS) + let goBackChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.goBack", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + goBackChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + try api.pigeonDelegate.goBack(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + goBackChannel.setMessageHandler(nil) + } + #endif + #if !os(iOS) + let goForwardChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.goForward", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + goForwardChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + try api.pigeonDelegate.goForward(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + goForwardChannel.setMessageHandler(nil) + } + #endif + #if !os(iOS) + let reloadChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.reload", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + reloadChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + try api.pigeonDelegate.reload(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + reloadChannel.setMessageHandler(nil) + } + #endif + #if !os(iOS) + let getTitleChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.getTitle", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getTitleChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.getTitle( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getTitleChannel.setMessageHandler(nil) + } + #endif + #if !os(iOS) + let setAllowsBackForwardNavigationGesturesChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setAllowsBackForwardNavigationGestures", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setAllowsBackForwardNavigationGesturesChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let allowArg = args[1] as! Bool + do { + try api.pigeonDelegate.setAllowsBackForwardNavigationGestures( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, allow: allowArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + setAllowsBackForwardNavigationGesturesChannel.setMessageHandler(nil) + } + #endif + #if !os(iOS) + let setCustomUserAgentChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setCustomUserAgent", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setCustomUserAgentChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let userAgentArg: String? = nilOrValue(args[1]) + do { + try api.pigeonDelegate.setCustomUserAgent( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, userAgent: userAgentArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + setCustomUserAgentChannel.setMessageHandler(nil) + } + #endif + #if !os(iOS) + let evaluateJavaScriptChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.evaluateJavaScript", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + evaluateJavaScriptChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let javaScriptStringArg = args[1] as! String + api.pigeonDelegate.evaluateJavaScript( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, javaScriptString: javaScriptStringArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + evaluateJavaScriptChannel.setMessageHandler(nil) + } + #endif + #if !os(iOS) + let setInspectableChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setInspectable", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setInspectableChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let inspectableArg = args[1] as! Bool + do { + try api.pigeonDelegate.setInspectable( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, inspectable: inspectableArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + setInspectableChannel.setMessageHandler(nil) + } + #endif + #if !os(iOS) + let getCustomUserAgentChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.getCustomUserAgent", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getCustomUserAgentChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.getCustomUserAgent( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getCustomUserAgentChannel.setMessageHandler(nil) + } + #endif + } + + #if !os(iOS) + ///Creates a Dart instance of NSViewWKWebView 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: ""))) + } 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(())) + } + } + } + } + #endif +} +open class PigeonApiDelegateWKWebView { +} + +protocol PigeonApiProtocolWKWebView { +} + +final class PigeonApiWKWebView: PigeonApiProtocolWKWebView { + unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar + let pigeonDelegate: PigeonApiDelegateWKWebView + ///An implementation of [NSObject] used to access callback methods + var pigeonApiNSObject: PigeonApiNSObject { + return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) + } + + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKWebView) + { + self.pigeonRegistrar = pigeonRegistrar + 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: ""))) + } 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(())) + } + } + } + } +} +protocol PigeonApiDelegateWKUIDelegate { + func pigeonDefaultConstructor(pigeonApi: PigeonApiWKUIDelegate) throws -> WKUIDelegate +} + +protocol PigeonApiProtocolWKUIDelegate { + /// Creates a new web view. + func onCreateWebView( + pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, + configuration configurationArg: WKWebViewConfiguration, + navigationAction navigationActionArg: WKNavigationAction, + completion: @escaping (Result) -> Void) + /// Determines whether a web resource, which the security origin object + /// describes, can access to the device’s microphone audio and camera video. + func requestMediaCapturePermission( + pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, + origin originArg: WKSecurityOrigin, frame frameArg: WKFrameInfo, type typeArg: MediaCaptureType, + completion: @escaping (Result) -> Void) + /// Displays a JavaScript alert panel. + func runJavaScriptAlertPanel( + pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, + message messageArg: String, frame frameArg: WKFrameInfo, + completion: @escaping (Result) -> Void) + /// Displays a JavaScript confirm panel. + func runJavaScriptConfirmPanel( + pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, + message messageArg: String, frame frameArg: WKFrameInfo, + completion: @escaping (Result) -> Void) + /// Displays a JavaScript text input panel. + func runJavaScriptTextInputPanel( + pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, + prompt promptArg: String, defaultText defaultTextArg: String?, frame frameArg: WKFrameInfo, + completion: @escaping (Result) -> Void) +} + +final class PigeonApiWKUIDelegate: PigeonApiProtocolWKUIDelegate { + unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar + let pigeonDelegate: PigeonApiDelegateWKUIDelegate + ///An implementation of [NSObject] used to access callback methods + var pigeonApiNSObject: PigeonApiNSObject { + return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) + } + + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKUIDelegate + ) { + self.pigeonRegistrar = pigeonRegistrar + self.pigeonDelegate = delegate + } + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKUIDelegate? + ) { + let codec: FlutterStandardMessageCodec = + api != nil + ? FlutterStandardMessageCodec( + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) + : FlutterStandardMessageCodec.sharedInstance() + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.pigeon_defaultConstructor", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + pigeonDefaultConstructorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonIdentifierArg = args[0] as! Int64 + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), + withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + pigeonDefaultConstructorChannel.setMessageHandler(nil) + } + } + + ///Creates a Dart instance of WKUIDelegate and attaches it to [pigeonInstance]. + func pigeonNewInstance( + pigeonInstance: WKUIDelegate, 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 { + 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: ""))) + } + } + /// Creates a new web view. + func onCreateWebView( + pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, + configuration configurationArg: WKWebViewConfiguration, + navigationAction navigationActionArg: WKNavigationAction, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + PigeonError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.onCreateWebView" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage( + [pigeonInstanceArg, webViewArg, configurationArg, navigationActionArg] 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(())) + } + } + } + + /// Determines whether a web resource, which the security origin object + /// describes, can access to the device’s microphone audio and camera video. + func requestMediaCapturePermission( + pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, + origin originArg: WKSecurityOrigin, frame frameArg: WKFrameInfo, type typeArg: MediaCaptureType, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + PigeonError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.requestMediaCapturePermission" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, webViewArg, originArg, frameArg, typeArg] 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 if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! PermissionDecision + completion(.success(result)) + } + } + } + + /// Displays a JavaScript alert panel. + func runJavaScriptAlertPanel( + pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, + message messageArg: String, frame frameArg: WKFrameInfo, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + PigeonError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.runJavaScriptAlertPanel" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, webViewArg, messageArg, frameArg] 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(())) + } + } + } + + /// Displays a JavaScript confirm panel. + func runJavaScriptConfirmPanel( + pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, + message messageArg: String, frame frameArg: WKFrameInfo, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + PigeonError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.runJavaScriptConfirmPanel" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, webViewArg, messageArg, frameArg] 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 if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! Bool + completion(.success(result)) + } + } + } + + /// Displays a JavaScript text input panel. + func runJavaScriptTextInputPanel( + pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, + prompt promptArg: String, defaultText defaultTextArg: String?, frame frameArg: WKFrameInfo, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + PigeonError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.runJavaScriptTextInputPanel" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage( + [pigeonInstanceArg, webViewArg, promptArg, defaultTextArg, frameArg] 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 { + let result: String? = nilOrValue(listResponse[0]) + completion(.success(result)) + } + } + } + +} +protocol PigeonApiDelegateWKHTTPCookieStore { + /// Sets a cookie policy that indicates whether the cookie store allows cookie + /// storage. + func setCookie( + pigeonApi: PigeonApiWKHTTPCookieStore, pigeonInstance: WKHTTPCookieStore, cookie: HTTPCookie, + completion: @escaping (Result) -> Void) +} + +protocol PigeonApiProtocolWKHTTPCookieStore { +} + +final class PigeonApiWKHTTPCookieStore: PigeonApiProtocolWKHTTPCookieStore { + unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar + let pigeonDelegate: PigeonApiDelegateWKHTTPCookieStore + ///An implementation of [NSObject] used to access callback methods + var pigeonApiNSObject: PigeonApiNSObject { + return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) + } + + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateWKHTTPCookieStore + ) { + self.pigeonRegistrar = pigeonRegistrar + self.pigeonDelegate = delegate + } + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKHTTPCookieStore? + ) { + let codec: FlutterStandardMessageCodec = + api != nil + ? FlutterStandardMessageCodec( + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) + : FlutterStandardMessageCodec.sharedInstance() + let setCookieChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKHTTPCookieStore.setCookie", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setCookieChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKHTTPCookieStore + let cookieArg = args[1] as! HTTPCookie + api.pigeonDelegate.setCookie( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, cookie: cookieArg + ) { result in + switch result { + case .success: + reply(wrapResult(nil)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + setCookieChannel.setMessageHandler(nil) + } + } + + ///Creates a Dart instance of WKHTTPCookieStore and attaches it to [pigeonInstance]. + func pigeonNewInstance( + pigeonInstance: WKHTTPCookieStore, 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.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(())) + } + } + } + } +} +protocol PigeonApiDelegateUIScrollViewDelegate { + #if !os(macOS) + func pigeonDefaultConstructor(pigeonApi: PigeonApiUIScrollViewDelegate) throws + -> UIScrollViewDelegate + #endif +} + +protocol PigeonApiProtocolUIScrollViewDelegate { + #if !os(macOS) + /// Tells the delegate when the user scrolls the content view within the + /// scroll view. + /// + /// Note that this is a convenient method that includes the `contentOffset` of + /// the `scrollView`. + func scrollViewDidScroll( + pigeonInstance pigeonInstanceArg: UIScrollViewDelegate, + scrollView scrollViewArg: UIScrollView, x xArg: Double, y yArg: Double, + completion: @escaping (Result) -> Void) + #endif + +} + +final class PigeonApiUIScrollViewDelegate: PigeonApiProtocolUIScrollViewDelegate { + unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar + let pigeonDelegate: PigeonApiDelegateUIScrollViewDelegate + ///An implementation of [NSObject] used to access callback methods + var pigeonApiNSObject: PigeonApiNSObject { + return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) + } + + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateUIScrollViewDelegate + ) { + self.pigeonRegistrar = pigeonRegistrar + self.pigeonDelegate = delegate + } + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiUIScrollViewDelegate? + ) { + let codec: FlutterStandardMessageCodec = + api != nil + ? FlutterStandardMessageCodec( + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) + : FlutterStandardMessageCodec.sharedInstance() + #if !os(macOS) + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewDelegate.pigeon_defaultConstructor", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + pigeonDefaultConstructorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonIdentifierArg = args[0] as! Int64 + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), + withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + pigeonDefaultConstructorChannel.setMessageHandler(nil) + } + #endif + } + + #if !os(macOS) + ///Creates a Dart instance of UIScrollViewDelegate and attaches it to [pigeonInstance]. + func pigeonNewInstance( + pigeonInstance: UIScrollViewDelegate, + 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.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(())) + } + } + } + } + #endif + #if !os(macOS) + /// Tells the delegate when the user scrolls the content view within the + /// scroll view. + /// + /// Note that this is a convenient method that includes the `contentOffset` of + /// the `scrollView`. + func scrollViewDidScroll( + pigeonInstance pigeonInstanceArg: UIScrollViewDelegate, + scrollView scrollViewArg: UIScrollView, x xArg: Double, y yArg: Double, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + PigeonError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewDelegate.scrollViewDidScroll" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, scrollViewArg, xArg, yArg] 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(())) + } + } + } + #endif + +} +protocol PigeonApiDelegateURLCredential { + /// Creates a URL credential instance for internet password authentication + /// with a given user name and password, using a given persistence setting. + func withUser( + pigeonApi: PigeonApiURLCredential, user: String, password: String, + persistence: UrlCredentialPersistence + ) throws -> URLCredential +} + +protocol PigeonApiProtocolURLCredential { +} + +final class PigeonApiURLCredential: PigeonApiProtocolURLCredential { + unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar + let pigeonDelegate: PigeonApiDelegateURLCredential + ///An implementation of [NSObject] used to access callback methods + var pigeonApiNSObject: PigeonApiNSObject { + return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) + } + + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateURLCredential + ) { + self.pigeonRegistrar = pigeonRegistrar + self.pigeonDelegate = delegate + } + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiURLCredential? + ) { + let codec: FlutterStandardMessageCodec = + api != nil + ? FlutterStandardMessageCodec( + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) + : FlutterStandardMessageCodec.sharedInstance() + let withUserChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLCredential.withUser", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + withUserChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonIdentifierArg = args[0] as! Int64 + let userArg = args[1] as! String + let passwordArg = args[2] as! String + let persistenceArg = args[3] as! UrlCredentialPersistence + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + try api.pigeonDelegate.withUser( + pigeonApi: api, user: userArg, password: passwordArg, persistence: persistenceArg), + withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + withUserChannel.setMessageHandler(nil) + } + } + + ///Creates a Dart instance of URLCredential and attaches it to [pigeonInstance]. + func pigeonNewInstance( + pigeonInstance: URLCredential, 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.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(())) + } + } + } + } +} +protocol PigeonApiDelegateURLProtectionSpace { + /// The receiver’s host. + func host(pigeonApi: PigeonApiURLProtectionSpace, pigeonInstance: URLProtectionSpace) throws + -> String + /// The receiver’s port. + func port(pigeonApi: PigeonApiURLProtectionSpace, pigeonInstance: URLProtectionSpace) throws + -> Int64 + /// The receiver’s authentication realm. + func realm(pigeonApi: PigeonApiURLProtectionSpace, pigeonInstance: URLProtectionSpace) throws + -> String? + /// The authentication method used by the receiver. + func authenticationMethod( + pigeonApi: PigeonApiURLProtectionSpace, pigeonInstance: URLProtectionSpace + ) throws -> String? +} + +protocol PigeonApiProtocolURLProtectionSpace { +} + +final class PigeonApiURLProtectionSpace: PigeonApiProtocolURLProtectionSpace { + unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar + let pigeonDelegate: PigeonApiDelegateURLProtectionSpace + ///An implementation of [NSObject] used to access callback methods + var pigeonApiNSObject: PigeonApiNSObject { + return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) + } + + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateURLProtectionSpace + ) { + self.pigeonRegistrar = pigeonRegistrar + self.pigeonDelegate = delegate + } + ///Creates a Dart instance of URLProtectionSpace and attaches it to [pigeonInstance]. + func pigeonNewInstance( + pigeonInstance: URLProtectionSpace, 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 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(())) + } + } + } + } +} +protocol PigeonApiDelegateURLAuthenticationChallenge { + /// The receiver’s protection space. + func getProtectionSpace( + pigeonApi: PigeonApiURLAuthenticationChallenge, pigeonInstance: URLAuthenticationChallenge + ) throws -> URLProtectionSpace +} + +protocol PigeonApiProtocolURLAuthenticationChallenge { +} + +final class PigeonApiURLAuthenticationChallenge: PigeonApiProtocolURLAuthenticationChallenge { + unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar + let pigeonDelegate: PigeonApiDelegateURLAuthenticationChallenge + ///An implementation of [NSObject] used to access callback methods + var pigeonApiNSObject: PigeonApiNSObject { + return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) + } + + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateURLAuthenticationChallenge + ) { + self.pigeonRegistrar = pigeonRegistrar + self.pigeonDelegate = delegate + } + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiURLAuthenticationChallenge? + ) { + let codec: FlutterStandardMessageCodec = + api != nil + ? FlutterStandardMessageCodec( + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) + : FlutterStandardMessageCodec.sharedInstance() + let getProtectionSpaceChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.URLAuthenticationChallenge.getProtectionSpace", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getProtectionSpaceChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! URLAuthenticationChallenge + do { + let result = try api.pigeonDelegate.getProtectionSpace( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getProtectionSpaceChannel.setMessageHandler(nil) + } + } + + ///Creates a Dart instance of URLAuthenticationChallenge and attaches it to [pigeonInstance]. + func pigeonNewInstance( + pigeonInstance: URLAuthenticationChallenge, + 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.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(())) + } + } + } + } +} +protocol PigeonApiDelegateURL { + /// The absolute string for the URL. + func getAbsoluteString(pigeonApi: PigeonApiURL, pigeonInstance: URL) throws -> String +} + +protocol PigeonApiProtocolURL { +} + +final class PigeonApiURL: PigeonApiProtocolURL { + unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar + let pigeonDelegate: PigeonApiDelegateURL + ///An implementation of [NSObject] used to access callback methods + var pigeonApiNSObject: PigeonApiNSObject { + return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) + } + + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateURL) { + self.pigeonRegistrar = pigeonRegistrar + self.pigeonDelegate = delegate + } + static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiURL?) { + let codec: FlutterStandardMessageCodec = + api != nil + ? FlutterStandardMessageCodec( + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) + : FlutterStandardMessageCodec.sharedInstance() + let getAbsoluteStringChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.URL.getAbsoluteString", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getAbsoluteStringChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! URL + do { + let result = try api.pigeonDelegate.getAbsoluteString( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getAbsoluteStringChannel.setMessageHandler(nil) + } + } + + ///Creates a Dart instance of URL and attaches it to [pigeonInstance]. + func pigeonNewInstance( + pigeonInstance: URL, 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.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(())) + } + } + } + } +} +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 new file mode 100644 index 00000000000..e6c6e85952a --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebViewConfigurationProxyAPIDelegate.swift @@ -0,0 +1,102 @@ +// 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 `WKWebViewConfiguration`. +/// +/// 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 WebViewConfigurationProxyAPIDelegate: PigeonApiDelegateWKWebViewConfiguration { + func pigeonDefaultConstructor(pigeonApi: PigeonApiWKWebViewConfiguration) throws + -> WKWebViewConfiguration + { + return WKWebViewConfiguration() + } + + func setUserContentController( + pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, + controller: WKUserContentController + ) throws { + pigeonInstance.userContentController = controller + } + + func getUserContentController( + pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration + ) throws -> WKUserContentController { + return pigeonInstance.userContentController + } + + func setWebsiteDataStore( + pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, + dataStore: WKWebsiteDataStore + ) throws { + pigeonInstance.websiteDataStore = dataStore + } + + func getWebsiteDataStore( + pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration + ) throws -> WKWebsiteDataStore { + return pigeonInstance.websiteDataStore + } + + func setPreferences( + pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, + preferences: WKPreferences + ) throws { + pigeonInstance.preferences = preferences + } + + func getPreferences( + pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration + ) throws -> WKPreferences { + return pigeonInstance.preferences + } + + func setAllowsInlineMediaPlayback( + pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, allow: Bool + ) throws { + #if !os(macOS) + pigeonInstance.allowsInlineMediaPlayback = allow + #endif + // No-op, rather than error out, on macOS, since it's not a meaningful option on macOS and it's + // easier for clients if it's just ignored. + } + + func setLimitsNavigationsToAppBoundDomains( + pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, limit: Bool + ) throws { + if #available(iOS 14.0, macOS 11.0, *) { + pigeonInstance.limitsNavigationsToAppBoundDomains = limit + } else { + throw (pigeonApi.pigeonRegistrar as! ProxyAPIRegistrar) + .createUnsupportedVersionError( + method: "WKWebViewConfiguration.limitsNavigationsToAppBoundDomains", + versionRequirements: "iOS 14.0, macOS 11.0") + } + } + + func setMediaTypesRequiringUserActionForPlayback( + pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, + type: AudiovisualMediaType + ) throws { + switch type { + case .none: + pigeonInstance.mediaTypesRequiringUserActionForPlayback = [] + case .audio: + pigeonInstance.mediaTypesRequiringUserActionForPlayback = WKAudiovisualMediaTypes.audio + case .video: + pigeonInstance.mediaTypesRequiringUserActionForPlayback = WKAudiovisualMediaTypes.video + case .all: + 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/WebViewFlutterPlugin.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebViewFlutterPlugin.swift new file mode 100644 index 00000000000..bec8b2f2cb8 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebViewFlutterPlugin.swift @@ -0,0 +1,40 @@ +// 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. + +#if os(iOS) + import Flutter +#elseif os(macOS) + import FlutterMacOS +#else + #error("Unsupported platform.") +#endif + +public class WebViewFlutterPlugin: NSObject, FlutterPlugin { + var proxyApiRegistrar: ProxyAPIRegistrar? + + init(binaryMessenger: FlutterBinaryMessenger) { + proxyApiRegistrar = ProxyAPIRegistrar( + binaryMessenger: binaryMessenger) + proxyApiRegistrar?.setUp() + } + + public static func register(with registrar: FlutterPluginRegistrar) { + #if os(iOS) + let binaryMessenger = registrar.messenger() + #else + let binaryMessenger = registrar.messenger + #endif + let plugin = WebViewFlutterPlugin(binaryMessenger: binaryMessenger) + + let viewFactory = FlutterViewFactory(instanceManager: plugin.proxyApiRegistrar!.instanceManager) + registrar.register(viewFactory, withId: "plugins.flutter.io/webview") + registrar.publish(plugin) + } + + public func detachFromEngine(for registrar: FlutterPluginRegistrar) { + proxyApiRegistrar!.ignoreCallsToDart = true + proxyApiRegistrar!.tearDown() + proxyApiRegistrar = nil + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebViewFlutterWKWebViewExternalAPI.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebViewFlutterWKWebViewExternalAPI.swift new file mode 100644 index 00000000000..601f21520d4 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebViewFlutterWKWebViewExternalAPI.swift @@ -0,0 +1,37 @@ +// 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 + +#if os(iOS) + import Flutter +#elseif os(macOS) + import FlutterMacOS +#else + #error("Unsupported platform.") +#endif + +/// App and package facing native API provided by the `webview_flutter_wkwebview` plugin. +/// +/// This class follows the convention of breaking changes of the Dart API, which means that any +/// changes to the class that are not backwards compatible will only be made with a major version +/// change of the plugin. Native code other than this external API does not follow breaking change +/// conventions, so app or plugin clients should not use any other native APIs. +@objc(FWFWebViewFlutterWKWebViewExternalAPI) +public class FWFWebViewFlutterWKWebViewExternalAPI: NSObject { + /// Retrieves the `WKWebView` that is associated with `identifier`. + /// + /// See the Dart method `WebKitWebViewController.webViewIdentifier` to get the identifier of an + /// underlying `WKWebView`. + @objc(webViewForIdentifier:withPluginRegistry:) + public static func webView( + forIdentifier identifier: Int64, withPluginRegistry registry: FlutterPluginRegistry + ) -> WKWebView? { + let plugin = registry.valuePublished(byPlugin: "WebViewFlutterPlugin") as! WebViewFlutterPlugin + + let webView: WKWebView? = plugin.proxyApiRegistrar?.instanceManager.instance( + forIdentifier: identifier) + return webView + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebViewProxyAPIDelegate.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebViewProxyAPIDelegate.swift new file mode 100644 index 00000000000..8159a8a69ab --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebViewProxyAPIDelegate.swift @@ -0,0 +1,385 @@ +// 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 + +class WebViewImpl: WKWebView { + let api: PigeonApiProtocolWKWebView + unowned let registrar: ProxyAPIRegistrar + + init( + api: PigeonApiProtocolWKWebView, registrar: ProxyAPIRegistrar, frame: CGRect, + configuration: WKWebViewConfiguration + ) { + self.api = api + self.registrar = registrar + super.init(frame: frame, configuration: configuration) + #if os(iOS) + scrollView.contentInsetAdjustmentBehavior = .never + if #available(iOS 13.0, *) { + scrollView.automaticallyAdjustsScrollIndicatorInsets = false + } + #endif + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + override func observeValue( + forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey: Any]?, + context: UnsafeMutableRawPointer? + ) { + NSObjectImpl.handleObserveValue( + withApi: (api as! PigeonApiWKWebView).pigeonApiNSObject, registrar: registrar, + instance: self as NSObject, + forKeyPath: keyPath, of: object, change: change, context: context) + } + + override var frame: CGRect { + get { + return super.frame + } + set { + super.frame = newValue + #if os(iOS) + // Prevents the contentInsets from being adjusted by iOS and gives control to Flutter. + scrollView.contentInset = .zero + + // Adjust contentInset to compensate the adjustedContentInset so the sum will + // always be 0. + if scrollView.adjustedContentInset != .zero { + let insetToAdjust = scrollView.adjustedContentInset + scrollView.contentInset = UIEdgeInsets( + top: -insetToAdjust.top, left: -insetToAdjust.left, bottom: -insetToAdjust.bottom, + right: -insetToAdjust.right) + } + #endif + } + } +} + +/// ProxyApi implementation for `WKWebView`. +/// +/// 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 WebViewProxyAPIDelegate: PigeonApiDelegateWKWebView, PigeonApiDelegateUIViewWKWebView, + PigeonApiDelegateNSViewWKWebView +{ + func getUIViewWKWebViewAPI(_ api: PigeonApiNSViewWKWebView) -> PigeonApiUIViewWKWebView { + return api.pigeonRegistrar.apiDelegate.pigeonApiUIViewWKWebView(api.pigeonRegistrar) + } + + #if os(iOS) + func scrollView(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws + -> UIScrollView + { + return pigeonInstance.scrollView + } + #endif + + func pigeonDefaultConstructor( + pigeonApi: PigeonApiUIViewWKWebView, initialConfiguration: WKWebViewConfiguration + ) throws -> WKWebView { + return WebViewImpl( + api: pigeonApi.pigeonApiWKWebView, registrar: pigeonApi.pigeonRegistrar as! ProxyAPIRegistrar, + frame: CGRect(), configuration: initialConfiguration) + } + + func pigeonDefaultConstructor( + pigeonApi: PigeonApiNSViewWKWebView, initialConfiguration: WKWebViewConfiguration + ) throws -> WKWebView { + return try pigeonDefaultConstructor( + pigeonApi: getUIViewWKWebViewAPI(pigeonApi), initialConfiguration: initialConfiguration) + } + + func configuration(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) + -> WKWebViewConfiguration + { + return pigeonInstance.configuration + } + + func configuration(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws + -> WKWebViewConfiguration + { + return configuration( + pigeonApi: getUIViewWKWebViewAPI(pigeonApi), pigeonInstance: pigeonInstance) + } + + func setUIDelegate( + pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, delegate: WKUIDelegate + ) throws { + pigeonInstance.uiDelegate = delegate + } + + func setUIDelegate( + pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, delegate: WKUIDelegate + ) throws { + try setUIDelegate( + pigeonApi: getUIViewWKWebViewAPI(pigeonApi), pigeonInstance: pigeonInstance, + delegate: delegate) + } + + func setNavigationDelegate( + pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, delegate: WKNavigationDelegate + ) throws { + pigeonInstance.navigationDelegate = delegate + } + + func setNavigationDelegate( + pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, + delegate: WKNavigationDelegate + ) throws { + try setNavigationDelegate( + pigeonApi: getUIViewWKWebViewAPI(pigeonApi), pigeonInstance: pigeonInstance, + delegate: delegate) + } + + func getUrl(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> String? { + return pigeonInstance.url?.absoluteString + } + + func getUrl(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> String? { + return try getUrl(pigeonApi: getUIViewWKWebViewAPI(pigeonApi), pigeonInstance: pigeonInstance) + } + + func getEstimatedProgress(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws + -> Double + { + return pigeonInstance.estimatedProgress + } + + func getEstimatedProgress(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws + -> Double + { + return try getEstimatedProgress( + pigeonApi: getUIViewWKWebViewAPI(pigeonApi), pigeonInstance: pigeonInstance) + } + + func load( + pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, request: URLRequestWrapper + ) throws { + pigeonInstance.load(request.value) + } + + func load( + pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, request: URLRequestWrapper + ) throws { + try load( + pigeonApi: getUIViewWKWebViewAPI(pigeonApi), pigeonInstance: pigeonInstance, request: request) + } + + func loadHtmlString( + pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, string: String, baseUrl: String? + ) throws { + pigeonInstance.loadHTMLString(string, baseURL: baseUrl != nil ? URL(string: baseUrl!)! : nil) + } + + func loadHtmlString( + pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, string: String, baseUrl: String? + ) throws { + try loadHtmlString( + pigeonApi: getUIViewWKWebViewAPI(pigeonApi), pigeonInstance: pigeonInstance, string: string, + baseUrl: baseUrl) + } + + func loadFileUrl( + pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, url: String, + readAccessUrl: String + ) throws { + let fileURL = URL(fileURLWithPath: url, isDirectory: false) + let readAccessURL = URL(fileURLWithPath: readAccessUrl, isDirectory: true) + + pigeonInstance.loadFileURL(fileURL, allowingReadAccessTo: readAccessURL) + } + + func loadFileUrl( + pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, url: String, + readAccessUrl: String + ) throws { + try loadFileUrl( + pigeonApi: getUIViewWKWebViewAPI(pigeonApi), pigeonInstance: pigeonInstance, url: url, + readAccessUrl: readAccessUrl) + } + + func loadFlutterAsset(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, key: String) + throws + { + let registrar = pigeonApi.pigeonRegistrar as! ProxyAPIRegistrar + let assetFilePath = registrar.assetManager.lookupKeyForAsset(key) + + let url = registrar.bundle.url( + forResource: (assetFilePath as NSString).deletingPathExtension, + withExtension: (assetFilePath as NSString).pathExtension) + + if let url = url { + pigeonInstance.loadFileURL(url, allowingReadAccessTo: url.deletingLastPathComponent()) + } else { + throw PigeonError( + code: "FWFURLParsingError", + message: "Failed to find asset with filepath: `\(assetFilePath)`.", details: nil) + } + } + + func loadFlutterAsset(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, key: String) + throws + { + try loadFlutterAsset( + pigeonApi: getUIViewWKWebViewAPI(pigeonApi), pigeonInstance: pigeonInstance, key: key) + } + + func canGoBack(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> Bool { + return pigeonInstance.canGoBack + } + + func canGoBack(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> Bool { + return try canGoBack( + pigeonApi: getUIViewWKWebViewAPI(pigeonApi), pigeonInstance: pigeonInstance) + } + + func canGoForward(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> Bool { + return pigeonInstance.canGoForward + } + + func canGoForward(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> Bool { + return try canGoForward( + pigeonApi: getUIViewWKWebViewAPI(pigeonApi), pigeonInstance: pigeonInstance) + } + + func goBack(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws { + pigeonInstance.goBack() + } + + func goBack(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws { + try goBack(pigeonApi: getUIViewWKWebViewAPI(pigeonApi), pigeonInstance: pigeonInstance) + } + + func goForward(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws { + pigeonInstance.goForward() + } + + func goForward(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws { + try goForward(pigeonApi: getUIViewWKWebViewAPI(pigeonApi), pigeonInstance: pigeonInstance) + } + + func reload(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws { + pigeonInstance.reload() + } + + func reload(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws { + try reload(pigeonApi: getUIViewWKWebViewAPI(pigeonApi), pigeonInstance: pigeonInstance) + } + + func getTitle(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> String? { + return pigeonInstance.title + } + + func getTitle(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> String? { + return try getTitle(pigeonApi: getUIViewWKWebViewAPI(pigeonApi), pigeonInstance: pigeonInstance) + } + + func setAllowsBackForwardNavigationGestures( + pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, allow: Bool + ) throws { + pigeonInstance.allowsBackForwardNavigationGestures = allow + } + + func setAllowsBackForwardNavigationGestures( + pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, allow: Bool + ) throws { + try setAllowsBackForwardNavigationGestures( + pigeonApi: getUIViewWKWebViewAPI(pigeonApi), pigeonInstance: pigeonInstance, allow: allow) + } + + func setCustomUserAgent( + pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, userAgent: String? + ) throws { + pigeonInstance.customUserAgent = userAgent + } + + func setCustomUserAgent( + pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, userAgent: String? + ) throws { + try setCustomUserAgent( + pigeonApi: getUIViewWKWebViewAPI(pigeonApi), pigeonInstance: pigeonInstance, + userAgent: userAgent) + } + + func evaluateJavaScript( + pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, javaScriptString: String, + completion: @escaping (Result) -> Void + ) { + pigeonInstance.evaluateJavaScript(javaScriptString) { result, error in + if error == nil { + if let optionalResult = result as Any?? { + switch optionalResult { + case .none: + completion(.success(nil)) + case .some(let value): + if value is String || value is NSNumber { + completion(.success(value)) + } else { + let className = String(describing: value) + debugPrint( + "Return type of evaluateJavaScript is not directly supported: \(className). Returned description of value." + ) + completion(.success((value as AnyObject).description)) + } + } + } + } else { + let error = PigeonError( + code: "FWFEvaluateJavaScriptError", message: "Failed evaluating JavaScript.", + details: error! as NSError) + completion(.failure(error)) + } + } + } + + func evaluateJavaScript( + pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, javaScriptString: String, + completion: @escaping (Result) -> Void + ) { + evaluateJavaScript( + pigeonApi: getUIViewWKWebViewAPI(pigeonApi), pigeonInstance: pigeonInstance, + javaScriptString: javaScriptString, completion: completion) + } + + func setInspectable( + pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, inspectable: Bool + ) throws { + if #available(iOS 16.4, macOS 13.3, *) { + pigeonInstance.isInspectable = inspectable + if pigeonInstance.responds(to: Selector(("isInspectable:"))) { + pigeonInstance.perform(Selector(("isInspectable:")), with: inspectable) + } + } else { + throw (pigeonApi.pigeonRegistrar as! ProxyAPIRegistrar) + .createUnsupportedVersionError( + method: "WKWebView.inspectable", + versionRequirements: "iOS 16.4, macOS 13.3") + } + } + + func setInspectable( + pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, inspectable: Bool + ) throws { + try setInspectable( + pigeonApi: getUIViewWKWebViewAPI(pigeonApi), pigeonInstance: pigeonInstance, + inspectable: inspectable) + } + + func getCustomUserAgent(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws + -> String? + { + return pigeonInstance.customUserAgent + } + + func getCustomUserAgent(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws + -> String? + { + return try getCustomUserAgent( + pigeonApi: getUIViewWKWebViewAPI(pigeonApi), pigeonInstance: pigeonInstance) + } +} 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/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebsiteDataStoreProxyAPIDelegate.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebsiteDataStoreProxyAPIDelegate.swift new file mode 100644 index 00000000000..d58e49628f0 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebsiteDataStoreProxyAPIDelegate.swift @@ -0,0 +1,62 @@ +// 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 `WKWebsiteDataStore`. +/// +/// 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 WebsiteDataStoreProxyAPIDelegate: PigeonApiDelegateWKWebsiteDataStore { + func defaultDataStore(pigeonApi: PigeonApiWKWebsiteDataStore) -> WKWebsiteDataStore { + return WKWebsiteDataStore.default() + } + + func httpCookieStore(pigeonApi: PigeonApiWKWebsiteDataStore, pigeonInstance: WKWebsiteDataStore) + -> WKHTTPCookieStore + { + return pigeonInstance.httpCookieStore + } + + func removeDataOfTypes( + pigeonApi: PigeonApiWKWebsiteDataStore, pigeonInstance: WKWebsiteDataStore, + dataTypes: [WebsiteDataType], modificationTimeInSecondsSinceEpoch: Double, + completion: @escaping (Result) -> Void + ) { + let nativeDataTypes = Set( + dataTypes.map { + switch $0 { + case .cookies: + return WKWebsiteDataTypeCookies + case .memoryCache: + return WKWebsiteDataTypeMemoryCache + case .diskCache: + return WKWebsiteDataTypeDiskCache + case .offlineWebApplicationCache: + return WKWebsiteDataTypeOfflineWebApplicationCache + case .localStorage: + return WKWebsiteDataTypeLocalStorage + case .sessionStorage: + return WKWebsiteDataTypeSessionStorage + case .webSQLDatabases: + return WKWebsiteDataTypeWebSQLDatabases + case .indexedDBDatabases: + return WKWebsiteDataTypeIndexedDBDatabases + } + }) + + pigeonInstance.fetchDataRecords(ofTypes: nativeDataTypes) { records in + if records.isEmpty { + completion(.success(false)) + } else { + pigeonInstance.removeData( + ofTypes: nativeDataTypes, + modifiedSince: Date(timeIntervalSince1970: modificationTimeInSecondsSinceEpoch) + ) { + completion(.success(true)) + } + } + } + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/FlutterWebView.modulemap b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/FlutterWebView.modulemap deleted file mode 100644 index 1b7eaf646ee..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/FlutterWebView.modulemap +++ /dev/null @@ -1,10 +0,0 @@ -framework module webview_flutter_wkwebview { - umbrella header "webview-umbrella.h" - - export * - module * { export * } - - explicit module Test { - header "FWFInstanceManager_Test.h" - } -} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview-umbrella.h b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview-umbrella.h deleted file mode 100644 index e553b0a288b..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview-umbrella.h +++ /dev/null @@ -1,27 +0,0 @@ -// 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 -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FLTWebViewFlutterPlugin.h b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FLTWebViewFlutterPlugin.h deleted file mode 100644 index e57f238d9aa..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FLTWebViewFlutterPlugin.h +++ /dev/null @@ -1,18 +0,0 @@ -// 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 - -#if TARGET_OS_OSX -#import -#else -#import -#endif - -NS_ASSUME_NONNULL_BEGIN - -@interface FLTWebViewFlutterPlugin : NSObject -@end - -NS_ASSUME_NONNULL_END diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFDataConverters.h b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFDataConverters.h deleted file mode 100644 index b007ff901b9..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFDataConverters.h +++ /dev/null @@ -1,210 +0,0 @@ -// 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 "FWFGeneratedWebKitApis.h" - -#import - -NS_ASSUME_NONNULL_BEGIN - -/// Converts an FWFNSUrlRequestData to an NSURLRequest. -/// -/// @param data The data object containing information to create an NSURLRequest. -/// -/// @return An NSURLRequest or nil if data could not be converted. -extern NSURLRequest *_Nullable FWFNativeNSURLRequestFromRequestData(FWFNSUrlRequestData *data); - -/// Converts an FWFNSHttpCookieData to an NSHTTPCookie. -/// -/// @param data The data object containing information to create an NSHTTPCookie. -/// -/// @return An NSHTTPCookie or nil if data could not be converted. -extern NSHTTPCookie *_Nullable FWFNativeNSHTTPCookieFromCookieData(FWFNSHttpCookieData *data); - -/// Converts an FWFNSKeyValueObservingOptionsEnumData to an NSKeyValueObservingOptions. -/// -/// @param data The data object containing information to create an NSKeyValueObservingOptions. -/// -/// @return An NSKeyValueObservingOptions or -1 if data could not be converted. -extern NSKeyValueObservingOptions FWFNativeNSKeyValueObservingOptionsFromEnumData( - FWFNSKeyValueObservingOptionsEnumData *data); - -/// Converts an FWFNSHTTPCookiePropertyKeyEnumData to an NSHTTPCookiePropertyKey. -/// -/// @param data The data object containing information to create an NSHTTPCookiePropertyKey. -/// -/// @return An NSHttpCookiePropertyKey or nil if data could not be converted. -extern NSHTTPCookiePropertyKey _Nullable FWFNativeNSHTTPCookiePropertyKeyFromEnumData( - FWFNSHttpCookiePropertyKeyEnumData *data); - -/// Converts a WKUserScriptData to a WKUserScript. -/// -/// @param data The data object containing information to create a WKUserScript. -/// -/// @return A WKUserScript or nil if data could not be converted. -extern WKUserScript *FWFNativeWKUserScriptFromScriptData(FWFWKUserScriptData *data); - -/// Converts an FWFWKUserScriptInjectionTimeEnumData to a WKUserScriptInjectionTime. -/// -/// @param data The data object containing information to create a WKUserScriptInjectionTime. -/// -/// @return A WKUserScriptInjectionTime or -1 if data could not be converted. -extern WKUserScriptInjectionTime FWFNativeWKUserScriptInjectionTimeFromEnumData( - FWFWKUserScriptInjectionTimeEnumData *data); - -/// Converts an FWFWKAudiovisualMediaTypeEnumData to a WKAudiovisualMediaTypes. -/// -/// @param data The data object containing information to create a WKAudiovisualMediaTypes. -/// -/// @return A WKAudiovisualMediaType or -1 if data could not be converted. -extern WKAudiovisualMediaTypes FWFNativeWKAudiovisualMediaTypeFromEnumData( - FWFWKAudiovisualMediaTypeEnumData *data); - -/// Converts an FWFWKWebsiteDataTypeEnumData to a WKWebsiteDataType. -/// -/// @param data The data object containing information to create a WKWebsiteDataType. -/// -/// @return A WKWebsiteDataType or nil if data could not be converted. -extern NSString *_Nullable FWFNativeWKWebsiteDataTypeFromEnumData( - FWFWKWebsiteDataTypeEnumData *data); - -/// Converts a WKNavigationAction to an FWFWKNavigationActionData. -/// -/// @param action The object containing information to create a WKNavigationActionData. -/// -/// @return A FWFWKNavigationActionData. -extern FWFWKNavigationActionData *FWFWKNavigationActionDataFromNativeWKNavigationAction( - WKNavigationAction *action); - -/// Converts a NSURLRequest to an FWFNSUrlRequestData. -/// -/// @param request The object containing information to create a WKNavigationActionData. -/// -/// @return A FWFNSUrlRequestData. -extern FWFNSUrlRequestData *FWFNSUrlRequestDataFromNativeNSURLRequest(NSURLRequest *request); - -/** - * Converts a WKNavigationResponse to an FWFWKNavigationResponseData. - * - * @param response The object containing information to create a WKNavigationResponseData. - * - * @return A FWFWKNavigationResponseData. - */ -extern FWFWKNavigationResponseData *FWFWKNavigationResponseDataFromNativeNavigationResponse( - WKNavigationResponse *response); -/** - * Converts a NSURLResponse to an FWFNSHttpUrlResponseData. - * - * @param response The object containing information to create a WKNavigationActionData. - * - * @return A FWFNSHttpUrlResponseData. - */ -extern FWFNSHttpUrlResponseData *FWFNSHttpUrlResponseDataFromNativeNSURLResponse( - NSURLResponse *response); - -/** - * Converts a WKFrameInfo to an FWFWKFrameInfoData. - * - * @param info The object containing information to create a FWFWKFrameInfoData. - * - * @return A FWFWKFrameInfoData. - */ -extern FWFWKFrameInfoData *FWFWKFrameInfoDataFromNativeWKFrameInfo(WKFrameInfo *info); - -/// Converts an FWFWKNavigationActionPolicyEnumData to a WKNavigationActionPolicy. -/// -/// @param data The data object containing information to create a WKNavigationActionPolicy. -/// -/// @return A WKNavigationActionPolicy or -1 if data could not be converted. -extern WKNavigationActionPolicy FWFNativeWKNavigationActionPolicyFromEnumData( - FWFWKNavigationActionPolicyEnumData *data); - -/** - * Converts an FWFWKNavigationResponsePolicyEnumData to a WKNavigationResponsePolicy. - * - * @param policy The data object containing information to create a WKNavigationResponsePolicy. - * - * @return A WKNavigationResponsePolicy or -1 if data could not be converted. - */ -extern WKNavigationResponsePolicy FWFNativeWKNavigationResponsePolicyFromEnum( - FWFWKNavigationResponsePolicyEnum policy); - -/** - * Converts a NSError to an FWFNSErrorData. - * - * @param error The object containing information to create a FWFNSErrorData. - * - * @return A FWFNSErrorData. - */ -extern FWFNSErrorData *FWFNSErrorDataFromNativeNSError(NSError *error); - -/// Converts an NSKeyValueChangeKey to a FWFNSKeyValueChangeKeyEnumData. -/// -/// @param key The data object containing information to create a FWFNSKeyValueChangeKeyEnumData. -/// -/// @return A FWFNSKeyValueChangeKeyEnumData. -extern FWFNSKeyValueChangeKeyEnumData *FWFNSKeyValueChangeKeyEnumDataFromNativeNSKeyValueChangeKey( - NSKeyValueChangeKey key); - -/// Converts a WKScriptMessage to an FWFWKScriptMessageData. -/// -/// @param message The object containing information to create a FWFWKScriptMessageData. -/// -/// @return A FWFWKScriptMessageData. -extern FWFWKScriptMessageData *FWFWKScriptMessageDataFromNativeWKScriptMessage( - WKScriptMessage *message); - -/// Converts a WKNavigationType to an FWFWKNavigationType. -/// -/// @param type The object containing information to create a FWFWKNavigationType -/// -/// @return A FWFWKNavigationType. -extern FWFWKNavigationType FWFWKNavigationTypeFromNativeWKNavigationType(WKNavigationType type); - -/// Converts a WKSecurityOrigin to an FWFWKSecurityOriginData. -/// -/// @param origin The object containing information to create an FWFWKSecurityOriginData. -/// -/// @return An FWFWKSecurityOriginData. -extern FWFWKSecurityOriginData *FWFWKSecurityOriginDataFromNativeWKSecurityOrigin( - WKSecurityOrigin *origin); - -/// Converts an FWFWKPermissionDecisionData to a WKPermissionDecision. -/// -/// @param data The data object containing information to create a WKPermissionDecision. -/// -/// @return A WKPermissionDecision or -1 if data could not be converted. -API_AVAILABLE(ios(15.0), macos(12)) -extern WKPermissionDecision FWFNativeWKPermissionDecisionFromData( - FWFWKPermissionDecisionData *data); - -/// Converts an WKMediaCaptureType to a FWFWKMediaCaptureTypeData. -/// -/// @param type The data object containing information to create a FWFWKMediaCaptureTypeData. -/// -/// @return A FWFWKMediaCaptureTypeData or nil if data could not be converted. -API_AVAILABLE(ios(15.0), macos(12)) -extern FWFWKMediaCaptureTypeData *FWFWKMediaCaptureTypeDataFromNativeWKMediaCaptureType( - WKMediaCaptureType type); - -/// Converts an FWFNSUrlSessionAuthChallengeDisposition to an NSURLSessionAuthChallengeDisposition. -/// -/// @param value The object containing information to create an -/// NSURLSessionAuthChallengeDisposition. -/// -/// @return A NSURLSessionAuthChallengeDisposition or -1 if data could not be converted. -extern NSURLSessionAuthChallengeDisposition -FWFNativeNSURLSessionAuthChallengeDispositionFromFWFNSUrlSessionAuthChallengeDisposition( - FWFNSUrlSessionAuthChallengeDisposition value); - -/// Converts an FWFNSUrlCredentialPersistence to an NSURLCredentialPersistence. -/// -/// @param value The object containing information to create an NSURLCredentialPersistence. -/// -/// @return A NSURLCredentialPersistence or -1 if data could not be converted. -extern NSURLCredentialPersistence -FWFNativeNSURLCredentialPersistenceFromFWFNSUrlCredentialPersistence( - FWFNSUrlCredentialPersistence value); - -NS_ASSUME_NONNULL_END diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFGeneratedWebKitApis.h b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFGeneratedWebKitApis.h deleted file mode 100644 index 6d68c6c5bf3..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFGeneratedWebKitApis.h +++ /dev/null @@ -1,1257 +0,0 @@ -// 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 (v18.0.0), do not edit directly. -// See also: https://pub.dev/packages/pigeon - -#import - -@protocol FlutterBinaryMessenger; -@protocol FlutterMessageCodec; -@class FlutterError; -@class FlutterStandardTypedData; - -NS_ASSUME_NONNULL_BEGIN - -/// Mirror of NSKeyValueObservingOptions. -/// -/// See -/// https://developer.apple.com/documentation/foundation/nskeyvalueobservingoptions?language=objc. -typedef NS_ENUM(NSUInteger, FWFNSKeyValueObservingOptionsEnum) { - FWFNSKeyValueObservingOptionsEnumNewValue = 0, - FWFNSKeyValueObservingOptionsEnumOldValue = 1, - FWFNSKeyValueObservingOptionsEnumInitialValue = 2, - FWFNSKeyValueObservingOptionsEnumPriorNotification = 3, -}; - -/// Wrapper for FWFNSKeyValueObservingOptionsEnum to allow for nullability. -@interface FWFNSKeyValueObservingOptionsEnumBox : NSObject -@property(nonatomic, assign) FWFNSKeyValueObservingOptionsEnum value; -- (instancetype)initWithValue:(FWFNSKeyValueObservingOptionsEnum)value; -@end - -/// Mirror of NSKeyValueChange. -/// -/// See https://developer.apple.com/documentation/foundation/nskeyvaluechange?language=objc. -typedef NS_ENUM(NSUInteger, FWFNSKeyValueChangeEnum) { - FWFNSKeyValueChangeEnumSetting = 0, - FWFNSKeyValueChangeEnumInsertion = 1, - FWFNSKeyValueChangeEnumRemoval = 2, - FWFNSKeyValueChangeEnumReplacement = 3, -}; - -/// Wrapper for FWFNSKeyValueChangeEnum to allow for nullability. -@interface FWFNSKeyValueChangeEnumBox : NSObject -@property(nonatomic, assign) FWFNSKeyValueChangeEnum value; -- (instancetype)initWithValue:(FWFNSKeyValueChangeEnum)value; -@end - -/// Mirror of NSKeyValueChangeKey. -/// -/// See https://developer.apple.com/documentation/foundation/nskeyvaluechangekey?language=objc. -typedef NS_ENUM(NSUInteger, FWFNSKeyValueChangeKeyEnum) { - FWFNSKeyValueChangeKeyEnumIndexes = 0, - FWFNSKeyValueChangeKeyEnumKind = 1, - FWFNSKeyValueChangeKeyEnumNewValue = 2, - FWFNSKeyValueChangeKeyEnumNotificationIsPrior = 3, - FWFNSKeyValueChangeKeyEnumOldValue = 4, - FWFNSKeyValueChangeKeyEnumUnknown = 5, -}; - -/// Wrapper for FWFNSKeyValueChangeKeyEnum to allow for nullability. -@interface FWFNSKeyValueChangeKeyEnumBox : NSObject -@property(nonatomic, assign) FWFNSKeyValueChangeKeyEnum value; -- (instancetype)initWithValue:(FWFNSKeyValueChangeKeyEnum)value; -@end - -/// Mirror of WKUserScriptInjectionTime. -/// -/// See https://developer.apple.com/documentation/webkit/wkuserscriptinjectiontime?language=objc. -typedef NS_ENUM(NSUInteger, FWFWKUserScriptInjectionTimeEnum) { - FWFWKUserScriptInjectionTimeEnumAtDocumentStart = 0, - FWFWKUserScriptInjectionTimeEnumAtDocumentEnd = 1, -}; - -/// Wrapper for FWFWKUserScriptInjectionTimeEnum to allow for nullability. -@interface FWFWKUserScriptInjectionTimeEnumBox : NSObject -@property(nonatomic, assign) FWFWKUserScriptInjectionTimeEnum value; -- (instancetype)initWithValue:(FWFWKUserScriptInjectionTimeEnum)value; -@end - -/// Mirror of WKAudiovisualMediaTypes. -/// -/// See -/// [WKAudiovisualMediaTypes](https://developer.apple.com/documentation/webkit/wkaudiovisualmediatypes?language=objc). -typedef NS_ENUM(NSUInteger, FWFWKAudiovisualMediaTypeEnum) { - FWFWKAudiovisualMediaTypeEnumNone = 0, - FWFWKAudiovisualMediaTypeEnumAudio = 1, - FWFWKAudiovisualMediaTypeEnumVideo = 2, - FWFWKAudiovisualMediaTypeEnumAll = 3, -}; - -/// Wrapper for FWFWKAudiovisualMediaTypeEnum to allow for nullability. -@interface FWFWKAudiovisualMediaTypeEnumBox : NSObject -@property(nonatomic, assign) FWFWKAudiovisualMediaTypeEnum value; -- (instancetype)initWithValue:(FWFWKAudiovisualMediaTypeEnum)value; -@end - -/// Mirror of WKWebsiteDataTypes. -/// -/// See -/// https://developer.apple.com/documentation/webkit/wkwebsitedatarecord/data_store_record_types?language=objc. -typedef NS_ENUM(NSUInteger, FWFWKWebsiteDataTypeEnum) { - FWFWKWebsiteDataTypeEnumCookies = 0, - FWFWKWebsiteDataTypeEnumMemoryCache = 1, - FWFWKWebsiteDataTypeEnumDiskCache = 2, - FWFWKWebsiteDataTypeEnumOfflineWebApplicationCache = 3, - FWFWKWebsiteDataTypeEnumLocalStorage = 4, - FWFWKWebsiteDataTypeEnumSessionStorage = 5, - FWFWKWebsiteDataTypeEnumWebSQLDatabases = 6, - FWFWKWebsiteDataTypeEnumIndexedDBDatabases = 7, -}; - -/// Wrapper for FWFWKWebsiteDataTypeEnum to allow for nullability. -@interface FWFWKWebsiteDataTypeEnumBox : NSObject -@property(nonatomic, assign) FWFWKWebsiteDataTypeEnum value; -- (instancetype)initWithValue:(FWFWKWebsiteDataTypeEnum)value; -@end - -/// Mirror of WKNavigationActionPolicy. -/// -/// See https://developer.apple.com/documentation/webkit/wknavigationactionpolicy?language=objc. -typedef NS_ENUM(NSUInteger, FWFWKNavigationActionPolicyEnum) { - FWFWKNavigationActionPolicyEnumAllow = 0, - FWFWKNavigationActionPolicyEnumCancel = 1, -}; - -/// Wrapper for FWFWKNavigationActionPolicyEnum to allow for nullability. -@interface FWFWKNavigationActionPolicyEnumBox : NSObject -@property(nonatomic, assign) FWFWKNavigationActionPolicyEnum value; -- (instancetype)initWithValue:(FWFWKNavigationActionPolicyEnum)value; -@end - -/// Mirror of WKNavigationResponsePolicy. -/// -/// See https://developer.apple.com/documentation/webkit/wknavigationactionpolicy?language=objc. -typedef NS_ENUM(NSUInteger, FWFWKNavigationResponsePolicyEnum) { - FWFWKNavigationResponsePolicyEnumAllow = 0, - FWFWKNavigationResponsePolicyEnumCancel = 1, -}; - -/// Wrapper for FWFWKNavigationResponsePolicyEnum to allow for nullability. -@interface FWFWKNavigationResponsePolicyEnumBox : NSObject -@property(nonatomic, assign) FWFWKNavigationResponsePolicyEnum value; -- (instancetype)initWithValue:(FWFWKNavigationResponsePolicyEnum)value; -@end - -/// Mirror of NSHTTPCookiePropertyKey. -/// -/// See https://developer.apple.com/documentation/foundation/nshttpcookiepropertykey. -typedef NS_ENUM(NSUInteger, FWFNSHttpCookiePropertyKeyEnum) { - FWFNSHttpCookiePropertyKeyEnumComment = 0, - FWFNSHttpCookiePropertyKeyEnumCommentUrl = 1, - FWFNSHttpCookiePropertyKeyEnumDiscard = 2, - FWFNSHttpCookiePropertyKeyEnumDomain = 3, - FWFNSHttpCookiePropertyKeyEnumExpires = 4, - FWFNSHttpCookiePropertyKeyEnumMaximumAge = 5, - FWFNSHttpCookiePropertyKeyEnumName = 6, - FWFNSHttpCookiePropertyKeyEnumOriginUrl = 7, - FWFNSHttpCookiePropertyKeyEnumPath = 8, - FWFNSHttpCookiePropertyKeyEnumPort = 9, - FWFNSHttpCookiePropertyKeyEnumSameSitePolicy = 10, - FWFNSHttpCookiePropertyKeyEnumSecure = 11, - FWFNSHttpCookiePropertyKeyEnumValue = 12, - FWFNSHttpCookiePropertyKeyEnumVersion = 13, -}; - -/// Wrapper for FWFNSHttpCookiePropertyKeyEnum to allow for nullability. -@interface FWFNSHttpCookiePropertyKeyEnumBox : NSObject -@property(nonatomic, assign) FWFNSHttpCookiePropertyKeyEnum value; -- (instancetype)initWithValue:(FWFNSHttpCookiePropertyKeyEnum)value; -@end - -/// An object that contains information about an action that causes navigation -/// to occur. -/// -/// Wraps -/// [WKNavigationType](https://developer.apple.com/documentation/webkit/wknavigationaction?language=objc). -typedef NS_ENUM(NSUInteger, FWFWKNavigationType) { - /// A link activation. - /// - /// See - /// https://developer.apple.com/documentation/webkit/wknavigationtype/wknavigationtypelinkactivated?language=objc. - FWFWKNavigationTypeLinkActivated = 0, - /// A request to submit a form. - /// - /// See - /// https://developer.apple.com/documentation/webkit/wknavigationtype/wknavigationtypeformsubmitted?language=objc. - FWFWKNavigationTypeSubmitted = 1, - /// A request for the frame’s next or previous item. - /// - /// See - /// https://developer.apple.com/documentation/webkit/wknavigationtype/wknavigationtypebackforward?language=objc. - FWFWKNavigationTypeBackForward = 2, - /// A request to reload the webpage. - /// - /// See - /// https://developer.apple.com/documentation/webkit/wknavigationtype/wknavigationtypereload?language=objc. - FWFWKNavigationTypeReload = 3, - /// A request to resubmit a form. - /// - /// See - /// https://developer.apple.com/documentation/webkit/wknavigationtype/wknavigationtypeformresubmitted?language=objc. - FWFWKNavigationTypeFormResubmitted = 4, - /// A navigation request that originates for some other reason. - /// - /// See - /// https://developer.apple.com/documentation/webkit/wknavigationtype/wknavigationtypeother?language=objc. - FWFWKNavigationTypeOther = 5, - /// An unknown navigation type. - /// - /// This does not represent an actual value provided by the platform and only - /// indicates a value was provided that isn't currently supported. - FWFWKNavigationTypeUnknown = 6, -}; - -/// Wrapper for FWFWKNavigationType to allow for nullability. -@interface FWFWKNavigationTypeBox : NSObject -@property(nonatomic, assign) FWFWKNavigationType value; -- (instancetype)initWithValue:(FWFWKNavigationType)value; -@end - -/// Possible permission decisions for device resource access. -/// -/// See https://developer.apple.com/documentation/webkit/wkpermissiondecision?language=objc. -typedef NS_ENUM(NSUInteger, FWFWKPermissionDecision) { - /// Deny permission for the requested resource. - /// - /// See - /// https://developer.apple.com/documentation/webkit/wkpermissiondecision/wkpermissiondecisiondeny?language=objc. - FWFWKPermissionDecisionDeny = 0, - /// Deny permission for the requested resource. - /// - /// See - /// https://developer.apple.com/documentation/webkit/wkpermissiondecision/wkpermissiondecisiongrant?language=objc. - FWFWKPermissionDecisionGrant = 1, - /// Prompt the user for permission for the requested resource. - /// - /// See - /// https://developer.apple.com/documentation/webkit/wkpermissiondecision/wkpermissiondecisionprompt?language=objc. - FWFWKPermissionDecisionPrompt = 2, -}; - -/// Wrapper for FWFWKPermissionDecision to allow for nullability. -@interface FWFWKPermissionDecisionBox : NSObject -@property(nonatomic, assign) FWFWKPermissionDecision value; -- (instancetype)initWithValue:(FWFWKPermissionDecision)value; -@end - -/// List of the types of media devices that can capture audio, video, or both. -/// -/// See https://developer.apple.com/documentation/webkit/wkmediacapturetype?language=objc. -typedef NS_ENUM(NSUInteger, FWFWKMediaCaptureType) { - /// A media device that can capture video. - /// - /// See - /// https://developer.apple.com/documentation/webkit/wkmediacapturetype/wkmediacapturetypecamera?language=objc. - FWFWKMediaCaptureTypeCamera = 0, - /// A media device or devices that can capture audio and video. - /// - /// See - /// https://developer.apple.com/documentation/webkit/wkmediacapturetype/wkmediacapturetypecameraandmicrophone?language=objc. - FWFWKMediaCaptureTypeCameraAndMicrophone = 1, - /// A media device that can capture audio. - /// - /// See - /// https://developer.apple.com/documentation/webkit/wkmediacapturetype/wkmediacapturetypemicrophone?language=objc. - FWFWKMediaCaptureTypeMicrophone = 2, - /// An unknown media device. - /// - /// This does not represent an actual value provided by the platform and only - /// indicates a value was provided that isn't currently supported. - FWFWKMediaCaptureTypeUnknown = 3, -}; - -/// Wrapper for FWFWKMediaCaptureType to allow for nullability. -@interface FWFWKMediaCaptureTypeBox : NSObject -@property(nonatomic, assign) FWFWKMediaCaptureType value; -- (instancetype)initWithValue:(FWFWKMediaCaptureType)value; -@end - -/// Responses to an authentication challenge. -/// -/// See -/// https://developer.apple.com/documentation/foundation/nsurlsessionauthchallengedisposition?language=objc. -typedef NS_ENUM(NSUInteger, FWFNSUrlSessionAuthChallengeDisposition) { - /// Use the specified credential, which may be nil. - /// - /// See - /// https://developer.apple.com/documentation/foundation/nsurlsessionauthchallengedisposition/nsurlsessionauthchallengeusecredential?language=objc. - FWFNSUrlSessionAuthChallengeDispositionUseCredential = 0, - /// Use the default handling for the challenge as though this delegate method - /// were not implemented. - /// - /// See - /// https://developer.apple.com/documentation/foundation/nsurlsessionauthchallengedisposition/nsurlsessionauthchallengeperformdefaulthandling?language=objc. - FWFNSUrlSessionAuthChallengeDispositionPerformDefaultHandling = 1, - /// Cancel the entire request. - /// - /// See - /// https://developer.apple.com/documentation/foundation/nsurlsessionauthchallengedisposition/nsurlsessionauthchallengecancelauthenticationchallenge?language=objc. - FWFNSUrlSessionAuthChallengeDispositionCancelAuthenticationChallenge = 2, - /// Reject this challenge, and call the authentication delegate method again - /// with the next authentication protection space. - /// - /// See - /// https://developer.apple.com/documentation/foundation/nsurlsessionauthchallengedisposition/nsurlsessionauthchallengerejectprotectionspace?language=objc. - FWFNSUrlSessionAuthChallengeDispositionRejectProtectionSpace = 3, -}; - -/// Wrapper for FWFNSUrlSessionAuthChallengeDisposition to allow for nullability. -@interface FWFNSUrlSessionAuthChallengeDispositionBox : NSObject -@property(nonatomic, assign) FWFNSUrlSessionAuthChallengeDisposition value; -- (instancetype)initWithValue:(FWFNSUrlSessionAuthChallengeDisposition)value; -@end - -/// Specifies how long a credential will be kept. -typedef NS_ENUM(NSUInteger, FWFNSUrlCredentialPersistence) { - /// The credential should not be stored. - /// - /// See - /// https://developer.apple.com/documentation/foundation/nsurlcredentialpersistence/nsurlcredentialpersistencenone?language=objc. - FWFNSUrlCredentialPersistenceNone = 0, - /// The credential should be stored only for this session. - /// - /// See - /// https://developer.apple.com/documentation/foundation/nsurlcredentialpersistence/nsurlcredentialpersistenceforsession?language=objc. - FWFNSUrlCredentialPersistenceSession = 1, - /// The credential should be stored in the keychain. - /// - /// See - /// https://developer.apple.com/documentation/foundation/nsurlcredentialpersistence/nsurlcredentialpersistencepermanent?language=objc. - FWFNSUrlCredentialPersistencePermanent = 2, - /// The credential should be stored permanently in the keychain, and in - /// addition should be distributed to other devices based on the owning Apple - /// ID. - /// - /// See - /// https://developer.apple.com/documentation/foundation/nsurlcredentialpersistence/nsurlcredentialpersistencesynchronizable?language=objc. - FWFNSUrlCredentialPersistenceSynchronizable = 3, -}; - -/// Wrapper for FWFNSUrlCredentialPersistence to allow for nullability. -@interface FWFNSUrlCredentialPersistenceBox : NSObject -@property(nonatomic, assign) FWFNSUrlCredentialPersistence value; -- (instancetype)initWithValue:(FWFNSUrlCredentialPersistence)value; -@end - -@class FWFNSKeyValueObservingOptionsEnumData; -@class FWFNSKeyValueChangeKeyEnumData; -@class FWFWKUserScriptInjectionTimeEnumData; -@class FWFWKAudiovisualMediaTypeEnumData; -@class FWFWKWebsiteDataTypeEnumData; -@class FWFWKNavigationActionPolicyEnumData; -@class FWFNSHttpCookiePropertyKeyEnumData; -@class FWFWKPermissionDecisionData; -@class FWFWKMediaCaptureTypeData; -@class FWFNSUrlRequestData; -@class FWFNSHttpUrlResponseData; -@class FWFWKUserScriptData; -@class FWFWKNavigationActionData; -@class FWFWKNavigationResponseData; -@class FWFWKFrameInfoData; -@class FWFNSErrorData; -@class FWFWKScriptMessageData; -@class FWFWKSecurityOriginData; -@class FWFNSHttpCookieData; -@class FWFObjectOrIdentifier; -@class FWFAuthenticationChallengeResponse; - -@interface FWFNSKeyValueObservingOptionsEnumData : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithValue:(FWFNSKeyValueObservingOptionsEnum)value; -@property(nonatomic, assign) FWFNSKeyValueObservingOptionsEnum value; -@end - -@interface FWFNSKeyValueChangeKeyEnumData : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithValue:(FWFNSKeyValueChangeKeyEnum)value; -@property(nonatomic, assign) FWFNSKeyValueChangeKeyEnum value; -@end - -@interface FWFWKUserScriptInjectionTimeEnumData : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithValue:(FWFWKUserScriptInjectionTimeEnum)value; -@property(nonatomic, assign) FWFWKUserScriptInjectionTimeEnum value; -@end - -@interface FWFWKAudiovisualMediaTypeEnumData : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithValue:(FWFWKAudiovisualMediaTypeEnum)value; -@property(nonatomic, assign) FWFWKAudiovisualMediaTypeEnum value; -@end - -@interface FWFWKWebsiteDataTypeEnumData : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithValue:(FWFWKWebsiteDataTypeEnum)value; -@property(nonatomic, assign) FWFWKWebsiteDataTypeEnum value; -@end - -@interface FWFWKNavigationActionPolicyEnumData : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithValue:(FWFWKNavigationActionPolicyEnum)value; -@property(nonatomic, assign) FWFWKNavigationActionPolicyEnum value; -@end - -@interface FWFNSHttpCookiePropertyKeyEnumData : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithValue:(FWFNSHttpCookiePropertyKeyEnum)value; -@property(nonatomic, assign) FWFNSHttpCookiePropertyKeyEnum value; -@end - -@interface FWFWKPermissionDecisionData : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithValue:(FWFWKPermissionDecision)value; -@property(nonatomic, assign) FWFWKPermissionDecision value; -@end - -@interface FWFWKMediaCaptureTypeData : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithValue:(FWFWKMediaCaptureType)value; -@property(nonatomic, assign) FWFWKMediaCaptureType value; -@end - -/// Mirror of NSURLRequest. -/// -/// See https://developer.apple.com/documentation/foundation/nsurlrequest?language=objc. -@interface FWFNSUrlRequestData : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithUrl:(NSString *)url - httpMethod:(nullable NSString *)httpMethod - httpBody:(nullable FlutterStandardTypedData *)httpBody - allHttpHeaderFields:(NSDictionary *)allHttpHeaderFields; -@property(nonatomic, copy) NSString *url; -@property(nonatomic, copy, nullable) NSString *httpMethod; -@property(nonatomic, strong, nullable) FlutterStandardTypedData *httpBody; -@property(nonatomic, copy) NSDictionary *allHttpHeaderFields; -@end - -/// Mirror of NSURLResponse. -/// -/// See https://developer.apple.com/documentation/foundation/nshttpurlresponse?language=objc. -@interface FWFNSHttpUrlResponseData : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithStatusCode:(NSInteger)statusCode; -@property(nonatomic, assign) NSInteger statusCode; -@end - -/// Mirror of WKUserScript. -/// -/// See https://developer.apple.com/documentation/webkit/wkuserscript?language=objc. -@interface FWFWKUserScriptData : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithSource:(NSString *)source - injectionTime:(nullable FWFWKUserScriptInjectionTimeEnumData *)injectionTime - isMainFrameOnly:(BOOL)isMainFrameOnly; -@property(nonatomic, copy) NSString *source; -@property(nonatomic, strong, nullable) FWFWKUserScriptInjectionTimeEnumData *injectionTime; -@property(nonatomic, assign) BOOL isMainFrameOnly; -@end - -/// Mirror of WKNavigationAction. -/// -/// See https://developer.apple.com/documentation/webkit/wknavigationaction. -@interface FWFWKNavigationActionData : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithRequest:(FWFNSUrlRequestData *)request - targetFrame:(FWFWKFrameInfoData *)targetFrame - navigationType:(FWFWKNavigationType)navigationType; -@property(nonatomic, strong) FWFNSUrlRequestData *request; -@property(nonatomic, strong) FWFWKFrameInfoData *targetFrame; -@property(nonatomic, assign) FWFWKNavigationType navigationType; -@end - -/// Mirror of WKNavigationResponse. -/// -/// See https://developer.apple.com/documentation/webkit/wknavigationresponse. -@interface FWFWKNavigationResponseData : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithResponse:(FWFNSHttpUrlResponseData *)response - forMainFrame:(BOOL)forMainFrame; -@property(nonatomic, strong) FWFNSHttpUrlResponseData *response; -@property(nonatomic, assign) BOOL forMainFrame; -@end - -/// Mirror of WKFrameInfo. -/// -/// See https://developer.apple.com/documentation/webkit/wkframeinfo?language=objc. -@interface FWFWKFrameInfoData : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithIsMainFrame:(BOOL)isMainFrame request:(FWFNSUrlRequestData *)request; -@property(nonatomic, assign) BOOL isMainFrame; -@property(nonatomic, strong) FWFNSUrlRequestData *request; -@end - -/// Mirror of NSError. -/// -/// See https://developer.apple.com/documentation/foundation/nserror?language=objc. -@interface FWFNSErrorData : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithCode:(NSInteger)code - domain:(NSString *)domain - userInfo:(nullable NSDictionary *)userInfo; -@property(nonatomic, assign) NSInteger code; -@property(nonatomic, copy) NSString *domain; -@property(nonatomic, copy, nullable) NSDictionary *userInfo; -@end - -/// Mirror of WKScriptMessage. -/// -/// See https://developer.apple.com/documentation/webkit/wkscriptmessage?language=objc. -@interface FWFWKScriptMessageData : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithName:(NSString *)name body:(nullable id)body; -@property(nonatomic, copy) NSString *name; -@property(nonatomic, strong, nullable) id body; -@end - -/// Mirror of WKSecurityOrigin. -/// -/// See https://developer.apple.com/documentation/webkit/wksecurityorigin?language=objc. -@interface FWFWKSecurityOriginData : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithHost:(NSString *)host port:(NSInteger)port protocol:(NSString *)protocol; -@property(nonatomic, copy) NSString *host; -@property(nonatomic, assign) NSInteger port; -@property(nonatomic, copy) NSString *protocol; -@end - -/// Mirror of NSHttpCookieData. -/// -/// See https://developer.apple.com/documentation/foundation/nshttpcookie?language=objc. -@interface FWFNSHttpCookieData : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithPropertyKeys:(NSArray *)propertyKeys - propertyValues:(NSArray *)propertyValues; -@property(nonatomic, copy) NSArray *propertyKeys; -@property(nonatomic, copy) NSArray *propertyValues; -@end - -/// An object that can represent either a value supported by -/// `StandardMessageCodec`, a data class in this pigeon file, or an identifier -/// of an object stored in an `InstanceManager`. -@interface FWFObjectOrIdentifier : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithValue:(nullable id)value isIdentifier:(BOOL)isIdentifier; -@property(nonatomic, strong, nullable) id value; -/// Whether value is an int that is used to retrieve an instance stored in an -/// `InstanceManager`. -@property(nonatomic, assign) BOOL isIdentifier; -@end - -@interface FWFAuthenticationChallengeResponse : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithDisposition:(FWFNSUrlSessionAuthChallengeDisposition)disposition - credentialIdentifier:(nullable NSNumber *)credentialIdentifier; -@property(nonatomic, assign) FWFNSUrlSessionAuthChallengeDisposition disposition; -@property(nonatomic, strong, nullable) NSNumber *credentialIdentifier; -@end - -/// The codec used by FWFWKWebsiteDataStoreHostApi. -NSObject *FWFWKWebsiteDataStoreHostApiGetCodec(void); - -/// Mirror of WKWebsiteDataStore. -/// -/// See https://developer.apple.com/documentation/webkit/wkwebsitedatastore?language=objc. -@protocol FWFWKWebsiteDataStoreHostApi -- (void)createFromWebViewConfigurationWithIdentifier:(NSInteger)identifier - configurationIdentifier:(NSInteger)configurationIdentifier - error:(FlutterError *_Nullable *_Nonnull)error; -- (void)createDefaultDataStoreWithIdentifier:(NSInteger)identifier - error:(FlutterError *_Nullable *_Nonnull)error; -- (void)removeDataFromDataStoreWithIdentifier:(NSInteger)identifier - ofTypes:(NSArray *)dataTypes - modifiedSince:(double)modificationTimeInSecondsSinceEpoch - completion:(void (^)(NSNumber *_Nullable, - FlutterError *_Nullable))completion; -@end - -extern void SetUpFWFWKWebsiteDataStoreHostApi( - id binaryMessenger, - NSObject *_Nullable api); - -extern void SetUpFWFWKWebsiteDataStoreHostApiWithSuffix( - id binaryMessenger, - NSObject *_Nullable api, NSString *messageChannelSuffix); - -/// The codec used by FWFUIViewHostApi. -NSObject *FWFUIViewHostApiGetCodec(void); - -/// Mirror of UIView. -/// -/// See https://developer.apple.com/documentation/uikit/uiview?language=objc. -@protocol FWFUIViewHostApi -- (void)setBackgroundColorForViewWithIdentifier:(NSInteger)identifier - toValue:(nullable NSNumber *)value - error:(FlutterError *_Nullable *_Nonnull)error; -- (void)setOpaqueForViewWithIdentifier:(NSInteger)identifier - isOpaque:(BOOL)opaque - error:(FlutterError *_Nullable *_Nonnull)error; -@end - -extern void SetUpFWFUIViewHostApi(id binaryMessenger, - NSObject *_Nullable api); - -extern void SetUpFWFUIViewHostApiWithSuffix(id binaryMessenger, - NSObject *_Nullable api, - NSString *messageChannelSuffix); - -/// The codec used by FWFUIScrollViewHostApi. -NSObject *FWFUIScrollViewHostApiGetCodec(void); - -/// Mirror of UIScrollView. -/// -/// See https://developer.apple.com/documentation/uikit/uiscrollview?language=objc. -@protocol FWFUIScrollViewHostApi -- (void)createFromWebViewWithIdentifier:(NSInteger)identifier - webViewIdentifier:(NSInteger)webViewIdentifier - error:(FlutterError *_Nullable *_Nonnull)error; -/// @return `nil` only when `error != nil`. -- (nullable NSArray *) - contentOffsetForScrollViewWithIdentifier:(NSInteger)identifier - error:(FlutterError *_Nullable *_Nonnull)error; -- (void)scrollByForScrollViewWithIdentifier:(NSInteger)identifier - x:(double)x - y:(double)y - error:(FlutterError *_Nullable *_Nonnull)error; -- (void)verticalScrollBarEnabledForScrollViewWithIdentifier:(NSInteger)identifier - isEnabled:(BOOL)enabled - error:(FlutterError *_Nullable *_Nonnull)error; -- (void)horizontalScrollBarEnabledForScrollViewWithIdentifier:(NSInteger)identifier - isEnabled:(BOOL)enabled - error:(FlutterError *_Nullable *_Nonnull)error; -- (void)setContentOffsetForScrollViewWithIdentifier:(NSInteger)identifier - toX:(double)x - y:(double)y - error:(FlutterError *_Nullable *_Nonnull)error; -- (void)setDelegateForScrollViewWithIdentifier:(NSInteger)identifier - uiScrollViewDelegateIdentifier:(nullable NSNumber *)uiScrollViewDelegateIdentifier - error:(FlutterError *_Nullable *_Nonnull)error; -@end - -extern void SetUpFWFUIScrollViewHostApi(id binaryMessenger, - NSObject *_Nullable api); - -extern void SetUpFWFUIScrollViewHostApiWithSuffix(id binaryMessenger, - NSObject *_Nullable api, - NSString *messageChannelSuffix); - -/// The codec used by FWFWKWebViewConfigurationHostApi. -NSObject *FWFWKWebViewConfigurationHostApiGetCodec(void); - -/// Mirror of WKWebViewConfiguration. -/// -/// See https://developer.apple.com/documentation/webkit/wkwebviewconfiguration?language=objc. -@protocol FWFWKWebViewConfigurationHostApi -- (void)createWithIdentifier:(NSInteger)identifier error:(FlutterError *_Nullable *_Nonnull)error; -- (void)createFromWebViewWithIdentifier:(NSInteger)identifier - webViewIdentifier:(NSInteger)webViewIdentifier - error:(FlutterError *_Nullable *_Nonnull)error; -- (void)setAllowsInlineMediaPlaybackForConfigurationWithIdentifier:(NSInteger)identifier - isAllowed:(BOOL)allow - error: - (FlutterError *_Nullable *_Nonnull) - error; -- (void)setLimitsNavigationsToAppBoundDomainsForConfigurationWithIdentifier:(NSInteger)identifier - isLimited:(BOOL)limit - error:(FlutterError *_Nullable - *_Nonnull)error; -- (void) - setMediaTypesRequiresUserActionForConfigurationWithIdentifier:(NSInteger)identifier - forTypes: - (NSArray< - FWFWKAudiovisualMediaTypeEnumData - *> *)types - error: - (FlutterError *_Nullable *_Nonnull) - error; -@end - -extern void SetUpFWFWKWebViewConfigurationHostApi( - id binaryMessenger, - NSObject *_Nullable api); - -extern void SetUpFWFWKWebViewConfigurationHostApiWithSuffix( - id binaryMessenger, - NSObject *_Nullable api, NSString *messageChannelSuffix); - -/// The codec used by FWFWKWebViewConfigurationFlutterApi. -NSObject *FWFWKWebViewConfigurationFlutterApiGetCodec(void); - -/// Handles callbacks from a WKWebViewConfiguration instance. -/// -/// See https://developer.apple.com/documentation/webkit/wkwebviewconfiguration?language=objc. -@interface FWFWKWebViewConfigurationFlutterApi : NSObject -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger; -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - messageChannelSuffix:(nullable NSString *)messageChannelSuffix; -- (void)createWithIdentifier:(NSInteger)identifier - completion:(void (^)(FlutterError *_Nullable))completion; -@end - -/// The codec used by FWFWKUserContentControllerHostApi. -NSObject *FWFWKUserContentControllerHostApiGetCodec(void); - -/// Mirror of WKUserContentController. -/// -/// See https://developer.apple.com/documentation/webkit/wkusercontentcontroller?language=objc. -@protocol FWFWKUserContentControllerHostApi -- (void)createFromWebViewConfigurationWithIdentifier:(NSInteger)identifier - configurationIdentifier:(NSInteger)configurationIdentifier - error:(FlutterError *_Nullable *_Nonnull)error; -- (void)addScriptMessageHandlerForControllerWithIdentifier:(NSInteger)identifier - handlerIdentifier:(NSInteger)handlerIdentifier - ofName:(NSString *)name - error:(FlutterError *_Nullable *_Nonnull)error; -- (void)removeScriptMessageHandlerForControllerWithIdentifier:(NSInteger)identifier - name:(NSString *)name - error:(FlutterError *_Nullable *_Nonnull) - error; -- (void)removeAllScriptMessageHandlersForControllerWithIdentifier:(NSInteger)identifier - error: - (FlutterError *_Nullable *_Nonnull) - error; -- (void)addUserScriptForControllerWithIdentifier:(NSInteger)identifier - userScript:(FWFWKUserScriptData *)userScript - error:(FlutterError *_Nullable *_Nonnull)error; -- (void)removeAllUserScriptsForControllerWithIdentifier:(NSInteger)identifier - error:(FlutterError *_Nullable *_Nonnull)error; -@end - -extern void SetUpFWFWKUserContentControllerHostApi( - id binaryMessenger, - NSObject *_Nullable api); - -extern void SetUpFWFWKUserContentControllerHostApiWithSuffix( - id binaryMessenger, - NSObject *_Nullable api, NSString *messageChannelSuffix); - -/// The codec used by FWFWKPreferencesHostApi. -NSObject *FWFWKPreferencesHostApiGetCodec(void); - -/// Mirror of WKUserPreferences. -/// -/// See https://developer.apple.com/documentation/webkit/wkpreferences?language=objc. -@protocol FWFWKPreferencesHostApi -- (void)createFromWebViewConfigurationWithIdentifier:(NSInteger)identifier - configurationIdentifier:(NSInteger)configurationIdentifier - error:(FlutterError *_Nullable *_Nonnull)error; -- (void)setJavaScriptEnabledForPreferencesWithIdentifier:(NSInteger)identifier - isEnabled:(BOOL)enabled - error:(FlutterError *_Nullable *_Nonnull)error; -@end - -extern void SetUpFWFWKPreferencesHostApi(id binaryMessenger, - NSObject *_Nullable api); - -extern void SetUpFWFWKPreferencesHostApiWithSuffix(id binaryMessenger, - NSObject *_Nullable api, - NSString *messageChannelSuffix); - -/// The codec used by FWFWKScriptMessageHandlerHostApi. -NSObject *FWFWKScriptMessageHandlerHostApiGetCodec(void); - -/// Mirror of WKScriptMessageHandler. -/// -/// See https://developer.apple.com/documentation/webkit/wkscriptmessagehandler?language=objc. -@protocol FWFWKScriptMessageHandlerHostApi -- (void)createWithIdentifier:(NSInteger)identifier error:(FlutterError *_Nullable *_Nonnull)error; -@end - -extern void SetUpFWFWKScriptMessageHandlerHostApi( - id binaryMessenger, - NSObject *_Nullable api); - -extern void SetUpFWFWKScriptMessageHandlerHostApiWithSuffix( - id binaryMessenger, - NSObject *_Nullable api, NSString *messageChannelSuffix); - -/// The codec used by FWFWKScriptMessageHandlerFlutterApi. -NSObject *FWFWKScriptMessageHandlerFlutterApiGetCodec(void); - -/// Handles callbacks from a WKScriptMessageHandler instance. -/// -/// See https://developer.apple.com/documentation/webkit/wkscriptmessagehandler?language=objc. -@interface FWFWKScriptMessageHandlerFlutterApi : NSObject -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger; -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - messageChannelSuffix:(nullable NSString *)messageChannelSuffix; -- (void)didReceiveScriptMessageForHandlerWithIdentifier:(NSInteger)identifier - userContentControllerIdentifier:(NSInteger)userContentControllerIdentifier - message:(FWFWKScriptMessageData *)message - completion: - (void (^)(FlutterError *_Nullable))completion; -@end - -/// The codec used by FWFWKNavigationDelegateHostApi. -NSObject *FWFWKNavigationDelegateHostApiGetCodec(void); - -/// Mirror of WKNavigationDelegate. -/// -/// See https://developer.apple.com/documentation/webkit/wknavigationdelegate?language=objc. -@protocol FWFWKNavigationDelegateHostApi -- (void)createWithIdentifier:(NSInteger)identifier error:(FlutterError *_Nullable *_Nonnull)error; -@end - -extern void SetUpFWFWKNavigationDelegateHostApi( - id binaryMessenger, - NSObject *_Nullable api); - -extern void SetUpFWFWKNavigationDelegateHostApiWithSuffix( - id binaryMessenger, - NSObject *_Nullable api, NSString *messageChannelSuffix); - -/// The codec used by FWFWKNavigationDelegateFlutterApi. -NSObject *FWFWKNavigationDelegateFlutterApiGetCodec(void); - -/// Handles callbacks from a WKNavigationDelegate instance. -/// -/// See https://developer.apple.com/documentation/webkit/wknavigationdelegate?language=objc. -@interface FWFWKNavigationDelegateFlutterApi : NSObject -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger; -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - messageChannelSuffix:(nullable NSString *)messageChannelSuffix; -- (void)didFinishNavigationForDelegateWithIdentifier:(NSInteger)identifier - webViewIdentifier:(NSInteger)webViewIdentifier - URL:(nullable NSString *)url - completion:(void (^)(FlutterError *_Nullable))completion; -- (void)didStartProvisionalNavigationForDelegateWithIdentifier:(NSInteger)identifier - webViewIdentifier:(NSInteger)webViewIdentifier - URL:(nullable NSString *)url - completion:(void (^)(FlutterError *_Nullable)) - completion; -- (void) - decidePolicyForNavigationActionForDelegateWithIdentifier:(NSInteger)identifier - webViewIdentifier:(NSInteger)webViewIdentifier - navigationAction: - (FWFWKNavigationActionData *)navigationAction - completion: - (void (^)(FWFWKNavigationActionPolicyEnumData - *_Nullable, - FlutterError *_Nullable))completion; -- (void)decidePolicyForNavigationResponseForDelegateWithIdentifier:(NSInteger)identifier - webViewIdentifier:(NSInteger)webViewIdentifier - navigationResponse:(FWFWKNavigationResponseData *) - navigationResponse - completion: - (void (^)( - FWFWKNavigationResponsePolicyEnumBox - *_Nullable, - FlutterError *_Nullable))completion; -- (void)didFailNavigationForDelegateWithIdentifier:(NSInteger)identifier - webViewIdentifier:(NSInteger)webViewIdentifier - error:(FWFNSErrorData *)error - completion:(void (^)(FlutterError *_Nullable))completion; -- (void)didFailProvisionalNavigationForDelegateWithIdentifier:(NSInteger)identifier - webViewIdentifier:(NSInteger)webViewIdentifier - error:(FWFNSErrorData *)error - completion:(void (^)(FlutterError *_Nullable)) - completion; -- (void)webViewWebContentProcessDidTerminateForDelegateWithIdentifier:(NSInteger)identifier - webViewIdentifier:(NSInteger)webViewIdentifier - completion: - (void (^)(FlutterError *_Nullable)) - completion; -- (void)didReceiveAuthenticationChallengeForDelegateWithIdentifier:(NSInteger)identifier - webViewIdentifier:(NSInteger)webViewIdentifier - challengeIdentifier:(NSInteger)challengeIdentifier - completion: - (void (^)( - FWFAuthenticationChallengeResponse - *_Nullable, - FlutterError *_Nullable))completion; -@end - -/// The codec used by FWFNSObjectHostApi. -NSObject *FWFNSObjectHostApiGetCodec(void); - -/// Mirror of NSObject. -/// -/// See https://developer.apple.com/documentation/objectivec/nsobject. -@protocol FWFNSObjectHostApi -- (void)disposeObjectWithIdentifier:(NSInteger)identifier - error:(FlutterError *_Nullable *_Nonnull)error; -- (void)addObserverForObjectWithIdentifier:(NSInteger)identifier - observerIdentifier:(NSInteger)observerIdentifier - keyPath:(NSString *)keyPath - options: - (NSArray *)options - error:(FlutterError *_Nullable *_Nonnull)error; -- (void)removeObserverForObjectWithIdentifier:(NSInteger)identifier - observerIdentifier:(NSInteger)observerIdentifier - keyPath:(NSString *)keyPath - error:(FlutterError *_Nullable *_Nonnull)error; -@end - -extern void SetUpFWFNSObjectHostApi(id binaryMessenger, - NSObject *_Nullable api); - -extern void SetUpFWFNSObjectHostApiWithSuffix(id binaryMessenger, - NSObject *_Nullable api, - NSString *messageChannelSuffix); - -/// The codec used by FWFNSObjectFlutterApi. -NSObject *FWFNSObjectFlutterApiGetCodec(void); - -/// Handles callbacks from an NSObject instance. -/// -/// See https://developer.apple.com/documentation/objectivec/nsobject. -@interface FWFNSObjectFlutterApi : NSObject -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger; -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - messageChannelSuffix:(nullable NSString *)messageChannelSuffix; -- (void)observeValueForObjectWithIdentifier:(NSInteger)identifier - keyPath:(NSString *)keyPath - objectIdentifier:(NSInteger)objectIdentifier - changeKeys:(NSArray *)changeKeys - changeValues:(NSArray *)changeValues - completion:(void (^)(FlutterError *_Nullable))completion; -- (void)disposeObjectWithIdentifier:(NSInteger)identifier - completion:(void (^)(FlutterError *_Nullable))completion; -@end - -/// The codec used by FWFWKWebViewHostApi. -NSObject *FWFWKWebViewHostApiGetCodec(void); - -/// Mirror of WKWebView. -/// -/// See https://developer.apple.com/documentation/webkit/wkwebview?language=objc. -@protocol FWFWKWebViewHostApi -- (void)createWithIdentifier:(NSInteger)identifier - configurationIdentifier:(NSInteger)configurationIdentifier - error:(FlutterError *_Nullable *_Nonnull)error; -- (void)setUIDelegateForWebViewWithIdentifier:(NSInteger)identifier - delegateIdentifier:(nullable NSNumber *)uiDelegateIdentifier - error:(FlutterError *_Nullable *_Nonnull)error; -- (void)setNavigationDelegateForWebViewWithIdentifier:(NSInteger)identifier - delegateIdentifier: - (nullable NSNumber *)navigationDelegateIdentifier - error:(FlutterError *_Nullable *_Nonnull)error; -- (nullable NSString *)URLForWebViewWithIdentifier:(NSInteger)identifier - error:(FlutterError *_Nullable *_Nonnull)error; -/// @return `nil` only when `error != nil`. -- (nullable NSNumber *)estimatedProgressForWebViewWithIdentifier:(NSInteger)identifier - error:(FlutterError *_Nullable *_Nonnull) - error; -- (void)loadRequestForWebViewWithIdentifier:(NSInteger)identifier - request:(FWFNSUrlRequestData *)request - error:(FlutterError *_Nullable *_Nonnull)error; -- (void)loadHTMLForWebViewWithIdentifier:(NSInteger)identifier - HTMLString:(NSString *)string - baseURL:(nullable NSString *)baseUrl - error:(FlutterError *_Nullable *_Nonnull)error; -- (void)loadFileForWebViewWithIdentifier:(NSInteger)identifier - fileURL:(NSString *)url - readAccessURL:(NSString *)readAccessUrl - error:(FlutterError *_Nullable *_Nonnull)error; -- (void)loadAssetForWebViewWithIdentifier:(NSInteger)identifier - assetKey:(NSString *)key - error:(FlutterError *_Nullable *_Nonnull)error; -/// @return `nil` only when `error != nil`. -- (nullable NSNumber *)canGoBackForWebViewWithIdentifier:(NSInteger)identifier - error:(FlutterError *_Nullable *_Nonnull)error; -/// @return `nil` only when `error != nil`. -- (nullable NSNumber *)canGoForwardForWebViewWithIdentifier:(NSInteger)identifier - error: - (FlutterError *_Nullable *_Nonnull)error; -- (void)goBackForWebViewWithIdentifier:(NSInteger)identifier - error:(FlutterError *_Nullable *_Nonnull)error; -- (void)goForwardForWebViewWithIdentifier:(NSInteger)identifier - error:(FlutterError *_Nullable *_Nonnull)error; -- (void)reloadWebViewWithIdentifier:(NSInteger)identifier - error:(FlutterError *_Nullable *_Nonnull)error; -- (nullable NSString *)titleForWebViewWithIdentifier:(NSInteger)identifier - error:(FlutterError *_Nullable *_Nonnull)error; -- (void)setAllowsBackForwardForWebViewWithIdentifier:(NSInteger)identifier - isAllowed:(BOOL)allow - error:(FlutterError *_Nullable *_Nonnull)error; -- (void)setCustomUserAgentForWebViewWithIdentifier:(NSInteger)identifier - userAgent:(nullable NSString *)userAgent - error:(FlutterError *_Nullable *_Nonnull)error; -- (void)evaluateJavaScriptForWebViewWithIdentifier:(NSInteger)identifier - javaScriptString:(NSString *)javaScriptString - completion:(void (^)(id _Nullable, - FlutterError *_Nullable))completion; -- (void)setInspectableForWebViewWithIdentifier:(NSInteger)identifier - inspectable:(BOOL)inspectable - error:(FlutterError *_Nullable *_Nonnull)error; -- (nullable NSString *)customUserAgentForWebViewWithIdentifier:(NSInteger)identifier - error:(FlutterError *_Nullable *_Nonnull) - error; -@end - -extern void SetUpFWFWKWebViewHostApi(id binaryMessenger, - NSObject *_Nullable api); - -extern void SetUpFWFWKWebViewHostApiWithSuffix(id binaryMessenger, - NSObject *_Nullable api, - NSString *messageChannelSuffix); - -/// The codec used by FWFWKUIDelegateHostApi. -NSObject *FWFWKUIDelegateHostApiGetCodec(void); - -/// Mirror of WKUIDelegate. -/// -/// See https://developer.apple.com/documentation/webkit/wkuidelegate?language=objc. -@protocol FWFWKUIDelegateHostApi -- (void)createWithIdentifier:(NSInteger)identifier error:(FlutterError *_Nullable *_Nonnull)error; -@end - -extern void SetUpFWFWKUIDelegateHostApi(id binaryMessenger, - NSObject *_Nullable api); - -extern void SetUpFWFWKUIDelegateHostApiWithSuffix(id binaryMessenger, - NSObject *_Nullable api, - NSString *messageChannelSuffix); - -/// The codec used by FWFWKUIDelegateFlutterApi. -NSObject *FWFWKUIDelegateFlutterApiGetCodec(void); - -/// Handles callbacks from a WKUIDelegate instance. -/// -/// See https://developer.apple.com/documentation/webkit/wkuidelegate?language=objc. -@interface FWFWKUIDelegateFlutterApi : NSObject -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger; -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - messageChannelSuffix:(nullable NSString *)messageChannelSuffix; -- (void)onCreateWebViewForDelegateWithIdentifier:(NSInteger)identifier - webViewIdentifier:(NSInteger)webViewIdentifier - configurationIdentifier:(NSInteger)configurationIdentifier - navigationAction:(FWFWKNavigationActionData *)navigationAction - completion:(void (^)(FlutterError *_Nullable))completion; -/// Callback to Dart function `WKUIDelegate.requestMediaCapturePermission`. -- (void)requestMediaCapturePermissionForDelegateWithIdentifier:(NSInteger)identifier - webViewIdentifier:(NSInteger)webViewIdentifier - origin:(FWFWKSecurityOriginData *)origin - frame:(FWFWKFrameInfoData *)frame - type:(FWFWKMediaCaptureTypeData *)type - completion: - (void (^)( - FWFWKPermissionDecisionData *_Nullable, - FlutterError *_Nullable))completion; -/// Callback to Dart function `WKUIDelegate.runJavaScriptAlertPanel`. -- (void)runJavaScriptAlertPanelForDelegateWithIdentifier:(NSInteger)identifier - message:(NSString *)message - frame:(FWFWKFrameInfoData *)frame - completion: - (void (^)(FlutterError *_Nullable))completion; -/// Callback to Dart function `WKUIDelegate.runJavaScriptConfirmPanel`. -- (void)runJavaScriptConfirmPanelForDelegateWithIdentifier:(NSInteger)identifier - message:(NSString *)message - frame:(FWFWKFrameInfoData *)frame - completion: - (void (^)(NSNumber *_Nullable, - FlutterError *_Nullable))completion; -/// Callback to Dart function `WKUIDelegate.runJavaScriptTextInputPanel`. -- (void)runJavaScriptTextInputPanelForDelegateWithIdentifier:(NSInteger)identifier - prompt:(NSString *)prompt - defaultText:(NSString *)defaultText - frame:(FWFWKFrameInfoData *)frame - completion: - (void (^)(NSString *_Nullable, - FlutterError *_Nullable))completion; -@end - -/// The codec used by FWFWKHttpCookieStoreHostApi. -NSObject *FWFWKHttpCookieStoreHostApiGetCodec(void); - -/// Mirror of WKHttpCookieStore. -/// -/// See https://developer.apple.com/documentation/webkit/wkhttpcookiestore?language=objc. -@protocol FWFWKHttpCookieStoreHostApi -- (void)createFromWebsiteDataStoreWithIdentifier:(NSInteger)identifier - dataStoreIdentifier:(NSInteger)websiteDataStoreIdentifier - error:(FlutterError *_Nullable *_Nonnull)error; -- (void)setCookieForStoreWithIdentifier:(NSInteger)identifier - cookie:(FWFNSHttpCookieData *)cookie - completion:(void (^)(FlutterError *_Nullable))completion; -@end - -extern void SetUpFWFWKHttpCookieStoreHostApi(id binaryMessenger, - NSObject *_Nullable api); - -extern void SetUpFWFWKHttpCookieStoreHostApiWithSuffix( - id binaryMessenger, - NSObject *_Nullable api, NSString *messageChannelSuffix); - -/// The codec used by FWFNSUrlHostApi. -NSObject *FWFNSUrlHostApiGetCodec(void); - -/// Host API for `NSUrl`. -/// -/// This class may handle instantiating and adding native object instances that -/// are attached to a Dart instance or method calls on the associated native -/// class or an instance of the class. -/// -/// See https://developer.apple.com/documentation/foundation/nsurl?language=objc. -@protocol FWFNSUrlHostApi -- (nullable NSString *)absoluteStringForNSURLWithIdentifier:(NSInteger)identifier - error: - (FlutterError *_Nullable *_Nonnull)error; -@end - -extern void SetUpFWFNSUrlHostApi(id binaryMessenger, - NSObject *_Nullable api); - -extern void SetUpFWFNSUrlHostApiWithSuffix(id binaryMessenger, - NSObject *_Nullable api, - NSString *messageChannelSuffix); - -/// The codec used by FWFNSUrlFlutterApi. -NSObject *FWFNSUrlFlutterApiGetCodec(void); - -/// Flutter API for `NSUrl`. -/// -/// This class may handle instantiating and adding Dart instances that are -/// attached to a native instance or receiving callback methods from an -/// overridden native class. -/// -/// See https://developer.apple.com/documentation/foundation/nsurl?language=objc. -@interface FWFNSUrlFlutterApi : NSObject -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger; -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - messageChannelSuffix:(nullable NSString *)messageChannelSuffix; -- (void)createWithIdentifier:(NSInteger)identifier - completion:(void (^)(FlutterError *_Nullable))completion; -@end - -/// The codec used by FWFUIScrollViewDelegateHostApi. -NSObject *FWFUIScrollViewDelegateHostApiGetCodec(void); - -/// Host API for `UIScrollViewDelegate`. -/// -/// This class may handle instantiating and adding native object instances that -/// are attached to a Dart instance or method calls on the associated native -/// class or an instance of the class. -/// -/// See https://developer.apple.com/documentation/uikit/uiscrollviewdelegate?language=objc. -@protocol FWFUIScrollViewDelegateHostApi -- (void)createWithIdentifier:(NSInteger)identifier error:(FlutterError *_Nullable *_Nonnull)error; -@end - -extern void SetUpFWFUIScrollViewDelegateHostApi( - id binaryMessenger, - NSObject *_Nullable api); - -extern void SetUpFWFUIScrollViewDelegateHostApiWithSuffix( - id binaryMessenger, - NSObject *_Nullable api, NSString *messageChannelSuffix); - -/// The codec used by FWFUIScrollViewDelegateFlutterApi. -NSObject *FWFUIScrollViewDelegateFlutterApiGetCodec(void); - -/// Flutter API for `UIScrollViewDelegate`. -/// -/// See https://developer.apple.com/documentation/uikit/uiscrollviewdelegate?language=objc. -@interface FWFUIScrollViewDelegateFlutterApi : NSObject -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger; -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - messageChannelSuffix:(nullable NSString *)messageChannelSuffix; -- (void)scrollViewDidScrollWithIdentifier:(NSInteger)identifier - UIScrollViewIdentifier:(NSInteger)uiScrollViewIdentifier - x:(double)x - y:(double)y - completion:(void (^)(FlutterError *_Nullable))completion; -@end - -/// The codec used by FWFNSUrlCredentialHostApi. -NSObject *FWFNSUrlCredentialHostApiGetCodec(void); - -/// Host API for `NSUrlCredential`. -/// -/// This class may handle instantiating and adding native object instances that -/// are attached to a Dart instance or handle method calls on the associated -/// native class or an instance of the class. -/// -/// See https://developer.apple.com/documentation/foundation/nsurlcredential?language=objc. -@protocol FWFNSUrlCredentialHostApi -/// Create a new native instance and add it to the `InstanceManager`. -- (void)createWithUserWithIdentifier:(NSInteger)identifier - user:(NSString *)user - password:(NSString *)password - persistence:(FWFNSUrlCredentialPersistence)persistence - error:(FlutterError *_Nullable *_Nonnull)error; -@end - -extern void SetUpFWFNSUrlCredentialHostApi(id binaryMessenger, - NSObject *_Nullable api); - -extern void SetUpFWFNSUrlCredentialHostApiWithSuffix( - id binaryMessenger, NSObject *_Nullable api, - NSString *messageChannelSuffix); - -/// The codec used by FWFNSUrlProtectionSpaceFlutterApi. -NSObject *FWFNSUrlProtectionSpaceFlutterApiGetCodec(void); - -/// Flutter API for `NSUrlProtectionSpace`. -/// -/// This class may handle instantiating and adding Dart instances that are -/// attached to a native instance or receiving callback methods from an -/// overridden native class. -/// -/// See https://developer.apple.com/documentation/foundation/nsurlprotectionspace?language=objc. -@interface FWFNSUrlProtectionSpaceFlutterApi : NSObject -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger; -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - messageChannelSuffix:(nullable NSString *)messageChannelSuffix; -/// Create a new Dart instance and add it to the `InstanceManager`. -- (void)createWithIdentifier:(NSInteger)identifier - host:(nullable NSString *)host - realm:(nullable NSString *)realm - authenticationMethod:(nullable NSString *)authenticationMethod - completion:(void (^)(FlutterError *_Nullable))completion; -@end - -/// The codec used by FWFNSUrlAuthenticationChallengeFlutterApi. -NSObject *FWFNSUrlAuthenticationChallengeFlutterApiGetCodec(void); - -/// Flutter API for `NSUrlAuthenticationChallenge`. -/// -/// This class may handle instantiating and adding Dart instances that are -/// attached to a native instance or receiving callback methods from an -/// overridden native class. -/// -/// See -/// https://developer.apple.com/documentation/foundation/nsurlauthenticationchallenge?language=objc. -@interface FWFNSUrlAuthenticationChallengeFlutterApi : NSObject -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger; -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - messageChannelSuffix:(nullable NSString *)messageChannelSuffix; -/// Create a new Dart instance and add it to the `InstanceManager`. -- (void)createWithIdentifier:(NSInteger)identifier - protectionSpaceIdentifier:(NSInteger)protectionSpaceIdentifier - completion:(void (^)(FlutterError *_Nullable))completion; -@end - -NS_ASSUME_NONNULL_END diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFHTTPCookieStoreHostApi.h b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFHTTPCookieStoreHostApi.h deleted file mode 100644 index bb2adfb1936..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFHTTPCookieStoreHostApi.h +++ /dev/null @@ -1,25 +0,0 @@ -// 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 - -#if TARGET_OS_OSX -#import -#else -#import -#endif - -#import "FWFGeneratedWebKitApis.h" -#import "FWFInstanceManager.h" - -NS_ASSUME_NONNULL_BEGIN - -/// Host api implementation for WKHTTPCookieStore. -/// -/// Handles creating WKHTTPCookieStore that intercommunicate with a paired Dart object. -@interface FWFHTTPCookieStoreHostApiImpl : NSObject -- (instancetype)initWithInstanceManager:(FWFInstanceManager *)instanceManager; -@end - -NS_ASSUME_NONNULL_END diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFInstanceManager.h b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFInstanceManager.h deleted file mode 100644 index f8837059809..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFInstanceManager.h +++ /dev/null @@ -1,84 +0,0 @@ -// 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 - -NS_ASSUME_NONNULL_BEGIN - -typedef void (^FWFOnDeallocCallback)(long identifier); - -/// Maintains instances used to communicate with the corresponding objects in Dart. -/// -/// When an instance is added with an identifier, either can be used to retrieve the other. -/// -/// Added instances are added as a weak reference and a strong reference. When the strong reference -/// is removed with `removeStrongReferenceWithIdentifier:` and the weak reference is deallocated, -/// the `deallocCallback` is made with the instance's identifier. However, if the strong reference -/// is removed and then the identifier is retrieved with the intention to pass the identifier to -/// Dart (e.g. calling `identifierForInstance:identifierWillBePassedToFlutter:` with -/// `identifierWillBePassedToFlutter` set to YES), the strong reference to the instance is -/// recreated. The strong reference will then need to be removed manually again. -/// -/// Accessing and inserting to an InstanceManager is thread safe. -@interface FWFInstanceManager : NSObject -@property(readonly) FWFOnDeallocCallback deallocCallback; -- (instancetype)initWithDeallocCallback:(FWFOnDeallocCallback)callback; - -// TODO(bparrishMines): Pairs should not be able to be overwritten and this feature -// should be replaced with a call to clear the manager in the event of a hot restart. -/// Adds a new instance that was instantiated from Dart. -/// -/// If an instance or identifier has already been added, it will be replaced by the new values. The -/// Dart InstanceManager is considered the source of truth and has the capability to overwrite -/// stored pairs in response to hot restarts. -/// -/// @param instance The instance to be stored. -/// @param instanceIdentifier The identifier to be paired with instance. This value must be >= 0. -- (void)addDartCreatedInstance:(NSObject *)instance withIdentifier:(long)instanceIdentifier; - -/// Adds a new instance that was instantiated from the host platform. -/// -/// @param instance The instance to be stored. -/// @return The unique identifier stored with instance. -- (long)addHostCreatedInstance:(nonnull NSObject *)instance; - -/// Removes `instanceIdentifier` and its associated strongly referenced instance, if present, from -/// the manager. -/// -/// @param instanceIdentifier The identifier paired to an instance. -/// -/// @return The removed instance if the manager contains the given instanceIdentifier, otherwise -/// nil. -- (nullable NSObject *)removeInstanceWithIdentifier:(long)instanceIdentifier; - -/// Retrieves the instance associated with identifier. -/// -/// @param instanceIdentifier The identifier paired to an instance. -/// -/// @return The instance associated with `instanceIdentifier` if the manager contains the value, -/// otherwise nil. -- (nullable NSObject *)instanceForIdentifier:(long)instanceIdentifier; - -/// Retrieves the identifier paired with an instance. -/// -/// If the manager contains `instance`, as a strong or weak reference, the strong reference to -/// `instance` will be recreated and will need to be removed again with -/// `removeInstanceWithIdentifier:`. -/// -/// This method also expects the Dart `InstanceManager` to have, or recreate, a weak reference to -/// the instance the identifier is associated with once it receives it. -/// -/// @param instance An instance that may be stored in the manager. -/// -/// @return The identifier associated with `instance` if the manager contains the value, otherwise -/// NSNotFound. -- (long)identifierWithStrongReferenceForInstance:(nonnull NSObject *)instance; - -/// Returns whether this manager contains the given `instance`. -/// -/// @return Whether this manager contains the given `instance`. -- (BOOL)containsInstance:(nonnull NSObject *)instance; -@end - -NS_ASSUME_NONNULL_END diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFInstanceManager_Test.h b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFInstanceManager_Test.h deleted file mode 100644 index 20d1e4847da..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFInstanceManager_Test.h +++ /dev/null @@ -1,25 +0,0 @@ -// 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 "FWFInstanceManager.h" - -NS_ASSUME_NONNULL_BEGIN - -@interface FWFInstanceManager () -/// The next identifier that will be used for a host-created instance. -@property long nextIdentifier; - -/// The number of instances stored as a strong reference. -/// -/// Added for debugging purposes. -- (NSUInteger)strongInstanceCount; - -/// The number of instances stored as a weak reference. -/// -/// Added for debugging purposes. NSMapTables that store keys or objects as weak reference will be -/// reclaimed nondeterministically. -- (NSUInteger)weakInstanceCount; -@end - -NS_ASSUME_NONNULL_END diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFNavigationDelegateHostApi.h b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFNavigationDelegateHostApi.h deleted file mode 100644 index db1edee310e..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFNavigationDelegateHostApi.h +++ /dev/null @@ -1,44 +0,0 @@ -// 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 -#import - -#if TARGET_OS_OSX -#import -#else -#import -#endif - -#import "FWFGeneratedWebKitApis.h" -#import "FWFInstanceManager.h" -#import "FWFObjectHostApi.h" - -NS_ASSUME_NONNULL_BEGIN - -/// Flutter api implementation for WKNavigationDelegate. -/// -/// Handles making callbacks to Dart for a WKNavigationDelegate. -@interface FWFNavigationDelegateFlutterApiImpl : FWFWKNavigationDelegateFlutterApi -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - instanceManager:(FWFInstanceManager *)instanceManager; -@end - -/// Implementation of WKNavigationDelegate for FWFNavigationDelegateHostApiImpl. -@interface FWFNavigationDelegate : FWFObject -@property(readonly, nonnull, nonatomic) FWFNavigationDelegateFlutterApiImpl *navigationDelegateAPI; - -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - instanceManager:(FWFInstanceManager *)instanceManager; -@end - -/// Host api implementation for WKNavigationDelegate. -/// -/// Handles creating WKNavigationDelegate that intercommunicate with a paired Dart object. -@interface FWFNavigationDelegateHostApiImpl : NSObject -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - instanceManager:(FWFInstanceManager *)instanceManager; -@end - -NS_ASSUME_NONNULL_END diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFObjectHostApi.h b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFObjectHostApi.h deleted file mode 100644 index 8bdc7f6a0c0..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFObjectHostApi.h +++ /dev/null @@ -1,45 +0,0 @@ -// 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. - -#if TARGET_OS_OSX -#import -#else -#import -#endif - -#import "FWFGeneratedWebKitApis.h" -#import "FWFInstanceManager.h" - -NS_ASSUME_NONNULL_BEGIN - -/// Flutter api implementation for NSObject. -/// -/// Handles making callbacks to Dart for an NSObject. -@interface FWFObjectFlutterApiImpl : FWFNSObjectFlutterApi -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - instanceManager:(FWFInstanceManager *)instanceManager; - -- (void)observeValueForObject:(NSObject *)instance - keyPath:(NSString *)keyPath - object:(NSObject *)object - change:(NSDictionary *)change - completion:(void (^)(FlutterError *_Nullable))completion; -@end - -/// Implementation of NSObject for FWFObjectHostApiImpl. -@interface FWFObject : NSObject -@property(readonly, nonnull, nonatomic) FWFObjectFlutterApiImpl *objectApi; - -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - instanceManager:(FWFInstanceManager *)instanceManager; -@end - -/// Host api implementation for NSObject. -/// -/// Handles creating NSObject that intercommunicate with a paired Dart object. -@interface FWFObjectHostApiImpl : NSObject -- (instancetype)initWithInstanceManager:(FWFInstanceManager *)instanceManager; -@end - -NS_ASSUME_NONNULL_END diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFPreferencesHostApi.h b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFPreferencesHostApi.h deleted file mode 100644 index de2b6dd63d5..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFPreferencesHostApi.h +++ /dev/null @@ -1,24 +0,0 @@ -// 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. - -#if TARGET_OS_OSX -#import -#else -#import -#endif -#import - -#import "FWFGeneratedWebKitApis.h" -#import "FWFInstanceManager.h" - -NS_ASSUME_NONNULL_BEGIN - -/// Host api implementation for WKPreferences. -/// -/// Handles creating WKPreferences that intercommunicate with a paired Dart object. -@interface FWFPreferencesHostApiImpl : NSObject -- (instancetype)initWithInstanceManager:(FWFInstanceManager *)instanceManager; -@end - -NS_ASSUME_NONNULL_END diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFScriptMessageHandlerHostApi.h b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFScriptMessageHandlerHostApi.h deleted file mode 100644 index 2e79e40edc5..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFScriptMessageHandlerHostApi.h +++ /dev/null @@ -1,44 +0,0 @@ -// 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 - -#if TARGET_OS_OSX -#import -#else -#import -#endif - -#import "FWFGeneratedWebKitApis.h" -#import "FWFInstanceManager.h" -#import "FWFObjectHostApi.h" - -NS_ASSUME_NONNULL_BEGIN - -/// Flutter api implementation for WKScriptMessageHandler. -/// -/// Handles making callbacks to Dart for a WKScriptMessageHandler. -@interface FWFScriptMessageHandlerFlutterApiImpl : FWFWKScriptMessageHandlerFlutterApi -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - instanceManager:(FWFInstanceManager *)instanceManager; -@end - -/// Implementation of WKScriptMessageHandler for FWFScriptMessageHandlerHostApiImpl. -@interface FWFScriptMessageHandler : FWFObject -@property(readonly, nonnull, nonatomic) - FWFScriptMessageHandlerFlutterApiImpl *scriptMessageHandlerAPI; - -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - instanceManager:(FWFInstanceManager *)instanceManager; -@end - -/// Host api implementation for WKScriptMessageHandler. -/// -/// Handles creating WKScriptMessageHandler that intercommunicate with a paired Dart object. -@interface FWFScriptMessageHandlerHostApiImpl : NSObject -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - instanceManager:(FWFInstanceManager *)instanceManager; -@end - -NS_ASSUME_NONNULL_END diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFScrollViewDelegateHostApi.h b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFScrollViewDelegateHostApi.h deleted file mode 100644 index 5608f79114c..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFScrollViewDelegateHostApi.h +++ /dev/null @@ -1,47 +0,0 @@ -// 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. - -// Using directory structure to remove platform-specific files doesn't work -// well with umbrella headers and module maps, so just no-op the file for -// other platforms instead. -#if TARGET_OS_IOS - -#import -#import -#import "FWFObjectHostApi.h" - -#import "FWFGeneratedWebKitApis.h" -#import "FWFInstanceManager.h" - -NS_ASSUME_NONNULL_BEGIN - -/// Flutter api implementation for UIScrollViewDelegate. -/// -/// Handles making callbacks to Dart for a UIScrollViewDelegate. -@interface FWFScrollViewDelegateFlutterApiImpl : FWFUIScrollViewDelegateFlutterApi - -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - instanceManager:(FWFInstanceManager *)instanceManager; -@end - -/// Implementation of WKUIScrollViewDelegate for FWFUIScrollViewDelegateHostApiImpl. -@interface FWFScrollViewDelegate : FWFObject -@property(readonly, nonnull, nonatomic) FWFScrollViewDelegateFlutterApiImpl *scrollViewDelegateAPI; - -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - instanceManager:(FWFInstanceManager *)instanceManager; - -@end - -/// Host api implementation for UIScrollViewDelegate. -/// -/// Handles creating UIScrollView that intercommunicate with a paired Dart object. -@interface FWFScrollViewDelegateHostApiImpl : NSObject -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - instanceManager:(FWFInstanceManager *)instanceManager; -@end - -NS_ASSUME_NONNULL_END - -#endif diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFScrollViewHostApi.h b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFScrollViewHostApi.h deleted file mode 100644 index 5c65e129c85..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFScrollViewHostApi.h +++ /dev/null @@ -1,25 +0,0 @@ -// 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 - -#if TARGET_OS_OSX -#import -#else -#import -#endif - -#import "FWFGeneratedWebKitApis.h" -#import "FWFInstanceManager.h" - -NS_ASSUME_NONNULL_BEGIN - -/// Host api implementation for UIScrollView. -/// -/// Handles creating UIScrollView that intercommunicate with a paired Dart object. -@interface FWFScrollViewHostApiImpl : NSObject -- (instancetype)initWithInstanceManager:(FWFInstanceManager *)instanceManager; -@end - -NS_ASSUME_NONNULL_END diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFUIDelegateHostApi.h b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFUIDelegateHostApi.h deleted file mode 100644 index f5b52a52acf..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFUIDelegateHostApi.h +++ /dev/null @@ -1,47 +0,0 @@ -// 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 - -#if TARGET_OS_OSX -#import -#else -#import -#endif - -#import "FWFGeneratedWebKitApis.h" -#import "FWFInstanceManager.h" -#import "FWFObjectHostApi.h" -#import "FWFWebViewConfigurationHostApi.h" - -NS_ASSUME_NONNULL_BEGIN - -/// Flutter api implementation for WKUIDelegate. -/// -/// Handles making callbacks to Dart for a WKUIDelegate. -@interface FWFUIDelegateFlutterApiImpl : FWFWKUIDelegateFlutterApi -@property(readonly, nonatomic) - FWFWebViewConfigurationFlutterApiImpl *webViewConfigurationFlutterApi; - -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - instanceManager:(FWFInstanceManager *)instanceManager; -@end - -/// Implementation of WKUIDelegate for FWFUIDelegateHostApiImpl. -@interface FWFUIDelegate : FWFObject -@property(readonly, nonnull, nonatomic) FWFUIDelegateFlutterApiImpl *UIDelegateAPI; - -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - instanceManager:(FWFInstanceManager *)instanceManager; -@end - -/// Host api implementation for WKUIDelegate. -/// -/// Handles creating WKUIDelegate that intercommunicate with a paired Dart object. -@interface FWFUIDelegateHostApiImpl : NSObject -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - instanceManager:(FWFInstanceManager *)instanceManager; -@end - -NS_ASSUME_NONNULL_END diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFUIViewHostApi.h b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFUIViewHostApi.h deleted file mode 100644 index cecd2ec6d3a..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFUIViewHostApi.h +++ /dev/null @@ -1,26 +0,0 @@ -// 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. - -// Using directory structure to remove platform-specific files doesn't work -// well with umbrella headers and module maps, so just no-op the file for -// other platforms instead. -#if TARGET_OS_IOS - -#import - -#import "FWFGeneratedWebKitApis.h" -#import "FWFInstanceManager.h" - -NS_ASSUME_NONNULL_BEGIN - -/// Host api implementation for UIView. -/// -/// Handles creating UIView that intercommunicate with a paired Dart object. -@interface FWFUIViewHostApiImpl : NSObject -- (instancetype)initWithInstanceManager:(FWFInstanceManager *)instanceManager; -@end - -NS_ASSUME_NONNULL_END - -#endif diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFURLAuthenticationChallengeHostApi.h b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFURLAuthenticationChallengeHostApi.h deleted file mode 100644 index 4bc572072b2..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFURLAuthenticationChallengeHostApi.h +++ /dev/null @@ -1,32 +0,0 @@ -// 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 -#import "FWFGeneratedWebKitApis.h" -#import "FWFInstanceManager.h" - -#if TARGET_OS_OSX -#import -#else -#import -#endif - -NS_ASSUME_NONNULL_BEGIN - -/// Flutter API implementation for `NSURLAuthenticationChallenge`. -/// -/// This class may handle instantiating and adding Dart instances that are attached to a native -/// instance or sending callback methods from an overridden native class. -@interface FWFURLAuthenticationChallengeFlutterApiImpl : NSObject -/// The Flutter API used to send messages back to Dart. -@property FWFNSUrlAuthenticationChallengeFlutterApi *api; -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - instanceManager:(FWFInstanceManager *)instanceManager; -/// Sends a message to Dart to create a new Dart instance and add it to the `InstanceManager`. -- (void)createWithInstance:(NSURLAuthenticationChallenge *)instance - protectionSpace:(NSURLProtectionSpace *)protectionSpace - completion:(void (^)(FlutterError *_Nullable))completion; -@end - -NS_ASSUME_NONNULL_END diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFURLCredentialHostApi.h b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFURLCredentialHostApi.h deleted file mode 100644 index 3f731bdcc62..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFURLCredentialHostApi.h +++ /dev/null @@ -1,27 +0,0 @@ -// 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 -#import "FWFDataConverters.h" -#import "FWFGeneratedWebKitApis.h" -#import "FWFInstanceManager.h" - -#if TARGET_OS_OSX -#import -#else -#import -#endif - -NS_ASSUME_NONNULL_BEGIN - -/// Host API implementation for `NSURLCredential`. -/// -/// This class may handle instantiating and adding native object instances that are attached to a -/// Dart instance or method calls on the associated native class or an instance of the class. -@interface FWFURLCredentialHostApiImpl : NSObject -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - instanceManager:(FWFInstanceManager *)instanceManager; -@end - -NS_ASSUME_NONNULL_END diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFURLHostApi.h b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFURLHostApi.h deleted file mode 100644 index 9238f89590b..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFURLHostApi.h +++ /dev/null @@ -1,41 +0,0 @@ -// 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 - -#if TARGET_OS_OSX -#import -#else -#import -#endif - -#import "FWFGeneratedWebKitApis.h" -#import "FWFInstanceManager.h" - -NS_ASSUME_NONNULL_BEGIN - -/// Host API implementation for `NSURL`. -/// -/// This class may handle instantiating and adding native object instances that are attached to a -/// Dart instance or method calls on the associated native class or an instance of the class. -@interface FWFURLHostApiImpl : NSObject -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - instanceManager:(FWFInstanceManager *)instanceManager; -@end - -/// Flutter API implementation for `NSURL`. -/// -/// This class may handle instantiating and adding Dart instances that are attached to a native -/// instance or sending callback methods from an overridden native class. -@interface FWFURLFlutterApiImpl : NSObject -/// The Flutter API used to send messages back to Dart. -@property FWFNSUrlFlutterApi *api; -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - instanceManager:(FWFInstanceManager *)instanceManager; - -/// Sends a message to Dart to create a new Dart instance and add it to the `InstanceManager`. -- (void)create:(NSURL *)instance completion:(void (^)(FlutterError *_Nullable))completion; -@end - -NS_ASSUME_NONNULL_END diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFURLProtectionSpaceHostApi.h b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFURLProtectionSpaceHostApi.h deleted file mode 100644 index f87e09c573e..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFURLProtectionSpaceHostApi.h +++ /dev/null @@ -1,34 +0,0 @@ -// 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 -#import "FWFGeneratedWebKitApis.h" -#import "FWFInstanceManager.h" - -#if TARGET_OS_OSX -#import -#else -#import -#endif - -NS_ASSUME_NONNULL_BEGIN - -/// Flutter API implementation for `NSURLProtectionSpace`. -/// -/// This class may handle instantiating and adding Dart instances that are attached to a native -/// instance or sending callback methods from an overridden native class. -@interface FWFURLProtectionSpaceFlutterApiImpl : NSObject -/// The Flutter API used to send messages back to Dart. -@property FWFNSUrlProtectionSpaceFlutterApi *api; -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - instanceManager:(FWFInstanceManager *)instanceManager; -/// Sends a message to Dart to create a new Dart instance and add it to the `InstanceManager`. -- (void)createWithInstance:(NSURLProtectionSpace *)instance - host:(nullable NSString *)host - realm:(nullable NSString *)realm - authenticationMethod:(nullable NSString *)authenticationMethod - completion:(void (^)(FlutterError *_Nullable))completion; -@end - -NS_ASSUME_NONNULL_END diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFUserContentControllerHostApi.h b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFUserContentControllerHostApi.h deleted file mode 100644 index 0905d3c7543..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFUserContentControllerHostApi.h +++ /dev/null @@ -1,25 +0,0 @@ -// 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 - -#if TARGET_OS_OSX -#import -#else -#import -#endif - -#import "FWFGeneratedWebKitApis.h" -#import "FWFInstanceManager.h" - -NS_ASSUME_NONNULL_BEGIN - -/// Host api implementation for WKUserContentController. -/// -/// Handles creating WKUserContentController that intercommunicate with a paired Dart object. -@interface FWFUserContentControllerHostApiImpl : NSObject -- (instancetype)initWithInstanceManager:(FWFInstanceManager *)instanceManager; -@end - -NS_ASSUME_NONNULL_END diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFWebViewConfigurationHostApi.h b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFWebViewConfigurationHostApi.h deleted file mode 100644 index a5dd32a153b..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFWebViewConfigurationHostApi.h +++ /dev/null @@ -1,46 +0,0 @@ -// 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 - -#if TARGET_OS_OSX -#import -#else -#import -#endif - -#import "FWFGeneratedWebKitApis.h" -#import "FWFInstanceManager.h" -#import "FWFObjectHostApi.h" - -NS_ASSUME_NONNULL_BEGIN - -/// Flutter api implementation for WKWebViewConfiguration. -/// -/// Handles making callbacks to Dart for a WKWebViewConfiguration. -@interface FWFWebViewConfigurationFlutterApiImpl : FWFWKWebViewConfigurationFlutterApi -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - instanceManager:(FWFInstanceManager *)instanceManager; - -- (void)createWithConfiguration:(WKWebViewConfiguration *)configuration - completion:(void (^)(FlutterError *_Nullable))completion; -@end - -/// Implementation of WKWebViewConfiguration for FWFWebViewConfigurationHostApiImpl. -@interface FWFWebViewConfiguration : WKWebViewConfiguration -@property(readonly, nonnull, nonatomic) FWFObjectFlutterApiImpl *objectApi; - -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - instanceManager:(FWFInstanceManager *)instanceManager; -@end - -/// Host api implementation for WKWebViewConfiguration. -/// -/// Handles creating WKWebViewConfiguration that intercommunicate with a paired Dart object. -@interface FWFWebViewConfigurationHostApiImpl : NSObject -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - instanceManager:(FWFInstanceManager *)instanceManager; -@end - -NS_ASSUME_NONNULL_END diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFWebViewFlutterWKWebViewExternalAPI.h b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFWebViewFlutterWKWebViewExternalAPI.h deleted file mode 100644 index e4e6ff3a1de..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFWebViewFlutterWKWebViewExternalAPI.h +++ /dev/null @@ -1,38 +0,0 @@ -// 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 -#import - -#if TARGET_OS_OSX -#import -#else -#import -#endif - -NS_ASSUME_NONNULL_BEGIN - -/// App and package facing native API provided by the `webview_flutter_wkwebview` plugin. -/// -/// This class follows the convention of breaking changes of the Dart API, which means that any -/// changes to the class that are not backwards compatible will only be made with a major version -/// change of the plugin. Native code other than this external API does not follow breaking change -/// conventions, so app or plugin clients should not use any other native APIs. -@interface FWFWebViewFlutterWKWebViewExternalAPI : NSObject -/// Retrieves the `WKWebView` that is associated with `identifier`. -/// -/// See the Dart method `WebKitWebViewController.webViewIdentifier` to get the identifier of an -/// underlying `WKWebView`. -/// -/// @param identifier The associated identifier of the `WebView`. -/// @param registry The plugin registry the `FLTWebViewFlutterPlugin` should belong to. If -/// the registry doesn't contain an attached instance of `FLTWebViewFlutterPlugin`, -/// this method returns nil. -/// @return The `WKWebView` associated with `identifier` or nil if a `WKWebView` instance associated -/// with `identifier` could not be found. -+ (nullable WKWebView *)webViewForIdentifier:(long)identifier - withPluginRegistry:(id)registry; -@end - -NS_ASSUME_NONNULL_END diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFWebViewHostApi.h b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFWebViewHostApi.h deleted file mode 100644 index 2f9f28bea6c..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFWebViewHostApi.h +++ /dev/null @@ -1,54 +0,0 @@ -// 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 - -#if TARGET_OS_OSX -#import -#else -#import -#endif - -#import "FWFGeneratedWebKitApis.h" -#import "FWFInstanceManager.h" -#import "FWFObjectHostApi.h" - -NS_ASSUME_NONNULL_BEGIN - -/// A set of Flutter and Dart assets used by a `FlutterEngine` to initialize execution. -/// -/// Default implementation delegates methods to FlutterDartProject. -@interface FWFAssetManager : NSObject -- (NSString *)lookupKeyForAsset:(NSString *)asset; -@end - -/// Implementation of WKWebView that can be used as a FlutterPlatformView. -@interface FWFWebView : WKWebView -// The macOS platform view API doesn't have a FlutterPlatformView abstraction, -// and uses NSView directly. -#if TARGET_OS_IOS - -#endif -@property(readonly, nonnull, nonatomic) FWFObjectFlutterApiImpl *objectApi; - -- (instancetype)initWithFrame:(CGRect)frame - configuration:(nonnull WKWebViewConfiguration *)configuration - binaryMessenger:(id)binaryMessenger - instanceManager:(FWFInstanceManager *)instanceManager; -@end - -/// Host api implementation for WKWebView. -/// -/// Handles creating WKWebViews that intercommunicate with a paired Dart object. -@interface FWFWebViewHostApiImpl : NSObject -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - instanceManager:(FWFInstanceManager *)instanceManager; - -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - instanceManager:(FWFInstanceManager *)instanceManager - bundle:(NSBundle *)bundle - assetManager:(FWFAssetManager *)assetManager; -@end - -NS_ASSUME_NONNULL_END diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFWebsiteDataStoreHostApi.h b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFWebsiteDataStoreHostApi.h deleted file mode 100644 index a5969e5215b..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFWebsiteDataStoreHostApi.h +++ /dev/null @@ -1,25 +0,0 @@ -// 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 - -#if TARGET_OS_OSX -#import -#else -#import -#endif - -#import "FWFGeneratedWebKitApis.h" -#import "FWFInstanceManager.h" - -NS_ASSUME_NONNULL_BEGIN - -/// Host api implementation for WKWebsiteDataStore. -/// -/// Handles creating WKWebsiteDataStore that intercommunicate with a paired Dart object. -@interface FWFWebsiteDataStoreHostApiImpl : NSObject -- (instancetype)initWithInstanceManager:(FWFInstanceManager *)instanceManager; -@end - -NS_ASSUME_NONNULL_END diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/integration_test/legacy/webview_flutter_test.dart b/packages/webview_flutter/webview_flutter_wkwebview/example/integration_test/legacy/webview_flutter_test.dart index 47c6876d13d..2dbf7504f9a 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/example/integration_test/legacy/webview_flutter_test.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/example/integration_test/legacy/webview_flutter_test.dart @@ -16,8 +16,8 @@ import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:integration_test/integration_test.dart'; import 'package:webview_flutter_platform_interface/src/webview_flutter_platform_interface_legacy.dart'; -import 'package:webview_flutter_wkwebview/src/common/instance_manager.dart'; import 'package:webview_flutter_wkwebview/src/common/weak_reference_utils.dart'; +import 'package:webview_flutter_wkwebview/src/common/web_kit.g.dart'; import 'package:webview_flutter_wkwebview_example/legacy/navigation_decision.dart'; import 'package:webview_flutter_wkwebview_example/legacy/navigation_request.dart'; import 'package:webview_flutter_wkwebview_example/legacy/web_view.dart'; @@ -79,7 +79,7 @@ Future main() async { 'withWeakRefenceTo allows encapsulating class to be garbage collected', (WidgetTester tester) async { final Completer gcCompleter = Completer(); - final InstanceManager instanceManager = InstanceManager( + final PigeonInstanceManager instanceManager = PigeonInstanceManager( onWeakReferenceRemoved: gcCompleter.complete, ); @@ -340,162 +340,139 @@ Future main() async { }); group('Video playback policy', () { - late String videoTestBase64; - setUpAll(() async { - final ByteData videoData = - await rootBundle.load('assets/sample_video.mp4'); - final String base64VideoData = - base64Encode(Uint8List.view(videoData.buffer)); - final String videoTest = ''' - - Video auto play - - - - - - - '''; - videoTestBase64 = base64Encode(const Utf8Encoder().convert(videoTest)); - }); - - testWidgets('Auto media playback', (WidgetTester tester) async { - Completer controllerCompleter = - Completer(); - Completer pageLoaded = Completer(); + testWidgets( + 'Auto media playback', + (WidgetTester tester) async { + final String videoTestBase64 = await getTestVideoBase64(); + Completer controllerCompleter = + Completer(); + Completer pageLoaded = Completer(); - await tester.pumpWidget( - Directionality( - textDirection: TextDirection.ltr, - child: WebView( - key: GlobalKey(), - initialUrl: 'data:text/html;charset=utf-8;base64,$videoTestBase64', - onWebViewCreated: (WebViewController controller) { - controllerCompleter.complete(controller); - }, - javascriptMode: JavascriptMode.unrestricted, - onPageFinished: (String url) { - pageLoaded.complete(null); - }, - initialMediaPlaybackPolicy: AutoMediaPlaybackPolicy.always_allow, + await tester.pumpWidget( + Directionality( + textDirection: TextDirection.ltr, + child: WebView( + key: GlobalKey(), + initialUrl: + 'data:text/html;charset=utf-8;base64,$videoTestBase64', + onWebViewCreated: (WebViewController controller) { + controllerCompleter.complete(controller); + }, + javascriptMode: JavascriptMode.unrestricted, + onPageFinished: (String url) { + pageLoaded.complete(null); + }, + initialMediaPlaybackPolicy: AutoMediaPlaybackPolicy.always_allow, + ), ), - ), - ); - WebViewController controller = await controllerCompleter.future; - await pageLoaded.future; + ); + WebViewController controller = await controllerCompleter.future; + await pageLoaded.future; - String isPaused = - await controller.runJavascriptReturningResult('isPaused();'); - expect(isPaused, _webviewBool(false)); + String isPaused = + await controller.runJavascriptReturningResult('isPaused();'); + expect(isPaused, _webviewBool(false)); - controllerCompleter = Completer(); - pageLoaded = Completer(); + controllerCompleter = Completer(); + pageLoaded = Completer(); - // We change the key to re-create a new webview as we change the initialMediaPlaybackPolicy - await tester.pumpWidget( - Directionality( - textDirection: TextDirection.ltr, - child: WebView( - key: GlobalKey(), - initialUrl: 'data:text/html;charset=utf-8;base64,$videoTestBase64', - onWebViewCreated: (WebViewController controller) { - controllerCompleter.complete(controller); - }, - javascriptMode: JavascriptMode.unrestricted, - onPageFinished: (String url) { - pageLoaded.complete(null); - }, + // We change the key to re-create a new webview as we change the initialMediaPlaybackPolicy + await tester.pumpWidget( + Directionality( + textDirection: TextDirection.ltr, + child: WebView( + key: GlobalKey(), + initialUrl: + 'data:text/html;charset=utf-8;base64,$videoTestBase64', + onWebViewCreated: (WebViewController controller) { + controllerCompleter.complete(controller); + }, + javascriptMode: JavascriptMode.unrestricted, + onPageFinished: (String url) { + pageLoaded.complete(null); + }, + ), ), - ), - ); + ); - controller = await controllerCompleter.future; - await pageLoaded.future; + controller = await controllerCompleter.future; + await pageLoaded.future; - isPaused = await controller.runJavascriptReturningResult('isPaused();'); - expect(isPaused, _webviewBool(true)); - }); + isPaused = await controller.runJavascriptReturningResult('isPaused();'); + expect(isPaused, _webviewBool(true)); + }, + // Flakes on iOS: https://github.com/flutter/flutter/issues/164632 + skip: Platform.isIOS, + ); - testWidgets('Changes to initialMediaPlaybackPolicy are ignored', - (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); - Completer pageLoaded = Completer(); + testWidgets( + 'Changes to initialMediaPlaybackPolicy are ignored', + (WidgetTester tester) async { + final String videoTestBase64 = await getTestVideoBase64(); + final Completer controllerCompleter = + Completer(); + Completer pageLoaded = Completer(); - final GlobalKey key = GlobalKey(); - await tester.pumpWidget( - Directionality( - textDirection: TextDirection.ltr, - child: WebView( - key: key, - initialUrl: 'data:text/html;charset=utf-8;base64,$videoTestBase64', - onWebViewCreated: (WebViewController controller) { - controllerCompleter.complete(controller); - }, - javascriptMode: JavascriptMode.unrestricted, - onPageFinished: (String url) { - pageLoaded.complete(null); - }, - initialMediaPlaybackPolicy: AutoMediaPlaybackPolicy.always_allow, + final GlobalKey key = GlobalKey(); + await tester.pumpWidget( + Directionality( + textDirection: TextDirection.ltr, + child: WebView( + key: key, + initialUrl: + 'data:text/html;charset=utf-8;base64,$videoTestBase64', + onWebViewCreated: (WebViewController controller) { + controllerCompleter.complete(controller); + }, + javascriptMode: JavascriptMode.unrestricted, + onPageFinished: (String url) { + pageLoaded.complete(null); + }, + initialMediaPlaybackPolicy: AutoMediaPlaybackPolicy.always_allow, + ), ), - ), - ); - final WebViewController controller = await controllerCompleter.future; - await pageLoaded.future; + ); + final WebViewController controller = await controllerCompleter.future; + await pageLoaded.future; - String isPaused = - await controller.runJavascriptReturningResult('isPaused();'); - expect(isPaused, _webviewBool(false)); + String isPaused = + await controller.runJavascriptReturningResult('isPaused();'); + expect(isPaused, _webviewBool(false)); - pageLoaded = Completer(); + pageLoaded = Completer(); - await tester.pumpWidget( - Directionality( - textDirection: TextDirection.ltr, - child: WebView( - key: key, - initialUrl: 'data:text/html;charset=utf-8;base64,$videoTestBase64', - onWebViewCreated: (WebViewController controller) { - controllerCompleter.complete(controller); - }, - javascriptMode: JavascriptMode.unrestricted, - onPageFinished: (String url) { - pageLoaded.complete(null); - }, + await tester.pumpWidget( + Directionality( + textDirection: TextDirection.ltr, + child: WebView( + key: key, + initialUrl: + 'data:text/html;charset=utf-8;base64,$videoTestBase64', + onWebViewCreated: (WebViewController controller) { + controllerCompleter.complete(controller); + }, + javascriptMode: JavascriptMode.unrestricted, + onPageFinished: (String url) { + pageLoaded.complete(null); + }, + ), ), - ), - ); + ); - await controller.reload(); + await controller.reload(); - await pageLoaded.future; + await pageLoaded.future; - isPaused = await controller.runJavascriptReturningResult('isPaused();'); - expect(isPaused, _webviewBool(false)); - }); + isPaused = await controller.runJavascriptReturningResult('isPaused();'); + expect(isPaused, _webviewBool(false)); + }, + // Flakes on iOS: https://github.com/flutter/flutter/issues/164632 + skip: Platform.isIOS, + ); testWidgets('Video plays inline when allowsInlineMediaPlayback is true', (WidgetTester tester) async { + final String videoTestBase64 = await getTestVideoBase64(); final Completer controllerCompleter = Completer(); final Completer pageLoaded = Completer(); @@ -547,6 +524,7 @@ Future main() async { testWidgets( 'Video plays full screen when allowsInlineMediaPlayback is false', (WidgetTester tester) async { + final String videoTestBase64 = await getTestVideoBase64(); final Completer controllerCompleter = Completer(); final Completer pageLoaded = Completer(); @@ -1201,13 +1179,13 @@ Future main() async { ); } -// JavaScript booleans evaluate to different string values on Android and iOS. -// This utility method returns the string boolean value of the current platform. -String _webviewBool(bool value) { - if (defaultTargetPlatform == TargetPlatform.iOS) { - return value ? '1' : '0'; +// JavaScript booleans evaluate to different string values on different devices. +// This utility method returns a matcher that match on either representation. +Matcher _webviewBool(bool value) { + if (value) { + return anyOf('true', '1'); } - return value ? 'true' : 'false'; + return anyOf('false', '0'); } /// Returns the value used for the HTTP User-Agent: request header in subsequent HTTP requests. @@ -1287,13 +1265,14 @@ class ResizableWebViewState extends State { } } -class CopyableObjectWithCallback with Copyable { +class CopyableObjectWithCallback extends PigeonInternalProxyApiBaseClass { CopyableObjectWithCallback(this.callback); final VoidCallback callback; @override - CopyableObjectWithCallback copy() { + // ignore: non_constant_identifier_names + CopyableObjectWithCallback pigeon_copy() { return CopyableObjectWithCallback(callback); } } @@ -1316,3 +1295,39 @@ class ClassWithCallbackClass { late final CopyableObjectWithCallback callbackClass; } + +Future getTestVideoBase64() async { + final ByteData videoData = await rootBundle.load('assets/sample_video.mp4'); + final String base64VideoData = base64Encode(Uint8List.view(videoData.buffer)); + final String videoTest = ''' + + Video auto play + + + + + + + '''; + return base64Encode(const Utf8Encoder().convert(videoTest)); +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/integration_test/webview_flutter_test.dart b/packages/webview_flutter/webview_flutter_wkwebview/example/integration_test/webview_flutter_test.dart index 7ca004d4078..42d66dcf35a 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/example/integration_test/webview_flutter_test.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/example/integration_test/webview_flutter_test.dart @@ -16,9 +16,10 @@ import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:integration_test/integration_test.dart'; import 'package:webview_flutter_platform_interface/webview_flutter_platform_interface.dart'; -import 'package:webview_flutter_wkwebview/src/common/instance_manager.dart'; +import 'package:webview_flutter_wkwebview/src/common/platform_webview.dart'; import 'package:webview_flutter_wkwebview/src/common/weak_reference_utils.dart'; -import 'package:webview_flutter_wkwebview/src/web_kit/web_kit.dart'; +import 'package:webview_flutter_wkwebview/src/common/web_kit.g.dart'; +import 'package:webview_flutter_wkwebview/src/webkit_proxy.dart'; import 'package:webview_flutter_wkwebview/webview_flutter_wkwebview.dart'; Future main() async { @@ -59,7 +60,7 @@ Future main() async { 'withWeakReferenceTo allows encapsulating class to be garbage collected', (WidgetTester tester) async { final Completer gcCompleter = Completer(); - final InstanceManager instanceManager = InstanceManager( + final PigeonInstanceManager instanceManager = PigeonInstanceManager( onWeakReferenceRemoved: gcCompleter.complete, ); @@ -83,48 +84,58 @@ Future main() async { testWidgets( 'WKWebView is released by garbage collection', (WidgetTester tester) async { - bool aWebViewHasBeenGarbageCollected = false; - - late final InstanceManager instanceManager; - instanceManager = - InstanceManager(onWeakReferenceRemoved: (int identifier) { - if (!aWebViewHasBeenGarbageCollected) { - final Copyable instance = - instanceManager.getInstanceWithWeakReference(identifier)!; - if (instance is WKWebView) { - aWebViewHasBeenGarbageCollected = true; - } + final Completer webViewGCCompleter = Completer(); + + const int webViewToken = -1; + final Finalizer finalizer = Finalizer((int token) { + if (token == webViewToken) { + webViewGCCompleter.complete(); } }); // Wait for any WebView to be garbage collected. - while (!aWebViewHasBeenGarbageCollected) { - await tester.pumpWidget( - Builder( - builder: (BuildContext context) { - return PlatformWebViewWidget( - WebKitWebViewWidgetCreationParams( - instanceManager: instanceManager, - controller: PlatformWebViewController( - WebKitWebViewControllerCreationParams( - instanceManager: instanceManager, - ), + await tester.pumpWidget( + Builder( + builder: (BuildContext context) { + return PlatformWebViewWidget( + WebKitWebViewWidgetCreationParams( + controller: PlatformWebViewController( + WebKitWebViewControllerCreationParams( + webKitProxy: WebKitProxy(newPlatformWebView: ({ + required WKWebViewConfiguration initialConfiguration, + void Function( + NSObject, + String?, + NSObject?, + Map?, + )? observeValue, + }) { + final PlatformWebView platformWebView = PlatformWebView( + initialConfiguration: initialConfiguration, + ); + finalizer.attach( + platformWebView.nativeWebView, + webViewToken, + ); + return platformWebView; + }), ), ), - ).build(context); - }, - ), - ); - await tester.pumpAndSettle(); + ), + ).build(context); + }, + ), + ); + await tester.pumpAndSettle(); + await tester.pumpWidget(Container()); - await tester.pumpWidget(Container()); + // Force garbage collection. + await IntegrationTestWidgetsFlutterBinding.instance + .watchPerformance(() async { + await tester.pumpAndSettle(); + }); - // Force garbage collection. - await IntegrationTestWidgetsFlutterBinding.instance - .watchPerformance(() async { - await tester.pumpAndSettle(); - }); - } + await expectLater(webViewGCCompleter.future, completes); }, timeout: const Timeout(Duration(seconds: 30)), ); @@ -267,6 +278,47 @@ Future main() async { await expectLater(channelCompleter.future, completion('hello')); }); + testWidgets('JavaScriptChannel can receive undefined', + (WidgetTester tester) async { + final Completer pageFinished = Completer(); + final PlatformWebViewController controller = PlatformWebViewController( + const PlatformWebViewControllerCreationParams(), + ); + unawaited(controller.setJavaScriptMode(JavaScriptMode.unrestricted)); + final PlatformNavigationDelegate delegate = PlatformNavigationDelegate( + const PlatformNavigationDelegateCreationParams(), + ); + unawaited(delegate.setOnPageFinished((_) => pageFinished.complete())); + unawaited(controller.setPlatformNavigationDelegate(delegate)); + + final Completer channelCompleter = Completer(); + await controller.addJavaScriptChannel( + JavaScriptChannelParams( + name: 'Channel', + onMessageReceived: (JavaScriptMessage message) { + channelCompleter.complete(message.message); + }, + ), + ); + + await controller.loadHtmlString( + 'data:text/html;charset=utf-8;base64,PCFET0NUWVBFIGh0bWw+', + ); + + await tester.pumpWidget(Builder( + builder: (BuildContext context) { + return PlatformWebViewWidget( + PlatformWebViewWidgetCreationParams(controller: controller), + ).build(context); + }, + )); + + await pageFinished.future; + + await controller.runJavaScript('Channel.postMessage(undefined);'); + await expectLater(channelCompleter.future, completion('(null)')); + }); + testWidgets('resize webview', (WidgetTester tester) async { final Completer buttonTapResizeCompleter = Completer(); final Completer onPageFinished = Completer(); @@ -331,46 +383,8 @@ Future main() async { }); group('Video playback policy', () { - late String videoTestBase64; - setUpAll(() async { - final ByteData videoData = - await rootBundle.load('assets/sample_video.mp4'); - final String base64VideoData = - base64Encode(Uint8List.view(videoData.buffer)); - final String videoTest = ''' - - Video auto play - - - - - - - '''; - videoTestBase64 = base64Encode(const Utf8Encoder().convert(videoTest)); - }); - testWidgets('Auto media playback', (WidgetTester tester) async { + final String videoTestBase64 = await getTestVideoBase64(); Completer pageLoaded = Completer(); WebKitWebViewController controller = WebKitWebViewController( @@ -443,6 +457,7 @@ Future main() async { testWidgets('Video plays inline when allowsInlineMediaPlayback is true', (WidgetTester tester) async { + final String videoTestBase64 = await getTestVideoBase64(); final Completer pageLoaded = Completer(); final Completer videoPlaying = Completer(); @@ -502,6 +517,7 @@ Future main() async { testWidgets( 'Video plays full screen when allowsInlineMediaPlayback is false', (WidgetTester tester) async { + final String videoTestBase64 = await getTestVideoBase64(); final Completer pageLoaded = Completer(); final Completer videoPlaying = Completer(); @@ -1684,13 +1700,14 @@ class ResizableWebViewState extends State { } } -class CopyableObjectWithCallback with Copyable { +class CopyableObjectWithCallback extends PigeonInternalProxyApiBaseClass { CopyableObjectWithCallback(this.callback); final VoidCallback callback; @override - CopyableObjectWithCallback copy() { + // ignore: non_constant_identifier_names + CopyableObjectWithCallback pigeon_copy() { return CopyableObjectWithCallback(callback); } } @@ -1713,3 +1730,39 @@ class ClassWithCallbackClass { late final CopyableObjectWithCallback callbackClass; } + +Future getTestVideoBase64() async { + final ByteData videoData = await rootBundle.load('assets/sample_video.mp4'); + final String base64VideoData = base64Encode(Uint8List.view(videoData.buffer)); + final String videoTest = ''' + + Video auto play + + + + + + + '''; + return base64Encode(const Utf8Encoder().convert(videoTest)); +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/Flutter/Debug.xcconfig b/packages/webview_flutter/webview_flutter_wkwebview/example/ios/Flutter/Debug.xcconfig index e8efba11468..ec97fc6f302 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/Flutter/Debug.xcconfig +++ b/packages/webview_flutter/webview_flutter_wkwebview/example/ios/Flutter/Debug.xcconfig @@ -1,2 +1,2 @@ -#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/Flutter/Release.xcconfig b/packages/webview_flutter/webview_flutter_wkwebview/example/ios/Flutter/Release.xcconfig index 399e9340e6f..c4855bfe200 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/Flutter/Release.xcconfig +++ b/packages/webview_flutter/webview_flutter_wkwebview/example/ios/Flutter/Release.xcconfig @@ -1,2 +1,2 @@ -#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" 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 e1dd7698669..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 @@ -7,37 +7,47 @@ objects = { /* Begin PBXBuildFile section */ - 1096EF442A6BD9DB000CBDF7 /* FWFScrollViewDelegateHostApiTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1096EF432A6BD9DB000CBDF7 /* FWFScrollViewDelegateHostApiTests.m */; }; 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 4047B3FE2C3DEE8500A8BA05 /* OCMock in Frameworks */ = {isa = PBXBuildFile; productRef = 4047B3FD2C3DEE8500A8BA05 /* OCMock */; }; - 8F4FF949299ADC2D000A6586 /* FWFWebViewFlutterWKWebViewExternalAPITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8F4FF948299ADC2D000A6586 /* FWFWebViewFlutterWKWebViewExternalAPITests.m */; }; - 8F4FF94B29AC223F000A6586 /* FWFURLTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8F4FF94A29AC223F000A6586 /* FWFURLTests.m */; }; - 8F562F902A56C02D00C2BED6 /* FWFURLCredentialHostApiTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8F562F8F2A56C02D00C2BED6 /* FWFURLCredentialHostApiTests.m */; }; - 8F562F922A56C04F00C2BED6 /* FWFURLProtectionSpaceHostApiTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8F562F912A56C04F00C2BED6 /* FWFURLProtectionSpaceHostApiTests.m */; }; - 8F562F942A56C07B00C2BED6 /* FWFURLAuthenticationChallengeHostApiTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8F562F932A56C07B00C2BED6 /* FWFURLAuthenticationChallengeHostApiTests.m */; }; - 8F78EAAA2A02CB9100C2E520 /* FWFErrorTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8F78EAA92A02CB9100C2E520 /* FWFErrorTests.m */; }; - 8FA6A87928062CD000A4B183 /* FWFInstanceManagerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8FA6A87828062CD000A4B183 /* FWFInstanceManagerTests.m */; }; - 8FB79B5328134C3100C101D3 /* FWFWebViewHostApiTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8FB79B5228134C3100C101D3 /* FWFWebViewHostApiTests.m */; }; - 8FB79B55281B24F600C101D3 /* FWFDataConvertersTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8FB79B54281B24F600C101D3 /* FWFDataConvertersTests.m */; }; - 8FB79B672820453400C101D3 /* FWFHTTPCookieStoreHostApiTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8FB79B662820453400C101D3 /* FWFHTTPCookieStoreHostApiTests.m */; }; - 8FB79B6928204E8700C101D3 /* FWFPreferencesHostApiTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8FB79B6828204E8700C101D3 /* FWFPreferencesHostApiTests.m */; }; - 8FB79B6B28204EE500C101D3 /* FWFWebsiteDataStoreHostApiTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8FB79B6A28204EE500C101D3 /* FWFWebsiteDataStoreHostApiTests.m */; }; - 8FB79B6D2820533B00C101D3 /* FWFWebViewConfigurationHostApiTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8FB79B6C2820533B00C101D3 /* FWFWebViewConfigurationHostApiTests.m */; }; - 8FB79B73282096B500C101D3 /* FWFScriptMessageHandlerHostApiTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8FB79B72282096B500C101D3 /* FWFScriptMessageHandlerHostApiTests.m */; }; - 8FB79B7928209D1300C101D3 /* FWFUserContentControllerHostApiTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8FB79B7828209D1300C101D3 /* FWFUserContentControllerHostApiTests.m */; }; - 8FB79B832820A39300C101D3 /* FWFNavigationDelegateHostApiTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8FB79B822820A39300C101D3 /* FWFNavigationDelegateHostApiTests.m */; }; - 8FB79B852820A3A400C101D3 /* FWFUIDelegateHostApiTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8FB79B842820A3A400C101D3 /* FWFUIDelegateHostApiTests.m */; }; - 8FB79B8F2820BAB300C101D3 /* FWFScrollViewHostApiTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8FB79B8E2820BAB300C101D3 /* FWFScrollViewHostApiTests.m */; }; - 8FB79B912820BAC700C101D3 /* FWFUIViewHostApiTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8FB79B902820BAC700C101D3 /* FWFUIViewHostApiTests.m */; }; - 8FB79B972821985200C101D3 /* FWFObjectHostApiTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8FB79B962821985200C101D3 /* FWFObjectHostApiTests.m */; }; + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; }; + 8F1488E22D2DE27000191744 /* ScriptMessageHandlerProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F1488D02D2DE27000191744 /* ScriptMessageHandlerProxyAPITests.swift */; }; + 8F1488E32D2DE27000191744 /* TestProxyApiRegistrar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F1488D62D2DE27000191744 /* TestProxyApiRegistrar.swift */; }; + 8F1488E42D2DE27000191744 /* URLRequestProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F1488DC2D2DE27000191744 /* URLRequestProxyAPITests.swift */; }; + 8F1488E52D2DE27000191744 /* TestBinaryMessenger.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F1488D52D2DE27000191744 /* TestBinaryMessenger.swift */; }; + 8F1488E62D2DE27000191744 /* WebViewProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F1488E12D2DE27000191744 /* WebViewProxyAPITests.swift */; }; + 8F1488E72D2DE27000191744 /* HTTPCookieStoreProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F1488C92D2DE27000191744 /* HTTPCookieStoreProxyAPITests.swift */; }; + 8F1488E82D2DE27000191744 /* ScriptMessageProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F1488D12D2DE27000191744 /* ScriptMessageProxyAPITests.swift */; }; + 8F1488E92D2DE27000191744 /* UIViewProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F1488D82D2DE27000191744 /* UIViewProxyAPITests.swift */; }; + 8F1488EA2D2DE27000191744 /* SecurityOriginProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F1488D42D2DE27000191744 /* SecurityOriginProxyAPITests.swift */; }; + 8F1488EB2D2DE27000191744 /* PreferencesProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F1488CF2D2DE27000191744 /* PreferencesProxyAPITests.swift */; }; + 8F1488EC2D2DE27000191744 /* FrameInfoProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F1488C62D2DE27000191744 /* FrameInfoProxyAPITests.swift */; }; + 8F1488ED2D2DE27000191744 /* ErrorProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F1488C52D2DE27000191744 /* ErrorProxyAPITests.swift */; }; + 8F1488EE2D2DE27000191744 /* NSObjectProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F1488CE2D2DE27000191744 /* NSObjectProxyAPITests.swift */; }; + 8F1488EF2D2DE27000191744 /* NavigationResponseProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F1488CD2D2DE27000191744 /* NavigationResponseProxyAPITests.swift */; }; + 8F1488F02D2DE27000191744 /* UserScriptProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F1488DE2D2DE27000191744 /* UserScriptProxyAPITests.swift */; }; + 8F1488F12D2DE27000191744 /* URLProtectionSpaceProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F1488DB2D2DE27000191744 /* URLProtectionSpaceProxyAPITests.swift */; }; + 8F1488F22D2DE27000191744 /* WebViewConfigurationProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F1488E02D2DE27000191744 /* WebViewConfigurationProxyAPITests.swift */; }; + 8F1488F32D2DE27000191744 /* WebsiteDataStoreProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F1488DF2D2DE27000191744 /* WebsiteDataStoreProxyAPITests.swift */; }; + 8F1488F42D2DE27000191744 /* URLCredentialProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F1488DA2D2DE27000191744 /* URLCredentialProxyAPITests.swift */; }; + 8F1488F52D2DE27000191744 /* URLAuthenticationChallengeProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F1488D92D2DE27000191744 /* URLAuthenticationChallengeProxyAPITests.swift */; }; + 8F1488F62D2DE27000191744 /* NavigationDelegateProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F1488CC2D2DE27000191744 /* NavigationDelegateProxyAPITests.swift */; }; + 8F1488F72D2DE27000191744 /* UIDelegateProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F1488D72D2DE27000191744 /* UIDelegateProxyAPITests.swift */; }; + 8F1488F82D2DE27000191744 /* ScrollViewDelegateProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F1488D22D2DE27000191744 /* ScrollViewDelegateProxyAPITests.swift */; }; + 8F1488FA2D2DE27000191744 /* FWFWebViewFlutterWKWebViewExternalAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F1488C72D2DE27000191744 /* FWFWebViewFlutterWKWebViewExternalAPITests.swift */; }; + 8F1488FB2D2DE27000191744 /* UserContentControllerProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F1488DD2D2DE27000191744 /* UserContentControllerProxyAPITests.swift */; }; + 8F1488FC2D2DE27000191744 /* HTTPURLResponseProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F1488CA2D2DE27000191744 /* HTTPURLResponseProxyAPITests.swift */; }; + 8F1488FD2D2DE27000191744 /* ScrollViewProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F1488D32D2DE27000191744 /* ScrollViewProxyAPITests.swift */; }; + 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 */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; - D7587C3652F6906210B3AE88 /* libPods-RunnerTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 17781D9462A1AEA7C99F8E45 /* libPods-RunnerTests.a */; }; - DAF0E91266956134538CC667 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 572FFC2B2BA326B420B22679 /* libPods-Runner.a */; }; + A1C354B092678F5A3DF18D01 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 185E08CFEB8AE9D939566DE6 /* libPods-Runner.a */; }; F7151F77266057800028CB91 /* FLTWebViewUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = F7151F76266057800028CB91 /* FLTWebViewUITests.m */; }; /* End PBXBuildFile section */ @@ -72,39 +82,51 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 1096EF432A6BD9DB000CBDF7 /* FWFScrollViewDelegateHostApiTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = FWFScrollViewDelegateHostApiTests.m; path = ../../darwin/Tests/FWFScrollViewDelegateHostApiTests.m; sourceTree = SOURCE_ROOT; }; 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 17781D9462A1AEA7C99F8E45 /* libPods-RunnerTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RunnerTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 2286ACB87EA8CA27E739AD6C /* 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 = ""; }; - 39B2BDAA45DC06EAB8A6C4E7 /* 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 = ""; }; + 14B8C759112CB6E8AA62F003 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + 185E08CFEB8AE9D939566DE6 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 572FFC2B2BA326B420B22679 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 4AA20286555659E34ACB3BE5 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + 56443D345A163E3A65320207 /* 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 = ""; }; + 573E8F1472CA1578A7CBDB63 /* libPods-RunnerTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RunnerTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 68BDCAE923C3F7CB00D9C032 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 68BDCAED23C3F7CB00D9C032 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - 8F4FF948299ADC2D000A6586 /* FWFWebViewFlutterWKWebViewExternalAPITests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FWFWebViewFlutterWKWebViewExternalAPITests.m; path = ../../darwin/Tests/FWFWebViewFlutterWKWebViewExternalAPITests.m; sourceTree = SOURCE_ROOT; }; - 8F4FF94A29AC223F000A6586 /* FWFURLTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = FWFURLTests.m; path = ../../darwin/Tests/FWFURLTests.m; sourceTree = SOURCE_ROOT; }; - 8F562F8F2A56C02D00C2BED6 /* FWFURLCredentialHostApiTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = FWFURLCredentialHostApiTests.m; path = ../../darwin/Tests/FWFURLCredentialHostApiTests.m; sourceTree = SOURCE_ROOT; }; - 8F562F912A56C04F00C2BED6 /* FWFURLProtectionSpaceHostApiTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = FWFURLProtectionSpaceHostApiTests.m; path = ../../darwin/Tests/FWFURLProtectionSpaceHostApiTests.m; sourceTree = SOURCE_ROOT; }; - 8F562F932A56C07B00C2BED6 /* FWFURLAuthenticationChallengeHostApiTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = FWFURLAuthenticationChallengeHostApiTests.m; path = ../../darwin/Tests/FWFURLAuthenticationChallengeHostApiTests.m; sourceTree = SOURCE_ROOT; }; - 8F78EAA92A02CB9100C2E520 /* FWFErrorTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = FWFErrorTests.m; path = ../../darwin/Tests/FWFErrorTests.m; sourceTree = SOURCE_ROOT; }; - 8FA6A87828062CD000A4B183 /* FWFInstanceManagerTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = FWFInstanceManagerTests.m; path = ../../darwin/Tests/FWFInstanceManagerTests.m; sourceTree = SOURCE_ROOT; }; - 8FB79B5228134C3100C101D3 /* FWFWebViewHostApiTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = FWFWebViewHostApiTests.m; path = ../../darwin/Tests/FWFWebViewHostApiTests.m; sourceTree = SOURCE_ROOT; }; - 8FB79B54281B24F600C101D3 /* FWFDataConvertersTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = FWFDataConvertersTests.m; path = ../../darwin/Tests/FWFDataConvertersTests.m; sourceTree = SOURCE_ROOT; }; - 8FB79B662820453400C101D3 /* FWFHTTPCookieStoreHostApiTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = FWFHTTPCookieStoreHostApiTests.m; path = ../../darwin/Tests/FWFHTTPCookieStoreHostApiTests.m; sourceTree = SOURCE_ROOT; }; - 8FB79B6828204E8700C101D3 /* FWFPreferencesHostApiTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = FWFPreferencesHostApiTests.m; path = ../../darwin/Tests/FWFPreferencesHostApiTests.m; sourceTree = SOURCE_ROOT; }; - 8FB79B6A28204EE500C101D3 /* FWFWebsiteDataStoreHostApiTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = FWFWebsiteDataStoreHostApiTests.m; path = ../../darwin/Tests/FWFWebsiteDataStoreHostApiTests.m; sourceTree = SOURCE_ROOT; }; - 8FB79B6C2820533B00C101D3 /* FWFWebViewConfigurationHostApiTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = FWFWebViewConfigurationHostApiTests.m; path = ../../darwin/Tests/FWFWebViewConfigurationHostApiTests.m; sourceTree = SOURCE_ROOT; }; - 8FB79B72282096B500C101D3 /* FWFScriptMessageHandlerHostApiTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = FWFScriptMessageHandlerHostApiTests.m; path = ../../darwin/Tests/FWFScriptMessageHandlerHostApiTests.m; sourceTree = SOURCE_ROOT; }; - 8FB79B7828209D1300C101D3 /* FWFUserContentControllerHostApiTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = FWFUserContentControllerHostApiTests.m; path = ../../darwin/Tests/FWFUserContentControllerHostApiTests.m; sourceTree = SOURCE_ROOT; }; - 8FB79B822820A39300C101D3 /* FWFNavigationDelegateHostApiTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = FWFNavigationDelegateHostApiTests.m; path = ../../darwin/Tests/FWFNavigationDelegateHostApiTests.m; sourceTree = SOURCE_ROOT; }; - 8FB79B842820A3A400C101D3 /* FWFUIDelegateHostApiTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = FWFUIDelegateHostApiTests.m; path = ../../darwin/Tests/FWFUIDelegateHostApiTests.m; sourceTree = SOURCE_ROOT; }; - 8FB79B8E2820BAB300C101D3 /* FWFScrollViewHostApiTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = FWFScrollViewHostApiTests.m; path = ../../darwin/Tests/FWFScrollViewHostApiTests.m; sourceTree = SOURCE_ROOT; }; - 8FB79B902820BAC700C101D3 /* FWFUIViewHostApiTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = FWFUIViewHostApiTests.m; path = ../../darwin/Tests/FWFUIViewHostApiTests.m; sourceTree = SOURCE_ROOT; }; - 8FB79B962821985200C101D3 /* FWFObjectHostApiTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = FWFObjectHostApiTests.m; path = ../../darwin/Tests/FWFObjectHostApiTests.m; sourceTree = SOURCE_ROOT; }; + 8F1488C52D2DE27000191744 /* ErrorProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = ErrorProxyAPITests.swift; path = ../../darwin/Tests/ErrorProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; + 8F1488C62D2DE27000191744 /* FrameInfoProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = FrameInfoProxyAPITests.swift; path = ../../darwin/Tests/FrameInfoProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; + 8F1488C72D2DE27000191744 /* FWFWebViewFlutterWKWebViewExternalAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = FWFWebViewFlutterWKWebViewExternalAPITests.swift; path = ../../darwin/Tests/FWFWebViewFlutterWKWebViewExternalAPITests.swift; sourceTree = SOURCE_ROOT; }; + 8F1488C82D2DE27000191744 /* HTTPCookieProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = HTTPCookieProxyAPITests.swift; path = ../../darwin/Tests/HTTPCookieProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; + 8F1488C92D2DE27000191744 /* HTTPCookieStoreProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = HTTPCookieStoreProxyAPITests.swift; path = ../../darwin/Tests/HTTPCookieStoreProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; + 8F1488CA2D2DE27000191744 /* HTTPURLResponseProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = HTTPURLResponseProxyAPITests.swift; path = ../../darwin/Tests/HTTPURLResponseProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; + 8F1488CB2D2DE27000191744 /* NavigationActionProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = NavigationActionProxyAPITests.swift; path = ../../darwin/Tests/NavigationActionProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; + 8F1488CC2D2DE27000191744 /* NavigationDelegateProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = NavigationDelegateProxyAPITests.swift; path = ../../darwin/Tests/NavigationDelegateProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; + 8F1488CD2D2DE27000191744 /* NavigationResponseProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = NavigationResponseProxyAPITests.swift; path = ../../darwin/Tests/NavigationResponseProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; + 8F1488CE2D2DE27000191744 /* NSObjectProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = NSObjectProxyAPITests.swift; path = ../../darwin/Tests/NSObjectProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; + 8F1488CF2D2DE27000191744 /* PreferencesProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = PreferencesProxyAPITests.swift; path = ../../darwin/Tests/PreferencesProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; + 8F1488D02D2DE27000191744 /* ScriptMessageHandlerProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = ScriptMessageHandlerProxyAPITests.swift; path = ../../darwin/Tests/ScriptMessageHandlerProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; + 8F1488D12D2DE27000191744 /* ScriptMessageProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = ScriptMessageProxyAPITests.swift; path = ../../darwin/Tests/ScriptMessageProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; + 8F1488D22D2DE27000191744 /* ScrollViewDelegateProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = ScrollViewDelegateProxyAPITests.swift; path = ../../darwin/Tests/ScrollViewDelegateProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; + 8F1488D32D2DE27000191744 /* ScrollViewProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = ScrollViewProxyAPITests.swift; path = ../../darwin/Tests/ScrollViewProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; + 8F1488D42D2DE27000191744 /* SecurityOriginProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = SecurityOriginProxyAPITests.swift; path = ../../darwin/Tests/SecurityOriginProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; + 8F1488D52D2DE27000191744 /* TestBinaryMessenger.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = TestBinaryMessenger.swift; path = ../../darwin/Tests/TestBinaryMessenger.swift; sourceTree = SOURCE_ROOT; }; + 8F1488D62D2DE27000191744 /* TestProxyApiRegistrar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = TestProxyApiRegistrar.swift; path = ../../darwin/Tests/TestProxyApiRegistrar.swift; sourceTree = SOURCE_ROOT; }; + 8F1488D72D2DE27000191744 /* UIDelegateProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = UIDelegateProxyAPITests.swift; path = ../../darwin/Tests/UIDelegateProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; + 8F1488D82D2DE27000191744 /* UIViewProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = UIViewProxyAPITests.swift; path = ../../darwin/Tests/UIViewProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; + 8F1488D92D2DE27000191744 /* URLAuthenticationChallengeProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = URLAuthenticationChallengeProxyAPITests.swift; path = ../../darwin/Tests/URLAuthenticationChallengeProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; + 8F1488DA2D2DE27000191744 /* URLCredentialProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = URLCredentialProxyAPITests.swift; path = ../../darwin/Tests/URLCredentialProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; + 8F1488DB2D2DE27000191744 /* URLProtectionSpaceProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = URLProtectionSpaceProxyAPITests.swift; path = ../../darwin/Tests/URLProtectionSpaceProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; + 8F1488DC2D2DE27000191744 /* URLRequestProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = URLRequestProxyAPITests.swift; path = ../../darwin/Tests/URLRequestProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; + 8F1488DD2D2DE27000191744 /* UserContentControllerProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = UserContentControllerProxyAPITests.swift; path = ../../darwin/Tests/UserContentControllerProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; + 8F1488DE2D2DE27000191744 /* UserScriptProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = UserScriptProxyAPITests.swift; path = ../../darwin/Tests/UserScriptProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; + 8F1488DF2D2DE27000191744 /* WebsiteDataStoreProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = WebsiteDataStoreProxyAPITests.swift; path = ../../darwin/Tests/WebsiteDataStoreProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; + 8F1488E02D2DE27000191744 /* WebViewConfigurationProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = WebViewConfigurationProxyAPITests.swift; path = ../../darwin/Tests/WebViewConfigurationProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; + 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; }; @@ -113,11 +135,10 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - B89AA31A64040E4A2F1E0CAF /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + C519E1940290A9B5DEBB9BCF /* 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 = ""; }; F7151F74266057800028CB91 /* RunnerUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; F7151F76266057800028CB91 /* FLTWebViewUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FLTWebViewUITests.m; sourceTree = ""; }; F7151F78266057800028CB91 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - F7A1921261392D1CBDAEC2E8 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -125,8 +146,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 4047B3FE2C3DEE8500A8BA05 /* OCMock in Frameworks */, - D7587C3652F6906210B3AE88 /* libPods-RunnerTests.a in Frameworks */, + 904EA421B6925EC8D52ABE1B /* libPods-RunnerTests.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -134,7 +154,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - DAF0E91266956134538CC667 /* libPods-Runner.a in Frameworks */, + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */, + A1C354B092678F5A3DF18D01 /* libPods-Runner.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -148,40 +169,42 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 52FBC2B567345431F81A0A0F /* Frameworks */ = { - isa = PBXGroup; - children = ( - 572FFC2B2BA326B420B22679 /* libPods-Runner.a */, - 17781D9462A1AEA7C99F8E45 /* libPods-RunnerTests.a */, - ); - name = Frameworks; - sourceTree = ""; - }; 68BDCAEA23C3F7CB00D9C032 /* RunnerTests */ = { isa = PBXGroup; children = ( + 8FC45F702D5C0C1E004E03E8 /* WebpagePreferencesProxyAPITests.swift */, + 8F1489002D2DE91C00191744 /* AuthenticationChallengeResponseProxyAPITests.swift */, + 8F1488C52D2DE27000191744 /* ErrorProxyAPITests.swift */, + 8F1488C62D2DE27000191744 /* FrameInfoProxyAPITests.swift */, + 8F1488C72D2DE27000191744 /* FWFWebViewFlutterWKWebViewExternalAPITests.swift */, + 8F1488C82D2DE27000191744 /* HTTPCookieProxyAPITests.swift */, + 8F1488C92D2DE27000191744 /* HTTPCookieStoreProxyAPITests.swift */, + 8F1488CA2D2DE27000191744 /* HTTPURLResponseProxyAPITests.swift */, + 8F1488CB2D2DE27000191744 /* NavigationActionProxyAPITests.swift */, + 8F1488CC2D2DE27000191744 /* NavigationDelegateProxyAPITests.swift */, + 8F1488CD2D2DE27000191744 /* NavigationResponseProxyAPITests.swift */, + 8F1488CE2D2DE27000191744 /* NSObjectProxyAPITests.swift */, + 8F1488CF2D2DE27000191744 /* PreferencesProxyAPITests.swift */, + 8F1488D02D2DE27000191744 /* ScriptMessageHandlerProxyAPITests.swift */, + 8F1488D12D2DE27000191744 /* ScriptMessageProxyAPITests.swift */, + 8F1488D22D2DE27000191744 /* ScrollViewDelegateProxyAPITests.swift */, + 8F1488D32D2DE27000191744 /* ScrollViewProxyAPITests.swift */, + 8F1488D42D2DE27000191744 /* SecurityOriginProxyAPITests.swift */, + 8F1488D52D2DE27000191744 /* TestBinaryMessenger.swift */, + 8F1488D62D2DE27000191744 /* TestProxyApiRegistrar.swift */, + 8F1488D72D2DE27000191744 /* UIDelegateProxyAPITests.swift */, + 8F1488D82D2DE27000191744 /* UIViewProxyAPITests.swift */, + 8F1488D92D2DE27000191744 /* URLAuthenticationChallengeProxyAPITests.swift */, + 8F1488DA2D2DE27000191744 /* URLCredentialProxyAPITests.swift */, + 8F1488DB2D2DE27000191744 /* URLProtectionSpaceProxyAPITests.swift */, + 8F1488DC2D2DE27000191744 /* URLRequestProxyAPITests.swift */, + 8F1488DD2D2DE27000191744 /* UserContentControllerProxyAPITests.swift */, + 8F1488DE2D2DE27000191744 /* UserScriptProxyAPITests.swift */, + 8F1488DF2D2DE27000191744 /* WebsiteDataStoreProxyAPITests.swift */, + 8F1488E02D2DE27000191744 /* WebViewConfigurationProxyAPITests.swift */, + 8F1488E12D2DE27000191744 /* WebViewProxyAPITests.swift */, 68BDCAED23C3F7CB00D9C032 /* Info.plist */, - 8F4FF948299ADC2D000A6586 /* FWFWebViewFlutterWKWebViewExternalAPITests.m */, - 8FA6A87828062CD000A4B183 /* FWFInstanceManagerTests.m */, - 8FB79B5228134C3100C101D3 /* FWFWebViewHostApiTests.m */, - 8FB79B54281B24F600C101D3 /* FWFDataConvertersTests.m */, - 8FB79B662820453400C101D3 /* FWFHTTPCookieStoreHostApiTests.m */, - 8FB79B6828204E8700C101D3 /* FWFPreferencesHostApiTests.m */, - 8FB79B6A28204EE500C101D3 /* FWFWebsiteDataStoreHostApiTests.m */, - 8FB79B6C2820533B00C101D3 /* FWFWebViewConfigurationHostApiTests.m */, - 8FB79B72282096B500C101D3 /* FWFScriptMessageHandlerHostApiTests.m */, - 8FB79B7828209D1300C101D3 /* FWFUserContentControllerHostApiTests.m */, - 8FB79B822820A39300C101D3 /* FWFNavigationDelegateHostApiTests.m */, - 8FB79B842820A3A400C101D3 /* FWFUIDelegateHostApiTests.m */, - 8FB79B8E2820BAB300C101D3 /* FWFScrollViewHostApiTests.m */, - 8FB79B902820BAC700C101D3 /* FWFUIViewHostApiTests.m */, - 8FB79B962821985200C101D3 /* FWFObjectHostApiTests.m */, - 8F4FF94A29AC223F000A6586 /* FWFURLTests.m */, - 8F562F8F2A56C02D00C2BED6 /* FWFURLCredentialHostApiTests.m */, - 8F562F912A56C04F00C2BED6 /* FWFURLProtectionSpaceHostApiTests.m */, - 8F562F932A56C07B00C2BED6 /* FWFURLAuthenticationChallengeHostApiTests.m */, - 8F78EAA92A02CB9100C2E520 /* FWFErrorTests.m */, - 1096EF432A6BD9DB000CBDF7 /* FWFScrollViewDelegateHostApiTests.m */, + 8F66D9D72D1362BE000835F9 /* RunnerTests-Bridging-Header.h */, ); path = RunnerTests; sourceTree = ""; @@ -206,7 +229,7 @@ F7151F75266057800028CB91 /* RunnerUITests */, 97C146EF1CF9000F007C117D /* Products */, B8AEEA11D6ECBD09750349AE /* Pods */, - 52FBC2B567345431F81A0A0F /* Frameworks */, + CD4E515970E7228B6793AF9A /* Frameworks */, ); sourceTree = ""; }; @@ -247,14 +270,23 @@ B8AEEA11D6ECBD09750349AE /* Pods */ = { isa = PBXGroup; children = ( - F7A1921261392D1CBDAEC2E8 /* Pods-Runner.debug.xcconfig */, - B89AA31A64040E4A2F1E0CAF /* Pods-Runner.release.xcconfig */, - 39B2BDAA45DC06EAB8A6C4E7 /* Pods-RunnerTests.debug.xcconfig */, - 2286ACB87EA8CA27E739AD6C /* Pods-RunnerTests.release.xcconfig */, + 4AA20286555659E34ACB3BE5 /* Pods-Runner.debug.xcconfig */, + 14B8C759112CB6E8AA62F003 /* Pods-Runner.release.xcconfig */, + 56443D345A163E3A65320207 /* Pods-RunnerTests.debug.xcconfig */, + C519E1940290A9B5DEBB9BCF /* Pods-RunnerTests.release.xcconfig */, ); path = Pods; sourceTree = ""; }; + CD4E515970E7228B6793AF9A /* Frameworks */ = { + isa = PBXGroup; + children = ( + 185E08CFEB8AE9D939566DE6 /* libPods-Runner.a */, + 573E8F1472CA1578A7CBDB63 /* libPods-RunnerTests.a */, + ); + name = Frameworks; + sourceTree = ""; + }; F7151F75266057800028CB91 /* RunnerUITests */ = { isa = PBXGroup; children = ( @@ -271,7 +303,7 @@ isa = PBXNativeTarget; buildConfigurationList = 68BDCAF223C3F7CB00D9C032 /* Build configuration list for PBXNativeTarget "RunnerTests" */; buildPhases = ( - AA38EF430495C2FB50F0F114 /* [CP] Check Pods Manifest.lock */, + 15992349B960AD5AE56B30FC /* [CP] Check Pods Manifest.lock */, 68BDCAE523C3F7CB00D9C032 /* Sources */, 68BDCAE623C3F7CB00D9C032 /* Frameworks */, 68BDCAE723C3F7CB00D9C032 /* Resources */, @@ -282,9 +314,6 @@ 68BDCAEF23C3F7CB00D9C032 /* PBXTargetDependency */, ); name = RunnerTests; - packageProductDependencies = ( - 4047B3FD2C3DEE8500A8BA05 /* OCMock */, - ); productName = webview_flutter_exampleTests; productReference = 68BDCAE923C3F7CB00D9C032 /* RunnerTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; @@ -293,20 +322,23 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - 6F536C27DD48B395A30EBB65 /* [CP] Check Pods Manifest.lock */, + 9E2F8153891253EACD6E06D7 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - 699F6E4617F8F25892A802F1 /* [CP] Copy Pods Resources */, + 66FD1332CB120D7719E87101 /* [CP] Copy Pods Resources */, ); buildRules = ( ); dependencies = ( ); name = Runner; + packageProductDependencies = ( + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */, + ); productName = Runner; productReference = 97C146EE1CF9000F007C117D /* Runner.app */; productType = "com.apple.product-type.application"; @@ -341,10 +373,12 @@ TargetAttributes = { 68BDCAE823C3F7CB00D9C032 = { DevelopmentTeam = 7624MWN53C; + LastSwiftMigration = 1610; ProvisioningStyle = Automatic; }; 97C146ED1CF9000F007C117D = { CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 1610; }; F7151F73266057800028CB91 = { CreatedOnToolsVersion = 12.5; @@ -364,7 +398,7 @@ ); mainGroup = 97C146E51CF9000F007C117D; packageReferences = ( - 4047B3FC2C3DEE8500A8BA05 /* XCRemoteSwiftPackageReference "ocmock" */, + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */, ); productRefGroup = 97C146EF1CF9000F007C117D /* Products */; projectDirPath = ""; @@ -406,6 +440,28 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ + 15992349B960AD5AE56B30FC /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; @@ -422,7 +478,7 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed\n/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin\n"; }; - 699F6E4617F8F25892A802F1 /* [CP] Copy Pods Resources */ = { + 66FD1332CB120D7719E87101 /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -442,28 +498,6 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; showEnvVarsInLog = 0; }; - 6F536C27DD48B395A30EBB65 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; @@ -479,7 +513,7 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build\n"; }; - AA38EF430495C2FB50F0F114 /* [CP] Check Pods Manifest.lock */ = { + 9E2F8153891253EACD6E06D7 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -494,7 +528,7 @@ outputFileListPaths = ( ); outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt", + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; @@ -508,27 +542,37 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 8FA6A87928062CD000A4B183 /* FWFInstanceManagerTests.m in Sources */, - 8F78EAAA2A02CB9100C2E520 /* FWFErrorTests.m in Sources */, - 8F4FF94B29AC223F000A6586 /* FWFURLTests.m in Sources */, - 8FB79B852820A3A400C101D3 /* FWFUIDelegateHostApiTests.m in Sources */, - 8FB79B972821985200C101D3 /* FWFObjectHostApiTests.m in Sources */, - 8FB79B672820453400C101D3 /* FWFHTTPCookieStoreHostApiTests.m in Sources */, - 8F562F942A56C07B00C2BED6 /* FWFURLAuthenticationChallengeHostApiTests.m in Sources */, - 8FB79B5328134C3100C101D3 /* FWFWebViewHostApiTests.m in Sources */, - 8FB79B73282096B500C101D3 /* FWFScriptMessageHandlerHostApiTests.m in Sources */, - 8FB79B7928209D1300C101D3 /* FWFUserContentControllerHostApiTests.m in Sources */, - 8F562F902A56C02D00C2BED6 /* FWFURLCredentialHostApiTests.m in Sources */, - 8F4FF949299ADC2D000A6586 /* FWFWebViewFlutterWKWebViewExternalAPITests.m in Sources */, - 8FB79B6B28204EE500C101D3 /* FWFWebsiteDataStoreHostApiTests.m in Sources */, - 1096EF442A6BD9DB000CBDF7 /* FWFScrollViewDelegateHostApiTests.m in Sources */, - 8FB79B8F2820BAB300C101D3 /* FWFScrollViewHostApiTests.m in Sources */, - 8F562F922A56C04F00C2BED6 /* FWFURLProtectionSpaceHostApiTests.m in Sources */, - 8FB79B912820BAC700C101D3 /* FWFUIViewHostApiTests.m in Sources */, - 8FB79B55281B24F600C101D3 /* FWFDataConvertersTests.m in Sources */, - 8FB79B6D2820533B00C101D3 /* FWFWebViewConfigurationHostApiTests.m in Sources */, - 8FB79B832820A39300C101D3 /* FWFNavigationDelegateHostApiTests.m in Sources */, - 8FB79B6928204E8700C101D3 /* FWFPreferencesHostApiTests.m in Sources */, + 8FC45F712D5C0C1E004E03E8 /* WebpagePreferencesProxyAPITests.swift in Sources */, + 8F1488E22D2DE27000191744 /* ScriptMessageHandlerProxyAPITests.swift in Sources */, + 8F1488E32D2DE27000191744 /* TestProxyApiRegistrar.swift in Sources */, + 8F1488E42D2DE27000191744 /* URLRequestProxyAPITests.swift in Sources */, + 8F1488E52D2DE27000191744 /* TestBinaryMessenger.swift in Sources */, + 8F1488E62D2DE27000191744 /* WebViewProxyAPITests.swift in Sources */, + 8F1488E72D2DE27000191744 /* HTTPCookieStoreProxyAPITests.swift in Sources */, + 8F1489012D2DE91C00191744 /* AuthenticationChallengeResponseProxyAPITests.swift in Sources */, + 8F1488E82D2DE27000191744 /* ScriptMessageProxyAPITests.swift in Sources */, + 8F1488E92D2DE27000191744 /* UIViewProxyAPITests.swift in Sources */, + 8F1488EA2D2DE27000191744 /* SecurityOriginProxyAPITests.swift in Sources */, + 8F1488EB2D2DE27000191744 /* PreferencesProxyAPITests.swift in Sources */, + 8F1488EC2D2DE27000191744 /* FrameInfoProxyAPITests.swift in Sources */, + 8F1488ED2D2DE27000191744 /* ErrorProxyAPITests.swift in Sources */, + 8F1488EE2D2DE27000191744 /* NSObjectProxyAPITests.swift in Sources */, + 8F1488EF2D2DE27000191744 /* NavigationResponseProxyAPITests.swift in Sources */, + 8F1488F02D2DE27000191744 /* UserScriptProxyAPITests.swift in Sources */, + 8F1488F12D2DE27000191744 /* URLProtectionSpaceProxyAPITests.swift in Sources */, + 8F1488F22D2DE27000191744 /* WebViewConfigurationProxyAPITests.swift in Sources */, + 8F1488F32D2DE27000191744 /* WebsiteDataStoreProxyAPITests.swift in Sources */, + 8F1488F42D2DE27000191744 /* URLCredentialProxyAPITests.swift in Sources */, + 8F1488F52D2DE27000191744 /* URLAuthenticationChallengeProxyAPITests.swift in Sources */, + 8F1488F62D2DE27000191744 /* NavigationDelegateProxyAPITests.swift in Sources */, + 8F1488F72D2DE27000191744 /* UIDelegateProxyAPITests.swift in Sources */, + 8F1488F82D2DE27000191744 /* ScrollViewDelegateProxyAPITests.swift in Sources */, + 8F1488FA2D2DE27000191744 /* FWFWebViewFlutterWKWebViewExternalAPITests.swift in Sources */, + 8F1488FB2D2DE27000191744 /* UserContentControllerProxyAPITests.swift in Sources */, + 8F1488FC2D2DE27000191744 /* HTTPURLResponseProxyAPITests.swift in Sources */, + 8F1488FD2D2DE27000191744 /* ScrollViewProxyAPITests.swift in Sources */, + 8F1488FE2D2DE27000191744 /* HTTPCookieProxyAPITests.swift in Sources */, + 8F1488FF2D2DE27000191744 /* NavigationActionProxyAPITests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -587,9 +631,10 @@ /* Begin XCBuildConfiguration section */ 68BDCAF023C3F7CB00D9C032 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 39B2BDAA45DC06EAB8A6C4E7 /* Pods-RunnerTests.debug.xcconfig */; + baseConfigurationReference = 56443D345A163E3A65320207 /* Pods-RunnerTests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; + CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Automatic; INFOPLIST_FILE = RunnerTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -599,15 +644,20 @@ ); PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.plugins.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "RunnerTests/RunnerTests-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/Runner"; + USE_HEADERMAP = NO; }; name = Debug; }; 68BDCAF123C3F7CB00D9C032 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 2286ACB87EA8CA27E739AD6C /* Pods-RunnerTests.release.xcconfig */; + baseConfigurationReference = C519E1940290A9B5DEBB9BCF /* Pods-RunnerTests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; + CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Automatic; INFOPLIST_FILE = RunnerTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -617,7 +667,11 @@ ); PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.plugins.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; + SWIFT_OBJC_BRIDGING_HEADER = "RunnerTests/RunnerTests-Bridging-Header.h"; + SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/Runner"; + USE_HEADERMAP = NO; }; name = Release; }; @@ -673,6 +727,8 @@ MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; + SWIFT_STRICT_CONCURRENCY = minimal; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -722,6 +778,8 @@ IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; + SWIFT_STRICT_CONCURRENCY = minimal; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; @@ -732,6 +790,7 @@ baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; DEVELOPMENT_TEAM = 7624MWN53C; ENABLE_BITCODE = NO; @@ -750,6 +809,9 @@ ); PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.plugins.webviewFlutterExample; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "RunnerTests/Runner-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 6.0; VERSIONING_SYSTEM = "apple-generic"; }; name = Debug; @@ -759,6 +821,7 @@ baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; DEVELOPMENT_TEAM = 7624MWN53C; ENABLE_BITCODE = NO; @@ -777,6 +840,8 @@ ); PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.plugins.webviewFlutterExample; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "RunnerTests/Runner-Bridging-Header.h"; + SWIFT_VERSION = 6.0; VERSIONING_SYSTEM = "apple-generic"; }; name = Release; @@ -856,22 +921,17 @@ }; /* End XCConfigurationList section */ -/* Begin XCRemoteSwiftPackageReference section */ - 4047B3FC2C3DEE8500A8BA05 /* XCRemoteSwiftPackageReference "ocmock" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/erikdoe/ocmock"; - requirement = { - kind = revision; - revision = fe1661a3efed11831a6452f4b1a0c5e6ddc08c3d; - }; +/* Begin XCLocalSwiftPackageReference section */ + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; }; -/* End XCRemoteSwiftPackageReference section */ +/* End XCLocalSwiftPackageReference section */ /* Begin XCSwiftPackageProductDependency section */ - 4047B3FD2C3DEE8500A8BA05 /* OCMock */ = { + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = { isa = XCSwiftPackageProductDependency; - package = 4047B3FC2C3DEE8500A8BA05 /* XCRemoteSwiftPackageReference "ocmock" */; - productName = OCMock; + productName = FlutterGeneratedPluginSwiftPackage; }; /* End XCSwiftPackageProductDependency section */ }; diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/webview_flutter/webview_flutter_wkwebview/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 65b8955c3c6..ef4558defd5 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/packages/webview_flutter/webview_flutter_wkwebview/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,7 +1,7 @@ + version = "1.7"> @@ -86,6 +86,7 @@ ignoresPersistentStateOnLaunch = "NO" debugDocumentVersioning = "YES" debugServiceExtension = "internal" + enableGPUValidationMode = "1" allowLocationSimulation = "YES"> diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/RunnerTests-Bridging-Header.h b/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/RunnerTests-Bridging-Header.h new file mode 100644 index 00000000000..e7217c7d7b3 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/RunnerTests-Bridging-Header.h @@ -0,0 +1,3 @@ +// 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. 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/lib/main.dart b/packages/webview_flutter/webview_flutter_wkwebview/example/lib/main.dart index 2d23fe0386d..3bd0a5382ac 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/example/lib/main.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/example/lib/main.dart @@ -216,10 +216,7 @@ Page resource error: ); request.grant(); }, - ) - ..loadRequest(LoadRequestParams( - uri: Uri.parse('https://flutter.dev'), - )); + ); // setBackgroundColor and setOnScrollPositionChange are not supported on // macOS. @@ -328,6 +325,7 @@ Page resource error: } enum MenuOptions { + loadFlutterDev, showUserAgent, listCookies, clearCookies, @@ -365,6 +363,8 @@ class SampleMenu extends StatelessWidget { key: const ValueKey('ShowPopupMenu'), onSelected: (MenuOptions value) { switch (value) { + case MenuOptions.loadFlutterDev: + _loadFlutterDev(); case MenuOptions.showUserAgent: _onShowUserAgent(); case MenuOptions.listCookies: @@ -400,6 +400,10 @@ class SampleMenu extends StatelessWidget { } }, itemBuilder: (BuildContext context) => >[ + const PopupMenuItem( + value: MenuOptions.loadFlutterDev, + child: Text('Load flutter.dev'), + ), const PopupMenuItem( value: MenuOptions.showUserAgent, child: Text('Show user agent'), @@ -469,6 +473,12 @@ class SampleMenu extends StatelessWidget { ); } + Future _loadFlutterDev() { + return webViewController.loadRequest(LoadRequestParams( + uri: Uri.parse('https://flutter.dev'), + )); + } + Future _onShowUserAgent() { // Send a message with the user agent string to the Toaster JavaScript channel we registered // with the WebView. 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 264cd2e6145..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 @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 54; + objectVersion = 60; objects = { /* Begin PBXAggregateTarget section */ @@ -22,34 +22,44 @@ /* Begin PBXBuildFile section */ 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; }; - 337257E82C626C94005E6518 /* OCMock in Frameworks */ = {isa = PBXBuildFile; productRef = 337257E72C626C94005E6518 /* OCMock */; }; 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; }; 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; - 33CF716F2C090A5900FB3AA4 /* FWFURLProtectionSpaceHostApiTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33CF715A2C090A5800FB3AA4 /* FWFURLProtectionSpaceHostApiTests.m */; }; - 33CF71702C090A5900FB3AA4 /* FWFUIDelegateHostApiTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33CF715B2C090A5800FB3AA4 /* FWFUIDelegateHostApiTests.m */; }; - 33CF71712C090A5900FB3AA4 /* FWFErrorTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33CF715C2C090A5800FB3AA4 /* FWFErrorTests.m */; }; - 33CF71722C090A5900FB3AA4 /* FWFUIViewHostApiTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33CF715D2C090A5800FB3AA4 /* FWFUIViewHostApiTests.m */; }; - 33CF71732C090A5900FB3AA4 /* FWFDataConvertersTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33CF715E2C090A5800FB3AA4 /* FWFDataConvertersTests.m */; }; - 33CF71742C090A5900FB3AA4 /* FWFURLCredentialHostApiTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33CF715F2C090A5800FB3AA4 /* FWFURLCredentialHostApiTests.m */; }; - 33CF71752C090A5900FB3AA4 /* FWFWebViewFlutterWKWebViewExternalAPITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33CF71602C090A5800FB3AA4 /* FWFWebViewFlutterWKWebViewExternalAPITests.m */; }; - 33CF71762C090A5900FB3AA4 /* FWFPreferencesHostApiTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33CF71612C090A5800FB3AA4 /* FWFPreferencesHostApiTests.m */; }; - 33CF71772C090A5900FB3AA4 /* FWFWebViewHostApiTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33CF71622C090A5800FB3AA4 /* FWFWebViewHostApiTests.m */; }; - 33CF71782C090A5900FB3AA4 /* FWFScrollViewHostApiTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33CF71632C090A5800FB3AA4 /* FWFScrollViewHostApiTests.m */; }; - 33CF71792C090A5900FB3AA4 /* FWFInstanceManagerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33CF71642C090A5800FB3AA4 /* FWFInstanceManagerTests.m */; }; - 33CF717A2C090A5900FB3AA4 /* FWFScrollViewDelegateHostApiTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33CF71652C090A5800FB3AA4 /* FWFScrollViewDelegateHostApiTests.m */; }; - 33CF717B2C090A5900FB3AA4 /* FWFUserContentControllerHostApiTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33CF71662C090A5800FB3AA4 /* FWFUserContentControllerHostApiTests.m */; }; - 33CF717C2C090A5900FB3AA4 /* FWFScriptMessageHandlerHostApiTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33CF71672C090A5800FB3AA4 /* FWFScriptMessageHandlerHostApiTests.m */; }; - 33CF717D2C090A5900FB3AA4 /* FWFURLAuthenticationChallengeHostApiTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33CF71682C090A5800FB3AA4 /* FWFURLAuthenticationChallengeHostApiTests.m */; }; - 33CF717E2C090A5900FB3AA4 /* FWFURLTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33CF71692C090A5800FB3AA4 /* FWFURLTests.m */; }; - 33CF717F2C090A5900FB3AA4 /* FWFWebViewConfigurationHostApiTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33CF716A2C090A5900FB3AA4 /* FWFWebViewConfigurationHostApiTests.m */; }; - 33CF71802C090A5900FB3AA4 /* FWFWebsiteDataStoreHostApiTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33CF716B2C090A5900FB3AA4 /* FWFWebsiteDataStoreHostApiTests.m */; }; - 33CF71812C090A5900FB3AA4 /* FWFHTTPCookieStoreHostApiTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33CF716C2C090A5900FB3AA4 /* FWFHTTPCookieStoreHostApiTests.m */; }; - 33CF71822C090A5900FB3AA4 /* FWFNavigationDelegateHostApiTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33CF716D2C090A5900FB3AA4 /* FWFNavigationDelegateHostApiTests.m */; }; - 33CF71832C090A5900FB3AA4 /* FWFObjectHostApiTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33CF716E2C090A5900FB3AA4 /* FWFObjectHostApiTests.m */; }; - 696987BFFD9F58717569B4E4 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2F0D686780FFBF662B127EB3 /* Pods_RunnerTests.framework */; }; - 94A776FC184B2E22F5BB8688 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4396B0510D22FC1052724D77 /* Pods_Runner.framework */; }; + 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 */; }; + 8FF1FEA52D37201300A5E400 /* NavigationResponseProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FF1FE8D2D37201300A5E400 /* NavigationResponseProxyAPITests.swift */; }; + 8FF1FEA62D37201300A5E400 /* FWFWebViewFlutterWKWebViewExternalAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FF1FE872D37201300A5E400 /* FWFWebViewFlutterWKWebViewExternalAPITests.swift */; }; + 8FF1FEA72D37201300A5E400 /* UserContentControllerProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FF1FE9D2D37201300A5E400 /* UserContentControllerProxyAPITests.swift */; }; + 8FF1FEA82D37201300A5E400 /* TestBinaryMessenger.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FF1FE952D37201300A5E400 /* TestBinaryMessenger.swift */; }; + 8FF1FEA92D37201300A5E400 /* TestProxyApiRegistrar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FF1FE962D37201300A5E400 /* TestProxyApiRegistrar.swift */; }; + 8FF1FEAA2D37201300A5E400 /* HTTPURLResponseProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FF1FE8A2D37201300A5E400 /* HTTPURLResponseProxyAPITests.swift */; }; + 8FF1FEAB2D37201300A5E400 /* AuthenticationChallengeResponseProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FF1FE842D37201300A5E400 /* AuthenticationChallengeResponseProxyAPITests.swift */; }; + 8FF1FEAC2D37201300A5E400 /* UIViewProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FF1FE982D37201300A5E400 /* UIViewProxyAPITests.swift */; }; + 8FF1FEAD2D37201300A5E400 /* WebViewConfigurationProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FF1FEA02D37201300A5E400 /* WebViewConfigurationProxyAPITests.swift */; }; + 8FF1FEAE2D37201300A5E400 /* NavigationActionProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FF1FE8B2D37201300A5E400 /* NavigationActionProxyAPITests.swift */; }; + 8FF1FEAF2D37201300A5E400 /* ScrollViewDelegateProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FF1FE922D37201300A5E400 /* ScrollViewDelegateProxyAPITests.swift */; }; + 8FF1FEB02D37201300A5E400 /* ErrorProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FF1FE852D37201300A5E400 /* ErrorProxyAPITests.swift */; }; + 8FF1FEB12D37201300A5E400 /* UIDelegateProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FF1FE972D37201300A5E400 /* UIDelegateProxyAPITests.swift */; }; + 8FF1FEB22D37201300A5E400 /* WebViewProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FF1FEA12D37201300A5E400 /* WebViewProxyAPITests.swift */; }; + 8FF1FEB32D37201300A5E400 /* URLProtectionSpaceProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FF1FE9B2D37201300A5E400 /* URLProtectionSpaceProxyAPITests.swift */; }; + 8FF1FEB42D37201300A5E400 /* NavigationDelegateProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FF1FE8C2D37201300A5E400 /* NavigationDelegateProxyAPITests.swift */; }; + 8FF1FEB52D37201300A5E400 /* WebsiteDataStoreProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FF1FE9F2D37201300A5E400 /* WebsiteDataStoreProxyAPITests.swift */; }; + 8FF1FEB62D37201300A5E400 /* PreferencesProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FF1FE8F2D37201300A5E400 /* PreferencesProxyAPITests.swift */; }; + 8FF1FEB72D37201300A5E400 /* URLCredentialProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FF1FE9A2D37201300A5E400 /* URLCredentialProxyAPITests.swift */; }; + 8FF1FEB82D37201300A5E400 /* URLRequestProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FF1FE9C2D37201300A5E400 /* URLRequestProxyAPITests.swift */; }; + 8FF1FEB92D37201300A5E400 /* UserScriptProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FF1FE9E2D37201300A5E400 /* UserScriptProxyAPITests.swift */; }; + 8FF1FEBA2D37201300A5E400 /* ScriptMessageHandlerProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FF1FE902D37201300A5E400 /* ScriptMessageHandlerProxyAPITests.swift */; }; + 8FF1FEBB2D37201300A5E400 /* SecurityOriginProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FF1FE942D37201300A5E400 /* SecurityOriginProxyAPITests.swift */; }; + 8FF1FEBC2D37201300A5E400 /* HTTPCookieStoreProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FF1FE892D37201300A5E400 /* HTTPCookieStoreProxyAPITests.swift */; }; + 8FF1FEBD2D37201300A5E400 /* ScriptMessageProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FF1FE912D37201300A5E400 /* ScriptMessageProxyAPITests.swift */; }; + 8FF1FEBE2D37201300A5E400 /* FrameInfoProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FF1FE862D37201300A5E400 /* FrameInfoProxyAPITests.swift */; }; + 8FF1FEBF2D37201300A5E400 /* HTTPCookieProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FF1FE882D37201300A5E400 /* HTTPCookieProxyAPITests.swift */; }; + EC73D2F02E81CFF0A2CA5D1E /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D183650EAE2ABECF7D9CBA94 /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -83,9 +93,7 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 293218A8CB10C8BE4DB72BF6 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; - 2BB8CCF4A3B17FE9A00CF6B7 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; - 2F0D686780FFBF662B127EB3 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 02805256CB102DDACBC04AEE /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 331C80D5294CF71000263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; @@ -98,37 +106,50 @@ 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Debug.xcconfig"; sourceTree = ""; }; 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Release.xcconfig"; sourceTree = ""; }; 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Flutter-Generated.xcconfig"; path = "ephemeral/Flutter-Generated.xcconfig"; sourceTree = ""; }; - 33CF715A2C090A5800FB3AA4 /* FWFURLProtectionSpaceHostApiTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FWFURLProtectionSpaceHostApiTests.m; path = ../../darwin/Tests/FWFURLProtectionSpaceHostApiTests.m; sourceTree = SOURCE_ROOT; }; - 33CF715B2C090A5800FB3AA4 /* FWFUIDelegateHostApiTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FWFUIDelegateHostApiTests.m; path = ../../darwin/Tests/FWFUIDelegateHostApiTests.m; sourceTree = SOURCE_ROOT; }; - 33CF715C2C090A5800FB3AA4 /* FWFErrorTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FWFErrorTests.m; path = ../../darwin/Tests/FWFErrorTests.m; sourceTree = SOURCE_ROOT; }; - 33CF715D2C090A5800FB3AA4 /* FWFUIViewHostApiTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FWFUIViewHostApiTests.m; path = ../../darwin/Tests/FWFUIViewHostApiTests.m; sourceTree = SOURCE_ROOT; }; - 33CF715E2C090A5800FB3AA4 /* FWFDataConvertersTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FWFDataConvertersTests.m; path = ../../darwin/Tests/FWFDataConvertersTests.m; sourceTree = SOURCE_ROOT; }; - 33CF715F2C090A5800FB3AA4 /* FWFURLCredentialHostApiTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FWFURLCredentialHostApiTests.m; path = ../../darwin/Tests/FWFURLCredentialHostApiTests.m; sourceTree = SOURCE_ROOT; }; - 33CF71602C090A5800FB3AA4 /* FWFWebViewFlutterWKWebViewExternalAPITests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FWFWebViewFlutterWKWebViewExternalAPITests.m; path = ../../darwin/Tests/FWFWebViewFlutterWKWebViewExternalAPITests.m; sourceTree = SOURCE_ROOT; }; - 33CF71612C090A5800FB3AA4 /* FWFPreferencesHostApiTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FWFPreferencesHostApiTests.m; path = ../../darwin/Tests/FWFPreferencesHostApiTests.m; sourceTree = SOURCE_ROOT; }; - 33CF71622C090A5800FB3AA4 /* FWFWebViewHostApiTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FWFWebViewHostApiTests.m; path = ../../darwin/Tests/FWFWebViewHostApiTests.m; sourceTree = SOURCE_ROOT; }; - 33CF71632C090A5800FB3AA4 /* FWFScrollViewHostApiTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FWFScrollViewHostApiTests.m; path = ../../darwin/Tests/FWFScrollViewHostApiTests.m; sourceTree = SOURCE_ROOT; }; - 33CF71642C090A5800FB3AA4 /* FWFInstanceManagerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FWFInstanceManagerTests.m; path = ../../darwin/Tests/FWFInstanceManagerTests.m; sourceTree = SOURCE_ROOT; }; - 33CF71652C090A5800FB3AA4 /* FWFScrollViewDelegateHostApiTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FWFScrollViewDelegateHostApiTests.m; path = ../../darwin/Tests/FWFScrollViewDelegateHostApiTests.m; sourceTree = SOURCE_ROOT; }; - 33CF71662C090A5800FB3AA4 /* FWFUserContentControllerHostApiTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FWFUserContentControllerHostApiTests.m; path = ../../darwin/Tests/FWFUserContentControllerHostApiTests.m; sourceTree = SOURCE_ROOT; }; - 33CF71672C090A5800FB3AA4 /* FWFScriptMessageHandlerHostApiTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FWFScriptMessageHandlerHostApiTests.m; path = ../../darwin/Tests/FWFScriptMessageHandlerHostApiTests.m; sourceTree = SOURCE_ROOT; }; - 33CF71682C090A5800FB3AA4 /* FWFURLAuthenticationChallengeHostApiTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FWFURLAuthenticationChallengeHostApiTests.m; path = ../../darwin/Tests/FWFURLAuthenticationChallengeHostApiTests.m; sourceTree = SOURCE_ROOT; }; - 33CF71692C090A5800FB3AA4 /* FWFURLTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FWFURLTests.m; path = ../../darwin/Tests/FWFURLTests.m; sourceTree = SOURCE_ROOT; }; - 33CF716A2C090A5900FB3AA4 /* FWFWebViewConfigurationHostApiTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FWFWebViewConfigurationHostApiTests.m; path = ../../darwin/Tests/FWFWebViewConfigurationHostApiTests.m; sourceTree = SOURCE_ROOT; }; - 33CF716B2C090A5900FB3AA4 /* FWFWebsiteDataStoreHostApiTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FWFWebsiteDataStoreHostApiTests.m; path = ../../darwin/Tests/FWFWebsiteDataStoreHostApiTests.m; sourceTree = SOURCE_ROOT; }; - 33CF716C2C090A5900FB3AA4 /* FWFHTTPCookieStoreHostApiTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FWFHTTPCookieStoreHostApiTests.m; path = ../../darwin/Tests/FWFHTTPCookieStoreHostApiTests.m; sourceTree = SOURCE_ROOT; }; - 33CF716D2C090A5900FB3AA4 /* FWFNavigationDelegateHostApiTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FWFNavigationDelegateHostApiTests.m; path = ../../darwin/Tests/FWFNavigationDelegateHostApiTests.m; sourceTree = SOURCE_ROOT; }; - 33CF716E2C090A5900FB3AA4 /* FWFObjectHostApiTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FWFObjectHostApiTests.m; path = ../../darwin/Tests/FWFObjectHostApiTests.m; sourceTree = SOURCE_ROOT; }; 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; - 4396B0510D22FC1052724D77 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 7A8789C38AC8A7893DF1757D /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + 418FB4EA49104BADE288A967 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 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 = ""; }; - 8E3B7819B86A3E8D5B2787F8 /* 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 = ""; }; + 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; }; + 8FF1FE872D37201300A5E400 /* FWFWebViewFlutterWKWebViewExternalAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = FWFWebViewFlutterWKWebViewExternalAPITests.swift; path = ../../darwin/Tests/FWFWebViewFlutterWKWebViewExternalAPITests.swift; sourceTree = SOURCE_ROOT; }; + 8FF1FE882D37201300A5E400 /* HTTPCookieProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = HTTPCookieProxyAPITests.swift; path = ../../darwin/Tests/HTTPCookieProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; + 8FF1FE892D37201300A5E400 /* HTTPCookieStoreProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = HTTPCookieStoreProxyAPITests.swift; path = ../../darwin/Tests/HTTPCookieStoreProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; + 8FF1FE8A2D37201300A5E400 /* HTTPURLResponseProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = HTTPURLResponseProxyAPITests.swift; path = ../../darwin/Tests/HTTPURLResponseProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; + 8FF1FE8B2D37201300A5E400 /* NavigationActionProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = NavigationActionProxyAPITests.swift; path = ../../darwin/Tests/NavigationActionProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; + 8FF1FE8C2D37201300A5E400 /* NavigationDelegateProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = NavigationDelegateProxyAPITests.swift; path = ../../darwin/Tests/NavigationDelegateProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; + 8FF1FE8D2D37201300A5E400 /* NavigationResponseProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = NavigationResponseProxyAPITests.swift; path = ../../darwin/Tests/NavigationResponseProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; + 8FF1FE8E2D37201300A5E400 /* NSObjectProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = NSObjectProxyAPITests.swift; path = ../../darwin/Tests/NSObjectProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; + 8FF1FE8F2D37201300A5E400 /* PreferencesProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = PreferencesProxyAPITests.swift; path = ../../darwin/Tests/PreferencesProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; + 8FF1FE902D37201300A5E400 /* ScriptMessageHandlerProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = ScriptMessageHandlerProxyAPITests.swift; path = ../../darwin/Tests/ScriptMessageHandlerProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; + 8FF1FE912D37201300A5E400 /* ScriptMessageProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = ScriptMessageProxyAPITests.swift; path = ../../darwin/Tests/ScriptMessageProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; + 8FF1FE922D37201300A5E400 /* ScrollViewDelegateProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = ScrollViewDelegateProxyAPITests.swift; path = ../../darwin/Tests/ScrollViewDelegateProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; + 8FF1FE932D37201300A5E400 /* ScrollViewProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = ScrollViewProxyAPITests.swift; path = ../../darwin/Tests/ScrollViewProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; + 8FF1FE942D37201300A5E400 /* SecurityOriginProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = SecurityOriginProxyAPITests.swift; path = ../../darwin/Tests/SecurityOriginProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; + 8FF1FE952D37201300A5E400 /* TestBinaryMessenger.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = TestBinaryMessenger.swift; path = ../../darwin/Tests/TestBinaryMessenger.swift; sourceTree = SOURCE_ROOT; }; + 8FF1FE962D37201300A5E400 /* TestProxyApiRegistrar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = TestProxyApiRegistrar.swift; path = ../../darwin/Tests/TestProxyApiRegistrar.swift; sourceTree = SOURCE_ROOT; }; + 8FF1FE972D37201300A5E400 /* UIDelegateProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = UIDelegateProxyAPITests.swift; path = ../../darwin/Tests/UIDelegateProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; + 8FF1FE982D37201300A5E400 /* UIViewProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = UIViewProxyAPITests.swift; path = ../../darwin/Tests/UIViewProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; + 8FF1FE992D37201300A5E400 /* URLAuthenticationChallengeProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = URLAuthenticationChallengeProxyAPITests.swift; path = ../../darwin/Tests/URLAuthenticationChallengeProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; + 8FF1FE9A2D37201300A5E400 /* URLCredentialProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = URLCredentialProxyAPITests.swift; path = ../../darwin/Tests/URLCredentialProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; + 8FF1FE9B2D37201300A5E400 /* URLProtectionSpaceProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = URLProtectionSpaceProxyAPITests.swift; path = ../../darwin/Tests/URLProtectionSpaceProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; + 8FF1FE9C2D37201300A5E400 /* URLRequestProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = URLRequestProxyAPITests.swift; path = ../../darwin/Tests/URLRequestProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; + 8FF1FE9D2D37201300A5E400 /* UserContentControllerProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = UserContentControllerProxyAPITests.swift; path = ../../darwin/Tests/UserContentControllerProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; + 8FF1FE9E2D37201300A5E400 /* UserScriptProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = UserScriptProxyAPITests.swift; path = ../../darwin/Tests/UserScriptProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; + 8FF1FE9F2D37201300A5E400 /* WebsiteDataStoreProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = WebsiteDataStoreProxyAPITests.swift; path = ../../darwin/Tests/WebsiteDataStoreProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; + 8FF1FEA02D37201300A5E400 /* WebViewConfigurationProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = WebViewConfigurationProxyAPITests.swift; path = ../../darwin/Tests/WebViewConfigurationProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; + 8FF1FEA12D37201300A5E400 /* WebViewProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = WebViewProxyAPITests.swift; path = ../../darwin/Tests/WebViewProxyAPITests.swift; sourceTree = SOURCE_ROOT; }; + 8FF1FEC02D37201500A5E400 /* RunnerTests-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "RunnerTests-Bridging-Header.h"; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; - B29CEB47BBE7D438B12895F3 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; }; - BB0A609D94A71B55CFCFC007 /* 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 = ""; }; + ADCB9E0C172AE7D0FAEDBF42 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; + B8188FDAD7773BAC85CB6DE9 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; }; + D183650EAE2ABECF7D9CBA94 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + D63AEC83B24957EBEB3AA850 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -136,8 +157,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 337257E82C626C94005E6518 /* OCMock in Frameworks */, - 696987BFFD9F58717569B4E4 /* Pods_RunnerTests.framework in Frameworks */, + 6FBECA2F94D9B352000B75D7 /* Pods_RunnerTests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -145,7 +165,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 94A776FC184B2E22F5BB8688 /* Pods_Runner.framework in Frameworks */, + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */, + EC73D2F02E81CFF0A2CA5D1E /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -155,27 +176,38 @@ 331C80D6294CF71000263BE5 /* RunnerTests */ = { isa = PBXGroup; children = ( - 33CF715E2C090A5800FB3AA4 /* FWFDataConvertersTests.m */, - 33CF715C2C090A5800FB3AA4 /* FWFErrorTests.m */, - 33CF716C2C090A5900FB3AA4 /* FWFHTTPCookieStoreHostApiTests.m */, - 33CF71642C090A5800FB3AA4 /* FWFInstanceManagerTests.m */, - 33CF716D2C090A5900FB3AA4 /* FWFNavigationDelegateHostApiTests.m */, - 33CF716E2C090A5900FB3AA4 /* FWFObjectHostApiTests.m */, - 33CF71612C090A5800FB3AA4 /* FWFPreferencesHostApiTests.m */, - 33CF71672C090A5800FB3AA4 /* FWFScriptMessageHandlerHostApiTests.m */, - 33CF71652C090A5800FB3AA4 /* FWFScrollViewDelegateHostApiTests.m */, - 33CF71632C090A5800FB3AA4 /* FWFScrollViewHostApiTests.m */, - 33CF715B2C090A5800FB3AA4 /* FWFUIDelegateHostApiTests.m */, - 33CF715D2C090A5800FB3AA4 /* FWFUIViewHostApiTests.m */, - 33CF71682C090A5800FB3AA4 /* FWFURLAuthenticationChallengeHostApiTests.m */, - 33CF715F2C090A5800FB3AA4 /* FWFURLCredentialHostApiTests.m */, - 33CF715A2C090A5800FB3AA4 /* FWFURLProtectionSpaceHostApiTests.m */, - 33CF71692C090A5800FB3AA4 /* FWFURLTests.m */, - 33CF71662C090A5800FB3AA4 /* FWFUserContentControllerHostApiTests.m */, - 33CF716B2C090A5900FB3AA4 /* FWFWebsiteDataStoreHostApiTests.m */, - 33CF716A2C090A5900FB3AA4 /* FWFWebViewConfigurationHostApiTests.m */, - 33CF71602C090A5800FB3AA4 /* FWFWebViewFlutterWKWebViewExternalAPITests.m */, - 33CF71622C090A5800FB3AA4 /* FWFWebViewHostApiTests.m */, + 8FC45F722D5C0C37004E03E8 /* WebpagePreferencesProxyAPITests.swift */, + 8FF1FE842D37201300A5E400 /* AuthenticationChallengeResponseProxyAPITests.swift */, + 8FF1FE852D37201300A5E400 /* ErrorProxyAPITests.swift */, + 8FF1FE862D37201300A5E400 /* FrameInfoProxyAPITests.swift */, + 8FF1FE872D37201300A5E400 /* FWFWebViewFlutterWKWebViewExternalAPITests.swift */, + 8FF1FE882D37201300A5E400 /* HTTPCookieProxyAPITests.swift */, + 8FF1FE892D37201300A5E400 /* HTTPCookieStoreProxyAPITests.swift */, + 8FF1FE8A2D37201300A5E400 /* HTTPURLResponseProxyAPITests.swift */, + 8FF1FE8B2D37201300A5E400 /* NavigationActionProxyAPITests.swift */, + 8FF1FE8C2D37201300A5E400 /* NavigationDelegateProxyAPITests.swift */, + 8FF1FE8D2D37201300A5E400 /* NavigationResponseProxyAPITests.swift */, + 8FF1FE8E2D37201300A5E400 /* NSObjectProxyAPITests.swift */, + 8FF1FE8F2D37201300A5E400 /* PreferencesProxyAPITests.swift */, + 8FF1FE902D37201300A5E400 /* ScriptMessageHandlerProxyAPITests.swift */, + 8FF1FE912D37201300A5E400 /* ScriptMessageProxyAPITests.swift */, + 8FF1FE922D37201300A5E400 /* ScrollViewDelegateProxyAPITests.swift */, + 8FF1FE932D37201300A5E400 /* ScrollViewProxyAPITests.swift */, + 8FF1FE942D37201300A5E400 /* SecurityOriginProxyAPITests.swift */, + 8FF1FE952D37201300A5E400 /* TestBinaryMessenger.swift */, + 8FF1FE962D37201300A5E400 /* TestProxyApiRegistrar.swift */, + 8FF1FE972D37201300A5E400 /* UIDelegateProxyAPITests.swift */, + 8FF1FE982D37201300A5E400 /* UIViewProxyAPITests.swift */, + 8FF1FE992D37201300A5E400 /* URLAuthenticationChallengeProxyAPITests.swift */, + 8FF1FE9A2D37201300A5E400 /* URLCredentialProxyAPITests.swift */, + 8FF1FE9B2D37201300A5E400 /* URLProtectionSpaceProxyAPITests.swift */, + 8FF1FE9C2D37201300A5E400 /* URLRequestProxyAPITests.swift */, + 8FF1FE9D2D37201300A5E400 /* UserContentControllerProxyAPITests.swift */, + 8FF1FE9E2D37201300A5E400 /* UserScriptProxyAPITests.swift */, + 8FF1FE9F2D37201300A5E400 /* WebsiteDataStoreProxyAPITests.swift */, + 8FF1FEA02D37201300A5E400 /* WebViewConfigurationProxyAPITests.swift */, + 8FF1FEA12D37201300A5E400 /* WebViewProxyAPITests.swift */, + 8FF1FEC02D37201500A5E400 /* RunnerTests-Bridging-Header.h */, ); path = RunnerTests; sourceTree = ""; @@ -198,8 +230,8 @@ 33CEB47122A05771004F2AC0 /* Flutter */, 331C80D6294CF71000263BE5 /* RunnerTests */, 33CC10EE2044A3C60003C045 /* Products */, - D73912EC22F37F3D000D13A0 /* Frameworks */, 57E0600E4AC0FCC05F33A596 /* Pods */, + DEE7D4409B558EFC0D7C2BDC /* Frameworks */, ); sourceTree = ""; }; @@ -250,21 +282,21 @@ 57E0600E4AC0FCC05F33A596 /* Pods */ = { isa = PBXGroup; children = ( - 7A8789C38AC8A7893DF1757D /* Pods-Runner.debug.xcconfig */, - 293218A8CB10C8BE4DB72BF6 /* Pods-Runner.release.xcconfig */, - 2BB8CCF4A3B17FE9A00CF6B7 /* Pods-Runner.profile.xcconfig */, - BB0A609D94A71B55CFCFC007 /* Pods-RunnerTests.debug.xcconfig */, - 8E3B7819B86A3E8D5B2787F8 /* Pods-RunnerTests.release.xcconfig */, - B29CEB47BBE7D438B12895F3 /* Pods-RunnerTests.profile.xcconfig */, + 02805256CB102DDACBC04AEE /* Pods-Runner.debug.xcconfig */, + D63AEC83B24957EBEB3AA850 /* Pods-Runner.release.xcconfig */, + ADCB9E0C172AE7D0FAEDBF42 /* Pods-Runner.profile.xcconfig */, + 69E635CFAEEB8242654D4BBC /* Pods-RunnerTests.debug.xcconfig */, + 7D83F970E1160B09690C7723 /* Pods-RunnerTests.release.xcconfig */, + B8188FDAD7773BAC85CB6DE9 /* Pods-RunnerTests.profile.xcconfig */, ); path = Pods; sourceTree = ""; }; - D73912EC22F37F3D000D13A0 /* Frameworks */ = { + DEE7D4409B558EFC0D7C2BDC /* Frameworks */ = { isa = PBXGroup; children = ( - 4396B0510D22FC1052724D77 /* Pods_Runner.framework */, - 2F0D686780FFBF662B127EB3 /* Pods_RunnerTests.framework */, + D183650EAE2ABECF7D9CBA94 /* Pods_Runner.framework */, + 418FB4EA49104BADE288A967 /* Pods_RunnerTests.framework */, ); name = Frameworks; sourceTree = ""; @@ -276,7 +308,7 @@ isa = PBXNativeTarget; buildConfigurationList = 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; buildPhases = ( - 5B369AB3CC6C4456A15F9A02 /* [CP] Check Pods Manifest.lock */, + 05D7642BA03EFE4FAEF7BAB1 /* [CP] Check Pods Manifest.lock */, 331C80D1294CF70F00263BE5 /* Sources */, 331C80D2294CF70F00263BE5 /* Frameworks */, 331C80D3294CF70F00263BE5 /* Resources */, @@ -287,9 +319,6 @@ 331C80DA294CF71000263BE5 /* PBXTargetDependency */, ); name = RunnerTests; - packageProductDependencies = ( - 337257E72C626C94005E6518 /* OCMock */, - ); productName = RunnerTests; productReference = 331C80D5294CF71000263BE5 /* RunnerTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; @@ -298,13 +327,13 @@ isa = PBXNativeTarget; buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - 52BDF375441D3D4ACF9978EC /* [CP] Check Pods Manifest.lock */, + 4D1FE18AFCDA46E722527658 /* [CP] Check Pods Manifest.lock */, 33CC10E92044A3C60003C045 /* Sources */, 33CC10EA2044A3C60003C045 /* Frameworks */, 33CC10EB2044A3C60003C045 /* Resources */, 33CC110E2044A8840003C045 /* Bundle Framework */, 3399D490228B24CF009A79C7 /* ShellScript */, - AE091060DB78993007C49A9B /* [CP] Embed Pods Frameworks */, + D37A0828FB9E6E410964A0F6 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -312,6 +341,9 @@ 33CC11202044C79F0003C045 /* PBXTargetDependency */, ); name = Runner; + packageProductDependencies = ( + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */, + ); productName = Runner; productReference = 33CC10ED2044A3C60003C045 /* example.app */; productType = "com.apple.product-type.application"; @@ -328,7 +360,7 @@ TargetAttributes = { 331C80D4294CF70F00263BE5 = { CreatedOnToolsVersion = 14.0; - LastSwiftMigration = 1510; + LastSwiftMigration = 1610; TestTargetID = 33CC10EC2044A3C60003C045; }; 33CC10EC2044A3C60003C045 = { @@ -357,7 +389,7 @@ ); mainGroup = 33CC10E42044A3C60003C045; packageReferences = ( - 337257E62C626C94005E6518 /* XCRemoteSwiftPackageReference "ocmock" */, + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */, ); productRefGroup = 33CC10EE2044A3C60003C045 /* Products */; projectDirPath = ""; @@ -390,67 +422,67 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 3399D490228B24CF009A79C7 /* ShellScript */ = { + 05D7642BA03EFE4FAEF7BAB1 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( ); inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", ); + name = "[CP] Check Pods Manifest.lock"; outputFileListPaths = ( ); outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; }; - 33CC111E2044C6BF0003C045 /* ShellScript */ = { + 3399D490228B24CF009A79C7 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - Flutter/ephemeral/FlutterInputs.xcfilelist, ); inputPaths = ( - Flutter/ephemeral/tripwire, ); outputFileListPaths = ( - Flutter/ephemeral/FlutterOutputs.xcfilelist, ); outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; + shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n"; }; - 52BDF375441D3D4ACF9978EC /* [CP] Check Pods Manifest.lock */ = { + 33CC111E2044C6BF0003C045 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( + Flutter/ephemeral/FlutterInputs.xcfilelist, ); inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", + Flutter/ephemeral/tripwire, ); - name = "[CP] Check Pods Manifest.lock"; outputFileListPaths = ( + Flutter/ephemeral/FlutterOutputs.xcfilelist, ); outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; + shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; }; - 5B369AB3CC6C4456A15F9A02 /* [CP] Check Pods Manifest.lock */ = { + 4D1FE18AFCDA46E722527658 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -465,14 +497,14 @@ outputFileListPaths = ( ); outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt", + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - AE091060DB78993007C49A9B /* [CP] Embed Pods Frameworks */ = { + D37A0828FB9E6E410964A0F6 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -496,27 +528,37 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 33CF71822C090A5900FB3AA4 /* FWFNavigationDelegateHostApiTests.m in Sources */, - 33CF71832C090A5900FB3AA4 /* FWFObjectHostApiTests.m in Sources */, - 33CF71762C090A5900FB3AA4 /* FWFPreferencesHostApiTests.m in Sources */, - 33CF717E2C090A5900FB3AA4 /* FWFURLTests.m in Sources */, - 33CF71702C090A5900FB3AA4 /* FWFUIDelegateHostApiTests.m in Sources */, - 33CF717C2C090A5900FB3AA4 /* FWFScriptMessageHandlerHostApiTests.m in Sources */, - 33CF716F2C090A5900FB3AA4 /* FWFURLProtectionSpaceHostApiTests.m in Sources */, - 33CF717A2C090A5900FB3AA4 /* FWFScrollViewDelegateHostApiTests.m in Sources */, - 33CF71782C090A5900FB3AA4 /* FWFScrollViewHostApiTests.m in Sources */, - 33CF71712C090A5900FB3AA4 /* FWFErrorTests.m in Sources */, - 33CF71812C090A5900FB3AA4 /* FWFHTTPCookieStoreHostApiTests.m in Sources */, - 33CF717F2C090A5900FB3AA4 /* FWFWebViewConfigurationHostApiTests.m in Sources */, - 33CF717B2C090A5900FB3AA4 /* FWFUserContentControllerHostApiTests.m in Sources */, - 33CF71802C090A5900FB3AA4 /* FWFWebsiteDataStoreHostApiTests.m in Sources */, - 33CF71752C090A5900FB3AA4 /* FWFWebViewFlutterWKWebViewExternalAPITests.m in Sources */, - 33CF717D2C090A5900FB3AA4 /* FWFURLAuthenticationChallengeHostApiTests.m in Sources */, - 33CF71772C090A5900FB3AA4 /* FWFWebViewHostApiTests.m in Sources */, - 33CF71742C090A5900FB3AA4 /* FWFURLCredentialHostApiTests.m in Sources */, - 33CF71732C090A5900FB3AA4 /* FWFDataConvertersTests.m in Sources */, - 33CF71792C090A5900FB3AA4 /* FWFInstanceManagerTests.m in Sources */, - 33CF71722C090A5900FB3AA4 /* FWFUIViewHostApiTests.m in Sources */, + 8FC45F732D5C0C37004E03E8 /* WebpagePreferencesProxyAPITests.swift in Sources */, + 8FF1FEA22D37201300A5E400 /* NSObjectProxyAPITests.swift in Sources */, + 8FF1FEA32D37201300A5E400 /* ScrollViewProxyAPITests.swift in Sources */, + 8FF1FEA42D37201300A5E400 /* URLAuthenticationChallengeProxyAPITests.swift in Sources */, + 8FF1FEA52D37201300A5E400 /* NavigationResponseProxyAPITests.swift in Sources */, + 8FF1FEA62D37201300A5E400 /* FWFWebViewFlutterWKWebViewExternalAPITests.swift in Sources */, + 8FF1FEA72D37201300A5E400 /* UserContentControllerProxyAPITests.swift in Sources */, + 8FF1FEA82D37201300A5E400 /* TestBinaryMessenger.swift in Sources */, + 8FF1FEA92D37201300A5E400 /* TestProxyApiRegistrar.swift in Sources */, + 8FF1FEAA2D37201300A5E400 /* HTTPURLResponseProxyAPITests.swift in Sources */, + 8FF1FEAB2D37201300A5E400 /* AuthenticationChallengeResponseProxyAPITests.swift in Sources */, + 8FF1FEAC2D37201300A5E400 /* UIViewProxyAPITests.swift in Sources */, + 8FF1FEAD2D37201300A5E400 /* WebViewConfigurationProxyAPITests.swift in Sources */, + 8FF1FEAE2D37201300A5E400 /* NavigationActionProxyAPITests.swift in Sources */, + 8FF1FEAF2D37201300A5E400 /* ScrollViewDelegateProxyAPITests.swift in Sources */, + 8FF1FEB02D37201300A5E400 /* ErrorProxyAPITests.swift in Sources */, + 8FF1FEB12D37201300A5E400 /* UIDelegateProxyAPITests.swift in Sources */, + 8FF1FEB22D37201300A5E400 /* WebViewProxyAPITests.swift in Sources */, + 8FF1FEB32D37201300A5E400 /* URLProtectionSpaceProxyAPITests.swift in Sources */, + 8FF1FEB42D37201300A5E400 /* NavigationDelegateProxyAPITests.swift in Sources */, + 8FF1FEB52D37201300A5E400 /* WebsiteDataStoreProxyAPITests.swift in Sources */, + 8FF1FEB62D37201300A5E400 /* PreferencesProxyAPITests.swift in Sources */, + 8FF1FEB72D37201300A5E400 /* URLCredentialProxyAPITests.swift in Sources */, + 8FF1FEB82D37201300A5E400 /* URLRequestProxyAPITests.swift in Sources */, + 8FF1FEB92D37201300A5E400 /* UserScriptProxyAPITests.swift in Sources */, + 8FF1FEBA2D37201300A5E400 /* ScriptMessageHandlerProxyAPITests.swift in Sources */, + 8FF1FEBB2D37201300A5E400 /* SecurityOriginProxyAPITests.swift in Sources */, + 8FF1FEBC2D37201300A5E400 /* HTTPCookieStoreProxyAPITests.swift in Sources */, + 8FF1FEBD2D37201300A5E400 /* ScriptMessageProxyAPITests.swift in Sources */, + 8FF1FEBE2D37201300A5E400 /* FrameInfoProxyAPITests.swift in Sources */, + 8FF1FEBF2D37201300A5E400 /* HTTPCookieProxyAPITests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -560,7 +602,7 @@ /* Begin XCBuildConfiguration section */ 331C80DB294CF71000263BE5 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = BB0A609D94A71B55CFCFC007 /* Pods-RunnerTests.debug.xcconfig */; + baseConfigurationReference = 69E635CFAEEB8242654D4BBC /* Pods-RunnerTests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CLANG_ENABLE_MODULES = YES; @@ -569,6 +611,7 @@ MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.plugins.example.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "RunnerTests/RunnerTests-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/example.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/example"; @@ -577,7 +620,7 @@ }; 331C80DC294CF71000263BE5 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 8E3B7819B86A3E8D5B2787F8 /* Pods-RunnerTests.release.xcconfig */; + baseConfigurationReference = 7D83F970E1160B09690C7723 /* Pods-RunnerTests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CLANG_ENABLE_MODULES = YES; @@ -586,6 +629,7 @@ MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.plugins.example.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "RunnerTests/RunnerTests-Bridging-Header.h"; SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/example.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/example"; }; @@ -593,7 +637,7 @@ }; 331C80DD294CF71000263BE5 /* Profile */ = { isa = XCBuildConfiguration; - baseConfigurationReference = B29CEB47BBE7D438B12895F3 /* Pods-RunnerTests.profile.xcconfig */; + baseConfigurationReference = B8188FDAD7773BAC85CB6DE9 /* Pods-RunnerTests.profile.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CLANG_ENABLE_MODULES = YES; @@ -602,6 +646,7 @@ MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.plugins.example.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "RunnerTests/RunnerTests-Bridging-Header.h"; SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/example.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/example"; }; @@ -879,22 +924,17 @@ }; /* End XCConfigurationList section */ -/* Begin XCRemoteSwiftPackageReference section */ - 337257E62C626C94005E6518 /* XCRemoteSwiftPackageReference "ocmock" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/erikdoe/ocmock"; - requirement = { - kind = revision; - revision = fe1661a3efed11831a6452f4b1a0c5e6ddc08c3d; - }; +/* Begin XCLocalSwiftPackageReference section */ + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; }; -/* End XCRemoteSwiftPackageReference section */ +/* End XCLocalSwiftPackageReference section */ /* Begin XCSwiftPackageProductDependency section */ - 337257E72C626C94005E6518 /* OCMock */ = { + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = { isa = XCSwiftPackageProductDependency; - package = 337257E62C626C94005E6518 /* XCRemoteSwiftPackageReference "ocmock" */; - productName = OCMock; + productName = FlutterGeneratedPluginSwiftPackage; }; /* End XCSwiftPackageProductDependency section */ }; diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index be6977d7622..6f094588e81 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -5,6 +5,24 @@ + + + + + + + + + + diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/macos/RunnerTests/RunnerTests-Bridging-Header.h b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/RunnerTests/RunnerTests-Bridging-Header.h new file mode 100644 index 00000000000..e7217c7d7b3 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/RunnerTests/RunnerTests-Bridging-Header.h @@ -0,0 +1,3 @@ +// 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. 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/example/pubspec.yaml b/packages/webview_flutter/webview_flutter_wkwebview/example/pubspec.yaml index 2212808e098..051e60afa66 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/example/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter_wkwebview/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Demonstrates how to use the webview_flutter_wkwebview plugin. publish_to: none environment: - sdk: ^3.3.0 - flutter: ">=3.19.0" + sdk: ^3.4.0 + flutter: ">=3.22.0" dependencies: flutter: diff --git a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/common/instance_manager.dart b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/common/instance_manager.dart deleted file mode 100644 index 3cc100aebd4..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/common/instance_manager.dart +++ /dev/null @@ -1,198 +0,0 @@ -// 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 'package:flutter/foundation.dart'; - -/// An immutable object that can provide functional copies of itself. -/// -/// All implementers are expected to be immutable as defined by the annotation. -@immutable -mixin Copyable { - /// Instantiates and returns a functionally identical object to oneself. - /// - /// Outside of tests, this method should only ever be called by - /// [InstanceManager]. - /// - /// Subclasses should always override their parent's implementation of this - /// method. - @protected - Copyable copy(); -} - -/// Maintains instances used to communicate with the native objects they -/// represent. -/// -/// Added instances are stored as weak references and their copies are stored -/// as strong references to maintain access to their variables and callback -/// methods. Both are stored with the same identifier. -/// -/// When a weak referenced instance becomes inaccessible, -/// [onWeakReferenceRemoved] is called with its associated identifier. -/// -/// If an instance is retrieved and has the possibility to be used, -/// (e.g. calling [getInstanceWithWeakReference]) a copy of the strong reference -/// is added as a weak reference with the same identifier. This prevents a -/// scenario where the weak referenced instance was released and then later -/// returned by the host platform. -class InstanceManager { - /// Constructs an [InstanceManager]. - InstanceManager({required void Function(int) onWeakReferenceRemoved}) { - this.onWeakReferenceRemoved = (int identifier) { - _weakInstances.remove(identifier); - onWeakReferenceRemoved(identifier); - }; - _finalizer = Finalizer(this.onWeakReferenceRemoved); - } - - // Identifiers are locked to a specific range to avoid collisions with objects - // created simultaneously by the host platform. - // Host uses identifiers >= 2^16 and Dart is expected to use values n where, - // 0 <= n < 2^16. - static const int _maxDartCreatedIdentifier = 65536; - - // Expando is used because it doesn't prevent its keys from becoming - // inaccessible. This allows the manager to efficiently retrieve an identifier - // of an instance without holding a strong reference to that instance. - // - // It also doesn't use `==` to search for identifiers, which would lead to an - // infinite loop when comparing an object to its copy. (i.e. which was caused - // by calling instanceManager.getIdentifier() inside of `==` while this was a - // HashMap). - final Expando _identifiers = Expando(); - final Map> _weakInstances = - >{}; - final Map _strongInstances = {}; - late final Finalizer _finalizer; - int _nextIdentifier = 0; - - /// Called when a weak referenced instance is removed by [removeWeakReference] - /// or becomes inaccessible. - late final void Function(int) onWeakReferenceRemoved; - - /// Adds a new instance that was instantiated by Dart. - /// - /// In other words, Dart wants to add a new instance that will represent - /// an object that will be instantiated on the host platform. - /// - /// Throws assertion error if the instance has already been added. - /// - /// Returns the randomly generated id of the [instance] added. - int addDartCreatedInstance(Copyable instance) { - assert(getIdentifier(instance) == null); - - final int identifier = _nextUniqueIdentifier(); - _addInstanceWithIdentifier(instance, identifier); - return identifier; - } - - /// Removes the instance, if present, and call [onWeakReferenceRemoved] with - /// its identifier. - /// - /// Returns the identifier associated with the removed instance. Otherwise, - /// `null` if the instance was not found in this manager. - /// - /// This does not remove the the strong referenced instance associated with - /// [instance]. This can be done with [remove]. - int? removeWeakReference(Copyable instance) { - final int? identifier = getIdentifier(instance); - if (identifier == null) { - return null; - } - - _identifiers[instance] = null; - _finalizer.detach(instance); - onWeakReferenceRemoved(identifier); - - return identifier; - } - - /// Removes [identifier] and its associated strongly referenced instance, if - /// present, from the manager. - /// - /// Returns the strong referenced instance associated with [identifier] before - /// it was removed. Returns `null` if [identifier] was not associated with - /// any strong reference. - /// - /// This does not remove the the weak referenced instance associtated with - /// [identifier]. This can be done with [removeWeakReference]. - T? remove(int identifier) { - return _strongInstances.remove(identifier) as T?; - } - - /// Retrieves the instance associated with identifier. - /// - /// The value returned is chosen from the following order: - /// - /// 1. A weakly referenced instance associated with identifier. - /// 2. If the only instance associated with identifier is a strongly - /// referenced instance, a copy of the instance is added as a weak reference - /// with the same identifier. Returning the newly created copy. - /// 3. If no instance is associated with identifier, returns null. - /// - /// This method also expects the host `InstanceManager` to have a strong - /// reference to the instance the identifier is associated with. - T? getInstanceWithWeakReference(int identifier) { - final Copyable? weakInstance = _weakInstances[identifier]?.target; - - if (weakInstance == null) { - final Copyable? strongInstance = _strongInstances[identifier]; - if (strongInstance != null) { - final Copyable copy = strongInstance.copy(); - _identifiers[copy] = identifier; - _weakInstances[identifier] = WeakReference(copy); - _finalizer.attach(copy, identifier, detach: copy); - return copy as T; - } - return strongInstance as T?; - } - - return weakInstance as T; - } - - /// Retrieves the identifier associated with instance. - int? getIdentifier(Copyable instance) { - return _identifiers[instance]; - } - - /// Adds a new instance that was instantiated by the host platform. - /// - /// In other words, the host platform wants to add a new instance that - /// represents an object on the host platform. Stored with [identifier]. - /// - /// Throws assertion error if the instance or its identifier has already been - /// added. - /// - /// Returns unique identifier of the [instance] added. - void addHostCreatedInstance(Copyable instance, int identifier) { - assert(!containsIdentifier(identifier)); - assert(getIdentifier(instance) == null); - assert(identifier >= 0); - _addInstanceWithIdentifier(instance, identifier); - } - - void _addInstanceWithIdentifier(Copyable instance, int identifier) { - _identifiers[instance] = identifier; - _weakInstances[identifier] = WeakReference(instance); - _finalizer.attach(instance, identifier, detach: instance); - - final Copyable copy = instance.copy(); - _identifiers[copy] = identifier; - _strongInstances[identifier] = copy; - } - - /// Whether this manager contains the given [identifier]. - bool containsIdentifier(int identifier) { - return _weakInstances.containsKey(identifier) || - _strongInstances.containsKey(identifier); - } - - int _nextUniqueIdentifier() { - late int identifier; - do { - identifier = _nextIdentifier; - _nextIdentifier = (_nextIdentifier + 1) % _maxDartCreatedIdentifier; - } while (containsIdentifier(identifier)); - return identifier; - } -} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/common/platform_webview.dart b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/common/platform_webview.dart new file mode 100644 index 00000000000..7a9638ec099 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/common/platform_webview.dart @@ -0,0 +1,400 @@ +// 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 'package:flutter/foundation.dart'; + +import 'web_kit.g.dart'; + +/// Platform agnostic native WebView. +/// +/// iOS and macOS reference different `WebView` implementations, so this handles +/// delegating calls to the implementation of the current platform. +class PlatformWebView { + /// Creates a [PlatformWebView]. + PlatformWebView({ + required WKWebViewConfiguration initialConfiguration, + void Function( + NSObject instance, + String? keyPath, + NSObject? object, + Map? change, + )? observeValue, + }) { + switch (defaultTargetPlatform) { + case TargetPlatform.iOS: + nativeWebView = UIViewWKWebView( + initialConfiguration: initialConfiguration, + observeValue: observeValue, + ); + case TargetPlatform.macOS: + nativeWebView = NSViewWKWebView( + initialConfiguration: initialConfiguration, + observeValue: observeValue, + ); + case _: + throw UnimplementedError('$defaultTargetPlatform is not supported.'); + } + } + + /// Creates a [PlatformWebView] with the native WebView instance. + PlatformWebView.fromNativeWebView(WKWebView webView) + : nativeWebView = webView; + + /// The underlying native WebView instance. + late final WKWebView nativeWebView; + + /// Registers the observer object to receive KVO notifications for the key + /// path relative to the object receiving this message. + Future addObserver( + NSObject observer, + String keyPath, + List options, + ) { + final WKWebView webView = nativeWebView; + switch (webView) { + case UIViewWKWebView(): + return webView.addObserver(observer, keyPath, options); + case NSViewWKWebView(): + return webView.addObserver(observer, keyPath, options); + } + + throw UnimplementedError('${webView.runtimeType} is not supported.'); + } + + /// A Boolean value that indicates whether there is a valid back item in the + /// back-forward list. + Future canGoBack() { + final WKWebView webView = nativeWebView; + switch (webView) { + case UIViewWKWebView(): + return webView.canGoBack(); + case NSViewWKWebView(): + return webView.canGoBack(); + } + + throw UnimplementedError('${webView.runtimeType} is not supported.'); + } + + /// A Boolean value that indicates whether there is a valid forward item in + /// the back-forward list. + Future canGoForward() { + final WKWebView webView = nativeWebView; + switch (webView) { + case UIViewWKWebView(): + return webView.canGoForward(); + case NSViewWKWebView(): + return webView.canGoForward(); + } + + throw UnimplementedError('${webView.runtimeType} is not supported.'); + } + + /// The object that contains the configuration details for the web view. + WKWebViewConfiguration get configuration { + final WKWebView webView = nativeWebView; + switch (webView) { + case UIViewWKWebView(): + return webView.configuration; + case NSViewWKWebView(): + return webView.configuration; + } + + throw UnimplementedError('${webView.runtimeType} is not supported.'); + } + + /// Evaluates the specified JavaScript string. + Future evaluateJavaScript(String javaScriptString) { + final WKWebView webView = nativeWebView; + switch (webView) { + case UIViewWKWebView(): + return webView.evaluateJavaScript(javaScriptString); + case NSViewWKWebView(): + return webView.evaluateJavaScript(javaScriptString); + } + + throw UnimplementedError('${webView.runtimeType} is not supported.'); + } + + /// The custom user agent string. + Future getCustomUserAgent() { + final WKWebView webView = nativeWebView; + switch (webView) { + case UIViewWKWebView(): + return webView.getCustomUserAgent(); + case NSViewWKWebView(): + return webView.getCustomUserAgent(); + } + + throw UnimplementedError('${webView.runtimeType} is not supported.'); + } + + /// An estimate of what fraction of the current navigation has been loaded. + Future getEstimatedProgress() { + final WKWebView webView = nativeWebView; + switch (webView) { + case UIViewWKWebView(): + return webView.getEstimatedProgress(); + case NSViewWKWebView(): + return webView.getEstimatedProgress(); + } + + throw UnimplementedError('${webView.runtimeType} is not supported.'); + } + + /// The page title. + Future getTitle() { + final WKWebView webView = nativeWebView; + switch (webView) { + case UIViewWKWebView(): + return webView.getTitle(); + case NSViewWKWebView(): + return webView.getTitle(); + } + + throw UnimplementedError('${webView.runtimeType} is not supported.'); + } + + /// The URL being requested. + Future getUrl() { + final WKWebView webView = nativeWebView; + switch (webView) { + case UIViewWKWebView(): + return webView.getUrl(); + case NSViewWKWebView(): + return webView.getUrl(); + } + + throw UnimplementedError('${webView.runtimeType} is not supported.'); + } + + /// Navigates to the back item in the back-forward list. + Future goBack() { + final WKWebView webView = nativeWebView; + switch (webView) { + case UIViewWKWebView(): + return webView.goBack(); + case NSViewWKWebView(): + return webView.goBack(); + } + + throw UnimplementedError('${webView.runtimeType} is not supported.'); + } + + /// Navigates to the forward item in the back-forward list. + Future goForward() { + final WKWebView webView = nativeWebView; + switch (webView) { + case UIViewWKWebView(): + return webView.goForward(); + case NSViewWKWebView(): + return webView.goForward(); + } + + throw UnimplementedError('${webView.runtimeType} is not supported.'); + } + + /// Loads the web content that the specified URL request object references and + /// navigates to that content. + Future load(URLRequest request) { + final WKWebView webView = nativeWebView; + switch (webView) { + case UIViewWKWebView(): + return webView.load(request); + case NSViewWKWebView(): + return webView.load(request); + } + + throw UnimplementedError('${webView.runtimeType} is not supported.'); + } + + /// Loads the web content from the specified file and navigates to it. + Future loadFileUrl(String url, String readAccessUrl) { + final WKWebView webView = nativeWebView; + switch (webView) { + case UIViewWKWebView(): + return webView.loadFileUrl(url, readAccessUrl); + case NSViewWKWebView(): + return webView.loadFileUrl(url, readAccessUrl); + } + + throw UnimplementedError('${webView.runtimeType} is not supported.'); + } + + /// Convenience method to load a Flutter asset. + Future loadFlutterAsset(String key) { + final WKWebView webView = nativeWebView; + switch (webView) { + case UIViewWKWebView(): + return webView.loadFlutterAsset(key); + case NSViewWKWebView(): + return webView.loadFlutterAsset(key); + } + + throw UnimplementedError('${webView.runtimeType} is not supported.'); + } + + /// Loads the contents of the specified HTML string and navigates to it. + Future loadHtmlString(String string, String? baseUrl) { + final WKWebView webView = nativeWebView; + switch (webView) { + case UIViewWKWebView(): + return webView.loadHtmlString(string, baseUrl); + case NSViewWKWebView(): + return webView.loadHtmlString(string, baseUrl); + } + + throw UnimplementedError('${webView.runtimeType} is not supported.'); + } + + /// Informs the observing object when the value at the specified key path + /// relative to the observed object has changed. + void Function(NSObject pigeonInstance, String? keyPath, NSObject? object, + Map? change)? get observeValue { + final WKWebView webView = nativeWebView; + switch (webView) { + case UIViewWKWebView(): + return webView.observeValue; + case NSViewWKWebView(): + return webView.observeValue; + } + + throw UnimplementedError('${webView.runtimeType} is not supported.'); + } + + /// Reloads the current webpage. + Future reload() { + final WKWebView webView = nativeWebView; + switch (webView) { + case UIViewWKWebView(): + return webView.reload(); + case NSViewWKWebView(): + return webView.reload(); + } + + throw UnimplementedError('${webView.runtimeType} is not supported.'); + } + + /// Stops the observer object from receiving change notifications for the + /// property specified by the key path relative to the object receiving this + /// message. + Future removeObserver(NSObject object, String keyPath) { + final WKWebView webView = nativeWebView; + switch (webView) { + case UIViewWKWebView(): + return webView.removeObserver(object, keyPath); + case NSViewWKWebView(): + return webView.removeObserver(object, keyPath); + } + + throw UnimplementedError('${webView.runtimeType} is not supported.'); + } + + /// The scroll view associated with the web view. + UIScrollView get scrollView { + final WKWebView webView = nativeWebView; + switch (webView) { + case UIViewWKWebView(): + return webView.scrollView; + case NSViewWKWebView(): + throw UnimplementedError('scrollView is not implemented on macOS'); + } + + throw UnimplementedError('${webView.runtimeType} is not supported.'); + } + + /// A Boolean value that indicates whether horizontal swipe gestures trigger + /// backward and forward page navigation. + Future setAllowsBackForwardNavigationGestures(bool allow) { + final WKWebView webView = nativeWebView; + switch (webView) { + case UIViewWKWebView(): + return webView.setAllowsBackForwardNavigationGestures(allow); + case NSViewWKWebView(): + return webView.setAllowsBackForwardNavigationGestures(allow); + } + + throw UnimplementedError('${webView.runtimeType} is not supported.'); + } + + /// The view’s background color. + Future setBackgroundColor(int? value) { + final WKWebView webView = nativeWebView; + switch (webView) { + case UIViewWKWebView(): + return webView.setBackgroundColor(value); + case NSViewWKWebView(): + // TODO(stuartmorgan): Implement background color support. + throw UnimplementedError('backgroundColor is not implemented on macOS'); + } + + throw UnimplementedError('${webView.runtimeType} is not supported.'); + } + + /// The custom user agent string. + Future setCustomUserAgent(String? userAgent) { + final WKWebView webView = nativeWebView; + switch (webView) { + case UIViewWKWebView(): + return webView.setCustomUserAgent(userAgent); + case NSViewWKWebView(): + return webView.setCustomUserAgent(userAgent); + } + + throw UnimplementedError('${webView.runtimeType} is not supported.'); + } + + /// A Boolean value that indicates whether you can inspect the view with + /// Safari Web Inspector. + Future setInspectable(bool inspectable) { + final WKWebView webView = nativeWebView; + switch (webView) { + case UIViewWKWebView(): + return webView.setInspectable(inspectable); + case NSViewWKWebView(): + return webView.setInspectable(inspectable); + } + + throw UnimplementedError('${webView.runtimeType} is not supported.'); + } + + /// The object you use to manage navigation behavior for the web view. + Future setNavigationDelegate(WKNavigationDelegate delegate) { + final WKWebView webView = nativeWebView; + switch (webView) { + case UIViewWKWebView(): + return webView.setNavigationDelegate(delegate); + case NSViewWKWebView(): + return webView.setNavigationDelegate(delegate); + } + + throw UnimplementedError('${webView.runtimeType} is not supported.'); + } + + /// A Boolean value that determines whether the view is opaque. + Future setOpaque(bool opaque) { + final WKWebView webView = nativeWebView; + switch (webView) { + case UIViewWKWebView(): + return webView.setOpaque(opaque); + case NSViewWKWebView(): + throw UnimplementedError('opaque is not implemented on macOS'); + } + + throw UnimplementedError('${webView.runtimeType} is not supported.'); + } + + /// The object you use to integrate custom user interface elements, such as + /// contextual menus or panels, into web view interactions. + Future setUIDelegate(WKUIDelegate delegate) { + final WKWebView webView = nativeWebView; + switch (webView) { + case UIViewWKWebView(): + return webView.setUIDelegate(delegate); + case NSViewWKWebView(): + return webView.setUIDelegate(delegate); + } + + throw UnimplementedError('${webView.runtimeType} is not supported.'); + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/common/weak_reference_utils.dart b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/common/weak_reference_utils.dart index f12485ad6e7..014d9eb42ea 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/common/weak_reference_utils.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/common/weak_reference_utils.dart @@ -18,7 +18,7 @@ /// ) { /// weakReference.target?.onJavascriptChannelMessage( /// message.name, -/// message.body!.toString(), +/// message.body.toString(), /// ); /// }; /// }, 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 38e4cb187cf..ee91ba63f41 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,15 +1,17 @@ // 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 (v18.0.0), do not edit directly. +// Autogenerated from Pigeon (v24.2.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 import 'dart:async'; import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; -import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer; +import 'package:flutter/foundation.dart' + show ReadBuffer, WriteBuffer, immutable, protected; import 'package:flutter/services.dart'; +import 'package:flutter/widgets.dart' show WidgetsFlutterBinding; PlatformException _createConnectionError(String channelName) { return PlatformException( @@ -29,1403 +31,3614 @@ List wrapResponse( return [error.code, error.message, error.details]; } -/// Mirror of NSKeyValueObservingOptions. +/// An immutable object that serves as the base class for all ProxyApis and +/// can provide functional copies of itself. /// -/// See https://developer.apple.com/documentation/foundation/nskeyvalueobservingoptions?language=objc. -enum NSKeyValueObservingOptionsEnum { +/// All implementers are expected to be [immutable] as defined by the annotation +/// and override [pigeon_copy] returning an instance of itself. +@immutable +abstract class PigeonInternalProxyApiBaseClass { + /// Construct a [PigeonInternalProxyApiBaseClass]. + PigeonInternalProxyApiBaseClass({ + this.pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + }) : pigeon_instanceManager = + pigeon_instanceManager ?? PigeonInstanceManager.instance; + + /// Sends and receives binary data across the Flutter platform barrier. + /// + /// If it is null, the default BinaryMessenger will be used, which routes to + /// the host platform. + @protected + final BinaryMessenger? pigeon_binaryMessenger; + + /// Maintains instances stored to communicate with native language objects. + final PigeonInstanceManager pigeon_instanceManager; + + /// Instantiates and returns a functionally identical object to oneself. + /// + /// Outside of tests, this method should only ever be called by + /// [PigeonInstanceManager]. + /// + /// Subclasses should always override their parent's implementation of this + /// method. + @protected + PigeonInternalProxyApiBaseClass pigeon_copy(); +} + +/// Maintains instances used to communicate with the native objects they +/// represent. +/// +/// Added instances are stored as weak references and their copies are stored +/// as strong references to maintain access to their variables and callback +/// methods. Both are stored with the same identifier. +/// +/// When a weak referenced instance becomes inaccessible, +/// [onWeakReferenceRemoved] is called with its associated identifier. +/// +/// If an instance is retrieved and has the possibility to be used, +/// (e.g. calling [getInstanceWithWeakReference]) a copy of the strong reference +/// is added as a weak reference with the same identifier. This prevents a +/// scenario where the weak referenced instance was released and then later +/// returned by the host platform. +class PigeonInstanceManager { + /// Constructs a [PigeonInstanceManager]. + PigeonInstanceManager({required void Function(int) onWeakReferenceRemoved}) { + this.onWeakReferenceRemoved = (int identifier) { + _weakInstances.remove(identifier); + onWeakReferenceRemoved(identifier); + }; + _finalizer = Finalizer(this.onWeakReferenceRemoved); + } + + // Identifiers are locked to a specific range to avoid collisions with objects + // created simultaneously by the host platform. + // Host uses identifiers >= 2^16 and Dart is expected to use values n where, + // 0 <= n < 2^16. + static const int _maxDartCreatedIdentifier = 65536; + + /// The default [PigeonInstanceManager] used by ProxyApis. + /// + /// On creation, this manager makes a call to clear the native + /// InstanceManager. This is to prevent identifier conflicts after a host + /// restart. + static final PigeonInstanceManager instance = _initInstance(); + + // Expando is used because it doesn't prevent its keys from becoming + // inaccessible. This allows the manager to efficiently retrieve an identifier + // of an instance without holding a strong reference to that instance. + // + // It also doesn't use `==` to search for identifiers, which would lead to an + // infinite loop when comparing an object to its copy. (i.e. which was caused + // by calling instanceManager.getIdentifier() inside of `==` while this was a + // HashMap). + final Expando _identifiers = Expando(); + final Map> + _weakInstances = >{}; + final Map _strongInstances = + {}; + late final Finalizer _finalizer; + int _nextIdentifier = 0; + + /// Called when a weak referenced instance is removed by [removeWeakReference] + /// or becomes inaccessible. + late final void Function(int) onWeakReferenceRemoved; + + static PigeonInstanceManager _initInstance() { + WidgetsFlutterBinding.ensureInitialized(); + final _PigeonInternalInstanceManagerApi api = + _PigeonInternalInstanceManagerApi(); + // Clears the native `PigeonInstanceManager` on the initial use of the Dart one. + api.clear(); + final PigeonInstanceManager instanceManager = PigeonInstanceManager( + onWeakReferenceRemoved: (int identifier) { + api.removeStrongReference(identifier); + }, + ); + _PigeonInternalInstanceManagerApi.setUpMessageHandlers( + instanceManager: instanceManager); + URLRequest.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + HTTPURLResponse.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + URLResponse.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WKUserScript.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WKNavigationAction.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WKNavigationResponse.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WKFrameInfo.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + NSError.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WKScriptMessage.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WKSecurityOrigin.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + HTTPCookie.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + AuthenticationChallengeResponse.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WKWebsiteDataStore.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + UIView.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + UIScrollView.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WKWebViewConfiguration.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WKUserContentController.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WKPreferences.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WKScriptMessageHandler.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WKNavigationDelegate.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + NSObject.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + UIViewWKWebView.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + NSViewWKWebView.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WKWebView.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WKUIDelegate.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WKHTTPCookieStore.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + UIScrollViewDelegate.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + URLCredential.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + URLProtectionSpace.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + URLAuthenticationChallenge.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + URL.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + WKWebpagePreferences.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + return instanceManager; + } + + /// Adds a new instance that was instantiated by Dart. + /// + /// In other words, Dart wants to add a new instance that will represent + /// an object that will be instantiated on the host platform. + /// + /// Throws assertion error if the instance has already been added. + /// + /// Returns the randomly generated id of the [instance] added. + int addDartCreatedInstance(PigeonInternalProxyApiBaseClass instance) { + final int identifier = _nextUniqueIdentifier(); + _addInstanceWithIdentifier(instance, identifier); + return identifier; + } + + /// Removes the instance, if present, and call [onWeakReferenceRemoved] with + /// its identifier. + /// + /// Returns the identifier associated with the removed instance. Otherwise, + /// `null` if the instance was not found in this manager. + /// + /// This does not remove the strong referenced instance associated with + /// [instance]. This can be done with [remove]. + int? removeWeakReference(PigeonInternalProxyApiBaseClass instance) { + final int? identifier = getIdentifier(instance); + if (identifier == null) { + return null; + } + + _identifiers[instance] = null; + _finalizer.detach(instance); + onWeakReferenceRemoved(identifier); + + return identifier; + } + + /// Removes [identifier] and its associated strongly referenced instance, if + /// present, from the manager. + /// + /// Returns the strong referenced instance associated with [identifier] before + /// it was removed. Returns `null` if [identifier] was not associated with + /// any strong reference. + /// + /// This does not remove the weak referenced instance associated with + /// [identifier]. This can be done with [removeWeakReference]. + T? remove(int identifier) { + return _strongInstances.remove(identifier) as T?; + } + + /// Retrieves the instance associated with identifier. + /// + /// The value returned is chosen from the following order: + /// + /// 1. A weakly referenced instance associated with identifier. + /// 2. If the only instance associated with identifier is a strongly + /// referenced instance, a copy of the instance is added as a weak reference + /// with the same identifier. Returning the newly created copy. + /// 3. If no instance is associated with identifier, returns null. + /// + /// This method also expects the host `InstanceManager` to have a strong + /// reference to the instance the identifier is associated with. + T? getInstanceWithWeakReference( + int identifier) { + final PigeonInternalProxyApiBaseClass? weakInstance = + _weakInstances[identifier]?.target; + + if (weakInstance == null) { + final PigeonInternalProxyApiBaseClass? strongInstance = + _strongInstances[identifier]; + if (strongInstance != null) { + final PigeonInternalProxyApiBaseClass copy = + strongInstance.pigeon_copy(); + _identifiers[copy] = identifier; + _weakInstances[identifier] = + WeakReference(copy); + _finalizer.attach(copy, identifier, detach: copy); + return copy as T; + } + return strongInstance as T?; + } + + return weakInstance as T; + } + + /// Retrieves the identifier associated with instance. + int? getIdentifier(PigeonInternalProxyApiBaseClass instance) { + return _identifiers[instance]; + } + + /// Adds a new instance that was instantiated by the host platform. + /// + /// In other words, the host platform wants to add a new instance that + /// represents an object on the host platform. Stored with [identifier]. + /// + /// Throws assertion error if the instance or its identifier has already been + /// added. + /// + /// Returns unique identifier of the [instance] added. + void addHostCreatedInstance( + PigeonInternalProxyApiBaseClass instance, int identifier) { + _addInstanceWithIdentifier(instance, identifier); + } + + void _addInstanceWithIdentifier( + PigeonInternalProxyApiBaseClass instance, int identifier) { + assert(!containsIdentifier(identifier)); + assert(getIdentifier(instance) == null); + assert(identifier >= 0); + + _identifiers[instance] = identifier; + _weakInstances[identifier] = + WeakReference(instance); + _finalizer.attach(instance, identifier, detach: instance); + + final PigeonInternalProxyApiBaseClass copy = instance.pigeon_copy(); + _identifiers[copy] = identifier; + _strongInstances[identifier] = copy; + } + + /// Whether this manager contains the given [identifier]. + bool containsIdentifier(int identifier) { + return _weakInstances.containsKey(identifier) || + _strongInstances.containsKey(identifier); + } + + int _nextUniqueIdentifier() { + late int identifier; + do { + identifier = _nextIdentifier; + _nextIdentifier = (_nextIdentifier + 1) % _maxDartCreatedIdentifier; + } while (containsIdentifier(identifier)); + return identifier; + } +} + +/// Generated API for managing the Dart and native `PigeonInstanceManager`s. +class _PigeonInternalInstanceManagerApi { + /// Constructor for [_PigeonInternalInstanceManagerApi]. + _PigeonInternalInstanceManagerApi({BinaryMessenger? binaryMessenger}) + : pigeonVar_binaryMessenger = binaryMessenger; + + final BinaryMessenger? pigeonVar_binaryMessenger; + + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); + + static void setUpMessageHandlers({ + bool pigeon_clearHandlers = false, + BinaryMessenger? binaryMessenger, + PigeonInstanceManager? instanceManager, + }) { + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.PigeonInternalInstanceManager.removeStrongReference', + 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.PigeonInternalInstanceManager.removeStrongReference was null.'); + final List args = (message as List?)!; + final int? arg_identifier = (args[0] as int?); + assert(arg_identifier != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.PigeonInternalInstanceManager.removeStrongReference was null, expected non-null int.'); + try { + (instanceManager ?? PigeonInstanceManager.instance) + .remove(arg_identifier!); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + } + + Future removeStrongReference(int identifier) async { + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.PigeonInternalInstanceManager.removeStrongReference'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([identifier]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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; + } + } + + /// Clear the native `PigeonInstanceManager`. + /// + /// This is typically called after a hot restart. + Future clear() async { + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.PigeonInternalInstanceManager.clear'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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; + } + } +} + +class _PigeonInternalProxyApiBaseCodec extends _PigeonCodec { + const _PigeonInternalProxyApiBaseCodec(this.instanceManager); + final PigeonInstanceManager instanceManager; + @override + void writeValue(WriteBuffer buffer, Object? value) { + if (value is PigeonInternalProxyApiBaseClass) { + buffer.putUint8(128); + writeValue(buffer, instanceManager.getIdentifier(value)); + } else { + super.writeValue(buffer, value); + } + } + + @override + Object? readValueOfType(int type, ReadBuffer buffer) { + switch (type) { + case 128: + return instanceManager + .getInstanceWithWeakReference(readValue(buffer)! as int); + default: + return super.readValueOfType(type, buffer); + } + } +} + +/// The values that can be returned in a change dictionary. +/// +/// See https://developer.apple.com/documentation/foundation/nskeyvalueobservingoptions. +enum KeyValueObservingOptions { + /// Indicates that the change dictionary should provide the new attribute + /// value, if applicable. newValue, + + /// Indicates that the change dictionary should contain the old attribute + /// value, if applicable. oldValue, + + /// If specified, a notification should be sent to the observer immediately, + /// before the observer registration method even returns. initialValue, + + /// Whether separate notifications should be sent to the observer before and + /// after each change, instead of a single notification after the change. priorNotification, } -/// Mirror of NSKeyValueChange. +/// The kinds of changes that can be observed. /// -/// See https://developer.apple.com/documentation/foundation/nskeyvaluechange?language=objc. -enum NSKeyValueChangeEnum { +/// See https://developer.apple.com/documentation/foundation/nskeyvaluechange. +enum KeyValueChange { + /// Indicates that the value of the observed key path was set to a new value. setting, + + /// Indicates that an object has been inserted into the to-many relationship + /// that is being observed. insertion, + + /// Indicates that an object has been removed from the to-many relationship + /// that is being observed. removal, + + /// Indicates that an object has been replaced in the to-many relationship + /// that is being observed. replacement, + + /// The value is not recognized by the wrapper. + unknown, } -/// Mirror of NSKeyValueChangeKey. +/// The keys that can appear in the change dictionary. /// -/// See https://developer.apple.com/documentation/foundation/nskeyvaluechangekey?language=objc. -enum NSKeyValueChangeKeyEnum { +/// See https://developer.apple.com/documentation/foundation/nskeyvaluechangekey. +enum KeyValueChangeKey { + /// If the value of the `KeyValueChangeKey.kind` entry is + /// `KeyValueChange.insertion`, `KeyValueChange.removal`, or + /// `KeyValueChange.replacement`, the value of this key is a Set object that + /// contains the indexes of the inserted, removed, or replaced objects. indexes, + + /// An object that contains a value corresponding to one of the + /// `KeyValueChange` enum, indicating what sort of change has occurred. kind, + + /// If the value of the `KeyValueChange.kind` entry is + /// `KeyValueChange.setting, and `KeyValueObservingOptions.newValue` was + /// specified when the observer was registered, the value of this key is the + /// new value for the attribute. newValue, + + /// If the `KeyValueObservingOptions.priorNotification` option was specified + /// when the observer was registered this notification is sent prior to a + /// change. notificationIsPrior, + + /// If the value of the `KeyValueChange.kind` entry is + /// `KeyValueChange.setting`, and `KeyValueObservingOptions.old` was specified + /// when the observer was registered, the value of this key is the value + /// before the attribute was changed. oldValue, + + /// The value is not recognized by the wrapper. unknown, } -/// Mirror of WKUserScriptInjectionTime. +/// Constants for the times at which to inject script content into a webpage. /// -/// See https://developer.apple.com/documentation/webkit/wkuserscriptinjectiontime?language=objc. -enum WKUserScriptInjectionTimeEnum { +/// See https://developer.apple.com/documentation/webkit/wkuserscriptinjectiontime. +enum UserScriptInjectionTime { + /// A constant to inject the script after the creation of the webpage’s + /// document element, but before loading any other content. atDocumentStart, + + /// A constant to inject the script after the document finishes loading, but + /// before loading any other subresources. atDocumentEnd, + + /// The value is not recognized by the wrapper. + unknown, } -/// Mirror of WKAudiovisualMediaTypes. +/// The media types that require a user gesture to begin playing. /// -/// See [WKAudiovisualMediaTypes](https://developer.apple.com/documentation/webkit/wkaudiovisualmediatypes?language=objc). -enum WKAudiovisualMediaTypeEnum { +/// See https://developer.apple.com/documentation/webkit/wkaudiovisualmediatypes. +enum AudiovisualMediaType { + /// No media types require a user gesture to begin playing. none, + + /// Media types that contain audio require a user gesture to begin playing. audio, + + /// Media types that contain video require a user gesture to begin playing. video, + + /// All media types require a user gesture to begin playing. all, } -/// Mirror of WKWebsiteDataTypes. +/// A `WKWebsiteDataRecord` object includes these constants in its dataTypes +/// property. /// -/// See https://developer.apple.com/documentation/webkit/wkwebsitedatarecord/data_store_record_types?language=objc. -enum WKWebsiteDataTypeEnum { +/// See https://developer.apple.com/documentation/webkit/wkwebsitedatarecord/data_store_record_types. +enum WebsiteDataType { + /// Cookies. cookies, + + /// In-memory caches. memoryCache, + + /// On-disk caches. diskCache, + + /// HTML offline web app caches. offlineWebApplicationCache, + + /// HTML local storage. localStorage, + + /// HTML session storage. sessionStorage, + + /// WebSQL databases. webSQLDatabases, + + /// IndexedDB databases. indexedDBDatabases, } -/// Mirror of WKNavigationActionPolicy. +/// Constants that indicate whether to allow or cancel navigation to a webpage +/// from an action. /// -/// See https://developer.apple.com/documentation/webkit/wknavigationactionpolicy?language=objc. -enum WKNavigationActionPolicyEnum { +/// See https://developer.apple.com/documentation/webkit/wknavigationactionpolicy. +enum NavigationActionPolicy { + /// Allow the navigation to continue. allow, + + /// Cancel the navigation. cancel, + + /// Allow the download to proceed. + download, } -/// Mirror of WKNavigationResponsePolicy. +/// Constants that indicate whether to allow or cancel navigation to a webpage +/// from a response. /// -/// See https://developer.apple.com/documentation/webkit/wknavigationactionpolicy?language=objc. -enum WKNavigationResponsePolicyEnum { +/// See https://developer.apple.com/documentation/webkit/wknavigationresponsepolicy. +enum NavigationResponsePolicy { + /// Allow the navigation to continue. allow, + + /// Cancel the navigation. cancel, + + /// Allow the download to proceed. + download, } -/// Mirror of NSHTTPCookiePropertyKey. +/// Constants that define the supported keys in a cookie attributes dictionary. /// -/// See https://developer.apple.com/documentation/foundation/nshttpcookiepropertykey. -enum NSHttpCookiePropertyKeyEnum { +/// See https://developer.apple.com/documentation/foundation/httpcookiepropertykey. +enum HttpCookiePropertyKey { + /// A String object containing the comment for the cookie. comment, + + /// An Uri object or String object containing the comment URL for the cookie. commentUrl, + + /// Aa String object stating whether the cookie should be discarded at the end + /// of the session. discard, + + /// An String object containing the domain for the cookie. domain, + + /// An Date object or String object specifying the expiration date for the + /// cookie. expires, + + /// An String object containing an integer value stating how long in seconds + /// the cookie should be kept, at most. maximumAge, + + /// An String object containing the name of the cookie (required). name, + + /// A URL or String object containing the URL that set this cookie. originUrl, + + /// A String object containing the path for the cookie. path, + + /// An String object containing comma-separated integer values specifying the + /// ports for the cookie. port, + + /// A string indicating the same-site policy for the cookie. sameSitePolicy, + + /// A String object indicating that the cookie should be transmitted only over + /// secure channels. secure, + + /// A String object containing the value of the cookie. value, + + /// A String object that specifies the version of the cookie. version, + + /// The value is not recognized by the wrapper. + unknown, } -/// An object that contains information about an action that causes navigation -/// to occur. +/// The type of action that triggered the navigation. /// -/// Wraps [WKNavigationType](https://developer.apple.com/documentation/webkit/wknavigationaction?language=objc). -enum WKNavigationType { +/// See https://developer.apple.com/documentation/webkit/wknavigationtype. +enum NavigationType { /// A link activation. - /// - /// See https://developer.apple.com/documentation/webkit/wknavigationtype/wknavigationtypelinkactivated?language=objc. linkActivated, /// A request to submit a form. - /// - /// See https://developer.apple.com/documentation/webkit/wknavigationtype/wknavigationtypeformsubmitted?language=objc. - submitted, + formSubmitted, /// A request for the frame’s next or previous item. - /// - /// See https://developer.apple.com/documentation/webkit/wknavigationtype/wknavigationtypebackforward?language=objc. backForward, /// A request to reload the webpage. - /// - /// See https://developer.apple.com/documentation/webkit/wknavigationtype/wknavigationtypereload?language=objc. reload, /// A request to resubmit a form. - /// - /// See https://developer.apple.com/documentation/webkit/wknavigationtype/wknavigationtypeformresubmitted?language=objc. formResubmitted, /// A navigation request that originates for some other reason. - /// - /// See https://developer.apple.com/documentation/webkit/wknavigationtype/wknavigationtypeother?language=objc. other, - /// An unknown navigation type. - /// - /// This does not represent an actual value provided by the platform and only - /// indicates a value was provided that isn't currently supported. + /// The value is not recognized by the wrapper. unknown, } /// Possible permission decisions for device resource access. /// -/// See https://developer.apple.com/documentation/webkit/wkpermissiondecision?language=objc. -enum WKPermissionDecision { +/// See https://developer.apple.com/documentation/webkit/wkpermissiondecision. +enum PermissionDecision { /// Deny permission for the requested resource. - /// - /// See https://developer.apple.com/documentation/webkit/wkpermissiondecision/wkpermissiondecisiondeny?language=objc. deny, /// Deny permission for the requested resource. - /// - /// See https://developer.apple.com/documentation/webkit/wkpermissiondecision/wkpermissiondecisiongrant?language=objc. grant, /// Prompt the user for permission for the requested resource. - /// - /// See https://developer.apple.com/documentation/webkit/wkpermissiondecision/wkpermissiondecisionprompt?language=objc. prompt, } /// List of the types of media devices that can capture audio, video, or both. /// -/// See https://developer.apple.com/documentation/webkit/wkmediacapturetype?language=objc. -enum WKMediaCaptureType { +/// See https://developer.apple.com/documentation/webkit/wkmediacapturetype. +enum MediaCaptureType { /// A media device that can capture video. - /// - /// See https://developer.apple.com/documentation/webkit/wkmediacapturetype/wkmediacapturetypecamera?language=objc. camera, /// A media device or devices that can capture audio and video. - /// - /// See https://developer.apple.com/documentation/webkit/wkmediacapturetype/wkmediacapturetypecameraandmicrophone?language=objc. cameraAndMicrophone, /// A media device that can capture audio. - /// - /// See https://developer.apple.com/documentation/webkit/wkmediacapturetype/wkmediacapturetypemicrophone?language=objc. microphone, - /// An unknown media device. - /// - /// This does not represent an actual value provided by the platform and only - /// indicates a value was provided that isn't currently supported. + /// The value is not recognized by the wrapper. unknown, } /// Responses to an authentication challenge. /// -/// See https://developer.apple.com/documentation/foundation/nsurlsessionauthchallengedisposition?language=objc. -enum NSUrlSessionAuthChallengeDisposition { +/// See https://developer.apple.com/documentation/foundation/urlsession/authchallengedisposition. +enum UrlSessionAuthChallengeDisposition { /// Use the specified credential, which may be nil. - /// - /// See https://developer.apple.com/documentation/foundation/nsurlsessionauthchallengedisposition/nsurlsessionauthchallengeusecredential?language=objc. useCredential, /// Use the default handling for the challenge as though this delegate method /// were not implemented. - /// - /// See https://developer.apple.com/documentation/foundation/nsurlsessionauthchallengedisposition/nsurlsessionauthchallengeperformdefaulthandling?language=objc. performDefaultHandling, /// Cancel the entire request. - /// - /// See https://developer.apple.com/documentation/foundation/nsurlsessionauthchallengedisposition/nsurlsessionauthchallengecancelauthenticationchallenge?language=objc. cancelAuthenticationChallenge, /// Reject this challenge, and call the authentication delegate method again /// with the next authentication protection space. - /// - /// See https://developer.apple.com/documentation/foundation/nsurlsessionauthchallengedisposition/nsurlsessionauthchallengerejectprotectionspace?language=objc. rejectProtectionSpace, + + /// The value is not recognized by the wrapper. + unknown, } /// Specifies how long a credential will be kept. -enum NSUrlCredentialPersistence { +/// +/// See https://developer.apple.com/documentation/foundation/nsurlcredentialpersistence. +enum UrlCredentialPersistence { /// The credential should not be stored. - /// - /// See https://developer.apple.com/documentation/foundation/nsurlcredentialpersistence/nsurlcredentialpersistencenone?language=objc. none, /// The credential should be stored only for this session. - /// - /// See https://developer.apple.com/documentation/foundation/nsurlcredentialpersistence/nsurlcredentialpersistenceforsession?language=objc. - session, + forSession, /// The credential should be stored in the keychain. - /// - /// See https://developer.apple.com/documentation/foundation/nsurlcredentialpersistence/nsurlcredentialpersistencepermanent?language=objc. permanent, /// The credential should be stored permanently in the keychain, and in /// addition should be distributed to other devices based on the owning Apple /// ID. - /// - /// See https://developer.apple.com/documentation/foundation/nsurlcredentialpersistence/nsurlcredentialpersistencesynchronizable?language=objc. synchronizable, } -class NSKeyValueObservingOptionsEnumData { - NSKeyValueObservingOptionsEnumData({ - required this.value, - }); - - NSKeyValueObservingOptionsEnum value; - - Object encode() { - return [ - value.index, - ]; - } - - static NSKeyValueObservingOptionsEnumData decode(Object result) { - result as List; - return NSKeyValueObservingOptionsEnumData( - value: NSKeyValueObservingOptionsEnum.values[result[0]! as int], - ); - } -} - -class NSKeyValueChangeKeyEnumData { - NSKeyValueChangeKeyEnumData({ - required this.value, - }); - - NSKeyValueChangeKeyEnum value; - - Object encode() { - return [ - value.index, - ]; +class _PigeonCodec extends StandardMessageCodec { + const _PigeonCodec(); + @override + void writeValue(WriteBuffer buffer, Object? value) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is KeyValueObservingOptions) { + buffer.putUint8(129); + writeValue(buffer, value.index); + } else if (value is KeyValueChange) { + buffer.putUint8(130); + writeValue(buffer, value.index); + } else if (value is KeyValueChangeKey) { + buffer.putUint8(131); + writeValue(buffer, value.index); + } else if (value is UserScriptInjectionTime) { + buffer.putUint8(132); + writeValue(buffer, value.index); + } else if (value is AudiovisualMediaType) { + buffer.putUint8(133); + writeValue(buffer, value.index); + } else if (value is WebsiteDataType) { + buffer.putUint8(134); + writeValue(buffer, value.index); + } else if (value is NavigationActionPolicy) { + buffer.putUint8(135); + writeValue(buffer, value.index); + } else if (value is NavigationResponsePolicy) { + buffer.putUint8(136); + writeValue(buffer, value.index); + } else if (value is HttpCookiePropertyKey) { + buffer.putUint8(137); + writeValue(buffer, value.index); + } else if (value is NavigationType) { + buffer.putUint8(138); + writeValue(buffer, value.index); + } else if (value is PermissionDecision) { + buffer.putUint8(139); + writeValue(buffer, value.index); + } else if (value is MediaCaptureType) { + buffer.putUint8(140); + writeValue(buffer, value.index); + } else if (value is UrlSessionAuthChallengeDisposition) { + buffer.putUint8(141); + writeValue(buffer, value.index); + } else if (value is UrlCredentialPersistence) { + buffer.putUint8(142); + writeValue(buffer, value.index); + } else { + super.writeValue(buffer, value); + } } - static NSKeyValueChangeKeyEnumData decode(Object result) { - result as List; - return NSKeyValueChangeKeyEnumData( - value: NSKeyValueChangeKeyEnum.values[result[0]! as int], - ); + @override + Object? readValueOfType(int type, ReadBuffer buffer) { + switch (type) { + case 129: + final int? value = readValue(buffer) as int?; + return value == null ? null : KeyValueObservingOptions.values[value]; + case 130: + final int? value = readValue(buffer) as int?; + return value == null ? null : KeyValueChange.values[value]; + case 131: + final int? value = readValue(buffer) as int?; + return value == null ? null : KeyValueChangeKey.values[value]; + case 132: + final int? value = readValue(buffer) as int?; + return value == null ? null : UserScriptInjectionTime.values[value]; + case 133: + final int? value = readValue(buffer) as int?; + return value == null ? null : AudiovisualMediaType.values[value]; + case 134: + final int? value = readValue(buffer) as int?; + return value == null ? null : WebsiteDataType.values[value]; + case 135: + final int? value = readValue(buffer) as int?; + return value == null ? null : NavigationActionPolicy.values[value]; + case 136: + final int? value = readValue(buffer) as int?; + return value == null ? null : NavigationResponsePolicy.values[value]; + case 137: + final int? value = readValue(buffer) as int?; + return value == null ? null : HttpCookiePropertyKey.values[value]; + case 138: + final int? value = readValue(buffer) as int?; + return value == null ? null : NavigationType.values[value]; + case 139: + final int? value = readValue(buffer) as int?; + return value == null ? null : PermissionDecision.values[value]; + case 140: + final int? value = readValue(buffer) as int?; + return value == null ? null : MediaCaptureType.values[value]; + case 141: + final int? value = readValue(buffer) as int?; + return value == null + ? null + : UrlSessionAuthChallengeDisposition.values[value]; + case 142: + final int? value = readValue(buffer) as int?; + return value == null ? null : UrlCredentialPersistence.values[value]; + default: + return super.readValueOfType(type, buffer); + } } } -class WKUserScriptInjectionTimeEnumData { - WKUserScriptInjectionTimeEnumData({ - required this.value, - }); - - WKUserScriptInjectionTimeEnum value; - - Object encode() { - return [ - value.index, - ]; - } - - static WKUserScriptInjectionTimeEnumData decode(Object result) { - result as List; - return WKUserScriptInjectionTimeEnumData( - value: WKUserScriptInjectionTimeEnum.values[result[0]! as int], +/// A URL load request that is independent of protocol or URL scheme. +/// +/// See https://developer.apple.com/documentation/foundation/urlrequest. +class URLRequest extends NSObject { + URLRequest({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + super.observeValue, + required String url, + }) : super.pigeon_detached() { + final int pigeonVar_instanceIdentifier = + pigeon_instanceManager.addDartCreatedInstance(this); + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecURLRequest; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.pigeon_defaultConstructor'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([pigeonVar_instanceIdentifier, url]); + () async { + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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; + } + }(); } -} -class WKAudiovisualMediaTypeEnumData { - WKAudiovisualMediaTypeEnumData({ - required this.value, - }); - - WKAudiovisualMediaTypeEnum value; - - Object encode() { - return [ - value.index, - ]; + /// Constructs [URLRequest] 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 + URLRequest.pigeon_detached({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + super.observeValue, + }) : super.pigeon_detached(); + + late final _PigeonInternalProxyApiBaseCodec _pigeonVar_codecURLRequest = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); + + static void pigeon_setUpMessageHandlers({ + bool pigeon_clearHandlers = false, + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + URLRequest 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.URLRequest.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.URLRequest.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.URLRequest.pigeon_newInstance was null, expected non-null int.'); + try { + (pigeon_instanceManager ?? PigeonInstanceManager.instance) + .addHostCreatedInstance( + pigeon_newInstance?.call() ?? + URLRequest.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())); + } + }); + } + } } - static WKAudiovisualMediaTypeEnumData decode(Object result) { - result as List; - return WKAudiovisualMediaTypeEnumData( - value: WKAudiovisualMediaTypeEnum.values[result[0]! as int], + /// The URL being requested. + Future getUrl() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecURLRequest; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.getUrl'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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 (pigeonVar_replyList[0] as String?); + } } -} - -class WKWebsiteDataTypeEnumData { - WKWebsiteDataTypeEnumData({ - required this.value, - }); - WKWebsiteDataTypeEnum value; + /// The HTTP request method. + Future setHttpMethod(String? method) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecURLRequest; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.setHttpMethod'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, method]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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; + } + } - Object encode() { - return [ - value.index, - ]; + /// The HTTP request method. + Future getHttpMethod() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecURLRequest; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.getHttpMethod'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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 (pigeonVar_replyList[0] as String?); + } } - static WKWebsiteDataTypeEnumData decode(Object result) { - result as List; - return WKWebsiteDataTypeEnumData( - value: WKWebsiteDataTypeEnum.values[result[0]! as int], + /// The request body. + Future setHttpBody(Uint8List? body) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecURLRequest; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.setHttpBody'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, body]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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; + } } -} -class WKNavigationActionPolicyEnumData { - WKNavigationActionPolicyEnumData({ - required this.value, - }); + /// The request body. + Future getHttpBody() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecURLRequest; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.getHttpBody'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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 (pigeonVar_replyList[0] as Uint8List?); + } + } - WKNavigationActionPolicyEnum value; + /// A dictionary containing all of the HTTP header fields for a request. + Future setAllHttpHeaderFields(Map? fields) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecURLRequest; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.setAllHttpHeaderFields'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, fields]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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; + } + } - Object encode() { - return [ - value.index, - ]; + /// A dictionary containing all of the HTTP header fields for a request. + Future?> getAllHttpHeaderFields() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecURLRequest; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.getAllHttpHeaderFields'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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 (pigeonVar_replyList[0] as Map?) + ?.cast(); + } } - static WKNavigationActionPolicyEnumData decode(Object result) { - result as List; - return WKNavigationActionPolicyEnumData( - value: WKNavigationActionPolicyEnum.values[result[0]! as int], + @override + URLRequest pigeon_copy() { + return URLRequest.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + observeValue: observeValue, ); } } -class NSHttpCookiePropertyKeyEnumData { - NSHttpCookiePropertyKeyEnumData({ - required this.value, - }); +/// The metadata associated with the response to an HTTP protocol URL load +/// request. +/// +/// See https://developer.apple.com/documentation/foundation/httpurlresponse. +class HTTPURLResponse extends URLResponse { + /// Constructs [HTTPURLResponse] 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 + HTTPURLResponse.pigeon_detached({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + required this.statusCode, + super.observeValue, + }) : super.pigeon_detached(); - NSHttpCookiePropertyKeyEnum value; + /// The response’s HTTP status code. + final int statusCode; - Object encode() { - return [ - value.index, - ]; + static void pigeon_setUpMessageHandlers({ + bool pigeon_clearHandlers = false, + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + HTTPURLResponse Function(int statusCode)? 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.HTTPURLResponse.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.HTTPURLResponse.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.HTTPURLResponse.pigeon_newInstance was null, expected non-null int.'); + final int? arg_statusCode = (args[1] as int?); + assert(arg_statusCode != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.HTTPURLResponse.pigeon_newInstance was null, expected non-null int.'); + try { + (pigeon_instanceManager ?? PigeonInstanceManager.instance) + .addHostCreatedInstance( + pigeon_newInstance?.call(arg_statusCode!) ?? + HTTPURLResponse.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + statusCode: arg_statusCode!, + ), + 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())); + } + }); + } + } } - static NSHttpCookiePropertyKeyEnumData decode(Object result) { - result as List; - return NSHttpCookiePropertyKeyEnumData( - value: NSHttpCookiePropertyKeyEnum.values[result[0]! as int], + @override + HTTPURLResponse pigeon_copy() { + return HTTPURLResponse.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + statusCode: statusCode, + observeValue: observeValue, ); } } -class WKPermissionDecisionData { - WKPermissionDecisionData({ - required this.value, - }); - - WKPermissionDecision value; - - Object encode() { - return [ - value.index, - ]; +/// The metadata associated with the response to a URL load request, independent +/// of protocol and URL scheme. +/// +/// See https://developer.apple.com/documentation/foundation/urlresponse. +class URLResponse extends NSObject { + /// Constructs [URLResponse] 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 + URLResponse.pigeon_detached({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + super.observeValue, + }) : super.pigeon_detached(); + + static void pigeon_setUpMessageHandlers({ + bool pigeon_clearHandlers = false, + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + URLResponse 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.URLResponse.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.URLResponse.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.URLResponse.pigeon_newInstance was null, expected non-null int.'); + try { + (pigeon_instanceManager ?? PigeonInstanceManager.instance) + .addHostCreatedInstance( + pigeon_newInstance?.call() ?? + URLResponse.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())); + } + }); + } + } } - static WKPermissionDecisionData decode(Object result) { - result as List; - return WKPermissionDecisionData( - value: WKPermissionDecision.values[result[0]! as int], + @override + URLResponse pigeon_copy() { + return URLResponse.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + observeValue: observeValue, ); } } -class WKMediaCaptureTypeData { - WKMediaCaptureTypeData({ - required this.value, - }); - - WKMediaCaptureType value; +/// A script that the web view injects into a webpage. +/// +/// See https://developer.apple.com/documentation/webkit/wkuserscript. +class WKUserScript extends NSObject { + /// Creates a user script object that contains the specified source code and + /// attributes. + WKUserScript({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + required this.source, + required this.injectionTime, + required this.isForMainFrameOnly, + super.observeValue, + }) : super.pigeon_detached() { + final int pigeonVar_instanceIdentifier = + pigeon_instanceManager.addDartCreatedInstance(this); + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecWKUserScript; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUserScript.pigeon_defaultConstructor'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = pigeonVar_channel + .send([ + pigeonVar_instanceIdentifier, + source, + injectionTime, + isForMainFrameOnly + ]); + () async { + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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; + } + }(); + } - Object encode() { - return [ - value.index, - ]; + /// Constructs [WKUserScript] 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 + WKUserScript.pigeon_detached({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + required this.source, + required this.injectionTime, + required this.isForMainFrameOnly, + super.observeValue, + }) : super.pigeon_detached(); + + late final _PigeonInternalProxyApiBaseCodec _pigeonVar_codecWKUserScript = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); + + /// The script’s source code. + final String source; + + /// The time at which to inject the script into the webpage. + final UserScriptInjectionTime injectionTime; + + /// A Boolean value that indicates whether to inject the script into the main + /// frame or all frames. + final bool isForMainFrameOnly; + + static void pigeon_setUpMessageHandlers({ + bool pigeon_clearHandlers = false, + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + WKUserScript Function( + String source, + UserScriptInjectionTime injectionTime, + bool isForMainFrameOnly, + )? 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.WKUserScript.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.WKUserScript.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.WKUserScript.pigeon_newInstance was null, expected non-null int.'); + final String? arg_source = (args[1] as String?); + assert(arg_source != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUserScript.pigeon_newInstance was null, expected non-null String.'); + final UserScriptInjectionTime? arg_injectionTime = + (args[2] as UserScriptInjectionTime?); + assert(arg_injectionTime != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUserScript.pigeon_newInstance was null, expected non-null UserScriptInjectionTime.'); + final bool? arg_isForMainFrameOnly = (args[3] as bool?); + assert(arg_isForMainFrameOnly != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUserScript.pigeon_newInstance was null, expected non-null bool.'); + try { + (pigeon_instanceManager ?? PigeonInstanceManager.instance) + .addHostCreatedInstance( + pigeon_newInstance?.call(arg_source!, arg_injectionTime!, + arg_isForMainFrameOnly!) ?? + WKUserScript.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + source: arg_source!, + injectionTime: arg_injectionTime!, + isForMainFrameOnly: arg_isForMainFrameOnly!, + ), + 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())); + } + }); + } + } } - static WKMediaCaptureTypeData decode(Object result) { - result as List; - return WKMediaCaptureTypeData( - value: WKMediaCaptureType.values[result[0]! as int], + @override + WKUserScript pigeon_copy() { + return WKUserScript.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + source: source, + injectionTime: injectionTime, + isForMainFrameOnly: isForMainFrameOnly, + observeValue: observeValue, ); } } -/// Mirror of NSURLRequest. +/// An object that contains information about an action that causes navigation +/// to occur. /// -/// See https://developer.apple.com/documentation/foundation/nsurlrequest?language=objc. -class NSUrlRequestData { - NSUrlRequestData({ - required this.url, - this.httpMethod, - this.httpBody, - required this.allHttpHeaderFields, - }); - - String url; - - String? httpMethod; - - Uint8List? httpBody; +/// See https://developer.apple.com/documentation/webkit/wknavigationaction. +class WKNavigationAction extends NSObject { + /// Constructs [WKNavigationAction] 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 + WKNavigationAction.pigeon_detached({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + required this.request, + this.targetFrame, + required this.navigationType, + super.observeValue, + }) : super.pigeon_detached(); - Map allHttpHeaderFields; + /// The URL request object associated with the navigation action. + final URLRequest request; - Object encode() { - return [ - url, - httpMethod, - httpBody, - allHttpHeaderFields, - ]; + /// The frame in which to display the new content. + /// + /// If the target of the navigation is a new window, this property is nil. + final WKFrameInfo? targetFrame; + + /// The type of action that triggered the navigation. + final NavigationType navigationType; + + static void pigeon_setUpMessageHandlers({ + bool pigeon_clearHandlers = false, + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + WKNavigationAction Function( + URLRequest request, + WKFrameInfo? targetFrame, + NavigationType navigationType, + )? 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.WKNavigationAction.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.WKNavigationAction.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.WKNavigationAction.pigeon_newInstance was null, expected non-null int.'); + final URLRequest? arg_request = (args[1] as URLRequest?); + assert(arg_request != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationAction.pigeon_newInstance was null, expected non-null URLRequest.'); + final WKFrameInfo? arg_targetFrame = (args[2] as WKFrameInfo?); + final NavigationType? arg_navigationType = + (args[3] as NavigationType?); + assert(arg_navigationType != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationAction.pigeon_newInstance was null, expected non-null NavigationType.'); + try { + (pigeon_instanceManager ?? PigeonInstanceManager.instance) + .addHostCreatedInstance( + pigeon_newInstance?.call( + arg_request!, arg_targetFrame, arg_navigationType!) ?? + WKNavigationAction.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + request: arg_request!, + targetFrame: arg_targetFrame, + navigationType: arg_navigationType!, + ), + 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())); + } + }); + } + } } - static NSUrlRequestData decode(Object result) { - result as List; - return NSUrlRequestData( - url: result[0]! as String, - httpMethod: result[1] as String?, - httpBody: result[2] as Uint8List?, - allHttpHeaderFields: - (result[3] as Map?)!.cast(), + @override + WKNavigationAction pigeon_copy() { + return WKNavigationAction.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + request: request, + targetFrame: targetFrame, + navigationType: navigationType, + observeValue: observeValue, ); } } -/// Mirror of NSURLResponse. +/// An object that contains the response to a navigation request, and which you +/// use to make navigation-related policy decisions. /// -/// See https://developer.apple.com/documentation/foundation/nshttpurlresponse?language=objc. -class NSHttpUrlResponseData { - NSHttpUrlResponseData({ - required this.statusCode, - }); - - int statusCode; - - Object encode() { - return [ - statusCode, - ]; +/// See https://developer.apple.com/documentation/webkit/wknavigationresponse. +class WKNavigationResponse extends NSObject { + /// Constructs [WKNavigationResponse] 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 + WKNavigationResponse.pigeon_detached({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + required this.response, + required this.isForMainFrame, + super.observeValue, + }) : super.pigeon_detached(); + + /// The frame’s response. + final URLResponse response; + + /// A Boolean value that indicates whether the response targets the web view’s + /// main frame. + final bool isForMainFrame; + + static void pigeon_setUpMessageHandlers({ + bool pigeon_clearHandlers = false, + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + WKNavigationResponse Function( + URLResponse response, + bool isForMainFrame, + )? 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.WKNavigationResponse.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.WKNavigationResponse.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.WKNavigationResponse.pigeon_newInstance was null, expected non-null int.'); + final URLResponse? arg_response = (args[1] as URLResponse?); + assert(arg_response != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationResponse.pigeon_newInstance was null, expected non-null URLResponse.'); + final bool? arg_isForMainFrame = (args[2] as bool?); + assert(arg_isForMainFrame != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationResponse.pigeon_newInstance was null, expected non-null bool.'); + try { + (pigeon_instanceManager ?? PigeonInstanceManager.instance) + .addHostCreatedInstance( + pigeon_newInstance?.call(arg_response!, arg_isForMainFrame!) ?? + WKNavigationResponse.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + response: arg_response!, + isForMainFrame: arg_isForMainFrame!, + ), + 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())); + } + }); + } + } } - static NSHttpUrlResponseData decode(Object result) { - result as List; - return NSHttpUrlResponseData( - statusCode: result[0]! as int, + @override + WKNavigationResponse pigeon_copy() { + return WKNavigationResponse.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + response: response, + isForMainFrame: isForMainFrame, + observeValue: observeValue, ); } } -/// Mirror of WKUserScript. +/// An object that contains information about a frame on a webpage. /// -/// See https://developer.apple.com/documentation/webkit/wkuserscript?language=objc. -class WKUserScriptData { - WKUserScriptData({ - required this.source, - this.injectionTime, - required this.isMainFrameOnly, - }); - - String source; - - WKUserScriptInjectionTimeEnumData? injectionTime; - - bool isMainFrameOnly; - - Object encode() { - return [ - source, - injectionTime?.encode(), - isMainFrameOnly, - ]; +/// See https://developer.apple.com/documentation/webkit/wkframeinfo. +class WKFrameInfo extends NSObject { + /// Constructs [WKFrameInfo] 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 + WKFrameInfo.pigeon_detached({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + required this.isMainFrame, + this.request, + super.observeValue, + }) : super.pigeon_detached(); + + /// A Boolean value indicating whether the frame is the web site's main frame + /// or a subframe. + final bool isMainFrame; + + /// The frame’s current request. + final URLRequest? request; + + static void pigeon_setUpMessageHandlers({ + bool pigeon_clearHandlers = false, + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + WKFrameInfo Function( + bool isMainFrame, + URLRequest? request, + )? 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.WKFrameInfo.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.WKFrameInfo.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.WKFrameInfo.pigeon_newInstance was null, expected non-null int.'); + final bool? arg_isMainFrame = (args[1] as bool?); + assert(arg_isMainFrame != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKFrameInfo.pigeon_newInstance was null, expected non-null bool.'); + final URLRequest? arg_request = (args[2] as URLRequest?); + try { + (pigeon_instanceManager ?? PigeonInstanceManager.instance) + .addHostCreatedInstance( + pigeon_newInstance?.call(arg_isMainFrame!, arg_request) ?? + WKFrameInfo.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + isMainFrame: arg_isMainFrame!, + request: arg_request, + ), + 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())); + } + }); + } + } } - static WKUserScriptData decode(Object result) { - result as List; - return WKUserScriptData( - source: result[0]! as String, - injectionTime: result[1] != null - ? WKUserScriptInjectionTimeEnumData.decode( - result[1]! as List) - : null, - isMainFrameOnly: result[2]! as bool, + @override + WKFrameInfo pigeon_copy() { + return WKFrameInfo.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + isMainFrame: isMainFrame, + request: request, + observeValue: observeValue, ); } } -/// Mirror of WKNavigationAction. +/// Information about an error condition including a domain, a domain-specific +/// error code, and application-specific information. /// -/// See https://developer.apple.com/documentation/webkit/wknavigationaction. -class WKNavigationActionData { - WKNavigationActionData({ - required this.request, - required this.targetFrame, - required this.navigationType, - }); +/// See https://developer.apple.com/documentation/foundation/nserror. +class NSError extends NSObject { + /// Constructs [NSError] 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 + NSError.pigeon_detached({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + required this.code, + required this.domain, + required this.userInfo, + super.observeValue, + }) : super.pigeon_detached(); + + /// The error code. + final int code; + + /// A string containing the error domain. + final String domain; + + /// The user info dictionary. + final Map userInfo; + + static void pigeon_setUpMessageHandlers({ + bool pigeon_clearHandlers = false, + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + NSError Function( + int code, + String domain, + Map userInfo, + )? 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.NSError.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.NSError.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.NSError.pigeon_newInstance was null, expected non-null int.'); + final int? arg_code = (args[1] as int?); + assert(arg_code != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.NSError.pigeon_newInstance was null, expected non-null int.'); + final String? arg_domain = (args[2] as String?); + assert(arg_domain != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.NSError.pigeon_newInstance was null, expected non-null String.'); + final Map? arg_userInfo = + (args[3] as Map?)?.cast(); + assert(arg_userInfo != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.NSError.pigeon_newInstance was null, expected non-null Map.'); + try { + (pigeon_instanceManager ?? PigeonInstanceManager.instance) + .addHostCreatedInstance( + pigeon_newInstance?.call(arg_code!, arg_domain!, arg_userInfo!) ?? + NSError.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + code: arg_code!, + domain: arg_domain!, + userInfo: arg_userInfo!, + ), + 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())); + } + }); + } + } + } - NSUrlRequestData request; + @override + NSError pigeon_copy() { + return NSError.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + code: code, + domain: domain, + userInfo: userInfo, + observeValue: observeValue, + ); + } +} - WKFrameInfoData targetFrame; +/// An object that encapsulates a message sent by JavaScript code from a +/// webpage. +/// +/// See https://developer.apple.com/documentation/webkit/wkscriptmessage. +class WKScriptMessage extends NSObject { + /// Constructs [WKScriptMessage] 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 + WKScriptMessage.pigeon_detached({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + required this.name, + this.body, + super.observeValue, + }) : super.pigeon_detached(); + + /// The name of the message handler to which the message is sent. + final String name; + + /// The body of the message. + final Object? body; + + static void pigeon_setUpMessageHandlers({ + bool pigeon_clearHandlers = false, + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + WKScriptMessage Function( + String name, + Object? body, + )? 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.WKScriptMessage.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.WKScriptMessage.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.WKScriptMessage.pigeon_newInstance was null, expected non-null int.'); + final String? arg_name = (args[1] as String?); + assert(arg_name != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKScriptMessage.pigeon_newInstance was null, expected non-null String.'); + final Object? arg_body = (args[2] as Object?); + try { + (pigeon_instanceManager ?? PigeonInstanceManager.instance) + .addHostCreatedInstance( + pigeon_newInstance?.call(arg_name!, arg_body) ?? + WKScriptMessage.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + name: arg_name!, + body: arg_body, + ), + 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())); + } + }); + } + } + } - WKNavigationType navigationType; + @override + WKScriptMessage pigeon_copy() { + return WKScriptMessage.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + name: name, + body: body, + observeValue: observeValue, + ); + } +} - Object encode() { - return [ - request.encode(), - targetFrame.encode(), - navigationType.index, - ]; +/// An object that identifies the origin of a particular resource. +/// +/// See https://developer.apple.com/documentation/webkit/wksecurityorigin. +class WKSecurityOrigin extends NSObject { + /// Constructs [WKSecurityOrigin] 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 + WKSecurityOrigin.pigeon_detached({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + required this.host, + required this.port, + required this.securityProtocol, + super.observeValue, + }) : super.pigeon_detached(); + + /// The security origin’s host. + final String host; + + /// The security origin's port. + final int port; + + /// The security origin's protocol. + final String securityProtocol; + + static void pigeon_setUpMessageHandlers({ + bool pigeon_clearHandlers = false, + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + WKSecurityOrigin Function( + String host, + int port, + String securityProtocol, + )? 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.WKSecurityOrigin.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.WKSecurityOrigin.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.WKSecurityOrigin.pigeon_newInstance was null, expected non-null int.'); + final String? arg_host = (args[1] as String?); + assert(arg_host != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKSecurityOrigin.pigeon_newInstance was null, expected non-null String.'); + final int? arg_port = (args[2] as int?); + assert(arg_port != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKSecurityOrigin.pigeon_newInstance was null, expected non-null int.'); + final String? arg_securityProtocol = (args[3] as String?); + assert(arg_securityProtocol != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKSecurityOrigin.pigeon_newInstance was null, expected non-null String.'); + try { + (pigeon_instanceManager ?? PigeonInstanceManager.instance) + .addHostCreatedInstance( + pigeon_newInstance?.call( + arg_host!, arg_port!, arg_securityProtocol!) ?? + WKSecurityOrigin.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + host: arg_host!, + port: arg_port!, + securityProtocol: arg_securityProtocol!, + ), + 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())); + } + }); + } + } } - static WKNavigationActionData decode(Object result) { - result as List; - return WKNavigationActionData( - request: NSUrlRequestData.decode(result[0]! as List), - targetFrame: WKFrameInfoData.decode(result[1]! as List), - navigationType: WKNavigationType.values[result[2]! as int], + @override + WKSecurityOrigin pigeon_copy() { + return WKSecurityOrigin.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + host: host, + port: port, + securityProtocol: securityProtocol, + observeValue: observeValue, ); } } -/// Mirror of WKNavigationResponse. +/// A representation of an HTTP cookie. /// -/// See https://developer.apple.com/documentation/webkit/wknavigationresponse. -class WKNavigationResponseData { - WKNavigationResponseData({ - required this.response, - required this.forMainFrame, - }); - - NSHttpUrlResponseData response; +/// See https://developer.apple.com/documentation/foundation/httpcookie. +class HTTPCookie extends NSObject { + HTTPCookie({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + super.observeValue, + required Map properties, + }) : super.pigeon_detached() { + final int pigeonVar_instanceIdentifier = + pigeon_instanceManager.addDartCreatedInstance(this); + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecHTTPCookie; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.HTTPCookie.pigeon_defaultConstructor'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = pigeonVar_channel + .send([pigeonVar_instanceIdentifier, properties]); + () async { + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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; + } + }(); + } - bool forMainFrame; + /// Constructs [HTTPCookie] 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 + HTTPCookie.pigeon_detached({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + super.observeValue, + }) : super.pigeon_detached(); + + late final _PigeonInternalProxyApiBaseCodec _pigeonVar_codecHTTPCookie = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); + + static void pigeon_setUpMessageHandlers({ + bool pigeon_clearHandlers = false, + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + HTTPCookie 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.HTTPCookie.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.HTTPCookie.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.HTTPCookie.pigeon_newInstance was null, expected non-null int.'); + try { + (pigeon_instanceManager ?? PigeonInstanceManager.instance) + .addHostCreatedInstance( + pigeon_newInstance?.call() ?? + HTTPCookie.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())); + } + }); + } + } + } - Object encode() { - return [ - response.encode(), - forMainFrame, - ]; + /// The cookie’s properties. + Future?> getProperties() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecHTTPCookie; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.HTTPCookie.getProperties'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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 (pigeonVar_replyList[0] as Map?) + ?.cast(); + } } - static WKNavigationResponseData decode(Object result) { - result as List; - return WKNavigationResponseData( - response: NSHttpUrlResponseData.decode(result[0]! as List), - forMainFrame: result[1]! as bool, + @override + HTTPCookie pigeon_copy() { + return HTTPCookie.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + observeValue: observeValue, ); } } -/// Mirror of WKFrameInfo. +/// Response object used to return multiple values to an auth challenge received +/// by a `WKNavigationDelegate` auth challenge. /// -/// See https://developer.apple.com/documentation/webkit/wkframeinfo?language=objc. -class WKFrameInfoData { - WKFrameInfoData({ - required this.isMainFrame, - required this.request, - }); - - bool isMainFrame; - - NSUrlRequestData request; - - Object encode() { - return [ - isMainFrame, - request.encode(), - ]; - } - - static WKFrameInfoData decode(Object result) { - result as List; - return WKFrameInfoData( - isMainFrame: result[0]! as bool, - request: NSUrlRequestData.decode(result[1]! as List), +/// The `webView(_:didReceive:completionHandler:)` method in +/// `WKNavigationDelegate` responds with a completion handler that takes two +/// values. The wrapper returns this class instead to handle this scenario. +class AuthenticationChallengeResponse extends PigeonInternalProxyApiBaseClass { + AuthenticationChallengeResponse({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + required this.disposition, + this.credential, + }) { + final int pigeonVar_instanceIdentifier = + pigeon_instanceManager.addDartCreatedInstance(this); + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecAuthenticationChallengeResponse; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.AuthenticationChallengeResponse.pigeon_defaultConstructor'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, ); + final Future pigeonVar_sendFuture = pigeonVar_channel + .send([pigeonVar_instanceIdentifier, disposition, credential]); + () async { + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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; + } + }(); } -} -/// Mirror of NSError. -/// -/// See https://developer.apple.com/documentation/foundation/nserror?language=objc. -class NSErrorData { - NSErrorData({ - required this.code, - required this.domain, - this.userInfo, + /// Constructs [AuthenticationChallengeResponse] 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 + AuthenticationChallengeResponse.pigeon_detached({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + required this.disposition, + this.credential, }); - int code; - - String domain; - - Map? userInfo; - - Object encode() { - return [ - code, - domain, - userInfo, - ]; + late final _PigeonInternalProxyApiBaseCodec + _pigeonVar_codecAuthenticationChallengeResponse = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); + + /// The option to use to handle the challenge. + final UrlSessionAuthChallengeDisposition disposition; + + /// The credential to use for authentication when the disposition parameter + /// contains the value URLSession.AuthChallengeDisposition.useCredential. + final URLCredential? credential; + + static void pigeon_setUpMessageHandlers({ + bool pigeon_clearHandlers = false, + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + AuthenticationChallengeResponse Function( + UrlSessionAuthChallengeDisposition disposition, + URLCredential? credential, + )? 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.AuthenticationChallengeResponse.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.AuthenticationChallengeResponse.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.AuthenticationChallengeResponse.pigeon_newInstance was null, expected non-null int.'); + final UrlSessionAuthChallengeDisposition? arg_disposition = + (args[1] as UrlSessionAuthChallengeDisposition?); + assert(arg_disposition != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.AuthenticationChallengeResponse.pigeon_newInstance was null, expected non-null UrlSessionAuthChallengeDisposition.'); + final URLCredential? arg_credential = (args[2] as URLCredential?); + try { + (pigeon_instanceManager ?? PigeonInstanceManager.instance) + .addHostCreatedInstance( + pigeon_newInstance?.call(arg_disposition!, arg_credential) ?? + AuthenticationChallengeResponse.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + disposition: arg_disposition!, + credential: arg_credential, + ), + 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())); + } + }); + } + } } - static NSErrorData decode(Object result) { - result as List; - return NSErrorData( - code: result[0]! as int, - domain: result[1]! as String, - userInfo: (result[2] as Map?)?.cast(), + @override + AuthenticationChallengeResponse pigeon_copy() { + return AuthenticationChallengeResponse.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + disposition: disposition, + credential: credential, ); } } -/// Mirror of WKScriptMessage. +/// An object that manages cookies, disk and memory caches, and other types of +/// data for a web view. /// -/// See https://developer.apple.com/documentation/webkit/wkscriptmessage?language=objc. -class WKScriptMessageData { - WKScriptMessageData({ - required this.name, - this.body, - }); - - String name; - - Object? body; +/// See https://developer.apple.com/documentation/webkit/wkwebsitedatastore. +class WKWebsiteDataStore extends NSObject { + /// Constructs [WKWebsiteDataStore] 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 + WKWebsiteDataStore.pigeon_detached({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + super.observeValue, + }) : super.pigeon_detached(); + + late final _PigeonInternalProxyApiBaseCodec + _pigeonVar_codecWKWebsiteDataStore = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); + + /// The default data store, which stores data persistently to disk. + static final WKWebsiteDataStore defaultDataStore = + pigeonVar_defaultDataStore(); + + /// The object that manages the HTTP cookies for your website. + late final WKHTTPCookieStore httpCookieStore = pigeonVar_httpCookieStore(); + + static void pigeon_setUpMessageHandlers({ + bool pigeon_clearHandlers = false, + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + WKWebsiteDataStore 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.WKWebsiteDataStore.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.WKWebsiteDataStore.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.WKWebsiteDataStore.pigeon_newInstance was null, expected non-null int.'); + try { + (pigeon_instanceManager ?? PigeonInstanceManager.instance) + .addHostCreatedInstance( + pigeon_newInstance?.call() ?? + WKWebsiteDataStore.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())); + } + }); + } + } + } - Object encode() { - return [ - name, - body, - ]; + static WKWebsiteDataStore pigeonVar_defaultDataStore() { + final WKWebsiteDataStore pigeonVar_instance = + WKWebsiteDataStore.pigeon_detached(); + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec(PigeonInstanceManager.instance); + final BinaryMessenger pigeonVar_binaryMessenger = + ServicesBinding.instance.defaultBinaryMessenger; + final int pigeonVar_instanceIdentifier = PigeonInstanceManager.instance + .addDartCreatedInstance(pigeonVar_instance); + () async { + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStore.defaultDataStore'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([pigeonVar_instanceIdentifier]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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; + } + }(); + return pigeonVar_instance; } - static WKScriptMessageData decode(Object result) { - result as List; - return WKScriptMessageData( - name: result[0]! as String, - body: result[1], + WKHTTPCookieStore pigeonVar_httpCookieStore() { + final WKHTTPCookieStore pigeonVar_instance = + WKHTTPCookieStore.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, ); + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecWKWebsiteDataStore; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + final int pigeonVar_instanceIdentifier = + pigeon_instanceManager.addDartCreatedInstance(pigeonVar_instance); + () async { + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStore.httpCookieStore'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, pigeonVar_instanceIdentifier]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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; + } + }(); + return pigeonVar_instance; } -} - -/// Mirror of WKSecurityOrigin. -/// -/// See https://developer.apple.com/documentation/webkit/wksecurityorigin?language=objc. -class WKSecurityOriginData { - WKSecurityOriginData({ - required this.host, - required this.port, - required this.protocol, - }); - - String host; - - int port; - String protocol; - - Object encode() { - return [ - host, - port, - protocol, - ]; + /// Removes the specified types of website data from one or more data records. + Future removeDataOfTypes( + List dataTypes, + double modificationTimeInSecondsSinceEpoch, + ) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecWKWebsiteDataStore; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStore.removeDataOfTypes'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = pigeonVar_channel + .send([this, dataTypes, modificationTimeInSecondsSinceEpoch]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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 bool?)!; + } } - static WKSecurityOriginData decode(Object result) { - result as List; - return WKSecurityOriginData( - host: result[0]! as String, - port: result[1]! as int, - protocol: result[2]! as String, + @override + WKWebsiteDataStore pigeon_copy() { + return WKWebsiteDataStore.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + observeValue: observeValue, ); } } -/// Mirror of NSHttpCookieData. +/// An object that manages the content for a rectangular area on the screen. /// -/// See https://developer.apple.com/documentation/foundation/nshttpcookie?language=objc. -class NSHttpCookieData { - NSHttpCookieData({ - required this.propertyKeys, - required this.propertyValues, - }); - - List propertyKeys; - - List propertyValues; - - Object encode() { - return [ - propertyKeys, - propertyValues, - ]; +/// See https://developer.apple.com/documentation/uikit/uiview. +class UIView extends NSObject { + /// Constructs [UIView] 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 + UIView.pigeon_detached({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + super.observeValue, + }) : super.pigeon_detached(); + + late final _PigeonInternalProxyApiBaseCodec _pigeonVar_codecUIView = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); + + static void pigeon_setUpMessageHandlers({ + bool pigeon_clearHandlers = false, + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + UIView 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.UIView.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.UIView.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.UIView.pigeon_newInstance was null, expected non-null int.'); + try { + (pigeon_instanceManager ?? PigeonInstanceManager.instance) + .addHostCreatedInstance( + pigeon_newInstance?.call() ?? + UIView.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())); + } + }); + } + } } - static NSHttpCookieData decode(Object result) { - result as List; - return NSHttpCookieData( - propertyKeys: (result[0] as List?)! - .cast(), - propertyValues: (result[1] as List?)!.cast(), + /// The view’s background color. + Future setBackgroundColor(int? value) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecUIView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIView.setBackgroundColor'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, value]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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; + } } -} - -/// An object that can represent either a value supported by -/// `StandardMessageCodec`, a data class in this pigeon file, or an identifier -/// of an object stored in an `InstanceManager`. -class ObjectOrIdentifier { - ObjectOrIdentifier({ - this.value, - required this.isIdentifier, - }); - Object? value; - - /// Whether value is an int that is used to retrieve an instance stored in an - /// `InstanceManager`. - bool isIdentifier; - - Object encode() { - return [ - value, - isIdentifier, - ]; + /// A Boolean value that determines whether the view is opaque. + Future setOpaque(bool opaque) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecUIView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIView.setOpaque'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, opaque]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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; + } } - static ObjectOrIdentifier decode(Object result) { - result as List; - return ObjectOrIdentifier( - value: result[0], - isIdentifier: result[1]! as bool, + @override + UIView pigeon_copy() { + return UIView.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + observeValue: observeValue, ); } } -class AuthenticationChallengeResponse { - AuthenticationChallengeResponse({ - required this.disposition, - this.credentialIdentifier, - }); - - NSUrlSessionAuthChallengeDisposition disposition; - - int? credentialIdentifier; - - Object encode() { - return [ - disposition.index, - credentialIdentifier, - ]; +/// A view that allows the scrolling and zooming of its contained views. +/// +/// See https://developer.apple.com/documentation/uikit/uiscrollview. +class UIScrollView extends UIView { + /// Constructs [UIScrollView] 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 + UIScrollView.pigeon_detached({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + super.observeValue, + }) : super.pigeon_detached(); + + late final _PigeonInternalProxyApiBaseCodec _pigeonVar_codecUIScrollView = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); + + static void pigeon_setUpMessageHandlers({ + bool pigeon_clearHandlers = false, + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + UIScrollView 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.UIScrollView.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.UIScrollView.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.UIScrollView.pigeon_newInstance was null, expected non-null int.'); + try { + (pigeon_instanceManager ?? PigeonInstanceManager.instance) + .addHostCreatedInstance( + pigeon_newInstance?.call() ?? + UIScrollView.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())); + } + }); + } + } } - static AuthenticationChallengeResponse decode(Object result) { - result as List; - return AuthenticationChallengeResponse( - disposition: - NSUrlSessionAuthChallengeDisposition.values[result[0]! as int], - credentialIdentifier: result[1] as int?, + /// The point at which the origin of the content view is offset from the + /// origin of the scroll view. + Future> getContentOffset() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecUIScrollView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.getContentOffset'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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 List?)!.cast(); + } } -} -class _WKWebsiteDataStoreHostApiCodec extends StandardMessageCodec { - const _WKWebsiteDataStoreHostApiCodec(); - @override - void writeValue(WriteBuffer buffer, Object? value) { - if (value is WKWebsiteDataTypeEnumData) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); + /// Move the scrolled position of your view. + /// + /// Convenience method to synchronize change to the x and y scroll position. + Future scrollBy( + double x, + double y, + ) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecUIScrollView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.scrollBy'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, x, y]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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 { - super.writeValue(buffer, value); + return; } } - @override - Object? readValueOfType(int type, ReadBuffer buffer) { - switch (type) { - case 128: - return WKWebsiteDataTypeEnumData.decode(readValue(buffer)!); - default: - return super.readValueOfType(type, buffer); + /// The point at which the origin of the content view is offset from the + /// origin of the scroll view. + Future setContentOffset( + double x, + double y, + ) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecUIScrollView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setContentOffset'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, x, y]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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; } } -} - -/// Mirror of WKWebsiteDataStore. -/// -/// See https://developer.apple.com/documentation/webkit/wkwebsitedatastore?language=objc. -class WKWebsiteDataStoreHostApi { - /// Constructor for [WKWebsiteDataStoreHostApi]. The [binaryMessenger] named argument is - /// available for dependency injection. If it is left null, the default - /// BinaryMessenger will be used which routes to the host platform. - WKWebsiteDataStoreHostApi( - {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) - : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - final BinaryMessenger? __pigeon_binaryMessenger; - static const MessageCodec pigeonChannelCodec = - _WKWebsiteDataStoreHostApiCodec(); - - final String __pigeon_messageChannelSuffix; - - Future createFromWebViewConfiguration( - int identifier, int configurationIdentifier) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStoreHostApi.createFromWebViewConfiguration$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + /// The delegate of the scroll view. + Future setDelegate(UIScrollViewDelegate? delegate) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecUIScrollView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setDelegate'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([identifier, configurationIdentifier]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, delegate]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; } } - Future createDefaultDataStore(int identifier) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStoreHostApi.createDefaultDataStore$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + /// Whether the scroll view bounces past the edge of content and back again. + Future setBounces(bool value) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecUIScrollView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setBounces'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([identifier]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, value]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; } } - Future removeDataOfTypes( - int identifier, - List dataTypes, - double modificationTimeInSecondsSinceEpoch) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStoreHostApi.removeDataOfTypes$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + /// Whether the scroll view bounces when it reaches the ends of its horizontal + /// axis. + Future setBouncesHorizontally(bool value) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecUIScrollView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setBouncesHorizontally'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([ - identifier, - dataTypes, - modificationTimeInSecondsSinceEpoch - ]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, value]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else { + return; + } + } + + /// Whether the scroll view bounces when it reaches the ends of its vertical + /// axis. + Future setBouncesVertically(bool value) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecUIScrollView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setBouncesVertically'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, value]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { - return (__pigeon_replyList[0] as bool?)!; + return; } } -} - -/// Mirror of UIView. -/// -/// See https://developer.apple.com/documentation/uikit/uiview?language=objc. -class UIViewHostApi { - /// Constructor for [UIViewHostApi]. The [binaryMessenger] named argument is - /// available for dependency injection. If it is left null, the default - /// BinaryMessenger will be used which routes to the host platform. - UIViewHostApi( - {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) - : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - final BinaryMessenger? __pigeon_binaryMessenger; - - static const MessageCodec pigeonChannelCodec = - StandardMessageCodec(); - - final String __pigeon_messageChannelSuffix; - Future setBackgroundColor(int identifier, int? value) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.UIViewHostApi.setBackgroundColor$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + /// Whether bouncing always occurs when vertical scrolling reaches the end of + /// the content. + /// + /// If the value of this property is true and `bouncesVertically` is true, the + /// scroll view allows vertical dragging even if the content is smaller than + /// the bounds of the scroll view. + Future setAlwaysBounceVertical(bool value) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecUIScrollView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setAlwaysBounceVertical'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([identifier, value]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, value]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; } } - Future setOpaque(int identifier, bool opaque) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.UIViewHostApi.setOpaque$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + /// Whether bouncing always occurs when horizontal scrolling reaches the end + /// of the content view. + /// + /// If the value of this property is true and `bouncesHorizontally` is true, + /// the scroll view allows horizontal dragging even if the content is smaller + /// than the bounds of the scroll view. + Future setAlwaysBounceHorizontal(bool value) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecUIScrollView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setAlwaysBounceHorizontal'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([identifier, opaque]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, value]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; } } -} - -/// Mirror of UIScrollView. -/// -/// See https://developer.apple.com/documentation/uikit/uiscrollview?language=objc. -class UIScrollViewHostApi { - /// Constructor for [UIScrollViewHostApi]. The [binaryMessenger] named argument is - /// available for dependency injection. If it is left null, the default - /// BinaryMessenger will be used which routes to the host platform. - UIScrollViewHostApi( - {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) - : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - final BinaryMessenger? __pigeon_binaryMessenger; - static const MessageCodec pigeonChannelCodec = - StandardMessageCodec(); - - final String __pigeon_messageChannelSuffix; - - Future createFromWebView(int identifier, int webViewIdentifier) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.createFromWebView$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + @override + UIScrollView pigeon_copy() { + return UIScrollView.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + observeValue: observeValue, + ); + } +} + +/// A collection of properties that you use to initialize a web view.. +/// +/// See https://developer.apple.com/documentation/webkit/wkwebviewconfiguration. +class WKWebViewConfiguration extends NSObject { + WKWebViewConfiguration({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + super.observeValue, + }) : super.pigeon_detached() { + final int pigeonVar_instanceIdentifier = + pigeon_instanceManager.addDartCreatedInstance(this); + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecWKWebViewConfiguration; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.pigeon_defaultConstructor'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([pigeonVar_instanceIdentifier]); + () async { + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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; + } + }(); + } + + /// Constructs [WKWebViewConfiguration] 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 + WKWebViewConfiguration.pigeon_detached({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + super.observeValue, + }) : super.pigeon_detached(); + + late final _PigeonInternalProxyApiBaseCodec + _pigeonVar_codecWKWebViewConfiguration = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); + + static void pigeon_setUpMessageHandlers({ + bool pigeon_clearHandlers = false, + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + WKWebViewConfiguration 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.WKWebViewConfiguration.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.WKWebViewConfiguration.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.WKWebViewConfiguration.pigeon_newInstance was null, expected non-null int.'); + try { + (pigeon_instanceManager ?? PigeonInstanceManager.instance) + .addHostCreatedInstance( + pigeon_newInstance?.call() ?? + WKWebViewConfiguration.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())); + } + }); + } + } + } + + /// The object that coordinates interactions between your app’s native code + /// and the webpage’s scripts and other content. + Future setUserContentController( + WKUserContentController controller) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecWKWebViewConfiguration; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setUserContentController'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([identifier, webViewIdentifier]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, controller]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; } } - Future> getContentOffset(int identifier) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.getContentOffset$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + /// The object that coordinates interactions between your app’s native code + /// and the webpage’s scripts and other content. + Future getUserContentController() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecWKWebViewConfiguration; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.getUserContentController'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([identifier]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as List?)!.cast(); + return (pigeonVar_replyList[0] as WKUserContentController?)!; } } - Future scrollBy(int identifier, double x, double y) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.scrollBy$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + /// The object you use to get and set the site’s cookies and to track the + /// cached data objects. + Future setWebsiteDataStore(WKWebsiteDataStore dataStore) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecWKWebViewConfiguration; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setWebsiteDataStore'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([identifier, x, y]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, dataStore]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; } } - Future verticalScrollBarEnabled(int identifier, bool enabled) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.verticalScrollBarEnabled$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + /// The object you use to get and set the site’s cookies and to track the + /// cached data objects. + Future getWebsiteDataStore() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecWKWebViewConfiguration; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.getWebsiteDataStore'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([identifier, enabled]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else { - return; - } - } - - Future horizontalScrollBarEnabled(int identifier, bool enabled) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.horizontalScrollBarEnabled$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, - pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = await __pigeon_channel - .send([identifier, enabled]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', ); } else { - return; + return (pigeonVar_replyList[0] as WKWebsiteDataStore?)!; } } - Future setContentOffset(int identifier, double x, double y) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.setContentOffset$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + /// The object that manages the preference-related settings for the web view. + Future setPreferences(WKPreferences preferences) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecWKWebViewConfiguration; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setPreferences'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([identifier, x, y]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, preferences]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; } } - Future setDelegate( - int identifier, int? uiScrollViewDelegateIdentifier) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.setDelegate$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + /// The object that manages the preference-related settings for the web view. + Future getPreferences() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecWKWebViewConfiguration; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.getPreferences'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([identifier, uiScrollViewDelegateIdentifier]) - as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + 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; - } - } -} - -class _WKWebViewConfigurationHostApiCodec extends StandardMessageCodec { - const _WKWebViewConfigurationHostApiCodec(); - @override - void writeValue(WriteBuffer buffer, Object? value) { - if (value is WKAudiovisualMediaTypeEnumData) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); - } else { - super.writeValue(buffer, value); - } - } - - @override - Object? readValueOfType(int type, ReadBuffer buffer) { - switch (type) { - case 128: - return WKAudiovisualMediaTypeEnumData.decode(readValue(buffer)!); - default: - return super.readValueOfType(type, buffer); + return (pigeonVar_replyList[0] as WKPreferences?)!; } } -} - -/// Mirror of WKWebViewConfiguration. -/// -/// See https://developer.apple.com/documentation/webkit/wkwebviewconfiguration?language=objc. -class WKWebViewConfigurationHostApi { - /// Constructor for [WKWebViewConfigurationHostApi]. The [binaryMessenger] named argument is - /// available for dependency injection. If it is left null, the default - /// BinaryMessenger will be used which routes to the host platform. - WKWebViewConfigurationHostApi( - {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) - : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - final BinaryMessenger? __pigeon_binaryMessenger; - - static const MessageCodec pigeonChannelCodec = - _WKWebViewConfigurationHostApiCodec(); - final String __pigeon_messageChannelSuffix; - - Future create(int identifier) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationHostApi.create$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + /// A Boolean value that indicates whether HTML5 videos play inline or use the + /// native full-screen controller. + Future setAllowsInlineMediaPlayback(bool allow) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecWKWebViewConfiguration; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setAllowsInlineMediaPlayback'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([identifier]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, allow]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; } } - Future createFromWebView(int identifier, int webViewIdentifier) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationHostApi.createFromWebView$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + /// A Boolean value that indicates whether the web view limits navigation to + /// pages within the app’s domain. + Future setLimitsNavigationsToAppBoundDomains(bool limit) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecWKWebViewConfiguration; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setLimitsNavigationsToAppBoundDomains'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([identifier, webViewIdentifier]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, limit]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; } } - Future setAllowsInlineMediaPlayback(int identifier, bool allow) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationHostApi.setAllowsInlineMediaPlayback$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + /// The media types that require a user gesture to begin playing. + Future setMediaTypesRequiringUserActionForPlayback( + AudiovisualMediaType type) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecWKWebViewConfiguration; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setMediaTypesRequiringUserActionForPlayback'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([identifier, allow]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, type]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; } } - Future setLimitsNavigationsToAppBoundDomains( - int identifier, bool limit) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationHostApi.setLimitsNavigationsToAppBoundDomains$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + /// 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( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([identifier, limit]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', ); } else { - return; + return (pigeonVar_replyList[0] as WKWebpagePreferences?)!; } } - Future setMediaTypesRequiringUserActionForPlayback( - int identifier, List types) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationHostApi.setMediaTypesRequiringUserActionForPlayback$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, - pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + @override + WKWebViewConfiguration pigeon_copy() { + return WKWebViewConfiguration.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + observeValue: observeValue, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([identifier, types]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else { - return; - } } } -/// Handles callbacks from a WKWebViewConfiguration instance. +/// An object for managing interactions between JavaScript code and your web +/// view, and for filtering content in your web view. /// -/// See https://developer.apple.com/documentation/webkit/wkwebviewconfiguration?language=objc. -abstract class WKWebViewConfigurationFlutterApi { - static const MessageCodec pigeonChannelCodec = - StandardMessageCodec(); - - void create(int identifier); - - static void setUp( - WKWebViewConfigurationFlutterApi? api, { - BinaryMessenger? binaryMessenger, - String messageChannelSuffix = '', +/// See https://developer.apple.com/documentation/webkit/wkusercontentcontroller. +class WKUserContentController extends NSObject { + /// Constructs [WKUserContentController] 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 + WKUserContentController.pigeon_detached({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + super.observeValue, + }) : super.pigeon_detached(); + + late final _PigeonInternalProxyApiBaseCodec + _pigeonVar_codecWKUserContentController = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); + + static void pigeon_setUpMessageHandlers({ + bool pigeon_clearHandlers = false, + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + WKUserContentController Function()? pigeon_newInstance, }) { - messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( + pigeon_instanceManager ?? PigeonInstanceManager.instance); + final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationFlutterApi.create$messageChannelSuffix', + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.pigeon_newInstance', pigeonChannelCodec, binaryMessenger: binaryMessenger); - if (api == null) { - __pigeon_channel.setMessageHandler(null); + if (pigeon_clearHandlers) { + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.pigeon_newInstance was null.'); final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationFlutterApi.create was null, expected non-null int.'); + final int? arg_pigeon_instanceIdentifier = (args[0] as int?); + assert(arg_pigeon_instanceIdentifier != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.pigeon_newInstance was null, expected non-null int.'); try { - api.create(arg_identifier!); + (pigeon_instanceManager ?? PigeonInstanceManager.instance) + .addHostCreatedInstance( + pigeon_newInstance?.call() ?? + WKUserContentController.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); @@ -1437,382 +3650,405 @@ abstract class WKWebViewConfigurationFlutterApi { } } } -} - -class _WKUserContentControllerHostApiCodec extends StandardMessageCodec { - const _WKUserContentControllerHostApiCodec(); - @override - void writeValue(WriteBuffer buffer, Object? value) { - if (value is WKUserScriptData) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); - } else if (value is WKUserScriptInjectionTimeEnumData) { - buffer.putUint8(129); - writeValue(buffer, value.encode()); - } else { - super.writeValue(buffer, value); - } - } - - @override - Object? readValueOfType(int type, ReadBuffer buffer) { - switch (type) { - case 128: - return WKUserScriptData.decode(readValue(buffer)!); - case 129: - return WKUserScriptInjectionTimeEnumData.decode(readValue(buffer)!); - default: - return super.readValueOfType(type, buffer); - } - } -} - -/// Mirror of WKUserContentController. -/// -/// See https://developer.apple.com/documentation/webkit/wkusercontentcontroller?language=objc. -class WKUserContentControllerHostApi { - /// Constructor for [WKUserContentControllerHostApi]. The [binaryMessenger] named argument is - /// available for dependency injection. If it is left null, the default - /// BinaryMessenger will be used which routes to the host platform. - WKUserContentControllerHostApi( - {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) - : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - final BinaryMessenger? __pigeon_binaryMessenger; - - static const MessageCodec pigeonChannelCodec = - _WKUserContentControllerHostApiCodec(); - final String __pigeon_messageChannelSuffix; - - Future createFromWebViewConfiguration( - int identifier, int configurationIdentifier) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.createFromWebViewConfiguration$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + /// Installs a message handler that you can call from your JavaScript code. + Future addScriptMessageHandler( + WKScriptMessageHandler handler, + String name, + ) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecWKUserContentController; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.addScriptMessageHandler'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([identifier, configurationIdentifier]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, handler, name]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; } } - Future addScriptMessageHandler( - int identifier, int handlerIdentifier, String name) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.addScriptMessageHandler$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + /// Uninstalls the custom message handler with the specified name from your + /// JavaScript code. + Future removeScriptMessageHandler(String name) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecWKUserContentController; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.removeScriptMessageHandler'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([identifier, handlerIdentifier, name]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, name]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; } } - Future removeScriptMessageHandler(int identifier, String name) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.removeScriptMessageHandler$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + /// Uninstalls all custom message handlers associated with the user content + /// controller. + Future removeAllScriptMessageHandlers() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecWKUserContentController; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.removeAllScriptMessageHandlers'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([identifier, name]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; } } - Future removeAllScriptMessageHandlers(int identifier) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.removeAllScriptMessageHandlers$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + /// Injects the specified script into the webpage’s content. + Future addUserScript(WKUserScript userScript) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecWKUserContentController; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.addUserScript'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([identifier]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, userScript]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; } } - Future addUserScript( - int identifier, WKUserScriptData userScript) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.addUserScript$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + /// Removes all user scripts from the web view. + Future removeAllUserScripts() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecWKUserContentController; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.removeAllUserScripts'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([identifier, userScript]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; } } - Future removeAllUserScripts(int identifier) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.removeAllUserScripts$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, - pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + @override + WKUserContentController pigeon_copy() { + return WKUserContentController.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + observeValue: observeValue, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([identifier]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else { - return; - } } } -/// Mirror of WKUserPreferences. +/// An object that encapsulates the standard behaviors to apply to websites. /// -/// See https://developer.apple.com/documentation/webkit/wkpreferences?language=objc. -class WKPreferencesHostApi { - /// Constructor for [WKPreferencesHostApi]. The [binaryMessenger] named argument is - /// available for dependency injection. If it is left null, the default - /// BinaryMessenger will be used which routes to the host platform. - WKPreferencesHostApi( - {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) - : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - final BinaryMessenger? __pigeon_binaryMessenger; - - static const MessageCodec pigeonChannelCodec = - StandardMessageCodec(); - - final String __pigeon_messageChannelSuffix; +/// See https://developer.apple.com/documentation/webkit/wkpreferences. +class WKPreferences extends NSObject { + /// Constructs [WKPreferences] 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 + WKPreferences.pigeon_detached({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + super.observeValue, + }) : super.pigeon_detached(); + + late final _PigeonInternalProxyApiBaseCodec _pigeonVar_codecWKPreferences = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); + + static void pigeon_setUpMessageHandlers({ + bool pigeon_clearHandlers = false, + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + WKPreferences 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.WKPreferences.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.WKPreferences.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.WKPreferences.pigeon_newInstance was null, expected non-null int.'); + try { + (pigeon_instanceManager ?? PigeonInstanceManager.instance) + .addHostCreatedInstance( + pigeon_newInstance?.call() ?? + WKPreferences.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())); + } + }); + } + } + } - Future createFromWebViewConfiguration( - int identifier, int configurationIdentifier) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKPreferencesHostApi.createFromWebViewConfiguration$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + /// A Boolean value that indicates whether JavaScript is enabled. + Future setJavaScriptEnabled(bool enabled) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecWKPreferences; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKPreferences.setJavaScriptEnabled'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([identifier, configurationIdentifier]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, enabled]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; } } - Future setJavaScriptEnabled(int identifier, bool enabled) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKPreferencesHostApi.setJavaScriptEnabled$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, - pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + @override + WKPreferences pigeon_copy() { + return WKPreferences.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + observeValue: observeValue, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([identifier, enabled]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else { - return; - } } } -/// Mirror of WKScriptMessageHandler. +/// An interface for receiving messages from JavaScript code running in a webpage. /// -/// See https://developer.apple.com/documentation/webkit/wkscriptmessagehandler?language=objc. -class WKScriptMessageHandlerHostApi { - /// Constructor for [WKScriptMessageHandlerHostApi]. The [binaryMessenger] named argument is - /// available for dependency injection. If it is left null, the default - /// BinaryMessenger will be used which routes to the host platform. - WKScriptMessageHandlerHostApi( - {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) - : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - final BinaryMessenger? __pigeon_binaryMessenger; - - static const MessageCodec pigeonChannelCodec = - StandardMessageCodec(); - - final String __pigeon_messageChannelSuffix; - - Future create(int identifier) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKScriptMessageHandlerHostApi.create$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = +/// See https://developer.apple.com/documentation/webkit/wkscriptmessagehandler. +class WKScriptMessageHandler extends NSObject { + WKScriptMessageHandler({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + super.observeValue, + required this.didReceiveScriptMessage, + }) : super.pigeon_detached() { + final int pigeonVar_instanceIdentifier = + pigeon_instanceManager.addDartCreatedInstance(this); + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecWKScriptMessageHandler; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKScriptMessageHandler.pigeon_defaultConstructor'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([identifier]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else { - return; - } - } -} - -class _WKScriptMessageHandlerFlutterApiCodec extends StandardMessageCodec { - const _WKScriptMessageHandlerFlutterApiCodec(); - @override - void writeValue(WriteBuffer buffer, Object? value) { - if (value is WKScriptMessageData) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); - } else { - super.writeValue(buffer, value); - } - } - - @override - Object? readValueOfType(int type, ReadBuffer buffer) { - switch (type) { - case 128: - return WKScriptMessageData.decode(readValue(buffer)!); - default: - return super.readValueOfType(type, buffer); - } + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([pigeonVar_instanceIdentifier]); + () async { + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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; + } + }(); } -} - -/// Handles callbacks from a WKScriptMessageHandler instance. -/// -/// See https://developer.apple.com/documentation/webkit/wkscriptmessagehandler?language=objc. -abstract class WKScriptMessageHandlerFlutterApi { - static const MessageCodec pigeonChannelCodec = - _WKScriptMessageHandlerFlutterApiCodec(); - - void didReceiveScriptMessage(int identifier, - int userContentControllerIdentifier, WKScriptMessageData message); - static void setUp( - WKScriptMessageHandlerFlutterApi? api, { - BinaryMessenger? binaryMessenger, - String messageChannelSuffix = '', + /// Constructs [WKScriptMessageHandler] 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 + WKScriptMessageHandler.pigeon_detached({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + super.observeValue, + required this.didReceiveScriptMessage, + }) : super.pigeon_detached(); + + late final _PigeonInternalProxyApiBaseCodec + _pigeonVar_codecWKScriptMessageHandler = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); + + /// Tells the handler that a webpage sent a script message. + /// + /// For the associated Native object to be automatically garbage collected, + /// it is required that the implementation of this `Function` doesn't have a + /// strong reference to the encapsulating class instance. When this `Function` + /// references a non-local variable, it is strongly recommended to access it + /// with a `WeakReference`: + /// + /// ```dart + /// final WeakReference weakMyVariable = WeakReference(myVariable); + /// final WKScriptMessageHandler instance = WKScriptMessageHandler( + /// didReceiveScriptMessage: (WKScriptMessageHandler pigeon_instance, ...) { + /// print(weakMyVariable?.target); + /// }, + /// ); + /// ``` + /// + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to + /// release the associated Native object manually. + final void Function( + WKScriptMessageHandler pigeon_instance, + WKUserContentController controller, + WKScriptMessage message, + ) didReceiveScriptMessage; + + static void pigeon_setUpMessageHandlers({ + bool pigeon_clearHandlers = false, + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + void Function( + WKScriptMessageHandler pigeon_instance, + WKUserContentController controller, + WKScriptMessage message, + )? didReceiveScriptMessage, }) { - messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( + pigeon_instanceManager ?? PigeonInstanceManager.instance); + final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKScriptMessageHandlerFlutterApi.didReceiveScriptMessage$messageChannelSuffix', + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKScriptMessageHandler.didReceiveScriptMessage', pigeonChannelCodec, binaryMessenger: binaryMessenger); - if (api == null) { - __pigeon_channel.setMessageHandler(null); + if (pigeon_clearHandlers) { + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKScriptMessageHandlerFlutterApi.didReceiveScriptMessage was null.'); + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKScriptMessageHandler.didReceiveScriptMessage was null.'); final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKScriptMessageHandlerFlutterApi.didReceiveScriptMessage was null, expected non-null int.'); - final int? arg_userContentControllerIdentifier = (args[1] as int?); - assert(arg_userContentControllerIdentifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKScriptMessageHandlerFlutterApi.didReceiveScriptMessage was null, expected non-null int.'); - final WKScriptMessageData? arg_message = - (args[2] as WKScriptMessageData?); + final WKScriptMessageHandler? arg_pigeon_instance = + (args[0] as WKScriptMessageHandler?); + assert(arg_pigeon_instance != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKScriptMessageHandler.didReceiveScriptMessage was null, expected non-null WKScriptMessageHandler.'); + final WKUserContentController? arg_controller = + (args[1] as WKUserContentController?); + assert(arg_controller != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKScriptMessageHandler.didReceiveScriptMessage was null, expected non-null WKUserContentController.'); + final WKScriptMessage? arg_message = (args[2] as WKScriptMessage?); assert(arg_message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKScriptMessageHandlerFlutterApi.didReceiveScriptMessage was null, expected non-null WKScriptMessageData.'); + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKScriptMessageHandler.didReceiveScriptMessage was null, expected non-null WKScriptMessage.'); try { - api.didReceiveScriptMessage(arg_identifier!, - arg_userContentControllerIdentifier!, arg_message!); + (didReceiveScriptMessage ?? + arg_pigeon_instance!.didReceiveScriptMessage) + .call(arg_pigeon_instance!, arg_controller!, arg_message!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -1824,174 +4060,376 @@ abstract class WKScriptMessageHandlerFlutterApi { } } } + + @override + WKScriptMessageHandler pigeon_copy() { + return WKScriptMessageHandler.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + observeValue: observeValue, + didReceiveScriptMessage: didReceiveScriptMessage, + ); + } } -/// Mirror of WKNavigationDelegate. +/// Methods for accepting or rejecting navigation changes, and for tracking the +/// progress of navigation requests. /// -/// See https://developer.apple.com/documentation/webkit/wknavigationdelegate?language=objc. -class WKNavigationDelegateHostApi { - /// Constructor for [WKNavigationDelegateHostApi]. The [binaryMessenger] named argument is - /// available for dependency injection. If it is left null, the default - /// BinaryMessenger will be used which routes to the host platform. - WKNavigationDelegateHostApi( - {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) - : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - final BinaryMessenger? __pigeon_binaryMessenger; - - static const MessageCodec pigeonChannelCodec = - StandardMessageCodec(); - - final String __pigeon_messageChannelSuffix; - - Future create(int identifier) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateHostApi.create$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = +/// See https://developer.apple.com/documentation/webkit/wknavigationdelegate. +class WKNavigationDelegate extends NSObject { + WKNavigationDelegate({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + super.observeValue, + this.didFinishNavigation, + this.didStartProvisionalNavigation, + required this.decidePolicyForNavigationAction, + required this.decidePolicyForNavigationResponse, + this.didFailNavigation, + this.didFailProvisionalNavigation, + this.webViewWebContentProcessDidTerminate, + required this.didReceiveAuthenticationChallenge, + }) : super.pigeon_detached() { + final int pigeonVar_instanceIdentifier = + pigeon_instanceManager.addDartCreatedInstance(this); + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecWKNavigationDelegate; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.pigeon_defaultConstructor'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([identifier]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else { - return; - } - } -} - -class _WKNavigationDelegateFlutterApiCodec extends StandardMessageCodec { - const _WKNavigationDelegateFlutterApiCodec(); - @override - void writeValue(WriteBuffer buffer, Object? value) { - if (value is AuthenticationChallengeResponse) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); - } else if (value is NSErrorData) { - buffer.putUint8(129); - writeValue(buffer, value.encode()); - } else if (value is NSHttpUrlResponseData) { - buffer.putUint8(130); - writeValue(buffer, value.encode()); - } else if (value is NSUrlRequestData) { - buffer.putUint8(131); - writeValue(buffer, value.encode()); - } else if (value is WKFrameInfoData) { - buffer.putUint8(132); - writeValue(buffer, value.encode()); - } else if (value is WKNavigationActionData) { - buffer.putUint8(133); - writeValue(buffer, value.encode()); - } else if (value is WKNavigationActionPolicyEnumData) { - buffer.putUint8(134); - writeValue(buffer, value.encode()); - } else if (value is WKNavigationResponseData) { - buffer.putUint8(135); - writeValue(buffer, value.encode()); - } else { - super.writeValue(buffer, value); - } - } - - @override - Object? readValueOfType(int type, ReadBuffer buffer) { - switch (type) { - case 128: - return AuthenticationChallengeResponse.decode(readValue(buffer)!); - case 129: - return NSErrorData.decode(readValue(buffer)!); - case 130: - return NSHttpUrlResponseData.decode(readValue(buffer)!); - case 131: - return NSUrlRequestData.decode(readValue(buffer)!); - case 132: - return WKFrameInfoData.decode(readValue(buffer)!); - case 133: - return WKNavigationActionData.decode(readValue(buffer)!); - case 134: - return WKNavigationActionPolicyEnumData.decode(readValue(buffer)!); - case 135: - return WKNavigationResponseData.decode(readValue(buffer)!); - default: - return super.readValueOfType(type, buffer); - } + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([pigeonVar_instanceIdentifier]); + () async { + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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; + } + }(); } -} - -/// Handles callbacks from a WKNavigationDelegate instance. -/// -/// See https://developer.apple.com/documentation/webkit/wknavigationdelegate?language=objc. -abstract class WKNavigationDelegateFlutterApi { - static const MessageCodec pigeonChannelCodec = - _WKNavigationDelegateFlutterApiCodec(); - - void didFinishNavigation(int identifier, int webViewIdentifier, String? url); - - void didStartProvisionalNavigation( - int identifier, int webViewIdentifier, String? url); - - Future decidePolicyForNavigationAction( - int identifier, - int webViewIdentifier, - WKNavigationActionData navigationAction); - - Future decidePolicyForNavigationResponse( - int identifier, - int webViewIdentifier, - WKNavigationResponseData navigationResponse); - - void didFailNavigation( - int identifier, int webViewIdentifier, NSErrorData error); - - void didFailProvisionalNavigation( - int identifier, int webViewIdentifier, NSErrorData error); - - void webViewWebContentProcessDidTerminate( - int identifier, int webViewIdentifier); - - Future didReceiveAuthenticationChallenge( - int identifier, int webViewIdentifier, int challengeIdentifier); - static void setUp( - WKNavigationDelegateFlutterApi? api, { - BinaryMessenger? binaryMessenger, - String messageChannelSuffix = '', + /// Constructs [WKNavigationDelegate] 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 + WKNavigationDelegate.pigeon_detached({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + super.observeValue, + this.didFinishNavigation, + this.didStartProvisionalNavigation, + required this.decidePolicyForNavigationAction, + required this.decidePolicyForNavigationResponse, + this.didFailNavigation, + this.didFailProvisionalNavigation, + this.webViewWebContentProcessDidTerminate, + required this.didReceiveAuthenticationChallenge, + }) : super.pigeon_detached(); + + late final _PigeonInternalProxyApiBaseCodec + _pigeonVar_codecWKNavigationDelegate = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); + + /// Tells the delegate that navigation is complete. + /// + /// For the associated Native object to be automatically garbage collected, + /// it is required that the implementation of this `Function` doesn't have a + /// strong reference to the encapsulating class instance. When this `Function` + /// references a non-local variable, it is strongly recommended to access it + /// with a `WeakReference`: + /// + /// ```dart + /// final WeakReference weakMyVariable = WeakReference(myVariable); + /// final WKNavigationDelegate instance = WKNavigationDelegate( + /// didFinishNavigation: (WKNavigationDelegate pigeon_instance, ...) { + /// print(weakMyVariable?.target); + /// }, + /// ); + /// ``` + /// + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to + /// release the associated Native object manually. + final void Function( + WKNavigationDelegate pigeon_instance, + WKWebView webView, + String? url, + )? didFinishNavigation; + + /// Tells the delegate that navigation from the main frame has started. + /// + /// For the associated Native object to be automatically garbage collected, + /// it is required that the implementation of this `Function` doesn't have a + /// strong reference to the encapsulating class instance. When this `Function` + /// references a non-local variable, it is strongly recommended to access it + /// with a `WeakReference`: + /// + /// ```dart + /// final WeakReference weakMyVariable = WeakReference(myVariable); + /// final WKNavigationDelegate instance = WKNavigationDelegate( + /// didStartProvisionalNavigation: (WKNavigationDelegate pigeon_instance, ...) { + /// print(weakMyVariable?.target); + /// }, + /// ); + /// ``` + /// + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to + /// release the associated Native object manually. + final void Function( + WKNavigationDelegate pigeon_instance, + WKWebView webView, + String? url, + )? didStartProvisionalNavigation; + + /// Asks the delegate for permission to navigate to new content based on the + /// specified action information. + /// + /// For the associated Native object to be automatically garbage collected, + /// it is required that the implementation of this `Function` doesn't have a + /// strong reference to the encapsulating class instance. When this `Function` + /// references a non-local variable, it is strongly recommended to access it + /// with a `WeakReference`: + /// + /// ```dart + /// final WeakReference weakMyVariable = WeakReference(myVariable); + /// final WKNavigationDelegate instance = WKNavigationDelegate( + /// decidePolicyForNavigationAction: (WKNavigationDelegate pigeon_instance, ...) { + /// print(weakMyVariable?.target); + /// }, + /// ); + /// ``` + /// + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to + /// release the associated Native object manually. + final Future Function( + WKNavigationDelegate pigeon_instance, + WKWebView webView, + WKNavigationAction navigationAction, + ) decidePolicyForNavigationAction; + + /// Asks the delegate for permission to navigate to new content after the + /// response to the navigation request is known. + /// + /// For the associated Native object to be automatically garbage collected, + /// it is required that the implementation of this `Function` doesn't have a + /// strong reference to the encapsulating class instance. When this `Function` + /// references a non-local variable, it is strongly recommended to access it + /// with a `WeakReference`: + /// + /// ```dart + /// final WeakReference weakMyVariable = WeakReference(myVariable); + /// final WKNavigationDelegate instance = WKNavigationDelegate( + /// decidePolicyForNavigationResponse: (WKNavigationDelegate pigeon_instance, ...) { + /// print(weakMyVariable?.target); + /// }, + /// ); + /// ``` + /// + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to + /// release the associated Native object manually. + final Future Function( + WKNavigationDelegate pigeon_instance, + WKWebView webView, + WKNavigationResponse navigationResponse, + ) decidePolicyForNavigationResponse; + + /// Tells the delegate that an error occurred during navigation. + /// + /// For the associated Native object to be automatically garbage collected, + /// it is required that the implementation of this `Function` doesn't have a + /// strong reference to the encapsulating class instance. When this `Function` + /// references a non-local variable, it is strongly recommended to access it + /// with a `WeakReference`: + /// + /// ```dart + /// final WeakReference weakMyVariable = WeakReference(myVariable); + /// final WKNavigationDelegate instance = WKNavigationDelegate( + /// didFailNavigation: (WKNavigationDelegate pigeon_instance, ...) { + /// print(weakMyVariable?.target); + /// }, + /// ); + /// ``` + /// + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to + /// release the associated Native object manually. + final void Function( + WKNavigationDelegate pigeon_instance, + WKWebView webView, + NSError error, + )? didFailNavigation; + + /// Tells the delegate that an error occurred during the early navigation + /// process. + /// + /// For the associated Native object to be automatically garbage collected, + /// it is required that the implementation of this `Function` doesn't have a + /// strong reference to the encapsulating class instance. When this `Function` + /// references a non-local variable, it is strongly recommended to access it + /// with a `WeakReference`: + /// + /// ```dart + /// final WeakReference weakMyVariable = WeakReference(myVariable); + /// final WKNavigationDelegate instance = WKNavigationDelegate( + /// didFailProvisionalNavigation: (WKNavigationDelegate pigeon_instance, ...) { + /// print(weakMyVariable?.target); + /// }, + /// ); + /// ``` + /// + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to + /// release the associated Native object manually. + final void Function( + WKNavigationDelegate pigeon_instance, + WKWebView webView, + NSError error, + )? didFailProvisionalNavigation; + + /// Tells the delegate that the web view’s content process was terminated. + /// + /// For the associated Native object to be automatically garbage collected, + /// it is required that the implementation of this `Function` doesn't have a + /// strong reference to the encapsulating class instance. When this `Function` + /// references a non-local variable, it is strongly recommended to access it + /// with a `WeakReference`: + /// + /// ```dart + /// final WeakReference weakMyVariable = WeakReference(myVariable); + /// final WKNavigationDelegate instance = WKNavigationDelegate( + /// webViewWebContentProcessDidTerminate: (WKNavigationDelegate pigeon_instance, ...) { + /// print(weakMyVariable?.target); + /// }, + /// ); + /// ``` + /// + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to + /// release the associated Native object manually. + final void Function( + WKNavigationDelegate pigeon_instance, + WKWebView webView, + )? webViewWebContentProcessDidTerminate; + + /// Asks the delegate to respond to an authentication challenge. + /// + /// This return value expects a List with: + /// + /// 1. `UrlSessionAuthChallengeDisposition` + /// 2. A nullable map to instantiate a `URLCredential`. The map structure is + /// [ + /// "user": "", + /// "password": "", + /// "persistence": , + /// ] + /// + /// For the associated Native object to be automatically garbage collected, + /// it is required that the implementation of this `Function` doesn't have a + /// strong reference to the encapsulating class instance. When this `Function` + /// references a non-local variable, it is strongly recommended to access it + /// with a `WeakReference`: + /// + /// ```dart + /// final WeakReference weakMyVariable = WeakReference(myVariable); + /// final WKNavigationDelegate instance = WKNavigationDelegate( + /// didReceiveAuthenticationChallenge: (WKNavigationDelegate pigeon_instance, ...) { + /// print(weakMyVariable?.target); + /// }, + /// ); + /// ``` + /// + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to + /// release the associated Native object manually. + final Future> Function( + WKNavigationDelegate pigeon_instance, + WKWebView webView, + URLAuthenticationChallenge challenge, + ) didReceiveAuthenticationChallenge; + + static void pigeon_setUpMessageHandlers({ + bool pigeon_clearHandlers = false, + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + void Function( + WKNavigationDelegate pigeon_instance, + WKWebView webView, + String? url, + )? didFinishNavigation, + void Function( + WKNavigationDelegate pigeon_instance, + WKWebView webView, + String? url, + )? didStartProvisionalNavigation, + Future Function( + WKNavigationDelegate pigeon_instance, + WKWebView webView, + WKNavigationAction navigationAction, + )? decidePolicyForNavigationAction, + Future Function( + WKNavigationDelegate pigeon_instance, + WKWebView webView, + WKNavigationResponse navigationResponse, + )? decidePolicyForNavigationResponse, + void Function( + WKNavigationDelegate pigeon_instance, + WKWebView webView, + NSError error, + )? didFailNavigation, + void Function( + WKNavigationDelegate pigeon_instance, + WKWebView webView, + NSError error, + )? didFailProvisionalNavigation, + void Function( + WKNavigationDelegate pigeon_instance, + WKWebView webView, + )? webViewWebContentProcessDidTerminate, + Future> Function( + WKNavigationDelegate pigeon_instance, + WKWebView webView, + URLAuthenticationChallenge challenge, + )? didReceiveAuthenticationChallenge, }) { - messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( + pigeon_instanceManager ?? PigeonInstanceManager.instance); + final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.didFinishNavigation$messageChannelSuffix', + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didFinishNavigation', pigeonChannelCodec, binaryMessenger: binaryMessenger); - if (api == null) { - __pigeon_channel.setMessageHandler(null); + if (pigeon_clearHandlers) { + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.didFinishNavigation was null.'); + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didFinishNavigation was null.'); final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.didFinishNavigation was null, expected non-null int.'); - final int? arg_webViewIdentifier = (args[1] as int?); - assert(arg_webViewIdentifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.didFinishNavigation was null, expected non-null int.'); + final WKNavigationDelegate? arg_pigeon_instance = + (args[0] as WKNavigationDelegate?); + assert(arg_pigeon_instance != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didFinishNavigation was null, expected non-null WKNavigationDelegate.'); + final WKWebView? arg_webView = (args[1] as WKWebView?); + assert(arg_webView != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didFinishNavigation was null, expected non-null WKWebView.'); final String? arg_url = (args[2] as String?); try { - api.didFinishNavigation( - arg_identifier!, arg_webViewIdentifier!, arg_url); + (didFinishNavigation ?? arg_pigeon_instance!.didFinishNavigation) + ?.call(arg_pigeon_instance!, arg_webView!, arg_url); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -2002,29 +4440,33 @@ abstract class WKNavigationDelegateFlutterApi { }); } } + { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.didStartProvisionalNavigation$messageChannelSuffix', + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didStartProvisionalNavigation', pigeonChannelCodec, binaryMessenger: binaryMessenger); - if (api == null) { - __pigeon_channel.setMessageHandler(null); + if (pigeon_clearHandlers) { + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.didStartProvisionalNavigation was null.'); + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didStartProvisionalNavigation was null.'); final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.didStartProvisionalNavigation was null, expected non-null int.'); - final int? arg_webViewIdentifier = (args[1] as int?); - assert(arg_webViewIdentifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.didStartProvisionalNavigation was null, expected non-null int.'); + final WKNavigationDelegate? arg_pigeon_instance = + (args[0] as WKNavigationDelegate?); + assert(arg_pigeon_instance != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didStartProvisionalNavigation was null, expected non-null WKNavigationDelegate.'); + final WKWebView? arg_webView = (args[1] as WKWebView?); + assert(arg_webView != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didStartProvisionalNavigation was null, expected non-null WKWebView.'); final String? arg_url = (args[2] as String?); try { - api.didStartProvisionalNavigation( - arg_identifier!, arg_webViewIdentifier!, arg_url); + (didStartProvisionalNavigation ?? + arg_pigeon_instance!.didStartProvisionalNavigation) + ?.call(arg_pigeon_instance!, arg_webView!, arg_url); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -2035,33 +4477,38 @@ abstract class WKNavigationDelegateFlutterApi { }); } } + { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.decidePolicyForNavigationAction$messageChannelSuffix', + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.decidePolicyForNavigationAction', pigeonChannelCodec, binaryMessenger: binaryMessenger); - if (api == null) { - __pigeon_channel.setMessageHandler(null); + if (pigeon_clearHandlers) { + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.decidePolicyForNavigationAction was null.'); + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.decidePolicyForNavigationAction was null.'); final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.decidePolicyForNavigationAction was null, expected non-null int.'); - final int? arg_webViewIdentifier = (args[1] as int?); - assert(arg_webViewIdentifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.decidePolicyForNavigationAction was null, expected non-null int.'); - final WKNavigationActionData? arg_navigationAction = - (args[2] as WKNavigationActionData?); + final WKNavigationDelegate? arg_pigeon_instance = + (args[0] as WKNavigationDelegate?); + assert(arg_pigeon_instance != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.decidePolicyForNavigationAction was null, expected non-null WKNavigationDelegate.'); + final WKWebView? arg_webView = (args[1] as WKWebView?); + assert(arg_webView != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.decidePolicyForNavigationAction was null, expected non-null WKWebView.'); + final WKNavigationAction? arg_navigationAction = + (args[2] as WKNavigationAction?); assert(arg_navigationAction != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.decidePolicyForNavigationAction was null, expected non-null WKNavigationActionData.'); + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.decidePolicyForNavigationAction was null, expected non-null WKNavigationAction.'); try { - final WKNavigationActionPolicyEnumData output = - await api.decidePolicyForNavigationAction(arg_identifier!, - arg_webViewIdentifier!, arg_navigationAction!); + final NavigationActionPolicy output = + await (decidePolicyForNavigationAction ?? + arg_pigeon_instance!.decidePolicyForNavigationAction) + .call(arg_pigeon_instance!, arg_webView!, + arg_navigationAction!); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -2072,34 +4519,39 @@ abstract class WKNavigationDelegateFlutterApi { }); } } + { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.decidePolicyForNavigationResponse$messageChannelSuffix', + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.decidePolicyForNavigationResponse', pigeonChannelCodec, binaryMessenger: binaryMessenger); - if (api == null) { - __pigeon_channel.setMessageHandler(null); + if (pigeon_clearHandlers) { + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.decidePolicyForNavigationResponse was null.'); + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.decidePolicyForNavigationResponse was null.'); final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.decidePolicyForNavigationResponse was null, expected non-null int.'); - final int? arg_webViewIdentifier = (args[1] as int?); - assert(arg_webViewIdentifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.decidePolicyForNavigationResponse was null, expected non-null int.'); - final WKNavigationResponseData? arg_navigationResponse = - (args[2] as WKNavigationResponseData?); + final WKNavigationDelegate? arg_pigeon_instance = + (args[0] as WKNavigationDelegate?); + assert(arg_pigeon_instance != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.decidePolicyForNavigationResponse was null, expected non-null WKNavigationDelegate.'); + final WKWebView? arg_webView = (args[1] as WKWebView?); + assert(arg_webView != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.decidePolicyForNavigationResponse was null, expected non-null WKWebView.'); + final WKNavigationResponse? arg_navigationResponse = + (args[2] as WKNavigationResponse?); assert(arg_navigationResponse != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.decidePolicyForNavigationResponse was null, expected non-null WKNavigationResponseData.'); + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.decidePolicyForNavigationResponse was null, expected non-null WKNavigationResponse.'); try { - final WKNavigationResponsePolicyEnum output = - await api.decidePolicyForNavigationResponse(arg_identifier!, - arg_webViewIdentifier!, arg_navigationResponse!); - return wrapResponse(result: output.index); + final NavigationResponsePolicy output = + await (decidePolicyForNavigationResponse ?? + arg_pigeon_instance!.decidePolicyForNavigationResponse) + .call(arg_pigeon_instance!, arg_webView!, + arg_navigationResponse!); + return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); } catch (e) { @@ -2109,31 +4561,34 @@ abstract class WKNavigationDelegateFlutterApi { }); } } + { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.didFailNavigation$messageChannelSuffix', + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didFailNavigation', pigeonChannelCodec, binaryMessenger: binaryMessenger); - if (api == null) { - __pigeon_channel.setMessageHandler(null); + if (pigeon_clearHandlers) { + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.didFailNavigation was null.'); + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didFailNavigation was null.'); final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.didFailNavigation was null, expected non-null int.'); - final int? arg_webViewIdentifier = (args[1] as int?); - assert(arg_webViewIdentifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.didFailNavigation was null, expected non-null int.'); - final NSErrorData? arg_error = (args[2] as NSErrorData?); + final WKNavigationDelegate? arg_pigeon_instance = + (args[0] as WKNavigationDelegate?); + assert(arg_pigeon_instance != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didFailNavigation was null, expected non-null WKNavigationDelegate.'); + final WKWebView? arg_webView = (args[1] as WKWebView?); + assert(arg_webView != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didFailNavigation was null, expected non-null WKWebView.'); + final NSError? arg_error = (args[2] as NSError?); assert(arg_error != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.didFailNavigation was null, expected non-null NSErrorData.'); + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didFailNavigation was null, expected non-null NSError.'); try { - api.didFailNavigation( - arg_identifier!, arg_webViewIdentifier!, arg_error!); + (didFailNavigation ?? arg_pigeon_instance!.didFailNavigation) + ?.call(arg_pigeon_instance!, arg_webView!, arg_error!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -2144,31 +4599,35 @@ abstract class WKNavigationDelegateFlutterApi { }); } } + { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.didFailProvisionalNavigation$messageChannelSuffix', + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didFailProvisionalNavigation', pigeonChannelCodec, binaryMessenger: binaryMessenger); - if (api == null) { - __pigeon_channel.setMessageHandler(null); + if (pigeon_clearHandlers) { + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.didFailProvisionalNavigation was null.'); + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didFailProvisionalNavigation was null.'); final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.didFailProvisionalNavigation was null, expected non-null int.'); - final int? arg_webViewIdentifier = (args[1] as int?); - assert(arg_webViewIdentifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.didFailProvisionalNavigation was null, expected non-null int.'); - final NSErrorData? arg_error = (args[2] as NSErrorData?); + final WKNavigationDelegate? arg_pigeon_instance = + (args[0] as WKNavigationDelegate?); + assert(arg_pigeon_instance != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didFailProvisionalNavigation was null, expected non-null WKNavigationDelegate.'); + final WKWebView? arg_webView = (args[1] as WKWebView?); + assert(arg_webView != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didFailProvisionalNavigation was null, expected non-null WKWebView.'); + final NSError? arg_error = (args[2] as NSError?); assert(arg_error != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.didFailProvisionalNavigation was null, expected non-null NSErrorData.'); + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didFailProvisionalNavigation was null, expected non-null NSError.'); try { - api.didFailProvisionalNavigation( - arg_identifier!, arg_webViewIdentifier!, arg_error!); + (didFailProvisionalNavigation ?? + arg_pigeon_instance!.didFailProvisionalNavigation) + ?.call(arg_pigeon_instance!, arg_webView!, arg_error!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -2179,28 +4638,32 @@ abstract class WKNavigationDelegateFlutterApi { }); } } + { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.webViewWebContentProcessDidTerminate$messageChannelSuffix', + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.webViewWebContentProcessDidTerminate', pigeonChannelCodec, binaryMessenger: binaryMessenger); - if (api == null) { - __pigeon_channel.setMessageHandler(null); + if (pigeon_clearHandlers) { + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.webViewWebContentProcessDidTerminate was null.'); + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.webViewWebContentProcessDidTerminate was null.'); final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.webViewWebContentProcessDidTerminate was null, expected non-null int.'); - final int? arg_webViewIdentifier = (args[1] as int?); - assert(arg_webViewIdentifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.webViewWebContentProcessDidTerminate was null, expected non-null int.'); + final WKNavigationDelegate? arg_pigeon_instance = + (args[0] as WKNavigationDelegate?); + assert(arg_pigeon_instance != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.webViewWebContentProcessDidTerminate was null, expected non-null WKNavigationDelegate.'); + final WKWebView? arg_webView = (args[1] as WKWebView?); + assert(arg_webView != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.webViewWebContentProcessDidTerminate was null, expected non-null WKWebView.'); try { - api.webViewWebContentProcessDidTerminate( - arg_identifier!, arg_webViewIdentifier!); + (webViewWebContentProcessDidTerminate ?? + arg_pigeon_instance!.webViewWebContentProcessDidTerminate) + ?.call(arg_pigeon_instance!, arg_webView!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -2211,32 +4674,37 @@ abstract class WKNavigationDelegateFlutterApi { }); } } + { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.didReceiveAuthenticationChallenge$messageChannelSuffix', + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didReceiveAuthenticationChallenge', pigeonChannelCodec, binaryMessenger: binaryMessenger); - if (api == null) { - __pigeon_channel.setMessageHandler(null); + if (pigeon_clearHandlers) { + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.didReceiveAuthenticationChallenge was null.'); + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didReceiveAuthenticationChallenge was null.'); final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.didReceiveAuthenticationChallenge was null, expected non-null int.'); - final int? arg_webViewIdentifier = (args[1] as int?); - assert(arg_webViewIdentifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.didReceiveAuthenticationChallenge was null, expected non-null int.'); - final int? arg_challengeIdentifier = (args[2] as int?); - assert(arg_challengeIdentifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.didReceiveAuthenticationChallenge was null, expected non-null int.'); + final WKNavigationDelegate? arg_pigeon_instance = + (args[0] as WKNavigationDelegate?); + assert(arg_pigeon_instance != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didReceiveAuthenticationChallenge was null, expected non-null WKNavigationDelegate.'); + final WKWebView? arg_webView = (args[1] as WKWebView?); + assert(arg_webView != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didReceiveAuthenticationChallenge was null, expected non-null WKWebView.'); + final URLAuthenticationChallenge? arg_challenge = + (args[2] as URLAuthenticationChallenge?); + assert(arg_challenge != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didReceiveAuthenticationChallenge was null, expected non-null URLAuthenticationChallenge.'); try { - final AuthenticationChallengeResponse output = - await api.didReceiveAuthenticationChallenge(arg_identifier!, - arg_webViewIdentifier!, arg_challengeIdentifier!); + final List output = + await (didReceiveAuthenticationChallenge ?? + arg_pigeon_instance!.didReceiveAuthenticationChallenge) + .call(arg_pigeon_instance!, arg_webView!, arg_challenge!); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -2248,239 +4716,1174 @@ abstract class WKNavigationDelegateFlutterApi { } } } -} -class _NSObjectHostApiCodec extends StandardMessageCodec { - const _NSObjectHostApiCodec(); - @override - void writeValue(WriteBuffer buffer, Object? value) { - if (value is NSKeyValueObservingOptionsEnumData) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); + @override + WKNavigationDelegate pigeon_copy() { + return WKNavigationDelegate.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + observeValue: observeValue, + didFinishNavigation: didFinishNavigation, + didStartProvisionalNavigation: didStartProvisionalNavigation, + decidePolicyForNavigationAction: decidePolicyForNavigationAction, + decidePolicyForNavigationResponse: decidePolicyForNavigationResponse, + didFailNavigation: didFailNavigation, + didFailProvisionalNavigation: didFailProvisionalNavigation, + webViewWebContentProcessDidTerminate: + webViewWebContentProcessDidTerminate, + didReceiveAuthenticationChallenge: didReceiveAuthenticationChallenge, + ); + } +} + +/// The root class of most Objective-C class hierarchies, from which subclasses +/// inherit a basic interface to the runtime system and the ability to behave as +/// Objective-C objects. +/// +/// See https://developer.apple.com/documentation/objectivec/nsobject. +class NSObject extends PigeonInternalProxyApiBaseClass { + NSObject({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + this.observeValue, + }) { + final int pigeonVar_instanceIdentifier = + pigeon_instanceManager.addDartCreatedInstance(this); + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecNSObject; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.NSObject.pigeon_defaultConstructor'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([pigeonVar_instanceIdentifier]); + () async { + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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; + } + }(); + } + + /// Constructs [NSObject] 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 + NSObject.pigeon_detached({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + this.observeValue, + }); + + late final _PigeonInternalProxyApiBaseCodec _pigeonVar_codecNSObject = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); + + /// Informs the observing object when the value at the specified key path + /// relative to the observed object has changed. + /// + /// For the associated Native object to be automatically garbage collected, + /// it is required that the implementation of this `Function` doesn't have a + /// strong reference to the encapsulating class instance. When this `Function` + /// references a non-local variable, it is strongly recommended to access it + /// with a `WeakReference`: + /// + /// ```dart + /// final WeakReference weakMyVariable = WeakReference(myVariable); + /// final NSObject instance = NSObject( + /// observeValue: (NSObject pigeon_instance, ...) { + /// print(weakMyVariable?.target); + /// }, + /// ); + /// ``` + /// + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to + /// release the associated Native object manually. + final void Function( + NSObject pigeon_instance, + String? keyPath, + NSObject? object, + Map? change, + )? observeValue; + + static void pigeon_setUpMessageHandlers({ + bool pigeon_clearHandlers = false, + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + NSObject Function()? pigeon_newInstance, + void Function( + NSObject pigeon_instance, + String? keyPath, + NSObject? object, + Map? change, + )? observeValue, + }) { + 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.NSObject.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.NSObject.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.NSObject.pigeon_newInstance was null, expected non-null int.'); + try { + (pigeon_instanceManager ?? PigeonInstanceManager.instance) + .addHostCreatedInstance( + pigeon_newInstance?.call() ?? + NSObject.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< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.NSObject.observeValue', + 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.NSObject.observeValue was null.'); + final List args = (message as List?)!; + final NSObject? arg_pigeon_instance = (args[0] as NSObject?); + assert(arg_pigeon_instance != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.NSObject.observeValue was null, expected non-null NSObject.'); + final String? arg_keyPath = (args[1] as String?); + final NSObject? arg_object = (args[2] as NSObject?); + final Map? arg_change = + (args[3] as Map?) + ?.cast(); + try { + (observeValue ?? arg_pigeon_instance!.observeValue)?.call( + arg_pigeon_instance!, arg_keyPath, arg_object, arg_change); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + } + + /// Registers the observer object to receive KVO notifications for the key + /// path relative to the object receiving this message. + Future addObserver( + NSObject observer, + String keyPath, + List options, + ) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecNSObject; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.NSObject.addObserver'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, observer, keyPath, options]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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; + } + } + + /// Stops the observer object from receiving change notifications for the + /// property specified by the key path relative to the object receiving this + /// message. + Future removeObserver( + NSObject observer, + String keyPath, + ) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecNSObject; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.NSObject.removeObserver'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, observer, keyPath]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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 + NSObject pigeon_copy() { + return NSObject.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + observeValue: observeValue, + ); + } +} + +/// An object that displays interactive web content, such as for an in-app +/// browser. +/// +/// See https://developer.apple.com/documentation/webkit/wkwebview. +class UIViewWKWebView extends UIView implements WKWebView { + UIViewWKWebView({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + super.observeValue, + required WKWebViewConfiguration initialConfiguration, + }) : super.pigeon_detached() { + final int pigeonVar_instanceIdentifier = + pigeon_instanceManager.addDartCreatedInstance(this); + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecUIViewWKWebView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.pigeon_defaultConstructor'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = pigeonVar_channel + .send([pigeonVar_instanceIdentifier, initialConfiguration]); + () async { + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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; + } + }(); + } + + /// Constructs [UIViewWKWebView] 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 + UIViewWKWebView.pigeon_detached({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + super.observeValue, + }) : super.pigeon_detached(); + + late final _PigeonInternalProxyApiBaseCodec _pigeonVar_codecUIViewWKWebView = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); + + /// The object that contains the configuration details for the web view. + late final WKWebViewConfiguration configuration = pigeonVar_configuration(); + + /// The scroll view associated with the web view. + late final UIScrollView scrollView = pigeonVar_scrollView(); + + static void pigeon_setUpMessageHandlers({ + bool pigeon_clearHandlers = false, + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + UIViewWKWebView 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.UIViewWKWebView.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.UIViewWKWebView.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.UIViewWKWebView.pigeon_newInstance was null, expected non-null int.'); + try { + (pigeon_instanceManager ?? PigeonInstanceManager.instance) + .addHostCreatedInstance( + pigeon_newInstance?.call() ?? + UIViewWKWebView.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())); + } + }); + } + } + } + + WKWebViewConfiguration pigeonVar_configuration() { + final WKWebViewConfiguration pigeonVar_instance = + WKWebViewConfiguration.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + ); + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecUIViewWKWebView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + final int pigeonVar_instanceIdentifier = + pigeon_instanceManager.addDartCreatedInstance(pigeonVar_instance); + () async { + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.configuration'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, pigeonVar_instanceIdentifier]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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; + } + }(); + return pigeonVar_instance; + } + + UIScrollView pigeonVar_scrollView() { + final UIScrollView pigeonVar_instance = UIScrollView.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + ); + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecUIViewWKWebView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + final int pigeonVar_instanceIdentifier = + pigeon_instanceManager.addDartCreatedInstance(pigeonVar_instance); + () async { + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.scrollView'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, pigeonVar_instanceIdentifier]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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; + } + }(); + return pigeonVar_instance; + } + + /// The object you use to integrate custom user interface elements, such as + /// contextual menus or panels, into web view interactions. + Future setUIDelegate(WKUIDelegate delegate) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecUIViewWKWebView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setUIDelegate'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, delegate]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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; + } + } + + /// The object you use to manage navigation behavior for the web view. + Future setNavigationDelegate(WKNavigationDelegate delegate) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecUIViewWKWebView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setNavigationDelegate'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, delegate]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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; + } + } + + /// The URL for the current webpage. + Future getUrl() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecUIViewWKWebView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.getUrl'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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 (pigeonVar_replyList[0] as String?); + } + } + + /// An estimate of what fraction of the current navigation has been loaded. + Future getEstimatedProgress() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecUIViewWKWebView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.getEstimatedProgress'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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 double?)!; + } + } + + /// Loads the web content that the specified URL request object references and + /// navigates to that content. + Future load(URLRequest request) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecUIViewWKWebView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.load'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, request]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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; + } + } + + /// Loads the contents of the specified HTML string and navigates to it. + Future loadHtmlString( + String string, + String? baseUrl, + ) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecUIViewWKWebView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.loadHtmlString'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, string, baseUrl]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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; + } + } + + /// Loads the web content from the specified file and navigates to it. + Future loadFileUrl( + String url, + String readAccessUrl, + ) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecUIViewWKWebView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.loadFileUrl'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, url, readAccessUrl]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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; + } + } + + /// Convenience method to load a Flutter asset. + Future loadFlutterAsset(String key) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecUIViewWKWebView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.loadFlutterAsset'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, key]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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; + } + } + + /// A Boolean value that indicates whether there is a valid back item in the + /// back-forward list. + Future canGoBack() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecUIViewWKWebView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.canGoBack'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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 bool?)!; + } + } + + /// A Boolean value that indicates whether there is a valid forward item in + /// the back-forward list. + Future canGoForward() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecUIViewWKWebView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.canGoForward'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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 { - super.writeValue(buffer, value); + return (pigeonVar_replyList[0] as bool?)!; } } - @override - Object? readValueOfType(int type, ReadBuffer buffer) { - switch (type) { - case 128: - return NSKeyValueObservingOptionsEnumData.decode(readValue(buffer)!); - default: - return super.readValueOfType(type, buffer); + /// Navigates to the back item in the back-forward list. + Future goBack() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecUIViewWKWebView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.goBack'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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; } } -} -/// Mirror of NSObject. -/// -/// See https://developer.apple.com/documentation/objectivec/nsobject. -class NSObjectHostApi { - /// Constructor for [NSObjectHostApi]. The [binaryMessenger] named argument is - /// available for dependency injection. If it is left null, the default - /// BinaryMessenger will be used which routes to the host platform. - NSObjectHostApi( - {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) - : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - final BinaryMessenger? __pigeon_binaryMessenger; + /// Navigates to the forward item in the back-forward list. + Future goForward() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecUIViewWKWebView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.goForward'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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; + } + } - static const MessageCodec pigeonChannelCodec = - _NSObjectHostApiCodec(); + /// Reloads the current webpage. + Future reload() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecUIViewWKWebView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.reload'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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; + } + } - final String __pigeon_messageChannelSuffix; + /// The page title. + Future getTitle() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecUIViewWKWebView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.getTitle'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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 (pigeonVar_replyList[0] as String?); + } + } - Future dispose(int identifier) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectHostApi.dispose$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + /// A Boolean value that indicates whether horizontal swipe gestures trigger + /// backward and forward page navigation. + Future setAllowsBackForwardNavigationGestures(bool allow) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecUIViewWKWebView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setAllowsBackForwardNavigationGestures'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([identifier]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, allow]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; } } - Future addObserver(int identifier, int observerIdentifier, - String keyPath, List options) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectHostApi.addObserver$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + /// The custom user agent string. + Future setCustomUserAgent(String? userAgent) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecUIViewWKWebView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setCustomUserAgent'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([identifier, observerIdentifier, keyPath, options]) - as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, userAgent]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; } } - Future removeObserver( - int identifier, int observerIdentifier, String keyPath) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectHostApi.removeObserver$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + /// Evaluates the specified JavaScript string. + Future evaluateJavaScript(String javaScriptString) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecUIViewWKWebView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.evaluateJavaScript'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, javaScriptString]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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 pigeonVar_replyList[0]; + } + } + + /// A Boolean value that indicates whether you can inspect the view with + /// Safari Web Inspector. + Future setInspectable(bool inspectable) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecUIViewWKWebView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setInspectable'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([identifier, observerIdentifier, keyPath]) - as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, inspectable]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; } } -} -class _NSObjectFlutterApiCodec extends StandardMessageCodec { - const _NSObjectFlutterApiCodec(); - @override - void writeValue(WriteBuffer buffer, Object? value) { - if (value is NSKeyValueChangeKeyEnumData) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); - } else if (value is ObjectOrIdentifier) { - buffer.putUint8(129); - writeValue(buffer, value.encode()); + /// The custom user agent string. + Future getCustomUserAgent() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecUIViewWKWebView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.getCustomUserAgent'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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 { - super.writeValue(buffer, value); + return (pigeonVar_replyList[0] as String?); } } @override - Object? readValueOfType(int type, ReadBuffer buffer) { - switch (type) { - case 128: - return NSKeyValueChangeKeyEnumData.decode(readValue(buffer)!); - case 129: - return ObjectOrIdentifier.decode(readValue(buffer)!); - default: - return super.readValueOfType(type, buffer); - } + UIViewWKWebView pigeon_copy() { + return UIViewWKWebView.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + observeValue: observeValue, + ); } } -/// Handles callbacks from an NSObject instance. +/// An object that displays interactive web content, such as for an in-app +/// browser. /// -/// See https://developer.apple.com/documentation/objectivec/nsobject. -abstract class NSObjectFlutterApi { - static const MessageCodec pigeonChannelCodec = - _NSObjectFlutterApiCodec(); - - void observeValue( - int identifier, - String keyPath, - int objectIdentifier, - List changeKeys, - List changeValues); - - void dispose(int identifier); - - static void setUp( - NSObjectFlutterApi? api, { - BinaryMessenger? binaryMessenger, - String messageChannelSuffix = '', - }) { - messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectFlutterApi.observeValue$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - __pigeon_channel.setMessageHandler(null); +/// See https://developer.apple.com/documentation/webkit/wkwebview. +class NSViewWKWebView extends NSObject implements WKWebView { + NSViewWKWebView({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + super.observeValue, + required WKWebViewConfiguration initialConfiguration, + }) : super.pigeon_detached() { + final int pigeonVar_instanceIdentifier = + pigeon_instanceManager.addDartCreatedInstance(this); + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecNSViewWKWebView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.pigeon_defaultConstructor'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = pigeonVar_channel + .send([pigeonVar_instanceIdentifier, initialConfiguration]); + () async { + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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 { - __pigeon_channel.setMessageHandler((Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectFlutterApi.observeValue was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectFlutterApi.observeValue was null, expected non-null int.'); - final String? arg_keyPath = (args[1] as String?); - assert(arg_keyPath != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectFlutterApi.observeValue was null, expected non-null String.'); - final int? arg_objectIdentifier = (args[2] as int?); - assert(arg_objectIdentifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectFlutterApi.observeValue was null, expected non-null int.'); - final List? arg_changeKeys = - (args[3] as List?)?.cast(); - assert(arg_changeKeys != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectFlutterApi.observeValue was null, expected non-null List.'); - final List? arg_changeValues = - (args[4] as List?)?.cast(); - assert(arg_changeValues != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectFlutterApi.observeValue was null, expected non-null List.'); - try { - api.observeValue(arg_identifier!, arg_keyPath!, - arg_objectIdentifier!, arg_changeKeys!, arg_changeValues!); - return wrapResponse(empty: true); - } on PlatformException catch (e) { - return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); - } - }); + return; } - } + }(); + } + + /// Constructs [NSViewWKWebView] 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 + NSViewWKWebView.pigeon_detached({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + super.observeValue, + }) : super.pigeon_detached(); + + late final _PigeonInternalProxyApiBaseCodec _pigeonVar_codecNSViewWKWebView = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); + + /// The object that contains the configuration details for the web view. + late final WKWebViewConfiguration configuration = pigeonVar_configuration(); + + static void pigeon_setUpMessageHandlers({ + bool pigeon_clearHandlers = false, + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + NSViewWKWebView Function()? pigeon_newInstance, + }) { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( + pigeon_instanceManager ?? PigeonInstanceManager.instance); + final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectFlutterApi.dispose$messageChannelSuffix', + 'dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.pigeon_newInstance', pigeonChannelCodec, binaryMessenger: binaryMessenger); - if (api == null) { - __pigeon_channel.setMessageHandler(null); + if (pigeon_clearHandlers) { + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectFlutterApi.dispose was null.'); + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.pigeon_newInstance was null.'); final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectFlutterApi.dispose was null, expected non-null int.'); + final int? arg_pigeon_instanceIdentifier = (args[0] as int?); + assert(arg_pigeon_instanceIdentifier != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.pigeon_newInstance was null, expected non-null int.'); try { - api.dispose(arg_identifier!); + (pigeon_instanceManager ?? PigeonInstanceManager.instance) + .addHostCreatedInstance( + pigeon_newInstance?.call() ?? + NSViewWKWebView.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); @@ -2492,810 +5895,1002 @@ abstract class NSObjectFlutterApi { } } } -} - -class _WKWebViewHostApiCodec extends StandardMessageCodec { - const _WKWebViewHostApiCodec(); - @override - void writeValue(WriteBuffer buffer, Object? value) { - if (value is AuthenticationChallengeResponse) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); - } else if (value is NSErrorData) { - buffer.putUint8(129); - writeValue(buffer, value.encode()); - } else if (value is NSHttpCookieData) { - buffer.putUint8(130); - writeValue(buffer, value.encode()); - } else if (value is NSHttpCookiePropertyKeyEnumData) { - buffer.putUint8(131); - writeValue(buffer, value.encode()); - } else if (value is NSHttpUrlResponseData) { - buffer.putUint8(132); - writeValue(buffer, value.encode()); - } else if (value is NSKeyValueChangeKeyEnumData) { - buffer.putUint8(133); - writeValue(buffer, value.encode()); - } else if (value is NSKeyValueObservingOptionsEnumData) { - buffer.putUint8(134); - writeValue(buffer, value.encode()); - } else if (value is NSUrlRequestData) { - buffer.putUint8(135); - writeValue(buffer, value.encode()); - } else if (value is ObjectOrIdentifier) { - buffer.putUint8(136); - writeValue(buffer, value.encode()); - } else if (value is WKAudiovisualMediaTypeEnumData) { - buffer.putUint8(137); - writeValue(buffer, value.encode()); - } else if (value is WKFrameInfoData) { - buffer.putUint8(138); - writeValue(buffer, value.encode()); - } else if (value is WKMediaCaptureTypeData) { - buffer.putUint8(139); - writeValue(buffer, value.encode()); - } else if (value is WKNavigationActionData) { - buffer.putUint8(140); - writeValue(buffer, value.encode()); - } else if (value is WKNavigationActionPolicyEnumData) { - buffer.putUint8(141); - writeValue(buffer, value.encode()); - } else if (value is WKNavigationResponseData) { - buffer.putUint8(142); - writeValue(buffer, value.encode()); - } else if (value is WKPermissionDecisionData) { - buffer.putUint8(143); - writeValue(buffer, value.encode()); - } else if (value is WKScriptMessageData) { - buffer.putUint8(144); - writeValue(buffer, value.encode()); - } else if (value is WKSecurityOriginData) { - buffer.putUint8(145); - writeValue(buffer, value.encode()); - } else if (value is WKUserScriptData) { - buffer.putUint8(146); - writeValue(buffer, value.encode()); - } else if (value is WKUserScriptInjectionTimeEnumData) { - buffer.putUint8(147); - writeValue(buffer, value.encode()); - } else if (value is WKWebsiteDataTypeEnumData) { - buffer.putUint8(148); - writeValue(buffer, value.encode()); - } else { - super.writeValue(buffer, value); - } - } - - @override - Object? readValueOfType(int type, ReadBuffer buffer) { - switch (type) { - case 128: - return AuthenticationChallengeResponse.decode(readValue(buffer)!); - case 129: - return NSErrorData.decode(readValue(buffer)!); - case 130: - return NSHttpCookieData.decode(readValue(buffer)!); - case 131: - return NSHttpCookiePropertyKeyEnumData.decode(readValue(buffer)!); - case 132: - return NSHttpUrlResponseData.decode(readValue(buffer)!); - case 133: - return NSKeyValueChangeKeyEnumData.decode(readValue(buffer)!); - case 134: - return NSKeyValueObservingOptionsEnumData.decode(readValue(buffer)!); - case 135: - return NSUrlRequestData.decode(readValue(buffer)!); - case 136: - return ObjectOrIdentifier.decode(readValue(buffer)!); - case 137: - return WKAudiovisualMediaTypeEnumData.decode(readValue(buffer)!); - case 138: - return WKFrameInfoData.decode(readValue(buffer)!); - case 139: - return WKMediaCaptureTypeData.decode(readValue(buffer)!); - case 140: - return WKNavigationActionData.decode(readValue(buffer)!); - case 141: - return WKNavigationActionPolicyEnumData.decode(readValue(buffer)!); - case 142: - return WKNavigationResponseData.decode(readValue(buffer)!); - case 143: - return WKPermissionDecisionData.decode(readValue(buffer)!); - case 144: - return WKScriptMessageData.decode(readValue(buffer)!); - case 145: - return WKSecurityOriginData.decode(readValue(buffer)!); - case 146: - return WKUserScriptData.decode(readValue(buffer)!); - case 147: - return WKUserScriptInjectionTimeEnumData.decode(readValue(buffer)!); - case 148: - return WKWebsiteDataTypeEnumData.decode(readValue(buffer)!); - default: - return super.readValueOfType(type, buffer); - } - } -} - -/// Mirror of WKWebView. -/// -/// See https://developer.apple.com/documentation/webkit/wkwebview?language=objc. -class WKWebViewHostApi { - /// Constructor for [WKWebViewHostApi]. The [binaryMessenger] named argument is - /// available for dependency injection. If it is left null, the default - /// BinaryMessenger will be used which routes to the host platform. - WKWebViewHostApi( - {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) - : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - final BinaryMessenger? __pigeon_binaryMessenger; - - static const MessageCodec pigeonChannelCodec = - _WKWebViewHostApiCodec(); - - final String __pigeon_messageChannelSuffix; - Future create(int identifier, int configurationIdentifier) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.create$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, - pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + WKWebViewConfiguration pigeonVar_configuration() { + final WKWebViewConfiguration pigeonVar_instance = + WKWebViewConfiguration.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([identifier, configurationIdentifier]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecNSViewWKWebView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + final int pigeonVar_instanceIdentifier = + pigeon_instanceManager.addDartCreatedInstance(pigeonVar_instance); + () async { + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.configuration'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, ); - } else { - return; - } - } - - Future setUIDelegate(int identifier, int? uiDelegateIdentifier) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.setUIDelegate$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, pigeonVar_instanceIdentifier]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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; + } + }(); + return pigeonVar_instance; + } + + /// The object you use to integrate custom user interface elements, such as + /// contextual menus or panels, into web view interactions. + Future setUIDelegate(WKUIDelegate delegate) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecNSViewWKWebView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setUIDelegate'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([identifier, uiDelegateIdentifier]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, delegate]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; } } - Future setNavigationDelegate( - int identifier, int? navigationDelegateIdentifier) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.setNavigationDelegate$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + /// The object you use to manage navigation behavior for the web view. + Future setNavigationDelegate(WKNavigationDelegate delegate) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecNSViewWKWebView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setNavigationDelegate'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([identifier, navigationDelegateIdentifier]) - as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, delegate]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; } } - Future getUrl(int identifier) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.getUrl$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + /// The URL for the current webpage. + Future getUrl() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecNSViewWKWebView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.getUrl'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([identifier]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { - return (__pigeon_replyList[0] as String?); + return (pigeonVar_replyList[0] as String?); } } - Future getEstimatedProgress(int identifier) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.getEstimatedProgress$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + /// An estimate of what fraction of the current navigation has been loaded. + Future getEstimatedProgress() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecNSViewWKWebView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.getEstimatedProgress'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([identifier]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as double?)!; + return (pigeonVar_replyList[0] as double?)!; } } - Future loadRequest(int identifier, NSUrlRequestData request) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.loadRequest$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + /// Loads the web content that the specified URL request object references and + /// navigates to that content. + Future load(URLRequest request) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecNSViewWKWebView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.load'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([identifier, request]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, request]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; } } + /// Loads the contents of the specified HTML string and navigates to it. Future loadHtmlString( - int identifier, String string, String? baseUrl) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.loadHtmlString$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + String string, + String? baseUrl, + ) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecNSViewWKWebView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.loadHtmlString'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([identifier, string, baseUrl]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, string, baseUrl]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; } } + /// Loads the web content from the specified file and navigates to it. Future loadFileUrl( - int identifier, String url, String readAccessUrl) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.loadFileUrl$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + String url, + String readAccessUrl, + ) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecNSViewWKWebView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.loadFileUrl'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([identifier, url, readAccessUrl]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, url, readAccessUrl]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; } } - Future loadFlutterAsset(int identifier, String key) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.loadFlutterAsset$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + /// Convenience method to load a Flutter asset. + Future loadFlutterAsset(String key) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecNSViewWKWebView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.loadFlutterAsset'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([identifier, key]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, key]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; } } - Future canGoBack(int identifier) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.canGoBack$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + /// A Boolean value that indicates whether there is a valid back item in the + /// back-forward list. + Future canGoBack() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecNSViewWKWebView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.canGoBack'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([identifier]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as bool?)!; + return (pigeonVar_replyList[0] as bool?)!; } } - Future canGoForward(int identifier) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.canGoForward$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + /// A Boolean value that indicates whether there is a valid forward item in + /// the back-forward list. + Future canGoForward() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecNSViewWKWebView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.canGoForward'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([identifier]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as bool?)!; + return (pigeonVar_replyList[0] as bool?)!; } } - Future goBack(int identifier) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.goBack$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + /// Navigates to the back item in the back-forward list. + Future goBack() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecNSViewWKWebView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.goBack'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([identifier]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; } } - Future goForward(int identifier) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.goForward$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + /// Navigates to the forward item in the back-forward list. + Future goForward() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecNSViewWKWebView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.goForward'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([identifier]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; } } - Future reload(int identifier) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.reload$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + /// Reloads the current webpage. + Future reload() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecNSViewWKWebView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.reload'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([identifier]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; } } - Future getTitle(int identifier) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.getTitle$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + /// The page title. + Future getTitle() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecNSViewWKWebView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.getTitle'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([identifier]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { - return (__pigeon_replyList[0] as String?); + return (pigeonVar_replyList[0] as String?); } } - Future setAllowsBackForwardNavigationGestures( - int identifier, bool allow) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.setAllowsBackForwardNavigationGestures$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + /// A Boolean value that indicates whether horizontal swipe gestures trigger + /// backward and forward page navigation. + Future setAllowsBackForwardNavigationGestures(bool allow) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecNSViewWKWebView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setAllowsBackForwardNavigationGestures'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([identifier, allow]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, allow]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; } } - Future setCustomUserAgent(int identifier, String? userAgent) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.setCustomUserAgent$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + /// The custom user agent string. + Future setCustomUserAgent(String? userAgent) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecNSViewWKWebView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setCustomUserAgent'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([identifier, userAgent]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, userAgent]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; } } - Future evaluateJavaScript( - int identifier, String javaScriptString) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.evaluateJavaScript$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + /// Evaluates the specified JavaScript string. + Future evaluateJavaScript(String javaScriptString) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecNSViewWKWebView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.evaluateJavaScript'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([identifier, javaScriptString]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, javaScriptString]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { - return __pigeon_replyList[0]; + return pigeonVar_replyList[0]; } } - Future setInspectable(int identifier, bool inspectable) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.setInspectable$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + /// A Boolean value that indicates whether you can inspect the view with + /// Safari Web Inspector. + Future setInspectable(bool inspectable) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecNSViewWKWebView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setInspectable'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([identifier, inspectable]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, inspectable]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; } } - Future getCustomUserAgent(int identifier) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.getCustomUserAgent$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + /// The custom user agent string. + Future getCustomUserAgent() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecNSViewWKWebView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.getCustomUserAgent'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([identifier]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { - return (__pigeon_replyList[0] as String?); + return (pigeonVar_replyList[0] as String?); } } -} - -/// Mirror of WKUIDelegate. -/// -/// See https://developer.apple.com/documentation/webkit/wkuidelegate?language=objc. -class WKUIDelegateHostApi { - /// Constructor for [WKUIDelegateHostApi]. The [binaryMessenger] named argument is - /// available for dependency injection. If it is left null, the default - /// BinaryMessenger will be used which routes to the host platform. - WKUIDelegateHostApi( - {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) - : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - final BinaryMessenger? __pigeon_binaryMessenger; - - static const MessageCodec pigeonChannelCodec = - StandardMessageCodec(); - final String __pigeon_messageChannelSuffix; - - Future create(int identifier) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateHostApi.create$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, - pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + @override + NSViewWKWebView pigeon_copy() { + return NSViewWKWebView.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + observeValue: observeValue, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([identifier]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else { - return; - } } } -class _WKUIDelegateFlutterApiCodec extends StandardMessageCodec { - const _WKUIDelegateFlutterApiCodec(); - @override - void writeValue(WriteBuffer buffer, Object? value) { - if (value is NSUrlRequestData) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); - } else if (value is WKFrameInfoData) { - buffer.putUint8(129); - writeValue(buffer, value.encode()); - } else if (value is WKMediaCaptureTypeData) { - buffer.putUint8(130); - writeValue(buffer, value.encode()); - } else if (value is WKNavigationActionData) { - buffer.putUint8(131); - writeValue(buffer, value.encode()); - } else if (value is WKPermissionDecisionData) { - buffer.putUint8(132); - writeValue(buffer, value.encode()); - } else if (value is WKSecurityOriginData) { - buffer.putUint8(133); - writeValue(buffer, value.encode()); - } else { - super.writeValue(buffer, value); +/// An object that displays interactive web content, such as for an in-app +/// browser. +/// +/// See https://developer.apple.com/documentation/webkit/wkwebview. +class WKWebView extends NSObject { + /// Constructs [WKWebView] 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 + WKWebView.pigeon_detached({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + super.observeValue, + }) : super.pigeon_detached(); + + static void pigeon_setUpMessageHandlers({ + bool pigeon_clearHandlers = false, + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + WKWebView 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.WKWebView.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.WKWebView.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.WKWebView.pigeon_newInstance was null, expected non-null int.'); + try { + (pigeon_instanceManager ?? PigeonInstanceManager.instance) + .addHostCreatedInstance( + pigeon_newInstance?.call() ?? + WKWebView.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())); + } + }); + } } } @override - Object? readValueOfType(int type, ReadBuffer buffer) { - switch (type) { - case 128: - return NSUrlRequestData.decode(readValue(buffer)!); - case 129: - return WKFrameInfoData.decode(readValue(buffer)!); - case 130: - return WKMediaCaptureTypeData.decode(readValue(buffer)!); - case 131: - return WKNavigationActionData.decode(readValue(buffer)!); - case 132: - return WKPermissionDecisionData.decode(readValue(buffer)!); - case 133: - return WKSecurityOriginData.decode(readValue(buffer)!); - default: - return super.readValueOfType(type, buffer); - } + WKWebView pigeon_copy() { + return WKWebView.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + observeValue: observeValue, + ); } } -/// Handles callbacks from a WKUIDelegate instance. +/// The methods for presenting native user interface elements on behalf of a +/// webpage. /// -/// See https://developer.apple.com/documentation/webkit/wkuidelegate?language=objc. -abstract class WKUIDelegateFlutterApi { - static const MessageCodec pigeonChannelCodec = - _WKUIDelegateFlutterApiCodec(); - - void onCreateWebView(int identifier, int webViewIdentifier, - int configurationIdentifier, WKNavigationActionData navigationAction); - - /// Callback to Dart function `WKUIDelegate.requestMediaCapturePermission`. - Future requestMediaCapturePermission( - int identifier, - int webViewIdentifier, - WKSecurityOriginData origin, - WKFrameInfoData frame, - WKMediaCaptureTypeData type); - - /// Callback to Dart function `WKUIDelegate.runJavaScriptAlertPanel`. - Future runJavaScriptAlertPanel( - int identifier, String message, WKFrameInfoData frame); - - /// Callback to Dart function `WKUIDelegate.runJavaScriptConfirmPanel`. - Future runJavaScriptConfirmPanel( - int identifier, String message, WKFrameInfoData frame); - - /// Callback to Dart function `WKUIDelegate.runJavaScriptTextInputPanel`. - Future runJavaScriptTextInputPanel( - int identifier, String prompt, String defaultText, WKFrameInfoData frame); - - static void setUp( - WKUIDelegateFlutterApi? api, { - BinaryMessenger? binaryMessenger, - String messageChannelSuffix = '', +/// See https://developer.apple.com/documentation/webkit/wkuidelegate. +class WKUIDelegate extends NSObject { + WKUIDelegate({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + super.observeValue, + this.onCreateWebView, + required this.requestMediaCapturePermission, + this.runJavaScriptAlertPanel, + required this.runJavaScriptConfirmPanel, + this.runJavaScriptTextInputPanel, + }) : super.pigeon_detached() { + final int pigeonVar_instanceIdentifier = + pigeon_instanceManager.addDartCreatedInstance(this); + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecWKUIDelegate; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.pigeon_defaultConstructor'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([pigeonVar_instanceIdentifier]); + () async { + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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; + } + }(); + } + + /// Constructs [WKUIDelegate] 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 + WKUIDelegate.pigeon_detached({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + super.observeValue, + this.onCreateWebView, + required this.requestMediaCapturePermission, + this.runJavaScriptAlertPanel, + required this.runJavaScriptConfirmPanel, + this.runJavaScriptTextInputPanel, + }) : super.pigeon_detached(); + + late final _PigeonInternalProxyApiBaseCodec _pigeonVar_codecWKUIDelegate = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); + + /// Creates a new web view. + /// + /// For the associated Native object to be automatically garbage collected, + /// it is required that the implementation of this `Function` doesn't have a + /// strong reference to the encapsulating class instance. When this `Function` + /// references a non-local variable, it is strongly recommended to access it + /// with a `WeakReference`: + /// + /// ```dart + /// final WeakReference weakMyVariable = WeakReference(myVariable); + /// final WKUIDelegate instance = WKUIDelegate( + /// onCreateWebView: (WKUIDelegate pigeon_instance, ...) { + /// print(weakMyVariable?.target); + /// }, + /// ); + /// ``` + /// + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to + /// release the associated Native object manually. + final void Function( + WKUIDelegate pigeon_instance, + WKWebView webView, + WKWebViewConfiguration configuration, + WKNavigationAction navigationAction, + )? onCreateWebView; + + /// Determines whether a web resource, which the security origin object + /// describes, can access to the device’s microphone audio and camera video. + /// + /// For the associated Native object to be automatically garbage collected, + /// it is required that the implementation of this `Function` doesn't have a + /// strong reference to the encapsulating class instance. When this `Function` + /// references a non-local variable, it is strongly recommended to access it + /// with a `WeakReference`: + /// + /// ```dart + /// final WeakReference weakMyVariable = WeakReference(myVariable); + /// final WKUIDelegate instance = WKUIDelegate( + /// requestMediaCapturePermission: (WKUIDelegate pigeon_instance, ...) { + /// print(weakMyVariable?.target); + /// }, + /// ); + /// ``` + /// + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to + /// release the associated Native object manually. + final Future Function( + WKUIDelegate pigeon_instance, + WKWebView webView, + WKSecurityOrigin origin, + WKFrameInfo frame, + MediaCaptureType type, + ) requestMediaCapturePermission; + + /// Displays a JavaScript alert panel. + /// + /// For the associated Native object to be automatically garbage collected, + /// it is required that the implementation of this `Function` doesn't have a + /// strong reference to the encapsulating class instance. When this `Function` + /// references a non-local variable, it is strongly recommended to access it + /// with a `WeakReference`: + /// + /// ```dart + /// final WeakReference weakMyVariable = WeakReference(myVariable); + /// final WKUIDelegate instance = WKUIDelegate( + /// runJavaScriptAlertPanel: (WKUIDelegate pigeon_instance, ...) { + /// print(weakMyVariable?.target); + /// }, + /// ); + /// ``` + /// + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to + /// release the associated Native object manually. + final Future Function( + WKUIDelegate pigeon_instance, + WKWebView webView, + String message, + WKFrameInfo frame, + )? runJavaScriptAlertPanel; + + /// Displays a JavaScript confirm panel. + /// + /// For the associated Native object to be automatically garbage collected, + /// it is required that the implementation of this `Function` doesn't have a + /// strong reference to the encapsulating class instance. When this `Function` + /// references a non-local variable, it is strongly recommended to access it + /// with a `WeakReference`: + /// + /// ```dart + /// final WeakReference weakMyVariable = WeakReference(myVariable); + /// final WKUIDelegate instance = WKUIDelegate( + /// runJavaScriptConfirmPanel: (WKUIDelegate pigeon_instance, ...) { + /// print(weakMyVariable?.target); + /// }, + /// ); + /// ``` + /// + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to + /// release the associated Native object manually. + final Future Function( + WKUIDelegate pigeon_instance, + WKWebView webView, + String message, + WKFrameInfo frame, + ) runJavaScriptConfirmPanel; + + /// Displays a JavaScript text input panel. + /// + /// For the associated Native object to be automatically garbage collected, + /// it is required that the implementation of this `Function` doesn't have a + /// strong reference to the encapsulating class instance. When this `Function` + /// references a non-local variable, it is strongly recommended to access it + /// with a `WeakReference`: + /// + /// ```dart + /// final WeakReference weakMyVariable = WeakReference(myVariable); + /// final WKUIDelegate instance = WKUIDelegate( + /// runJavaScriptTextInputPanel: (WKUIDelegate pigeon_instance, ...) { + /// print(weakMyVariable?.target); + /// }, + /// ); + /// ``` + /// + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to + /// release the associated Native object manually. + final Future Function( + WKUIDelegate pigeon_instance, + WKWebView webView, + String prompt, + String? defaultText, + WKFrameInfo frame, + )? runJavaScriptTextInputPanel; + + static void pigeon_setUpMessageHandlers({ + bool pigeon_clearHandlers = false, + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + void Function( + WKUIDelegate pigeon_instance, + WKWebView webView, + WKWebViewConfiguration configuration, + WKNavigationAction navigationAction, + )? onCreateWebView, + Future Function( + WKUIDelegate pigeon_instance, + WKWebView webView, + WKSecurityOrigin origin, + WKFrameInfo frame, + MediaCaptureType type, + )? requestMediaCapturePermission, + Future Function( + WKUIDelegate pigeon_instance, + WKWebView webView, + String message, + WKFrameInfo frame, + )? runJavaScriptAlertPanel, + Future Function( + WKUIDelegate pigeon_instance, + WKWebView webView, + String message, + WKFrameInfo frame, + )? runJavaScriptConfirmPanel, + Future Function( + WKUIDelegate pigeon_instance, + WKWebView webView, + String prompt, + String? defaultText, + WKFrameInfo frame, + )? runJavaScriptTextInputPanel, }) { - messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( + pigeon_instanceManager ?? PigeonInstanceManager.instance); + final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateFlutterApi.onCreateWebView$messageChannelSuffix', + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.onCreateWebView', pigeonChannelCodec, binaryMessenger: binaryMessenger); - if (api == null) { - __pigeon_channel.setMessageHandler(null); + if (pigeon_clearHandlers) { + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateFlutterApi.onCreateWebView was null.'); + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.onCreateWebView was null.'); final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateFlutterApi.onCreateWebView was null, expected non-null int.'); - final int? arg_webViewIdentifier = (args[1] as int?); - assert(arg_webViewIdentifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateFlutterApi.onCreateWebView was null, expected non-null int.'); - final int? arg_configurationIdentifier = (args[2] as int?); - assert(arg_configurationIdentifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateFlutterApi.onCreateWebView was null, expected non-null int.'); - final WKNavigationActionData? arg_navigationAction = - (args[3] as WKNavigationActionData?); + final WKUIDelegate? arg_pigeon_instance = (args[0] as WKUIDelegate?); + assert(arg_pigeon_instance != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.onCreateWebView was null, expected non-null WKUIDelegate.'); + final WKWebView? arg_webView = (args[1] as WKWebView?); + assert(arg_webView != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.onCreateWebView was null, expected non-null WKWebView.'); + final WKWebViewConfiguration? arg_configuration = + (args[2] as WKWebViewConfiguration?); + assert(arg_configuration != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.onCreateWebView was null, expected non-null WKWebViewConfiguration.'); + final WKNavigationAction? arg_navigationAction = + (args[3] as WKNavigationAction?); assert(arg_navigationAction != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateFlutterApi.onCreateWebView was null, expected non-null WKNavigationActionData.'); + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.onCreateWebView was null, expected non-null WKNavigationAction.'); try { - api.onCreateWebView(arg_identifier!, arg_webViewIdentifier!, - arg_configurationIdentifier!, arg_navigationAction!); + (onCreateWebView ?? arg_pigeon_instance!.onCreateWebView)?.call( + arg_pigeon_instance!, + arg_webView!, + arg_configuration!, + arg_navigationAction!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -3306,40 +6901,42 @@ abstract class WKUIDelegateFlutterApi { }); } } + { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateFlutterApi.requestMediaCapturePermission$messageChannelSuffix', + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.requestMediaCapturePermission', pigeonChannelCodec, binaryMessenger: binaryMessenger); - if (api == null) { - __pigeon_channel.setMessageHandler(null); + if (pigeon_clearHandlers) { + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateFlutterApi.requestMediaCapturePermission was null.'); + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.requestMediaCapturePermission was null.'); final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateFlutterApi.requestMediaCapturePermission was null, expected non-null int.'); - final int? arg_webViewIdentifier = (args[1] as int?); - assert(arg_webViewIdentifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateFlutterApi.requestMediaCapturePermission was null, expected non-null int.'); - final WKSecurityOriginData? arg_origin = - (args[2] as WKSecurityOriginData?); + final WKUIDelegate? arg_pigeon_instance = (args[0] as WKUIDelegate?); + assert(arg_pigeon_instance != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.requestMediaCapturePermission was null, expected non-null WKUIDelegate.'); + final WKWebView? arg_webView = (args[1] as WKWebView?); + assert(arg_webView != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.requestMediaCapturePermission was null, expected non-null WKWebView.'); + final WKSecurityOrigin? arg_origin = (args[2] as WKSecurityOrigin?); assert(arg_origin != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateFlutterApi.requestMediaCapturePermission was null, expected non-null WKSecurityOriginData.'); - final WKFrameInfoData? arg_frame = (args[3] as WKFrameInfoData?); + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.requestMediaCapturePermission was null, expected non-null WKSecurityOrigin.'); + final WKFrameInfo? arg_frame = (args[3] as WKFrameInfo?); assert(arg_frame != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateFlutterApi.requestMediaCapturePermission was null, expected non-null WKFrameInfoData.'); - final WKMediaCaptureTypeData? arg_type = - (args[4] as WKMediaCaptureTypeData?); + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.requestMediaCapturePermission was null, expected non-null WKFrameInfo.'); + final MediaCaptureType? arg_type = (args[4] as MediaCaptureType?); assert(arg_type != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateFlutterApi.requestMediaCapturePermission was null, expected non-null WKMediaCaptureTypeData.'); + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.requestMediaCapturePermission was null, expected non-null MediaCaptureType.'); try { - final WKPermissionDecisionData output = - await api.requestMediaCapturePermission(arg_identifier!, - arg_webViewIdentifier!, arg_origin!, arg_frame!, arg_type!); + final PermissionDecision output = + await (requestMediaCapturePermission ?? + arg_pigeon_instance!.requestMediaCapturePermission) + .call(arg_pigeon_instance!, arg_webView!, arg_origin!, + arg_frame!, arg_type!); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -3350,31 +6947,38 @@ abstract class WKUIDelegateFlutterApi { }); } } + { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateFlutterApi.runJavaScriptAlertPanel$messageChannelSuffix', + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.runJavaScriptAlertPanel', pigeonChannelCodec, binaryMessenger: binaryMessenger); - if (api == null) { - __pigeon_channel.setMessageHandler(null); + if (pigeon_clearHandlers) { + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateFlutterApi.runJavaScriptAlertPanel was null.'); + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.runJavaScriptAlertPanel was null.'); final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateFlutterApi.runJavaScriptAlertPanel was null, expected non-null int.'); - final String? arg_message = (args[1] as String?); + final WKUIDelegate? arg_pigeon_instance = (args[0] as WKUIDelegate?); + assert(arg_pigeon_instance != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.runJavaScriptAlertPanel was null, expected non-null WKUIDelegate.'); + final WKWebView? arg_webView = (args[1] as WKWebView?); + assert(arg_webView != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.runJavaScriptAlertPanel was null, expected non-null WKWebView.'); + final String? arg_message = (args[2] as String?); assert(arg_message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateFlutterApi.runJavaScriptAlertPanel was null, expected non-null String.'); - final WKFrameInfoData? arg_frame = (args[2] as WKFrameInfoData?); + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.runJavaScriptAlertPanel was null, expected non-null String.'); + final WKFrameInfo? arg_frame = (args[3] as WKFrameInfo?); assert(arg_frame != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateFlutterApi.runJavaScriptAlertPanel was null, expected non-null WKFrameInfoData.'); + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.runJavaScriptAlertPanel was null, expected non-null WKFrameInfo.'); try { - await api.runJavaScriptAlertPanel( - arg_identifier!, arg_message!, arg_frame!); + await (runJavaScriptAlertPanel ?? + arg_pigeon_instance!.runJavaScriptAlertPanel) + ?.call(arg_pigeon_instance!, arg_webView!, arg_message!, + arg_frame!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -3385,31 +6989,38 @@ abstract class WKUIDelegateFlutterApi { }); } } + { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateFlutterApi.runJavaScriptConfirmPanel$messageChannelSuffix', + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.runJavaScriptConfirmPanel', pigeonChannelCodec, binaryMessenger: binaryMessenger); - if (api == null) { - __pigeon_channel.setMessageHandler(null); + if (pigeon_clearHandlers) { + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateFlutterApi.runJavaScriptConfirmPanel was null.'); + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.runJavaScriptConfirmPanel was null.'); final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateFlutterApi.runJavaScriptConfirmPanel was null, expected non-null int.'); - final String? arg_message = (args[1] as String?); + final WKUIDelegate? arg_pigeon_instance = (args[0] as WKUIDelegate?); + assert(arg_pigeon_instance != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.runJavaScriptConfirmPanel was null, expected non-null WKUIDelegate.'); + final WKWebView? arg_webView = (args[1] as WKWebView?); + assert(arg_webView != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.runJavaScriptConfirmPanel was null, expected non-null WKWebView.'); + final String? arg_message = (args[2] as String?); assert(arg_message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateFlutterApi.runJavaScriptConfirmPanel was null, expected non-null String.'); - final WKFrameInfoData? arg_frame = (args[2] as WKFrameInfoData?); + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.runJavaScriptConfirmPanel was null, expected non-null String.'); + final WKFrameInfo? arg_frame = (args[3] as WKFrameInfo?); assert(arg_frame != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateFlutterApi.runJavaScriptConfirmPanel was null, expected non-null WKFrameInfoData.'); + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.runJavaScriptConfirmPanel was null, expected non-null WKFrameInfo.'); try { - final bool output = await api.runJavaScriptConfirmPanel( - arg_identifier!, arg_message!, arg_frame!); + final bool output = await (runJavaScriptConfirmPanel ?? + arg_pigeon_instance!.runJavaScriptConfirmPanel) + .call(arg_pigeon_instance!, arg_webView!, arg_message!, + arg_frame!); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -3420,34 +7031,39 @@ abstract class WKUIDelegateFlutterApi { }); } } + { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateFlutterApi.runJavaScriptTextInputPanel$messageChannelSuffix', + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.runJavaScriptTextInputPanel', pigeonChannelCodec, binaryMessenger: binaryMessenger); - if (api == null) { - __pigeon_channel.setMessageHandler(null); + if (pigeon_clearHandlers) { + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateFlutterApi.runJavaScriptTextInputPanel was null.'); + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.runJavaScriptTextInputPanel was null.'); final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateFlutterApi.runJavaScriptTextInputPanel was null, expected non-null int.'); - final String? arg_prompt = (args[1] as String?); + final WKUIDelegate? arg_pigeon_instance = (args[0] as WKUIDelegate?); + assert(arg_pigeon_instance != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.runJavaScriptTextInputPanel was null, expected non-null WKUIDelegate.'); + final WKWebView? arg_webView = (args[1] as WKWebView?); + assert(arg_webView != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.runJavaScriptTextInputPanel was null, expected non-null WKWebView.'); + final String? arg_prompt = (args[2] as String?); assert(arg_prompt != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateFlutterApi.runJavaScriptTextInputPanel was null, expected non-null String.'); - final String? arg_defaultText = (args[2] as String?); - assert(arg_defaultText != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateFlutterApi.runJavaScriptTextInputPanel was null, expected non-null String.'); - final WKFrameInfoData? arg_frame = (args[3] as WKFrameInfoData?); + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.runJavaScriptTextInputPanel was null, expected non-null String.'); + final String? arg_defaultText = (args[3] as String?); + final WKFrameInfo? arg_frame = (args[4] as WKFrameInfo?); assert(arg_frame != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateFlutterApi.runJavaScriptTextInputPanel was null, expected non-null WKFrameInfoData.'); + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.runJavaScriptTextInputPanel was null, expected non-null WKFrameInfo.'); try { - final String output = await api.runJavaScriptTextInputPanel( - arg_identifier!, arg_prompt!, arg_defaultText!, arg_frame!); + final String? output = await (runJavaScriptTextInputPanel ?? + arg_pigeon_instance!.runJavaScriptTextInputPanel) + ?.call(arg_pigeon_instance!, arg_webView!, arg_prompt!, + arg_defaultText, arg_frame!); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -3459,192 +7075,304 @@ abstract class WKUIDelegateFlutterApi { } } } -} - -class _WKHttpCookieStoreHostApiCodec extends StandardMessageCodec { - const _WKHttpCookieStoreHostApiCodec(); - @override - void writeValue(WriteBuffer buffer, Object? value) { - if (value is NSHttpCookieData) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); - } else if (value is NSHttpCookiePropertyKeyEnumData) { - buffer.putUint8(129); - writeValue(buffer, value.encode()); - } else { - super.writeValue(buffer, value); - } - } @override - Object? readValueOfType(int type, ReadBuffer buffer) { - switch (type) { - case 128: - return NSHttpCookieData.decode(readValue(buffer)!); - case 129: - return NSHttpCookiePropertyKeyEnumData.decode(readValue(buffer)!); - default: - return super.readValueOfType(type, buffer); - } + WKUIDelegate pigeon_copy() { + return WKUIDelegate.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + observeValue: observeValue, + onCreateWebView: onCreateWebView, + requestMediaCapturePermission: requestMediaCapturePermission, + runJavaScriptAlertPanel: runJavaScriptAlertPanel, + runJavaScriptConfirmPanel: runJavaScriptConfirmPanel, + runJavaScriptTextInputPanel: runJavaScriptTextInputPanel, + ); } } -/// Mirror of WKHttpCookieStore. +/// An object that manages the HTTP cookies associated with a particular web +/// view. /// -/// See https://developer.apple.com/documentation/webkit/wkhttpcookiestore?language=objc. -class WKHttpCookieStoreHostApi { - /// Constructor for [WKHttpCookieStoreHostApi]. The [binaryMessenger] named argument is - /// available for dependency injection. If it is left null, the default - /// BinaryMessenger will be used which routes to the host platform. - WKHttpCookieStoreHostApi( - {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) - : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - final BinaryMessenger? __pigeon_binaryMessenger; - - static const MessageCodec pigeonChannelCodec = - _WKHttpCookieStoreHostApiCodec(); - - final String __pigeon_messageChannelSuffix; +/// See https://developer.apple.com/documentation/webkit/wkhttpcookiestore. +class WKHTTPCookieStore extends NSObject { + /// Constructs [WKHTTPCookieStore] 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 + WKHTTPCookieStore.pigeon_detached({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + super.observeValue, + }) : super.pigeon_detached(); + + late final _PigeonInternalProxyApiBaseCodec + _pigeonVar_codecWKHTTPCookieStore = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); + + static void pigeon_setUpMessageHandlers({ + bool pigeon_clearHandlers = false, + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + WKHTTPCookieStore 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.WKHTTPCookieStore.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.WKHTTPCookieStore.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.WKHTTPCookieStore.pigeon_newInstance was null, expected non-null int.'); + try { + (pigeon_instanceManager ?? PigeonInstanceManager.instance) + .addHostCreatedInstance( + pigeon_newInstance?.call() ?? + WKHTTPCookieStore.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())); + } + }); + } + } + } - Future createFromWebsiteDataStore( - int identifier, int websiteDataStoreIdentifier) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKHttpCookieStoreHostApi.createFromWebsiteDataStore$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + /// Sets a cookie policy that indicates whether the cookie store allows cookie + /// storage. + Future setCookie(HTTPCookie cookie) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecWKHTTPCookieStore; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKHTTPCookieStore.setCookie'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([identifier, websiteDataStoreIdentifier]) - as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, cookie]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; } } - Future setCookie(int identifier, NSHttpCookieData cookie) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKHttpCookieStoreHostApi.setCookie$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, - pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + @override + WKHTTPCookieStore pigeon_copy() { + return WKHTTPCookieStore.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + observeValue: observeValue, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([identifier, cookie]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else { - return; - } } } -/// Host API for `NSUrl`. +/// The interface for the delegate of a scroll view. /// -/// This class may handle instantiating and adding native object instances that -/// are attached to a Dart instance or method calls on the associated native -/// class or an instance of the class. -/// -/// See https://developer.apple.com/documentation/foundation/nsurl?language=objc. -class NSUrlHostApi { - /// Constructor for [NSUrlHostApi]. The [binaryMessenger] named argument is - /// available for dependency injection. If it is left null, the default - /// BinaryMessenger will be used which routes to the host platform. - NSUrlHostApi( - {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) - : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - final BinaryMessenger? __pigeon_binaryMessenger; - - static const MessageCodec pigeonChannelCodec = - StandardMessageCodec(); - - final String __pigeon_messageChannelSuffix; - - Future getAbsoluteString(int identifier) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.NSUrlHostApi.getAbsoluteString$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = +/// See https://developer.apple.com/documentation/uikit/uiscrollviewdelegate. +class UIScrollViewDelegate extends NSObject { + UIScrollViewDelegate({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + super.observeValue, + this.scrollViewDidScroll, + }) : super.pigeon_detached() { + final int pigeonVar_instanceIdentifier = + pigeon_instanceManager.addDartCreatedInstance(this); + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecUIScrollViewDelegate; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewDelegate.pigeon_defaultConstructor'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([identifier]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else { - return (__pigeon_replyList[0] as String?); - } + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([pigeonVar_instanceIdentifier]); + () async { + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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; + } + }(); } -} - -/// Flutter API for `NSUrl`. -/// -/// This class may handle instantiating and adding Dart instances that are -/// attached to a native instance or receiving callback methods from an -/// overridden native class. -/// -/// See https://developer.apple.com/documentation/foundation/nsurl?language=objc. -abstract class NSUrlFlutterApi { - static const MessageCodec pigeonChannelCodec = - StandardMessageCodec(); - void create(int identifier); - - static void setUp( - NSUrlFlutterApi? api, { - BinaryMessenger? binaryMessenger, - String messageChannelSuffix = '', + /// Constructs [UIScrollViewDelegate] 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 + UIScrollViewDelegate.pigeon_detached({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + super.observeValue, + this.scrollViewDidScroll, + }) : super.pigeon_detached(); + + late final _PigeonInternalProxyApiBaseCodec + _pigeonVar_codecUIScrollViewDelegate = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); + + /// Tells the delegate when the user scrolls the content view within the + /// scroll view. + /// + /// Note that this is a convenient method that includes the `contentOffset` of + /// the `scrollView`. + /// + /// For the associated Native object to be automatically garbage collected, + /// it is required that the implementation of this `Function` doesn't have a + /// strong reference to the encapsulating class instance. When this `Function` + /// references a non-local variable, it is strongly recommended to access it + /// with a `WeakReference`: + /// + /// ```dart + /// final WeakReference weakMyVariable = WeakReference(myVariable); + /// final UIScrollViewDelegate instance = UIScrollViewDelegate( + /// scrollViewDidScroll: (UIScrollViewDelegate pigeon_instance, ...) { + /// print(weakMyVariable?.target); + /// }, + /// ); + /// ``` + /// + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to + /// release the associated Native object manually. + final void Function( + UIScrollViewDelegate pigeon_instance, + UIScrollView scrollView, + double x, + double y, + )? scrollViewDidScroll; + + static void pigeon_setUpMessageHandlers({ + bool pigeon_clearHandlers = false, + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + UIScrollViewDelegate Function()? pigeon_newInstance, + void Function( + UIScrollViewDelegate pigeon_instance, + UIScrollView scrollView, + double x, + double y, + )? scrollViewDidScroll, }) { - messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( + pigeon_instanceManager ?? PigeonInstanceManager.instance); + final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.NSUrlFlutterApi.create$messageChannelSuffix', + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewDelegate.pigeon_newInstance', pigeonChannelCodec, binaryMessenger: binaryMessenger); - if (api == null) { - __pigeon_channel.setMessageHandler(null); + if (pigeon_clearHandlers) { + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.NSUrlFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewDelegate.pigeon_newInstance was null.'); final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.NSUrlFlutterApi.create was null, expected non-null int.'); + final int? arg_pigeon_instanceIdentifier = (args[0] as int?); + assert(arg_pigeon_instanceIdentifier != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewDelegate.pigeon_newInstance was null, expected non-null int.'); + try { + (pigeon_instanceManager ?? PigeonInstanceManager.instance) + .addHostCreatedInstance( + pigeon_newInstance?.call() ?? + UIScrollViewDelegate.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< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewDelegate.scrollViewDidScroll', + 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.UIScrollViewDelegate.scrollViewDidScroll was null.'); + final List args = (message as List?)!; + final UIScrollViewDelegate? arg_pigeon_instance = + (args[0] as UIScrollViewDelegate?); + assert(arg_pigeon_instance != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewDelegate.scrollViewDidScroll was null, expected non-null UIScrollViewDelegate.'); + final UIScrollView? arg_scrollView = (args[1] as UIScrollView?); + assert(arg_scrollView != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewDelegate.scrollViewDidScroll was null, expected non-null UIScrollView.'); + final double? arg_x = (args[2] as double?); + assert(arg_x != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewDelegate.scrollViewDidScroll was null, expected non-null double.'); + final double? arg_y = (args[3] as double?); + assert(arg_y != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewDelegate.scrollViewDidScroll was null, expected non-null double.'); try { - api.create(arg_identifier!); + (scrollViewDidScroll ?? arg_pigeon_instance!.scrollViewDidScroll) + ?.call(arg_pigeon_instance!, arg_scrollView!, arg_x!, arg_y!); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -3656,101 +7384,225 @@ abstract class NSUrlFlutterApi { } } } + + @override + UIScrollViewDelegate pigeon_copy() { + return UIScrollViewDelegate.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + observeValue: observeValue, + scrollViewDidScroll: scrollViewDidScroll, + ); + } } -/// Host API for `UIScrollViewDelegate`. +/// An authentication credential consisting of information specific to the type +/// of credential and the type of persistent storage to use, if any. /// -/// This class may handle instantiating and adding native object instances that -/// are attached to a Dart instance or method calls on the associated native -/// class or an instance of the class. -/// -/// See https://developer.apple.com/documentation/uikit/uiscrollviewdelegate?language=objc. -class UIScrollViewDelegateHostApi { - /// Constructor for [UIScrollViewDelegateHostApi]. The [binaryMessenger] named argument is - /// available for dependency injection. If it is left null, the default - /// BinaryMessenger will be used which routes to the host platform. - UIScrollViewDelegateHostApi( - {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) - : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - final BinaryMessenger? __pigeon_binaryMessenger; - - static const MessageCodec pigeonChannelCodec = - StandardMessageCodec(); - - final String __pigeon_messageChannelSuffix; - - Future create(int identifier) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewDelegateHostApi.create$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = +/// See https://developer.apple.com/documentation/foundation/urlcredential. +class URLCredential extends NSObject { + /// Creates a URL credential instance for internet password authentication + /// with a given user name and password, using a given persistence setting. + URLCredential.withUser({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + super.observeValue, + required String user, + required String password, + required UrlCredentialPersistence persistence, + }) : super.pigeon_detached() { + final int pigeonVar_instanceIdentifier = + pigeon_instanceManager.addDartCreatedInstance(this); + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecURLCredential; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.URLCredential.withUser'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([identifier]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], - ); - } else { - return; + final Future pigeonVar_sendFuture = pigeonVar_channel.send( + [pigeonVar_instanceIdentifier, user, password, persistence]); + () async { + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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; + } + }(); + } + + /// Constructs [URLCredential] 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 + URLCredential.pigeon_detached({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + super.observeValue, + }) : super.pigeon_detached(); + + late final _PigeonInternalProxyApiBaseCodec _pigeonVar_codecURLCredential = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); + + static void pigeon_setUpMessageHandlers({ + bool pigeon_clearHandlers = false, + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + URLCredential 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.URLCredential.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.URLCredential.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.URLCredential.pigeon_newInstance was null, expected non-null int.'); + try { + (pigeon_instanceManager ?? PigeonInstanceManager.instance) + .addHostCreatedInstance( + pigeon_newInstance?.call() ?? + URLCredential.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())); + } + }); + } } } + + @override + URLCredential pigeon_copy() { + return URLCredential.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + observeValue: observeValue, + ); + } } -/// Flutter API for `UIScrollViewDelegate`. +/// A server or an area on a server, commonly referred to as a realm, that +/// requires authentication. /// -/// See https://developer.apple.com/documentation/uikit/uiscrollviewdelegate?language=objc. -abstract class UIScrollViewDelegateFlutterApi { - static const MessageCodec pigeonChannelCodec = - StandardMessageCodec(); - - void scrollViewDidScroll( - int identifier, int uiScrollViewIdentifier, double x, double y); - - static void setUp( - UIScrollViewDelegateFlutterApi? api, { - BinaryMessenger? binaryMessenger, - String messageChannelSuffix = '', +/// See https://developer.apple.com/documentation/foundation/urlprotectionspace. +class URLProtectionSpace extends NSObject { + /// Constructs [URLProtectionSpace] 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 + URLProtectionSpace.pigeon_detached({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + required this.host, + required this.port, + this.realm, + this.authenticationMethod, + super.observeValue, + }) : super.pigeon_detached(); + + /// The receiver’s host. + final String host; + + /// The receiver’s port. + final int port; + + /// The receiver’s authentication realm. + final String? realm; + + /// The authentication method used by the receiver. + final String? authenticationMethod; + + static void pigeon_setUpMessageHandlers({ + bool pigeon_clearHandlers = false, + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + URLProtectionSpace Function( + String host, + int port, + String? realm, + String? authenticationMethod, + )? pigeon_newInstance, }) { - messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( + pigeon_instanceManager ?? PigeonInstanceManager.instance); + final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewDelegateFlutterApi.scrollViewDidScroll$messageChannelSuffix', + 'dev.flutter.pigeon.webview_flutter_wkwebview.URLProtectionSpace.pigeon_newInstance', pigeonChannelCodec, binaryMessenger: binaryMessenger); - if (api == null) { - __pigeon_channel.setMessageHandler(null); + if (pigeon_clearHandlers) { + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewDelegateFlutterApi.scrollViewDidScroll was null.'); + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.URLProtectionSpace.pigeon_newInstance was null.'); final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewDelegateFlutterApi.scrollViewDidScroll was null, expected non-null int.'); - final int? arg_uiScrollViewIdentifier = (args[1] as int?); - assert(arg_uiScrollViewIdentifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewDelegateFlutterApi.scrollViewDidScroll was null, expected non-null int.'); - final double? arg_x = (args[2] as double?); - assert(arg_x != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewDelegateFlutterApi.scrollViewDidScroll was null, expected non-null double.'); - final double? arg_y = (args[3] as double?); - assert(arg_y != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewDelegateFlutterApi.scrollViewDidScroll was null, expected non-null double.'); + final int? arg_pigeon_instanceIdentifier = (args[0] as int?); + assert(arg_pigeon_instanceIdentifier != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.URLProtectionSpace.pigeon_newInstance was null, expected non-null int.'); + final String? arg_host = (args[1] as String?); + assert(arg_host != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.URLProtectionSpace.pigeon_newInstance was null, expected non-null String.'); + final int? arg_port = (args[2] as int?); + assert(arg_port != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.URLProtectionSpace.pigeon_newInstance was null, expected non-null int.'); + final String? arg_realm = (args[3] as String?); + final String? arg_authenticationMethod = (args[4] as String?); try { - api.scrollViewDidScroll( - arg_identifier!, arg_uiScrollViewIdentifier!, arg_x!, arg_y!); + (pigeon_instanceManager ?? PigeonInstanceManager.instance) + .addHostCreatedInstance( + pigeon_newInstance?.call(arg_host!, arg_port!, arg_realm, + arg_authenticationMethod) ?? + URLProtectionSpace.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + host: arg_host!, + port: arg_port!, + realm: arg_realm, + authenticationMethod: arg_authenticationMethod, + ), + arg_pigeon_instanceIdentifier!, + ); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -3762,103 +7614,190 @@ abstract class UIScrollViewDelegateFlutterApi { } } } + + @override + URLProtectionSpace pigeon_copy() { + return URLProtectionSpace.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + host: host, + port: port, + realm: realm, + authenticationMethod: authenticationMethod, + observeValue: observeValue, + ); + } } -/// Host API for `NSUrlCredential`. +/// A challenge from a server requiring authentication from the client. /// -/// This class may handle instantiating and adding native object instances that -/// are attached to a Dart instance or handle method calls on the associated -/// native class or an instance of the class. -/// -/// See https://developer.apple.com/documentation/foundation/nsurlcredential?language=objc. -class NSUrlCredentialHostApi { - /// Constructor for [NSUrlCredentialHostApi]. The [binaryMessenger] named argument is - /// available for dependency injection. If it is left null, the default - /// BinaryMessenger will be used which routes to the host platform. - NSUrlCredentialHostApi( - {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) - : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - final BinaryMessenger? __pigeon_binaryMessenger; - - static const MessageCodec pigeonChannelCodec = - StandardMessageCodec(); - - final String __pigeon_messageChannelSuffix; - - /// Create a new native instance and add it to the `InstanceManager`. - Future createWithUser(int identifier, String user, String password, - NSUrlCredentialPersistence persistence) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.webview_flutter_wkwebview.NSUrlCredentialHostApi.createWithUser$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - __pigeon_channelName, - pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, - ); - final List? __pigeon_replyList = await __pigeon_channel - .send([identifier, user, password, persistence.index]) - as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { - throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], +/// See https://developer.apple.com/documentation/foundation/urlauthenticationchallenge. +class URLAuthenticationChallenge extends NSObject { + /// Constructs [URLAuthenticationChallenge] 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 + URLAuthenticationChallenge.pigeon_detached({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + super.observeValue, + }) : super.pigeon_detached(); + + late final _PigeonInternalProxyApiBaseCodec + _pigeonVar_codecURLAuthenticationChallenge = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); + + static void pigeon_setUpMessageHandlers({ + bool pigeon_clearHandlers = false, + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + URLAuthenticationChallenge 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.URLAuthenticationChallenge.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.URLAuthenticationChallenge.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.URLAuthenticationChallenge.pigeon_newInstance was null, expected non-null int.'); + try { + (pigeon_instanceManager ?? PigeonInstanceManager.instance) + .addHostCreatedInstance( + pigeon_newInstance?.call() ?? + URLAuthenticationChallenge.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())); + } + }); + } + } + } + + /// The receiver’s protection space. + Future getProtectionSpace() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecURLAuthenticationChallenge; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.URLAuthenticationChallenge.getProtectionSpace'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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; + return (pigeonVar_replyList[0] as URLProtectionSpace?)!; } } + + @override + URLAuthenticationChallenge pigeon_copy() { + return URLAuthenticationChallenge.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + observeValue: observeValue, + ); + } } -/// Flutter API for `NSUrlProtectionSpace`. +/// A value that identifies the location of a resource, such as an item on a +/// remote server or the path to a local file. /// -/// This class may handle instantiating and adding Dart instances that are -/// attached to a native instance or receiving callback methods from an -/// overridden native class. -/// -/// See https://developer.apple.com/documentation/foundation/nsurlprotectionspace?language=objc. -abstract class NSUrlProtectionSpaceFlutterApi { - static const MessageCodec pigeonChannelCodec = - StandardMessageCodec(); - - /// Create a new Dart instance and add it to the `InstanceManager`. - void create(int identifier, String? host, String? realm, - String? authenticationMethod); - - static void setUp( - NSUrlProtectionSpaceFlutterApi? api, { - BinaryMessenger? binaryMessenger, - String messageChannelSuffix = '', +/// See https://developer.apple.com/documentation/foundation/url. +class URL extends NSObject { + /// Constructs [URL] 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 + URL.pigeon_detached({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + super.observeValue, + }) : super.pigeon_detached(); + + late final _PigeonInternalProxyApiBaseCodec _pigeonVar_codecURL = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); + + static void pigeon_setUpMessageHandlers({ + bool pigeon_clearHandlers = false, + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + URL Function()? pigeon_newInstance, }) { - messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( + pigeon_instanceManager ?? PigeonInstanceManager.instance); + final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.NSUrlProtectionSpaceFlutterApi.create$messageChannelSuffix', + 'dev.flutter.pigeon.webview_flutter_wkwebview.URL.pigeon_newInstance', pigeonChannelCodec, binaryMessenger: binaryMessenger); - if (api == null) { - __pigeon_channel.setMessageHandler(null); + if (pigeon_clearHandlers) { + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.NSUrlProtectionSpaceFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.URL.pigeon_newInstance was null.'); final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.NSUrlProtectionSpaceFlutterApi.create was null, expected non-null int.'); - final String? arg_host = (args[1] as String?); - final String? arg_realm = (args[2] as String?); - final String? arg_authenticationMethod = (args[3] as String?); + final int? arg_pigeon_instanceIdentifier = (args[0] as int?); + assert(arg_pigeon_instanceIdentifier != null, + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.URL.pigeon_newInstance was null, expected non-null int.'); try { - api.create( - arg_identifier!, arg_host, arg_realm, arg_authenticationMethod); + (pigeon_instanceManager ?? PigeonInstanceManager.instance) + .addHostCreatedInstance( + pigeon_newInstance?.call() ?? + URL.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); @@ -3870,50 +7809,109 @@ abstract class NSUrlProtectionSpaceFlutterApi { } } } -} -/// Flutter API for `NSUrlAuthenticationChallenge`. -/// -/// This class may handle instantiating and adding Dart instances that are -/// attached to a native instance or receiving callback methods from an -/// overridden native class. -/// -/// See https://developer.apple.com/documentation/foundation/nsurlauthenticationchallenge?language=objc. -abstract class NSUrlAuthenticationChallengeFlutterApi { - static const MessageCodec pigeonChannelCodec = - StandardMessageCodec(); + /// The absolute string for the URL. + Future getAbsoluteString() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecURL; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.URL.getAbsoluteString'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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 String?)!; + } + } - /// Create a new Dart instance and add it to the `InstanceManager`. - void create(int identifier, int protectionSpaceIdentifier); + @override + URL pigeon_copy() { + return URL.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + observeValue: observeValue, + ); + } +} - static void setUp( - NSUrlAuthenticationChallengeFlutterApi? api, { - BinaryMessenger? binaryMessenger, - String messageChannelSuffix = '', +/// 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, }) { - messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( + pigeon_instanceManager ?? PigeonInstanceManager.instance); + final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.NSUrlAuthenticationChallengeFlutterApi.create$messageChannelSuffix', + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebpagePreferences.pigeon_newInstance', pigeonChannelCodec, binaryMessenger: binaryMessenger); - if (api == null) { - __pigeon_channel.setMessageHandler(null); + if (pigeon_clearHandlers) { + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.NSUrlAuthenticationChallengeFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebpagePreferences.pigeon_newInstance was null.'); final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.NSUrlAuthenticationChallengeFlutterApi.create was null, expected non-null int.'); - final int? arg_protectionSpaceIdentifier = (args[1] as int?); - assert(arg_protectionSpaceIdentifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.NSUrlAuthenticationChallengeFlutterApi.create was null, expected non-null int.'); + 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 { - api.create(arg_identifier!, arg_protectionSpaceIdentifier!); + (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); @@ -3925,4 +7923,44 @@ abstract class NSUrlAuthenticationChallengeFlutterApi { } } } + + /// 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 Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, allow]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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/common/webkit_constants.dart b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/common/webkit_constants.dart new file mode 100644 index 00000000000..281df86ce5e --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/common/webkit_constants.dart @@ -0,0 +1,72 @@ +// 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 'web_kit.g.dart'; + +/// Possible error values that WebKit APIs can return. +/// +/// See https://developer.apple.com/documentation/webkit/wkerrorcode. +class WKErrorCode { + WKErrorCode._(); + + /// Indicates an unknown issue occurred. + /// + /// See https://developer.apple.com/documentation/webkit/wkerrorcode/wkerrorunknown. + static const int unknown = 1; + + /// Indicates the web process that contains the content is no longer running. + /// + /// See https://developer.apple.com/documentation/webkit/wkerrorcode/wkerrorwebcontentprocessterminated. + static const int webContentProcessTerminated = 2; + + /// Indicates the web view was invalidated. + /// + /// See https://developer.apple.com/documentation/webkit/wkerrorcode/wkerrorwebviewinvalidated. + static const int webViewInvalidated = 3; + + /// Indicates a JavaScript exception occurred. + /// + /// See https://developer.apple.com/documentation/webkit/wkerrorcode/wkerrorjavascriptexceptionoccurred. + static const int javaScriptExceptionOccurred = 4; + + /// Indicates the result of JavaScript execution could not be returned. + /// + /// See https://developer.apple.com/documentation/webkit/wkerrorcode/wkerrorjavascriptresulttypeisunsupported. + static const int javaScriptResultTypeIsUnsupported = 5; +} + +/// Keys that may exist in the user info map of `NSError`. +class NSErrorUserInfoKey { + NSErrorUserInfoKey._(); + + /// The corresponding value is a localized string representation of the error + /// that, if present, will be returned by [NSError.localizedDescription]. + /// + /// See https://developer.apple.com/documentation/foundation/nslocalizeddescriptionkey. + static const String NSLocalizedDescription = 'NSLocalizedDescription'; + + /// The URL which caused a load to fail. + /// + /// See https://developer.apple.com/documentation/foundation/nsurlerrorfailingurlstringerrorkey?language=objc. + static const String NSURLErrorFailingURLStringError = + 'NSErrorFailingURLStringKey'; +} + +/// The authentication method used by the receiver. +class NSUrlAuthenticationMethod { + /// Use the default authentication method for a protocol. + static const String default_ = 'NSURLAuthenticationMethodDefault'; + + /// Use HTML form authentication for this protection space. + static const String htmlForm = 'NSURLAuthenticationMethodHTMLForm'; + + /// Use HTTP basic authentication for this protection space. + static const String httpBasic = 'NSURLAuthenticationMethodHTTPBasic'; + + /// Use HTTP digest authentication for this protection space. + static const String httpDigest = 'NSURLAuthenticationMethodHTTPDigest'; + + /// Use NTLM authentication for this protection space. + static const String httpNtlm = 'NSURLAuthenticationMethodNTLM'; +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/foundation/foundation.dart b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/foundation/foundation.dart deleted file mode 100644 index 2df5c9efc6c..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/foundation/foundation.dart +++ /dev/null @@ -1,538 +0,0 @@ -// 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 'package:flutter/foundation.dart'; -import 'package:flutter/services.dart'; - -import '../common/instance_manager.dart'; -import '../common/weak_reference_utils.dart'; -import 'foundation_api_impls.dart'; - -export 'foundation_api_impls.dart' - show NSUrlCredentialPersistence, NSUrlSessionAuthChallengeDisposition; - -/// The values that can be returned in a change map. -/// -/// Wraps [NSKeyValueObservingOptions](https://developer.apple.com/documentation/foundation/nskeyvalueobservingoptions?language=objc). -enum NSKeyValueObservingOptions { - /// Indicates that the change map should provide the new attribute value, if applicable. - /// - /// See https://developer.apple.com/documentation/foundation/nskeyvalueobservingoptions/nskeyvalueobservingoptionnew?language=objc. - newValue, - - /// Indicates that the change map should contain the old attribute value, if applicable. - /// - /// See https://developer.apple.com/documentation/foundation/nskeyvalueobservingoptions/nskeyvalueobservingoptionold?language=objc. - oldValue, - - /// Indicates a notification should be sent to the observer immediately. - /// - /// See https://developer.apple.com/documentation/foundation/nskeyvalueobservingoptions/nskeyvalueobservingoptioninitial?language=objc. - initialValue, - - /// Whether separate notifications should be sent to the observer before and after each change. - /// - /// See https://developer.apple.com/documentation/foundation/nskeyvalueobservingoptions/nskeyvalueobservingoptionprior?language=objc. - priorNotification, -} - -/// The kinds of changes that can be observed. -/// -/// Wraps [NSKeyValueChange](https://developer.apple.com/documentation/foundation/nskeyvaluechange?language=objc). -enum NSKeyValueChange { - /// Indicates that the value of the observed key path was set to a new value. - /// - /// See https://developer.apple.com/documentation/foundation/nskeyvaluechange/nskeyvaluechangesetting?language=objc. - setting, - - /// Indicates that an object has been inserted into the to-many relationship that is being observed. - /// - /// See https://developer.apple.com/documentation/foundation/nskeyvaluechange/nskeyvaluechangeinsertion?language=objc. - insertion, - - /// Indicates that an object has been removed from the to-many relationship that is being observed. - /// - /// See https://developer.apple.com/documentation/foundation/nskeyvaluechange/nskeyvaluechangeremoval?language=objc. - removal, - - /// Indicates that an object has been replaced in the to-many relationship that is being observed. - /// - /// See https://developer.apple.com/documentation/foundation/nskeyvaluechange/nskeyvaluechangereplacement?language=objc. - replacement, -} - -/// The keys that can appear in the change map. -/// -/// Wraps [NSKeyValueChangeKey](https://developer.apple.com/documentation/foundation/nskeyvaluechangekey?language=objc). -enum NSKeyValueChangeKey { - /// Indicates changes made in a collection. - /// - /// See https://developer.apple.com/documentation/foundation/nskeyvaluechangeindexeskey?language=objc. - indexes, - - /// Indicates what sort of change has occurred. - /// - /// See https://developer.apple.com/documentation/foundation/nskeyvaluechangekindkey?language=objc. - kind, - - /// Indicates the new value for the attribute. - /// - /// See https://developer.apple.com/documentation/foundation/nskeyvaluechangenewkey?language=objc. - newValue, - - /// Indicates a notification is sent prior to a change. - /// - /// See https://developer.apple.com/documentation/foundation/nskeyvaluechangenotificationispriorkey?language=objc. - notificationIsPrior, - - /// Indicates the value of this key is the value before the attribute was changed. - /// - /// See https://developer.apple.com/documentation/foundation/nskeyvaluechangeoldkey?language=objc. - oldValue, - - /// An unknown change key. - /// - /// This does not represent an actual value provided by the platform and only - /// indicates a value was provided that isn't currently supported. - unknown, -} - -/// The supported keys in a cookie attributes dictionary. -/// -/// Wraps [NSHTTPCookiePropertyKey](https://developer.apple.com/documentation/foundation/nshttpcookiepropertykey). -enum NSHttpCookiePropertyKey { - /// A String object containing the comment for the cookie. - /// - /// See https://developer.apple.com/documentation/foundation/nshttpcookiecomment. - comment, - - /// A String object containing the comment URL for the cookie. - /// - /// See https://developer.apple.com/documentation/foundation/nshttpcookiecommenturl. - commentUrl, - - /// A String object stating whether the cookie should be discarded at the end of the session. - /// - /// See https://developer.apple.com/documentation/foundation/nshttpcookiediscard. - discard, - - /// A String object specifying the expiration date for the cookie. - /// - /// See https://developer.apple.com/documentation/foundation/nshttpcookiedomain. - domain, - - /// A String object specifying the expiration date for the cookie. - /// - /// See https://developer.apple.com/documentation/foundation/nshttpcookieexpires. - expires, - - /// A String object containing an integer value stating how long in seconds the cookie should be kept, at most. - /// - /// See https://developer.apple.com/documentation/foundation/nshttpcookiemaximumage. - maximumAge, - - /// A String object containing the name of the cookie (required). - /// - /// See https://developer.apple.com/documentation/foundation/nshttpcookiename. - name, - - /// A String object containing the URL that set this cookie. - /// - /// See https://developer.apple.com/documentation/foundation/nshttpcookieoriginurl. - originUrl, - - /// A String object containing the path for the cookie. - /// - /// See https://developer.apple.com/documentation/foundation/nshttpcookiepath. - path, - - /// A String object containing comma-separated integer values specifying the ports for the cookie. - /// - /// See https://developer.apple.com/documentation/foundation/nshttpcookieport. - port, - - /// A String indicating the same-site policy for the cookie. - /// - /// This is only supported on iOS version 13+. This value will be ignored on - /// versions < 13. - /// - /// See https://developer.apple.com/documentation/foundation/nshttpcookiesamesitepolicy. - sameSitePolicy, - - /// A String object indicating that the cookie should be transmitted only over secure channels. - /// - /// See https://developer.apple.com/documentation/foundation/nshttpcookiesecure. - secure, - - /// A String object containing the value of the cookie. - /// - /// See https://developer.apple.com/documentation/foundation/nshttpcookievalue. - value, - - /// A String object that specifies the version of the cookie. - /// - /// See https://developer.apple.com/documentation/foundation/nshttpcookieversion. - version, -} - -/// A URL load request that is independent of protocol or URL scheme. -/// -/// Wraps [NSUrlRequest](https://developer.apple.com/documentation/foundation/nsurlrequest?language=objc). -@immutable -class NSUrlRequest { - /// Constructs an [NSUrlRequest]. - const NSUrlRequest({ - required this.url, - this.httpMethod, - this.httpBody, - this.allHttpHeaderFields = const {}, - }); - - /// The URL being requested. - final String url; - - /// The HTTP request method. - /// - /// The default HTTP method is “GET”. - final String? httpMethod; - - /// Data sent as the message body of a request, as in an HTTP POST request. - final Uint8List? httpBody; - - /// All of the HTTP header fields for a request. - final Map allHttpHeaderFields; -} - -/// Keys that may exist in the user info map of `NSError`. -class NSErrorUserInfoKey { - NSErrorUserInfoKey._(); - - /// The corresponding value is a localized string representation of the error - /// that, if present, will be returned by [NSError.localizedDescription]. - /// - /// See https://developer.apple.com/documentation/foundation/nslocalizeddescriptionkey. - static const String NSLocalizedDescription = 'NSLocalizedDescription'; - - /// The URL which caused a load to fail. - /// - /// See https://developer.apple.com/documentation/foundation/nsurlerrorfailingurlstringerrorkey?language=objc. - static const String NSURLErrorFailingURLStringError = - 'NSErrorFailingURLStringKey'; -} - -/// The metadata associated with the response to an HTTP protocol URL load -/// request. -/// -/// Wraps [NSHttpUrlResponse](https://developer.apple.com/documentation/foundation/nshttpurlresponse?language=objc). -@immutable -class NSHttpUrlResponse { - /// Constructs an [NSHttpUrlResponse]. - const NSHttpUrlResponse({ - required this.statusCode, - }); - - /// The response’s HTTP status code. - final int statusCode; -} - -/// Information about an error condition. -/// -/// Wraps [NSError](https://developer.apple.com/documentation/foundation/nserror?language=objc). -@immutable -class NSError { - /// Constructs an [NSError]. - const NSError({ - required this.code, - required this.domain, - this.userInfo = const {}, - }); - - /// The error code. - /// - /// Error codes are [domain]-specific. - final int code; - - /// A string containing the error domain. - final String domain; - - /// Map of arbitrary data. - /// - /// See [NSErrorUserInfoKey] for possible keys (non-exhaustive). - /// - /// This currently only supports values that are a String. - final Map userInfo; - - /// A string containing the localized description of the error. - String? get localizedDescription => - userInfo[NSErrorUserInfoKey.NSLocalizedDescription] as String?; - - @override - String toString() { - if (localizedDescription?.isEmpty ?? true) { - return 'Error $domain:$code:$userInfo'; - } - return '$localizedDescription ($domain:$code:$userInfo)'; - } -} - -/// A representation of an HTTP cookie. -/// -/// Wraps [NSHTTPCookie](https://developer.apple.com/documentation/foundation/nshttpcookie). -@immutable -class NSHttpCookie { - /// Initializes an HTTP cookie object using the provided properties. - const NSHttpCookie.withProperties(this.properties); - - /// Properties of the new cookie object. - final Map properties; -} - -/// An object that represents the location of a resource, such as an item on a -/// remote server or the path to a local file. -/// -/// See https://developer.apple.com/documentation/foundation/nsurl?language=objc. -class NSUrl extends NSObject { - /// Instantiates a [NSUrl] without creating and attaching to an instance - /// of the associated native class. - /// - /// This should only be used outside of tests by subclasses created by this - /// library or to create a copy for an [InstanceManager]. - @protected - NSUrl.detached({super.binaryMessenger, super.instanceManager}) - : _nsUrlHostApi = NSUrlHostApiImpl( - binaryMessenger: binaryMessenger, - instanceManager: instanceManager, - ), - super.detached(); - - final NSUrlHostApiImpl _nsUrlHostApi; - - /// The URL string for the receiver as an absolute URL. (read-only) - /// - /// Represents [NSURL.absoluteString](https://developer.apple.com/documentation/foundation/nsurl/1409868-absolutestring?language=objc). - Future getAbsoluteString() { - return _nsUrlHostApi.getAbsoluteStringFromInstances(this); - } - - @override - NSObject copy() { - return NSUrl.detached( - binaryMessenger: _nsUrlHostApi.binaryMessenger, - instanceManager: _nsUrlHostApi.instanceManager, - ); - } -} - -/// The root class of most Objective-C class hierarchies. -@immutable -class NSObject with Copyable { - /// Constructs a [NSObject] without creating the associated - /// Objective-C object. - /// - /// This should only be used by subclasses created by this library or to - /// create copies. - NSObject.detached({ - this.observeValue, - BinaryMessenger? binaryMessenger, - InstanceManager? instanceManager, - }) : _api = NSObjectHostApiImpl( - binaryMessenger: binaryMessenger, - instanceManager: instanceManager, - ) { - // Ensures FlutterApis for the Foundation library are set up. - FoundationFlutterApis.instance.ensureSetUp(); - } - - /// Release the reference to the Objective-C object. - static void dispose(NSObject instance) { - instance._api.instanceManager.removeWeakReference(instance); - } - - /// Global instance of [InstanceManager]. - static final InstanceManager globalInstanceManager = - InstanceManager(onWeakReferenceRemoved: (int instanceId) { - NSObjectHostApiImpl().dispose(instanceId); - }); - - final NSObjectHostApiImpl _api; - - /// Informs the observing object when the value at the specified key path has - /// changed. - /// - /// {@template webview_flutter_wkwebview.foundation.callbacks} - /// For the associated Objective-C object to be automatically garbage - /// collected, it is required that this Function doesn't contain a strong - /// reference to the encapsulating class instance. Consider using - /// `WeakReference` when referencing an object not received as a parameter. - /// Otherwise, use [NSObject.dispose] to release the associated Objective-C - /// object manually. - /// - /// See [withWeakReferenceTo]. - /// {@endtemplate} - final void Function( - String keyPath, - NSObject object, - Map change, - )? observeValue; - - /// Registers the observer object to receive KVO notifications. - Future addObserver( - NSObject observer, { - required String keyPath, - required Set options, - }) { - assert(options.isNotEmpty); - return _api.addObserverForInstances( - this, - observer, - keyPath, - options, - ); - } - - /// Stops the observer object from receiving change notifications for the property. - Future removeObserver(NSObject observer, {required String keyPath}) { - return _api.removeObserverForInstances(this, observer, keyPath); - } - - @override - NSObject copy() { - return NSObject.detached( - observeValue: observeValue, - binaryMessenger: _api.binaryMessenger, - instanceManager: _api.instanceManager, - ); - } -} - -/// An authentication credential consisting of information specific to the type -/// of credential and the type of persistent storage to use, if any. -/// -/// See https://developer.apple.com/documentation/foundation/nsurlcredential?language=objc. -class NSUrlCredential extends NSObject { - /// Creates a URL credential instance for internet password authentication - /// with a given user name and password, using a given persistence setting. - NSUrlCredential.withUser({ - required String user, - required String password, - required NSUrlCredentialPersistence persistence, - @visibleForTesting super.binaryMessenger, - @visibleForTesting super.instanceManager, - }) : _urlCredentialApi = NSUrlCredentialHostApiImpl( - binaryMessenger: binaryMessenger, instanceManager: instanceManager), - super.detached() { - // Ensures Flutter Apis are setup. - FoundationFlutterApis.instance.ensureSetUp(); - _urlCredentialApi.createWithUserFromInstances( - this, - user, - password, - persistence, - ); - } - - /// Instantiates a [NSUrlCredential] without creating and attaching to an - /// instance of the associated native class. - /// - /// This should only be used outside of tests by subclasses created by this - /// library or to create a copy for an [InstanceManager]. - @protected - NSUrlCredential.detached({super.binaryMessenger, super.instanceManager}) - : _urlCredentialApi = NSUrlCredentialHostApiImpl( - binaryMessenger: binaryMessenger, instanceManager: instanceManager), - super.detached(); - - final NSUrlCredentialHostApiImpl _urlCredentialApi; - - @override - NSObject copy() { - return NSUrlCredential.detached( - binaryMessenger: _urlCredentialApi.binaryMessenger, - instanceManager: _urlCredentialApi.instanceManager, - ); - } -} - -/// A server or an area on a server, commonly referred to as a realm, that -/// requires authentication. -/// -/// See https://developer.apple.com/documentation/foundation/nsurlprotectionspace?language=objc. -class NSUrlProtectionSpace extends NSObject { - /// Instantiates a [NSUrlProtectionSpace] without creating and attaching to an - /// instance of the associated native class. - /// - /// This should only be used outside of tests by subclasses created by this - /// library or to create a copy for an [InstanceManager]. - @protected - NSUrlProtectionSpace.detached({ - required this.host, - required this.realm, - required this.authenticationMethod, - super.binaryMessenger, - super.instanceManager, - }) : super.detached(); - - /// The receiver’s host. - final String? host; - - /// The receiver’s authentication realm. - final String? realm; - - /// The authentication method used by the receiver. - final String? authenticationMethod; - - @override - NSUrlProtectionSpace copy() { - return NSUrlProtectionSpace.detached( - host: host, - realm: realm, - authenticationMethod: authenticationMethod, - ); - } -} - -/// The authentication method used by the receiver. -class NSUrlAuthenticationMethod { - /// Use the default authentication method for a protocol. - static const String default_ = 'NSURLAuthenticationMethodDefault'; - - /// Use HTML form authentication for this protection space. - static const String htmlForm = 'NSURLAuthenticationMethodHTMLForm'; - - /// Use HTTP basic authentication for this protection space. - static const String httpBasic = 'NSURLAuthenticationMethodHTTPBasic'; - - /// Use HTTP digest authentication for this protection space. - static const String httpDigest = 'NSURLAuthenticationMethodHTTPDigest'; - - /// Use NTLM authentication for this protection space. - static const String httpNtlm = 'NSURLAuthenticationMethodNTLM'; -} - -/// A challenge from a server requiring authentication from the client. -/// -/// See https://developer.apple.com/documentation/foundation/nsurlauthenticationchallenge?language=objc. -class NSUrlAuthenticationChallenge extends NSObject { - /// Instantiates a [NSUrlAuthenticationChallenge] without creating and - /// attaching to an instance of the associated native class. - /// - /// This should only be used outside of tests by subclasses created by this - /// library or to create a copy for an [InstanceManager]. - @protected - NSUrlAuthenticationChallenge.detached({ - required this.protectionSpace, - super.binaryMessenger, - super.instanceManager, - }) : super.detached(); - - /// The receiver’s protection space. - late final NSUrlProtectionSpace protectionSpace; - - @override - NSUrlAuthenticationChallenge copy() { - return NSUrlAuthenticationChallenge.detached( - protectionSpace: protectionSpace, - ); - } -} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/foundation/foundation_api_impls.dart b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/foundation/foundation_api_impls.dart deleted file mode 100644 index 293ce29bbbe..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/foundation/foundation_api_impls.dart +++ /dev/null @@ -1,392 +0,0 @@ -// 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 'package:flutter/foundation.dart'; -import 'package:flutter/services.dart'; - -import '../common/instance_manager.dart'; -import '../common/web_kit.g.dart'; -import 'foundation.dart'; - -export '../common/web_kit.g.dart' - show NSUrlCredentialPersistence, NSUrlSessionAuthChallengeDisposition; - -Iterable - _toNSKeyValueObservingOptionsEnumData( - Iterable options, -) { - return options.map(( - NSKeyValueObservingOptions option, - ) { - late final NSKeyValueObservingOptionsEnum? value; - switch (option) { - case NSKeyValueObservingOptions.newValue: - value = NSKeyValueObservingOptionsEnum.newValue; - case NSKeyValueObservingOptions.oldValue: - value = NSKeyValueObservingOptionsEnum.oldValue; - case NSKeyValueObservingOptions.initialValue: - value = NSKeyValueObservingOptionsEnum.initialValue; - case NSKeyValueObservingOptions.priorNotification: - value = NSKeyValueObservingOptionsEnum.priorNotification; - } - - return NSKeyValueObservingOptionsEnumData(value: value); - }); -} - -extension _NSKeyValueChangeKeyEnumDataConverter on NSKeyValueChangeKeyEnumData { - NSKeyValueChangeKey toNSKeyValueChangeKey() { - return NSKeyValueChangeKey.values.firstWhere( - (NSKeyValueChangeKey element) => element.name == value.name, - ); - } -} - -/// Handles initialization of Flutter APIs for the Foundation library. -class FoundationFlutterApis { - /// Constructs a [FoundationFlutterApis]. - @visibleForTesting - FoundationFlutterApis({ - BinaryMessenger? binaryMessenger, - InstanceManager? instanceManager, - }) : _binaryMessenger = binaryMessenger, - object = NSObjectFlutterApiImpl(instanceManager: instanceManager), - url = NSUrlFlutterApiImpl( - binaryMessenger: binaryMessenger, - instanceManager: instanceManager, - ), - urlProtectionSpace = NSUrlProtectionSpaceFlutterApiImpl( - binaryMessenger: binaryMessenger, - instanceManager: instanceManager, - ), - urlAuthenticationChallenge = NSUrlAuthenticationChallengeFlutterApiImpl( - binaryMessenger: binaryMessenger, - instanceManager: instanceManager, - ); - - static FoundationFlutterApis _instance = FoundationFlutterApis(); - - /// Sets the global instance containing the Flutter Apis for the Foundation library. - @visibleForTesting - static set instance(FoundationFlutterApis instance) { - _instance = instance; - } - - /// Global instance containing the Flutter Apis for the Foundation library. - static FoundationFlutterApis get instance { - return _instance; - } - - final BinaryMessenger? _binaryMessenger; - bool _hasBeenSetUp = false; - - /// Flutter Api for [NSObject]. - @visibleForTesting - final NSObjectFlutterApiImpl object; - - /// Flutter Api for [NSUrl]. - @visibleForTesting - final NSUrlFlutterApiImpl url; - - /// Flutter Api for [NSUrlProtectionSpace]. - @visibleForTesting - final NSUrlProtectionSpaceFlutterApiImpl urlProtectionSpace; - - /// Flutter Api for [NSUrlAuthenticationChallenge]. - @visibleForTesting - final NSUrlAuthenticationChallengeFlutterApiImpl urlAuthenticationChallenge; - - /// Ensures all the Flutter APIs have been set up to receive calls from native code. - void ensureSetUp() { - if (!_hasBeenSetUp) { - NSObjectFlutterApi.setUp( - object, - binaryMessenger: _binaryMessenger, - ); - NSUrlFlutterApi.setUp(url, binaryMessenger: _binaryMessenger); - NSUrlProtectionSpaceFlutterApi.setUp( - urlProtectionSpace, - binaryMessenger: _binaryMessenger, - ); - NSUrlAuthenticationChallengeFlutterApi.setUp( - urlAuthenticationChallenge, - binaryMessenger: _binaryMessenger, - ); - _hasBeenSetUp = true; - } - } -} - -/// Host api implementation for [NSObject]. -class NSObjectHostApiImpl extends NSObjectHostApi { - /// Constructs an [NSObjectHostApiImpl]. - NSObjectHostApiImpl({ - this.binaryMessenger, - InstanceManager? instanceManager, - }) : instanceManager = instanceManager ?? NSObject.globalInstanceManager, - super(binaryMessenger: binaryMessenger); - - /// Sends binary data across the Flutter platform barrier. - /// - /// If it is null, the default BinaryMessenger will be used which routes to - /// the host platform. - final BinaryMessenger? binaryMessenger; - - /// Maintains instances stored to communicate with Objective-C objects. - final InstanceManager instanceManager; - - /// Calls [addObserver] with the ids of the provided object instances. - Future addObserverForInstances( - NSObject instance, - NSObject observer, - String keyPath, - Set options, - ) { - return addObserver( - instanceManager.getIdentifier(instance)!, - instanceManager.getIdentifier(observer)!, - keyPath, - _toNSKeyValueObservingOptionsEnumData(options).toList(), - ); - } - - /// Calls [removeObserver] with the ids of the provided object instances. - Future removeObserverForInstances( - NSObject instance, - NSObject observer, - String keyPath, - ) { - return removeObserver( - instanceManager.getIdentifier(instance)!, - instanceManager.getIdentifier(observer)!, - keyPath, - ); - } -} - -/// Flutter api implementation for [NSObject]. -class NSObjectFlutterApiImpl extends NSObjectFlutterApi { - /// Constructs a [NSObjectFlutterApiImpl]. - NSObjectFlutterApiImpl({InstanceManager? instanceManager}) - : instanceManager = instanceManager ?? NSObject.globalInstanceManager; - - /// Maintains instances stored to communicate with native language objects. - final InstanceManager instanceManager; - - NSObject _getObject(int identifier) { - return instanceManager.getInstanceWithWeakReference(identifier)!; - } - - @override - void observeValue( - int identifier, - String keyPath, - int objectIdentifier, - List changeKeys, - List changeValues, - ) { - final void Function(String, NSObject, Map)? - function = _getObject(identifier).observeValue; - function?.call( - keyPath, - instanceManager.getInstanceWithWeakReference(objectIdentifier)! - as NSObject, - Map.fromIterables( - changeKeys.map( - (NSKeyValueChangeKeyEnumData? data) { - return data!.toNSKeyValueChangeKey(); - }, - ), - changeValues.map((ObjectOrIdentifier? value) { - if (value != null && value.isIdentifier) { - return instanceManager.getInstanceWithWeakReference( - value.value! as int, - ); - } - return value?.value; - }), - ), - ); - } - - @override - void dispose(int identifier) { - instanceManager.remove(identifier); - } -} - -/// Host api implementation for [NSUrl]. -class NSUrlHostApiImpl extends NSUrlHostApi { - /// Constructs an [NSUrlHostApiImpl]. - NSUrlHostApiImpl({ - this.binaryMessenger, - InstanceManager? instanceManager, - }) : instanceManager = instanceManager ?? NSObject.globalInstanceManager, - super(binaryMessenger: binaryMessenger); - - /// Sends binary data across the Flutter platform barrier. - /// - /// If it is null, the default BinaryMessenger will be used which routes to - /// the host platform. - final BinaryMessenger? binaryMessenger; - - /// Maintains instances stored to communicate with Objective-C objects. - final InstanceManager instanceManager; - - /// Calls [getAbsoluteString] with the ids of the provided object instances. - Future getAbsoluteStringFromInstances(NSUrl instance) { - return getAbsoluteString(instanceManager.getIdentifier(instance)!); - } -} - -/// Flutter API implementation for [NSUrl]. -/// -/// This class may handle instantiating and adding Dart instances that are -/// attached to a native instance or receiving callback methods from an -/// overridden native class. -class NSUrlFlutterApiImpl implements NSUrlFlutterApi { - /// Constructs a [NSUrlFlutterApiImpl]. - NSUrlFlutterApiImpl({ - this.binaryMessenger, - InstanceManager? instanceManager, - }) : instanceManager = instanceManager ?? NSObject.globalInstanceManager; - - /// Receives binary data across the Flutter platform barrier. - /// - /// If it is null, the default BinaryMessenger will be used which routes to - /// the host platform. - final BinaryMessenger? binaryMessenger; - - /// Maintains instances stored to communicate with native language objects. - final InstanceManager instanceManager; - - @override - void create(int identifier) { - instanceManager.addHostCreatedInstance( - NSUrl.detached( - binaryMessenger: binaryMessenger, - instanceManager: instanceManager, - ), - identifier, - ); - } -} - -/// Host api implementation for [NSUrlCredential]. -class NSUrlCredentialHostApiImpl extends NSUrlCredentialHostApi { - /// Constructs an [NSUrlCredentialHostApiImpl]. - NSUrlCredentialHostApiImpl({ - this.binaryMessenger, - InstanceManager? instanceManager, - }) : instanceManager = instanceManager ?? NSObject.globalInstanceManager, - super(binaryMessenger: binaryMessenger); - - /// Sends binary data across the Flutter platform barrier. - /// - /// If it is null, the default BinaryMessenger will be used which routes to - /// the host platform. - final BinaryMessenger? binaryMessenger; - - /// Maintains instances stored to communicate with Objective-C objects. - final InstanceManager instanceManager; - - /// Calls [createWithUser] with the ids of the provided object instances. - Future createWithUserFromInstances( - NSUrlCredential instance, - String user, - String password, - NSUrlCredentialPersistence persistence, - ) { - return createWithUser( - instanceManager.addDartCreatedInstance(instance), - user, - password, - persistence, - ); - } -} - -/// Flutter API implementation for [NSUrlProtectionSpace]. -/// -/// This class may handle instantiating and adding Dart instances that are -/// attached to a native instance or receiving callback methods from an -/// overridden native class. -@protected -class NSUrlProtectionSpaceFlutterApiImpl - implements NSUrlProtectionSpaceFlutterApi { - /// Constructs a [NSUrlProtectionSpaceFlutterApiImpl]. - NSUrlProtectionSpaceFlutterApiImpl({ - this.binaryMessenger, - InstanceManager? instanceManager, - }) : instanceManager = instanceManager ?? NSObject.globalInstanceManager; - - /// Receives binary data across the Flutter platform barrier. - /// - /// If it is null, the default BinaryMessenger will be used which routes to - /// the host platform. - final BinaryMessenger? binaryMessenger; - - /// Maintains instances stored to communicate with native language objects. - final InstanceManager instanceManager; - - @override - void create( - int identifier, - String? host, - String? realm, - String? authenticationMethod, - ) { - instanceManager.addHostCreatedInstance( - NSUrlProtectionSpace.detached( - host: host, - realm: realm, - authenticationMethod: authenticationMethod, - binaryMessenger: binaryMessenger, - instanceManager: instanceManager, - ), - identifier, - ); - } -} - -/// Flutter API implementation for [NSUrlAuthenticationChallenge]. -/// -/// This class may handle instantiating and adding Dart instances that are -/// attached to a native instance or receiving callback methods from an -/// overridden native class. -@protected -class NSUrlAuthenticationChallengeFlutterApiImpl - implements NSUrlAuthenticationChallengeFlutterApi { - /// Constructs a [NSUrlAuthenticationChallengeFlutterApiImpl]. - NSUrlAuthenticationChallengeFlutterApiImpl({ - this.binaryMessenger, - InstanceManager? instanceManager, - }) : instanceManager = instanceManager ?? NSObject.globalInstanceManager; - - /// Receives binary data across the Flutter platform barrier. - /// - /// If it is null, the default BinaryMessenger will be used which routes to - /// the host platform. - final BinaryMessenger? binaryMessenger; - - /// Maintains instances stored to communicate with native language objects. - final InstanceManager instanceManager; - - @override - void create( - int identifier, - int protectionSpaceIdentifier, - ) { - instanceManager.addHostCreatedInstance( - NSUrlAuthenticationChallenge.detached( - protectionSpace: instanceManager.getInstanceWithWeakReference( - protectionSpaceIdentifier, - )!, - binaryMessenger: binaryMessenger, - instanceManager: instanceManager, - ), - identifier, - ); - } -} 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 7a3795096de..89e184a89a5 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 @@ -4,7 +4,6 @@ import 'dart:async'; import 'dart:io'; -import 'dart:math'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -12,9 +11,10 @@ import 'package:path/path.dart' as path; // ignore: implementation_imports import 'package:webview_flutter_platform_interface/src/webview_flutter_platform_interface_legacy.dart'; +import '../common/platform_webview.dart'; import '../common/weak_reference_utils.dart'; -import '../foundation/foundation.dart'; -import '../web_kit/web_kit.dart'; +import '../common/web_kit.g.dart'; +import '../common/webkit_constants.dart'; /// A [Widget] that displays a [WKWebView]. class WebKitWebViewWidget extends StatefulWidget { @@ -112,18 +112,23 @@ class WebKitWebViewPlatformController extends WebViewPlatformController { final WebViewWidgetProxy webViewProxy; /// Represents the WebView maintained by platform code. - late final WKWebView webView; + late final PlatformWebView webView; /// Used to integrate custom user interface elements into web view interactions. @visibleForTesting late final WKUIDelegate uiDelegate = webViewProxy.createUIDelgate( onCreateWebView: ( + WKUIDelegate instance, WKWebView webView, WKWebViewConfiguration configuration, WKNavigationAction navigationAction, ) { - if (!navigationAction.targetFrame.isMainFrame) { - webView.loadRequest(navigationAction.request); + final bool isForMainFrame = + navigationAction.targetFrame?.isMainFrame ?? false; + if (!isForMainFrame) { + PlatformWebView.fromNativeWebView(webView).load( + navigationAction.request, + ); } }, ); @@ -134,45 +139,46 @@ class WebKitWebViewPlatformController extends WebViewPlatformController { this, (WeakReference weakReference) { return webViewProxy.createNavigationDelegate( - didFinishNavigation: (WKWebView webView, String? url) { + didFinishNavigation: (_, __, String? url) { weakReference.target?.callbacksHandler.onPageFinished(url ?? ''); }, - didStartProvisionalNavigation: (WKWebView webView, String? url) { + didStartProvisionalNavigation: (_, __, String? url) { weakReference.target?.callbacksHandler.onPageStarted(url ?? ''); }, decidePolicyForNavigationAction: ( - WKWebView webView, + _, + __, WKNavigationAction action, ) async { if (weakReference.target == null) { - return WKNavigationActionPolicy.allow; + return NavigationActionPolicy.allow; } if (!weakReference.target!._hasNavigationDelegate) { - return WKNavigationActionPolicy.allow; + return NavigationActionPolicy.allow; } final bool allow = await weakReference.target!.callbacksHandler.onNavigationRequest( - url: action.request.url, - isForMainFrame: action.targetFrame.isMainFrame, + url: await action.request.getUrl() ?? '', + isForMainFrame: action.targetFrame?.isMainFrame ?? false, ); return allow - ? WKNavigationActionPolicy.allow - : WKNavigationActionPolicy.cancel; + ? NavigationActionPolicy.allow + : NavigationActionPolicy.cancel; }, - didFailNavigation: (WKWebView webView, NSError error) { + didFailNavigation: (_, __, NSError error) { weakReference.target?.callbacksHandler.onWebResourceError( _toWebResourceError(error), ); }, - didFailProvisionalNavigation: (WKWebView webView, NSError error) { + didFailProvisionalNavigation: (_, __, NSError error) { weakReference.target?.callbacksHandler.onWebResourceError( _toWebResourceError(error), ); }, - webViewWebContentProcessDidTerminate: (WKWebView webView) { + webViewWebContentProcessDidTerminate: (_, __) { weakReference.target?.callbacksHandler.onWebResourceError( WebResourceError( errorCode: WKErrorCode.webContentProcessTerminated, @@ -183,6 +189,15 @@ class WebKitWebViewPlatformController extends WebViewPlatformController { ), ); }, + decidePolicyForNavigationResponse: (_, __, ___) async { + return NavigationResponsePolicy.allow; + }, + didReceiveAuthenticationChallenge: (_, __, ___) async { + return [ + UrlSessionAuthChallengeDisposition.performDefaultHandling, + null, + ]; + }, ); }, ); @@ -205,10 +220,10 @@ class WebKitWebViewPlatformController extends WebViewPlatformController { return ( String keyPath, NSObject object, - Map change, + Map change, ) { final double progress = - change[NSKeyValueChangeKey.newValue]! as double; + change[KeyValueChangeKey.newValue]! as double; weakReference.target?.onProgress((progress * 100).round()); }; }, @@ -230,16 +245,11 @@ class WebKitWebViewPlatformController extends WebViewPlatformController { } if (params.backgroundColor != null) { - final WKWebView webView = this.webView; - if (webView is WKWebViewIOS) { - unawaited(webView.setOpaque(false)); - unawaited(webView.setBackgroundColor(Colors.transparent)); - unawaited( - webView.scrollView.setBackgroundColor(params.backgroundColor)); - } else { - // TODO(stuartmorgan): Investigate doing this via JS instead. - throw UnimplementedError('Background color is yet supported on macOS'); - } + unawaited(webView.setOpaque(false)); + unawaited(webView.setBackgroundColor(Colors.transparent.value)); + unawaited( + webView.scrollView.setBackgroundColor(params.backgroundColor?.value), + ); } if (params.initialUrl != null) { @@ -264,36 +274,36 @@ class WebKitWebViewPlatformController extends WebViewPlatformController { requiresUserAction = false; } - configuration - .setMediaTypesRequiringUserActionForPlayback({ - if (requiresUserAction) WKAudiovisualMediaType.all, - if (!requiresUserAction) WKAudiovisualMediaType.none, - }); + configuration.setMediaTypesRequiringUserActionForPlayback( + requiresUserAction ? AudiovisualMediaType.all : AudiovisualMediaType.none, + ); } @override Future loadHtmlString(String html, {String? baseUrl}) { - return webView.loadHtmlString(html, baseUrl: baseUrl); + return webView.loadHtmlString(html, baseUrl); } @override Future loadFile(String absoluteFilePath) async { await webView.loadFileUrl( absoluteFilePath, - readAccessUrl: path.dirname(absoluteFilePath), + path.dirname(absoluteFilePath), ); } @override - Future clearCache() { - return webView.configuration.websiteDataStore.removeDataOfTypes( - { - WKWebsiteDataType.memoryCache, - WKWebsiteDataType.diskCache, - WKWebsiteDataType.offlineWebApplicationCache, - WKWebsiteDataType.localStorage, - }, - DateTime.fromMillisecondsSinceEpoch(0), + Future clearCache() async { + final WKWebsiteDataStore dataStore = + await webView.configuration.getWebsiteDataStore(); + await dataStore.removeDataOfTypes( + [ + WebsiteDataType.memoryCache, + WebsiteDataType.diskCache, + WebsiteDataType.offlineWebApplicationCache, + WebsiteDataType.localStorage, + ], + 0, ); } @@ -305,11 +315,11 @@ class WebKitWebViewPlatformController extends WebViewPlatformController { @override Future loadUrl(String url, Map? headers) async { - final NSUrlRequest request = NSUrlRequest( - url: url, - allHttpHeaderFields: headers ?? {}, + final URLRequest request = webViewProxy.createRequest(url: url); + unawaited( + request.setAllHttpHeaderFields(headers ?? const {}), ); - return webView.loadRequest(request); + return webView.load(request); } @override @@ -318,14 +328,14 @@ class WebKitWebViewPlatformController extends WebViewPlatformController { throw ArgumentError('WebViewRequest#uri is required to have a scheme.'); } - final NSUrlRequest urlRequest = NSUrlRequest( + final URLRequest urlRequest = webViewProxy.createRequest( url: request.uri.toString(), - allHttpHeaderFields: request.headers, - httpMethod: request.method.name, - httpBody: request.body, ); + unawaited(urlRequest.setAllHttpHeaderFields(request.headers)); + unawaited(urlRequest.setHttpMethod(request.method.name)); + unawaited(urlRequest.setHttpBody(request.body)); - return webView.loadRequest(urlRequest); + return webView.load(urlRequest); } @override @@ -385,51 +395,25 @@ class WebKitWebViewPlatformController extends WebViewPlatformController { Future currentUrl() => webView.getUrl(); @override - Future scrollTo(int x, int y) async { - final WKWebView webView = this.webView; - if (webView is WKWebViewIOS) { - return webView.scrollView.setContentOffset(Point( - x.toDouble(), - y.toDouble(), - )); - } else { - throw UnimplementedError('scrollTo is not supported on macOS'); - } + Future scrollTo(int x, int y) { + return webView.scrollView.setContentOffset(x.toDouble(), y.toDouble()); } @override Future scrollBy(int x, int y) async { - final WKWebView webView = this.webView; - if (webView is WKWebViewIOS) { - await webView.scrollView.scrollBy(Point( - x.toDouble(), - y.toDouble(), - )); - } else { - throw UnimplementedError('scrollBy is not supported on macOS'); - } + return webView.scrollView.scrollBy(x.toDouble(), y.toDouble()); } @override Future getScrollX() async { - final WKWebView webView = this.webView; - if (webView is WKWebViewIOS) { - final Point offset = await webView.scrollView.getContentOffset(); - return offset.x.toInt(); - } else { - throw UnimplementedError('getScrollX is not supported on macOS'); - } + final List offset = await webView.scrollView.getContentOffset(); + return offset[0].toInt(); } @override Future getScrollY() async { - final WKWebView webView = this.webView; - if (webView is WKWebViewIOS) { - final Point offset = await webView.scrollView.getContentOffset(); - return offset.y.toInt(); - } else { - throw UnimplementedError('getScrollY is not supported on macOS'); - } + final List offset = await webView.scrollView.getContentOffset(); + return offset[1].toInt(); } @override @@ -459,19 +443,20 @@ class WebKitWebViewPlatformController extends WebViewPlatformController { return !_scriptMessageHandlers.containsKey(channelName); }, ).map>( - (String channelName) { + (String channelName) async { final WKScriptMessageHandler handler = webViewProxy.createScriptMessageHandler( didReceiveScriptMessage: withWeakReferenceTo( javascriptChannelRegistry, (WeakReference weakReference) { return ( + WKScriptMessageHandler instance, WKUserContentController userContentController, WKScriptMessage message, ) { weakReference.target?.onJavascriptChannelMessage( message.name, - message.body!.toString(), + message.body.toString(), ); }; }, @@ -482,14 +467,14 @@ class WebKitWebViewPlatformController extends WebViewPlatformController { final String wrapperSource = 'window.$channelName = webkit.messageHandlers.$channelName;'; final WKUserScript wrapperScript = WKUserScript( - wrapperSource, - WKUserScriptInjectionTime.atDocumentStart, - isMainFrameOnly: false, + source: wrapperSource, + injectionTime: UserScriptInjectionTime.atDocumentStart, + isForMainFrameOnly: false, ); - webView.configuration.userContentController - .addUserScript(wrapperScript); - return webView.configuration.userContentController - .addScriptMessageHandler( + final WKUserContentController controller = + await webView.configuration.getUserContentController(); + unawaited(controller.addUserScript(wrapperScript)); + await controller.addScriptMessageHandler( handler, channelName, ); @@ -513,25 +498,44 @@ class WebKitWebViewPlatformController extends WebViewPlatformController { if (hasProgressTracking) { _progressObserverSet = true; await webView.addObserver( - webView, - keyPath: 'estimatedProgress', - options: { - NSKeyValueObservingOptions.newValue, - }, + webView.nativeWebView, + 'estimatedProgress', + [KeyValueObservingOptions.newValue], ); } else if (_progressObserverSet) { // Calls to removeObserver before addObserver causes a crash. _progressObserverSet = false; - await webView.removeObserver(webView, keyPath: 'estimatedProgress'); + await webView.removeObserver(webView.nativeWebView, 'estimatedProgress'); } } - Future _setJavaScriptMode(JavascriptMode mode) { + 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) { case JavascriptMode.disabled: - return webView.configuration.preferences.setJavaScriptEnabled(false); + await preferences.setJavaScriptEnabled(false); case JavascriptMode.unrestricted: - return webView.configuration.preferences.setJavaScriptEnabled(true); + await preferences.setJavaScriptEnabled(true); } } @@ -554,18 +558,19 @@ class WebKitWebViewPlatformController extends WebViewPlatformController { return _resetUserScripts(); } - Future _disableZoom() { - const WKUserScript userScript = WKUserScript( - "var meta = document.createElement('meta');\n" - "meta.name = 'viewport';\n" - "meta.content = 'width=device-width, initial-scale=1.0, maximum-scale=1.0, " - "user-scalable=no';\n" - "var head = document.getElementsByTagName('head')[0];head.appendChild(meta);", - WKUserScriptInjectionTime.atDocumentEnd, - isMainFrameOnly: true, + Future _disableZoom() async { + final WKUserScript userScript = WKUserScript( + source: "var meta = document.createElement('meta');\n" + "meta.name = 'viewport';\n" + "meta.content = 'width=device-width, initial-scale=1.0, maximum-scale=1.0, " + "user-scalable=no';\n" + "var head = document.getElementsByTagName('head')[0];head.appendChild(meta);", + injectionTime: UserScriptInjectionTime.atDocumentEnd, + isForMainFrameOnly: true, ); - return webView.configuration.userContentController - .addUserScript(userScript); + final WKUserContentController controller = + await webView.configuration.getUserContentController(); + return controller.addUserScript(userScript); } // WkWebView does not support removing a single user script, so all user @@ -576,15 +581,13 @@ class WebKitWebViewPlatformController extends WebViewPlatformController { Future _resetUserScripts({ Set removedJavaScriptChannels = const {}, }) async { - unawaited( - webView.configuration.userContentController.removeAllUserScripts(), - ); + final WKUserContentController controller = + await webView.configuration.getUserContentController(); + unawaited(controller.removeAllUserScripts()); // TODO(bparrishMines): This can be replaced with // `removeAllScriptMessageHandlers` once Dart supports runtime version // checking. (e.g. The equivalent to @availability in Objective-C.) - _scriptMessageHandlers.keys.forEach( - webView.configuration.userContentController.removeScriptMessageHandler, - ); + _scriptMessageHandlers.keys.forEach(controller.removeScriptMessageHandler); removedJavaScriptChannels.forEach(_scriptMessageHandlers.remove); final Set remainingNames = _scriptMessageHandlers.keys.toSet(); @@ -617,7 +620,9 @@ class WebKitWebViewPlatformController extends WebViewPlatformController { return WebResourceError( errorCode: error.code, domain: error.domain, - description: error.localizedDescription ?? '', + description: error.userInfo[NSErrorUserInfoKey.NSLocalizedDescription] + as String? ?? + '', errorType: errorType, ); } @@ -675,24 +680,26 @@ class WebViewWidgetProxy { final bool? overriddenIsMacOS; /// Constructs a [WKWebView]. - WKWebView createWebView( + PlatformWebView createWebView( WKWebViewConfiguration configuration, { void Function( String keyPath, NSObject object, - Map change, + Map change, )? observeValue, }) { - if (overriddenIsMacOS ?? Platform.isMacOS) { - return WKWebViewMacOS(configuration, observeValue: observeValue); - } else { - return WKWebViewIOS(configuration, observeValue: observeValue); - } + return PlatformWebView(initialConfiguration: configuration); + } + + /// Constructs a [URLRequest]. + URLRequest createRequest({required String url}) { + return URLRequest(url: url); } /// Constructs a [WKScriptMessageHandler]. WKScriptMessageHandler createScriptMessageHandler({ required void Function( + WKScriptMessageHandler instance, WKUserContentController userContentController, WKScriptMessage message, ) didReceiveScriptMessage, @@ -705,27 +712,50 @@ class WebViewWidgetProxy { /// Constructs a [WKUIDelegate]. WKUIDelegate createUIDelgate({ void Function( + WKUIDelegate instance, WKWebView webView, WKWebViewConfiguration configuration, WKNavigationAction navigationAction, )? onCreateWebView, }) { - return WKUIDelegate(onCreateWebView: onCreateWebView); + return WKUIDelegate( + onCreateWebView: onCreateWebView, + requestMediaCapturePermission: (_, __, ___, ____, _____) async { + return PermissionDecision.deny; + }, + runJavaScriptConfirmPanel: (_, __, ___, ____) async { + return false; + }, + ); } /// Constructs a [WKNavigationDelegate]. WKNavigationDelegate createNavigationDelegate({ - void Function(WKWebView webView, String? url)? didFinishNavigation, - void Function(WKWebView webView, String? url)? + void Function(WKNavigationDelegate, WKWebView webView, String? url)? + didFinishNavigation, + void Function(WKNavigationDelegate, WKWebView webView, String? url)? didStartProvisionalNavigation, - Future Function( + required Future Function( + WKNavigationDelegate, WKWebView webView, WKNavigationAction navigationAction, - )? decidePolicyForNavigationAction, - void Function(WKWebView webView, NSError error)? didFailNavigation, - void Function(WKWebView webView, NSError error)? + ) decidePolicyForNavigationAction, + void Function(WKNavigationDelegate, WKWebView webView, NSError error)? + didFailNavigation, + void Function(WKNavigationDelegate, WKWebView webView, NSError error)? didFailProvisionalNavigation, - void Function(WKWebView webView)? webViewWebContentProcessDidTerminate, + void Function(WKNavigationDelegate, WKWebView webView)? + webViewWebContentProcessDidTerminate, + required Future Function( + WKNavigationDelegate, + WKWebView webView, + WKNavigationResponse navigationResponse, + ) decidePolicyForNavigationResponse, + required Future> Function( + WKNavigationDelegate, + WKWebView webView, + URLAuthenticationChallenge challenge, + ) didReceiveAuthenticationChallenge, }) { return WKNavigationDelegate( didFinishNavigation: didFinishNavigation, @@ -735,6 +765,8 @@ class WebViewWidgetProxy { didFailProvisionalNavigation: didFailProvisionalNavigation, webViewWebContentProcessDidTerminate: webViewWebContentProcessDidTerminate, + decidePolicyForNavigationResponse: decidePolicyForNavigationResponse, + didReceiveAuthenticationChallenge: didReceiveAuthenticationChallenge, ); } } diff --git a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/legacy/webview_cupertino.dart b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/legacy/webview_cupertino.dart index 5ad959ca79b..6d9de39d005 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/legacy/webview_cupertino.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/legacy/webview_cupertino.dart @@ -11,7 +11,7 @@ import 'package:flutter/widgets.dart'; // ignore: implementation_imports import 'package:webview_flutter_platform_interface/src/webview_flutter_platform_interface_legacy.dart'; -import '../foundation/foundation.dart'; +import '../common/web_kit.g.dart'; import 'web_kit_webview_widget.dart'; /// Builds an iOS webview. @@ -42,8 +42,9 @@ class CupertinoWebView implements WebViewPlatform { } }, gestureRecognizers: gestureRecognizers, - creationParams: - NSObject.globalInstanceManager.getIdentifier(controller.webView), + creationParams: PigeonInstanceManager.instance.getIdentifier( + controller.webView.nativeWebView, + ), creationParamsCodec: const StandardMessageCodec(), ); }, diff --git a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/legacy/wkwebview_cookie_manager.dart b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/legacy/wkwebview_cookie_manager.dart index 59dce559f12..faa654836f2 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/legacy/wkwebview_cookie_manager.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/legacy/wkwebview_cookie_manager.dart @@ -2,27 +2,33 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter/foundation.dart'; // ignore: implementation_imports import 'package:webview_flutter_platform_interface/src/webview_flutter_platform_interface_legacy.dart'; -import '../foundation/foundation.dart'; -import '../web_kit/web_kit.dart'; +import '../common/web_kit.g.dart'; +import '../webkit_proxy.dart'; /// Handles all cookie operations for the WebView platform. class WKWebViewCookieManager extends WebViewCookieManagerPlatform { /// Constructs a [WKWebViewCookieManager]. - WKWebViewCookieManager({WKWebsiteDataStore? websiteDataStore}) - : websiteDataStore = - websiteDataStore ?? WKWebsiteDataStore.defaultDataStore; + WKWebViewCookieManager({ + WKWebsiteDataStore? websiteDataStore, + @visibleForTesting WebKitProxy webKitProxy = const WebKitProxy(), + }) : _webKitProxy = webKitProxy, + websiteDataStore = websiteDataStore ?? + webKitProxy.defaultDataStoreWKWebsiteDataStore(); /// Manages stored data for [WKWebView]s. final WKWebsiteDataStore websiteDataStore; + final WebKitProxy _webKitProxy; + @override Future clearCookies() async { return websiteDataStore.removeDataOfTypes( - {WKWebsiteDataType.cookies}, - DateTime.fromMillisecondsSinceEpoch(0), + [WebsiteDataType.cookies], + 0, ); } @@ -34,12 +40,12 @@ class WKWebViewCookieManager extends WebViewCookieManagerPlatform { } return websiteDataStore.httpCookieStore.setCookie( - NSHttpCookie.withProperties( - { - NSHttpCookiePropertyKey.name: cookie.name, - NSHttpCookiePropertyKey.value: cookie.value, - NSHttpCookiePropertyKey.domain: cookie.domain, - NSHttpCookiePropertyKey.path: cookie.path, + _webKitProxy.newHTTPCookie( + properties: { + HttpCookiePropertyKey.name: cookie.name, + HttpCookiePropertyKey.value: cookie.value, + HttpCookiePropertyKey.domain: cookie.domain, + HttpCookiePropertyKey.path: cookie.path, }, ), ); diff --git a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/ui_kit/ui_kit.dart b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/ui_kit/ui_kit.dart deleted file mode 100644 index a331792dd37..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/ui_kit/ui_kit.dart +++ /dev/null @@ -1,222 +0,0 @@ -// 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 'dart:async'; -import 'dart:math'; - -import 'package:flutter/foundation.dart'; -import 'package:flutter/services.dart'; - -import '../common/instance_manager.dart'; -import '../foundation/foundation.dart'; -import '../web_kit/web_kit.dart'; -import '../web_kit/web_kit_api_impls.dart'; -import 'ui_kit_api_impls.dart'; - -/// A view that allows the scrolling and zooming of its contained views. -/// -/// Wraps [UIScrollView](https://developer.apple.com/documentation/uikit/uiscrollview?language=objc). -@immutable -class UIScrollView extends UIViewBase { - /// Constructs a [UIScrollView] that is owned by [webView]. - factory UIScrollView.fromWebView( - WKWebView webView, { - BinaryMessenger? binaryMessenger, - InstanceManager? instanceManager, - }) { - final UIScrollView scrollView = UIScrollView.detached( - binaryMessenger: binaryMessenger, - instanceManager: instanceManager, - ); - scrollView._scrollViewApi.createFromWebViewForInstances( - scrollView, - webView, - ); - return scrollView; - } - - /// Constructs a [UIScrollView] without creating the associated - /// Objective-C object. - /// - /// This should only be used by subclasses created by this library or to - /// create copies. - UIScrollView.detached({ - super.observeValue, - super.binaryMessenger, - super.instanceManager, - }) : _scrollViewApi = UIScrollViewHostApiImpl( - binaryMessenger: binaryMessenger, - instanceManager: instanceManager, - ), - super.detached(); - - final UIScrollViewHostApiImpl _scrollViewApi; - - /// Point at which the origin of the content view is offset from the origin of the scroll view. - /// - /// Represents [WKWebView.contentOffset](https://developer.apple.com/documentation/uikit/uiscrollview/1619404-contentoffset?language=objc). - Future> getContentOffset() { - return _scrollViewApi.getContentOffsetForInstances(this); - } - - /// Move the scrolled position of this view. - /// - /// This method is not a part of UIKit and is only a helper method to make - /// scrollBy atomic. - Future scrollBy(Point offset) { - return _scrollViewApi.scrollByForInstances(this, offset); - } - - /// Define whether the vertical scrollbar should be drawn or not. The default value is true. - Future verticalScrollBarEnabled(bool enabled) { - return _scrollViewApi.verticalScrollBarEnabledForInstances(this, enabled); - } - - /// Define whether the horizontal scrollbar should be drawn or not. The default value is true. - Future horizontalScrollBarEnabled(bool enabled) { - return _scrollViewApi.horizontalScrollBarEnabledForInstances(this, enabled); - } - - /// Set point at which the origin of the content view is offset from the origin of the scroll view. - /// - /// The default value is `Point(0.0, 0.0)`. - /// - /// Sets [WKWebView.contentOffset](https://developer.apple.com/documentation/uikit/uiscrollview/1619404-contentoffset?language=objc). - Future setContentOffset(Point offset) { - return _scrollViewApi.setContentOffsetForInstances(this, offset); - } - - /// Set the delegate to this scroll view. - /// - /// Represents [UIScrollView.delegate](https://developer.apple.com/documentation/uikit/uiscrollview/1619430-delegate?language=objc). - Future setDelegate(UIScrollViewDelegate? delegate) { - return _scrollViewApi.setDelegateForInstances(this, delegate); - } - - @override - UIScrollView copy() { - return UIScrollView.detached( - observeValue: observeValue, - binaryMessenger: _viewApi.binaryMessenger, - instanceManager: _viewApi.instanceManager, - ); - } -} - -/// Methods that anything implementing a class that inherits from UIView on the -/// native side must implement. -/// -/// Classes without a multiple inheritence problem should extend UIViewBase -/// instead of implementing this directly. -abstract class UIView implements NSObject { - /// The view’s background color. - /// - /// The default value is null, which results in a transparent background color. - /// - /// Sets [UIView.backgroundColor](https://developer.apple.com/documentation/uikit/uiview/1622591-backgroundcolor?language=objc). - Future setBackgroundColor(Color? color); - - /// Determines whether the view is opaque. - /// - /// Sets [UIView.opaque](https://developer.apple.com/documentation/uikit/uiview?language=objc). - Future setOpaque(bool opaque); -} - -/// Manages the content for a rectangular area on the screen. -/// -/// Wraps [UIView](https://developer.apple.com/documentation/uikit/uiview?language=objc). -@immutable -class UIViewBase extends NSObject implements UIView { - /// Constructs a [UIView] without creating the associated - /// Objective-C object. - /// - /// This should only be used by subclasses created by this library or to - /// create copies. - UIViewBase.detached({ - super.observeValue, - super.binaryMessenger, - super.instanceManager, - }) : _viewApi = UIViewHostApiImpl( - binaryMessenger: binaryMessenger, - instanceManager: instanceManager, - ), - super.detached(); - - final UIViewHostApiImpl _viewApi; - - @override - Future setBackgroundColor(Color? color) { - return _viewApi.setBackgroundColorForInstances(this, color); - } - - @override - Future setOpaque(bool opaque) { - return _viewApi.setOpaqueForInstances(this, opaque); - } - - @override - UIView copy() { - return UIViewBase.detached( - observeValue: observeValue, - binaryMessenger: _viewApi.binaryMessenger, - instanceManager: _viewApi.instanceManager, - ); - } -} - -/// Responding to scroll view interactions. -/// -/// Represent [UIScrollViewDelegate](https://developer.apple.com/documentation/uikit/uiscrollviewdelegate?language=objc). -@immutable -class UIScrollViewDelegate extends NSObject { - /// Constructs a [UIScrollViewDelegate]. - UIScrollViewDelegate({ - this.scrollViewDidScroll, - super.binaryMessenger, - super.instanceManager, - }) : _scrollViewDelegateApi = UIScrollViewDelegateHostApiImpl( - binaryMessenger: binaryMessenger, - instanceManager: instanceManager, - ), - super.detached() { - // Ensures FlutterApis for the WebKit library are set up. - WebKitFlutterApis.instance.ensureSetUp(); - _scrollViewDelegateApi.createForInstance(this); - } - - /// Constructs a [UIScrollViewDelegate] without creating the associated - /// Objective-C object. - /// - /// This should only be used by subclasses created by this library or to - /// create copies. - UIScrollViewDelegate.detached({ - this.scrollViewDidScroll, - super.binaryMessenger, - super.instanceManager, - }) : _scrollViewDelegateApi = UIScrollViewDelegateHostApiImpl( - binaryMessenger: binaryMessenger, - instanceManager: instanceManager, - ), - super.detached(); - - final UIScrollViewDelegateHostApiImpl _scrollViewDelegateApi; - - /// Called when scroll view did scroll. - /// - /// {@macro webview_flutter_wkwebview.foundation.callbacks} - final void Function( - UIScrollView scrollView, - double x, - double y, - )? scrollViewDidScroll; - - @override - UIScrollViewDelegate copy() { - return UIScrollViewDelegate.detached( - scrollViewDidScroll: scrollViewDidScroll, - binaryMessenger: _scrollViewDelegateApi.binaryMessenger, - instanceManager: _scrollViewDelegateApi.instanceManager, - ); - } -} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/ui_kit/ui_kit_api_impls.dart b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/ui_kit/ui_kit_api_impls.dart deleted file mode 100644 index 97f562c86c7..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/ui_kit/ui_kit_api_impls.dart +++ /dev/null @@ -1,203 +0,0 @@ -// 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 'dart:async'; -import 'dart:math'; - -import 'package:flutter/services.dart'; - -import '../common/instance_manager.dart'; -import '../common/web_kit.g.dart'; -import '../foundation/foundation.dart'; -import '../web_kit/web_kit.dart'; -import 'ui_kit.dart'; - -/// Host api implementation for [UIScrollView]. -class UIScrollViewHostApiImpl extends UIScrollViewHostApi { - /// Constructs a [UIScrollViewHostApiImpl]. - UIScrollViewHostApiImpl({ - this.binaryMessenger, - InstanceManager? instanceManager, - }) : instanceManager = instanceManager ?? NSObject.globalInstanceManager, - super(binaryMessenger: binaryMessenger); - - /// Sends binary data across the Flutter platform barrier. - /// - /// If it is null, the default BinaryMessenger will be used which routes to - /// the host platform. - final BinaryMessenger? binaryMessenger; - - /// Maintains instances stored to communicate with Objective-C objects. - final InstanceManager instanceManager; - - /// Calls [createFromWebView] with the ids of the provided object instances. - Future createFromWebViewForInstances( - UIScrollView instance, - WKWebView webView, - ) { - return createFromWebView( - instanceManager.addDartCreatedInstance(instance), - instanceManager.getIdentifier(webView)!, - ); - } - - /// Calls [getContentOffset] with the ids of the provided object instances. - Future> getContentOffsetForInstances( - UIScrollView instance, - ) async { - final List point = await getContentOffset( - instanceManager.getIdentifier(instance)!, - ); - return Point(point[0]!, point[1]!); - } - - /// Calls [scrollBy] with the ids of the provided object instances. - Future scrollByForInstances( - UIScrollView instance, - Point offset, - ) { - return scrollBy( - instanceManager.getIdentifier(instance)!, - offset.x, - offset.y, - ); - } - - /// Calls [verticalScrollBarEnabled] with the ids of the provided object instances. - Future verticalScrollBarEnabledForInstances( - UIView instance, - bool enabled, - ) async { - return verticalScrollBarEnabled( - instanceManager.getIdentifier(instance)!, - enabled, - ); - } - - /// Calls [horizontalScrollBarEnabled] with the ids of the provided object instances. - Future horizontalScrollBarEnabledForInstances( - UIView instance, - bool enabled, - ) async { - return horizontalScrollBarEnabled( - instanceManager.getIdentifier(instance)!, - enabled, - ); - } - - /// Calls [setContentOffset] with the ids of the provided object instances. - Future setContentOffsetForInstances( - UIScrollView instance, - Point offset, - ) async { - return setContentOffset( - instanceManager.getIdentifier(instance)!, - offset.x, - offset.y, - ); - } - - /// Calls [setDelegate] with the ids of the provided object instances. - Future setDelegateForInstances( - UIScrollView instance, - UIScrollViewDelegate? delegate, - ) async { - return setDelegate( - instanceManager.getIdentifier(instance)!, - delegate != null ? instanceManager.getIdentifier(delegate) : null, - ); - } -} - -/// Host api implementation for [UIView]. -class UIViewHostApiImpl extends UIViewHostApi { - /// Constructs a [UIViewHostApiImpl]. - UIViewHostApiImpl({ - this.binaryMessenger, - InstanceManager? instanceManager, - }) : instanceManager = instanceManager ?? NSObject.globalInstanceManager, - super(binaryMessenger: binaryMessenger); - - /// Sends binary data across the Flutter platform barrier. - /// - /// If it is null, the default BinaryMessenger will be used which routes to - /// the host platform. - final BinaryMessenger? binaryMessenger; - - /// Maintains instances stored to communicate with Objective-C objects. - final InstanceManager instanceManager; - - /// Calls [setBackgroundColor] with the ids of the provided object instances. - Future setBackgroundColorForInstances( - UIView instance, - Color? color, - ) async { - return setBackgroundColor( - instanceManager.getIdentifier(instance)!, - color?.value, - ); - } - - /// Calls [setOpaque] with the ids of the provided object instances. - Future setOpaqueForInstances( - UIView instance, - bool opaque, - ) async { - return setOpaque(instanceManager.getIdentifier(instance)!, opaque); - } -} - -/// Flutter api implementation for [UIScrollViewDelegate]. -class UIScrollViewDelegateFlutterApiImpl - extends UIScrollViewDelegateFlutterApi { - /// Constructs a [UIScrollViewDelegateFlutterApiImpl]. - UIScrollViewDelegateFlutterApiImpl({InstanceManager? instanceManager}) - : instanceManager = instanceManager ?? NSObject.globalInstanceManager; - - /// Maintains instances stored to communicate with native language objects. - final InstanceManager instanceManager; - - UIScrollViewDelegate _getDelegate(int identifier) { - return instanceManager.getInstanceWithWeakReference(identifier)!; - } - - @override - void scrollViewDidScroll( - int identifier, - int uiScrollViewIdentifier, - double x, - double y, - ) { - final void Function(UIScrollView, double, double)? callback = - _getDelegate(identifier).scrollViewDidScroll; - final UIScrollView? uiScrollView = instanceManager - .getInstanceWithWeakReference(uiScrollViewIdentifier) as UIScrollView?; - assert(uiScrollView != null); - callback?.call(uiScrollView!, x, y); - } -} - -/// Host api implementation for [UIScrollViewDelegate]. -class UIScrollViewDelegateHostApiImpl extends UIScrollViewDelegateHostApi { - /// Constructs a [UIScrollViewDelegateHostApiImpl]. - UIScrollViewDelegateHostApiImpl({ - this.binaryMessenger, - InstanceManager? instanceManager, - }) : instanceManager = instanceManager ?? NSObject.globalInstanceManager, - super(binaryMessenger: binaryMessenger); - - /// Sends binary data across the Flutter platform barrier. - /// - /// If it is null, the default BinaryMessenger will be used which routes to - /// the host platform. - final BinaryMessenger? binaryMessenger; - - /// Maintains instances stored to communicate with Objective-C objects. - final InstanceManager instanceManager; - - /// Calls [create] with the ids of the provided object instances. - Future createForInstance(UIScrollViewDelegate instance) async { - return create(instanceManager.addDartCreatedInstance(instance)); - } -} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/web_kit/web_kit.dart b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/web_kit/web_kit.dart deleted file mode 100644 index d5dcf0fff30..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/web_kit/web_kit.dart +++ /dev/null @@ -1,1308 +0,0 @@ -// 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 'package:flutter/foundation.dart'; -import 'package:flutter/services.dart'; - -import '../common/instance_manager.dart'; -import '../foundation/foundation.dart'; -import '../ui_kit/ui_kit.dart'; -import '../ui_kit/ui_kit_api_impls.dart' show UIViewHostApiImpl; -import 'web_kit_api_impls.dart'; - -export 'web_kit_api_impls.dart' - show WKMediaCaptureType, WKNavigationType, WKPermissionDecision; - -/// Times at which to inject script content into a webpage. -/// -/// Wraps [WKUserScriptInjectionTime](https://developer.apple.com/documentation/webkit/wkuserscriptinjectiontime?language=objc). -enum WKUserScriptInjectionTime { - /// Inject the script after the creation of the webpage’s document element, but before loading any other content. - /// - /// See https://developer.apple.com/documentation/webkit/wkuserscriptinjectiontime/wkuserscriptinjectiontimeatdocumentstart?language=objc. - atDocumentStart, - - /// Inject the script after the document finishes loading, but before loading any other subresources. - /// - /// See https://developer.apple.com/documentation/webkit/wkuserscriptinjectiontime/wkuserscriptinjectiontimeatdocumentend?language=objc. - atDocumentEnd, -} - -/// The media types that require a user gesture to begin playing. -/// -/// Wraps [WKAudiovisualMediaTypes](https://developer.apple.com/documentation/webkit/wkaudiovisualmediatypes?language=objc). -enum WKAudiovisualMediaType { - /// No media types require a user gesture to begin playing. - /// - /// See https://developer.apple.com/documentation/webkit/wkaudiovisualmediatypes/wkaudiovisualmediatypenone?language=objc. - none, - - /// Media types that contain audio require a user gesture to begin playing. - /// - /// See https://developer.apple.com/documentation/webkit/wkaudiovisualmediatypes/wkaudiovisualmediatypeaudio?language=objc. - audio, - - /// Media types that contain video require a user gesture to begin playing. - /// - /// See https://developer.apple.com/documentation/webkit/wkaudiovisualmediatypes/wkaudiovisualmediatypevideo?language=objc. - video, - - /// All media types require a user gesture to begin playing. - /// - /// See https://developer.apple.com/documentation/webkit/wkaudiovisualmediatypes/wkaudiovisualmediatypeall?language=objc. - all, -} - -/// Types of data that websites store. -/// -/// See https://developer.apple.com/documentation/webkit/wkwebsitedatarecord/data_store_record_types?language=objc. -enum WKWebsiteDataType { - /// Cookies. - cookies, - - /// In-memory caches. - memoryCache, - - /// On-disk caches. - diskCache, - - /// HTML offline web app caches. - offlineWebApplicationCache, - - /// HTML local storage. - localStorage, - - /// HTML session storage. - sessionStorage, - - /// WebSQL databases. - webSQLDatabases, - - /// IndexedDB databases. - indexedDBDatabases, -} - -/// Indicate whether to allow or cancel navigation to a webpage. -/// -/// Wraps [WKNavigationActionPolicy](https://developer.apple.com/documentation/webkit/wknavigationactionpolicy?language=objc). -enum WKNavigationActionPolicy { - /// Allow navigation to continue. - /// - /// See https://developer.apple.com/documentation/webkit/wknavigationactionpolicy/wknavigationactionpolicyallow?language=objc. - allow, - - /// Cancel navigation. - /// - /// See https://developer.apple.com/documentation/webkit/wknavigationactionpolicy/wknavigationactionpolicycancel?language=objc. - cancel, -} - -/// Indicate whether to allow or cancel navigation to a webpage. -/// -/// Wraps [WKNavigationResponsePolicy](https://developer.apple.com/documentation/webkit/wknavigationresponsepolicy?language=objc). -enum WKNavigationResponsePolicy { - /// Allow navigation to continue. - /// - /// See https://developer.apple.com/documentation/webkit/wknavigationresponsepolicy/wknavigationresponsepolicyallow?language=objc. - allow, - - /// Cancel navigation. - /// - /// See https://developer.apple.com/documentation/webkit/wknavigationresponsepolicy/wknavigationresponsepolicycancel?language=objc. - cancel, -} - -/// Possible error values that WebKit APIs can return. -/// -/// See https://developer.apple.com/documentation/webkit/wkerrorcode. -class WKErrorCode { - WKErrorCode._(); - - /// Indicates an unknown issue occurred. - /// - /// See https://developer.apple.com/documentation/webkit/wkerrorcode/wkerrorunknown. - static const int unknown = 1; - - /// Indicates the web process that contains the content is no longer running. - /// - /// See https://developer.apple.com/documentation/webkit/wkerrorcode/wkerrorwebcontentprocessterminated. - static const int webContentProcessTerminated = 2; - - /// Indicates the web view was invalidated. - /// - /// See https://developer.apple.com/documentation/webkit/wkerrorcode/wkerrorwebviewinvalidated. - static const int webViewInvalidated = 3; - - /// Indicates a JavaScript exception occurred. - /// - /// See https://developer.apple.com/documentation/webkit/wkerrorcode/wkerrorjavascriptexceptionoccurred. - static const int javaScriptExceptionOccurred = 4; - - /// Indicates the result of JavaScript execution could not be returned. - /// - /// See https://developer.apple.com/documentation/webkit/wkerrorcode/wkerrorjavascriptresulttypeisunsupported. - static const int javaScriptResultTypeIsUnsupported = 5; -} - -/// A record of the data that a particular website stores persistently. -/// -/// Wraps [WKWebsiteDataRecord](https://developer.apple.com/documentation/webkit/wkwebsitedatarecord?language=objc). -@immutable -class WKWebsiteDataRecord { - /// Constructs a [WKWebsiteDataRecord]. - const WKWebsiteDataRecord({required this.displayName}); - - /// Identifying information that you display to users. - final String displayName; -} - -/// An object that contains information about an action that causes navigation to occur. -/// -/// Wraps [WKNavigationAction](https://developer.apple.com/documentation/webkit/wknavigationaction?language=objc). -@immutable -class WKNavigationAction { - /// Constructs a [WKNavigationAction]. - const WKNavigationAction({ - required this.request, - required this.targetFrame, - required this.navigationType, - }); - - /// The URL request object associated with the navigation action. - final NSUrlRequest request; - - /// The frame in which to display the new content. - final WKFrameInfo targetFrame; - - /// The type of action that triggered the navigation. - final WKNavigationType navigationType; -} - -/// An object that contains information about a response to a navigation request. -/// -/// Wraps [WKNavigationResponse](https://developer.apple.com/documentation/webkit/wknavigationresponse?language=objc). -@immutable -class WKNavigationResponse { - /// Constructs a [WKNavigationResponse]. - const WKNavigationResponse({ - required this.response, - required this.forMainFrame, - }); - - /// The URL request object associated with the navigation action. - final NSHttpUrlResponse response; - - /// The frame in which to display the new content. - final bool forMainFrame; -} - -/// An object that contains information about a frame on a webpage. -/// -/// An instance of this class is a transient, data-only object; it does not -/// uniquely identify a frame across multiple delegate method calls. -/// -/// Wraps [WKFrameInfo](https://developer.apple.com/documentation/webkit/wkframeinfo?language=objc). -@immutable -class WKFrameInfo { - /// Construct a [WKFrameInfo]. - const WKFrameInfo({ - required this.isMainFrame, - required this.request, - }); - - /// Indicates whether the frame is the web site's main frame or a subframe. - final bool isMainFrame; - - /// The URL request object associated with the navigation action. - final NSUrlRequest request; -} - -/// A script that the web view injects into a webpage. -/// -/// Wraps [WKUserScript](https://developer.apple.com/documentation/webkit/wkuserscript?language=objc). -@immutable -class WKUserScript { - /// Constructs a [UserScript]. - const WKUserScript( - this.source, - this.injectionTime, { - required this.isMainFrameOnly, - }); - - /// The script’s source code. - final String source; - - /// The time at which to inject the script into the webpage. - final WKUserScriptInjectionTime injectionTime; - - /// Indicates whether to inject the script into the main frame or all frames. - final bool isMainFrameOnly; -} - -/// An object that encapsulates a message sent by JavaScript code from a webpage. -/// -/// Wraps [WKScriptMessage](https://developer.apple.com/documentation/webkit/wkscriptmessage?language=objc). -@immutable -class WKScriptMessage { - /// Constructs a [WKScriptMessage]. - const WKScriptMessage({required this.name, this.body}); - - /// The name of the message handler to which the message is sent. - final String name; - - /// The body of the message. - /// - /// Allowed types are [num], [String], [List], [Map], and `null`. - final Object? body; -} - -/// Encapsulates the standard behaviors to apply to websites. -/// -/// Wraps [WKPreferences](https://developer.apple.com/documentation/webkit/wkpreferences?language=objc). -@immutable -class WKPreferences extends NSObject { - /// Constructs a [WKPreferences] that is owned by [configuration]. - factory WKPreferences.fromWebViewConfiguration( - WKWebViewConfiguration configuration, { - BinaryMessenger? binaryMessenger, - InstanceManager? instanceManager, - }) { - final WKPreferences preferences = WKPreferences.detached( - binaryMessenger: binaryMessenger, - instanceManager: instanceManager, - ); - preferences._preferencesApi.createFromWebViewConfigurationForInstances( - preferences, - configuration, - ); - return preferences; - } - - /// Constructs a [WKPreferences] without creating the associated - /// Objective-C object. - /// - /// This should only be used by subclasses created by this library or to - /// create copies. - WKPreferences.detached({ - super.observeValue, - super.binaryMessenger, - super.instanceManager, - }) : _preferencesApi = WKPreferencesHostApiImpl( - binaryMessenger: binaryMessenger, - instanceManager: instanceManager, - ), - super.detached(); - - final WKPreferencesHostApiImpl _preferencesApi; - - // TODO(bparrishMines): Deprecated for iOS 14.0+. Add support for alternative. - /// Sets whether JavaScript is enabled. - /// - /// The default value is true. - Future setJavaScriptEnabled(bool enabled) { - return _preferencesApi.setJavaScriptEnabledForInstances(this, enabled); - } - - @override - WKPreferences copy() { - return WKPreferences.detached( - observeValue: observeValue, - binaryMessenger: _preferencesApi.binaryMessenger, - instanceManager: _preferencesApi.instanceManager, - ); - } -} - -/// Manages cookies, disk and memory caches, and other types of data for a web view. -/// -/// Wraps [WKWebsiteDataStore](https://developer.apple.com/documentation/webkit/wkwebsitedatastore?language=objc). -@immutable -class WKWebsiteDataStore extends NSObject { - /// Constructs a [WKWebsiteDataStore] without creating the associated - /// Objective-C object. - /// - /// This should only be used by subclasses created by this library or to - /// create copies. - WKWebsiteDataStore.detached({ - super.observeValue, - super.binaryMessenger, - super.instanceManager, - }) : _websiteDataStoreApi = WKWebsiteDataStoreHostApiImpl( - binaryMessenger: binaryMessenger, - instanceManager: instanceManager, - ), - super.detached(); - - factory WKWebsiteDataStore._defaultDataStore() { - final WKWebsiteDataStore websiteDataStore = WKWebsiteDataStore.detached(); - websiteDataStore._websiteDataStoreApi.createDefaultDataStoreForInstances( - websiteDataStore, - ); - return websiteDataStore; - } - - /// Constructs a [WKWebsiteDataStore] that is owned by [configuration]. - factory WKWebsiteDataStore.fromWebViewConfiguration( - WKWebViewConfiguration configuration, { - BinaryMessenger? binaryMessenger, - InstanceManager? instanceManager, - }) { - final WKWebsiteDataStore websiteDataStore = WKWebsiteDataStore.detached( - binaryMessenger: binaryMessenger, - instanceManager: instanceManager, - ); - websiteDataStore._websiteDataStoreApi - .createFromWebViewConfigurationForInstances( - websiteDataStore, - configuration, - ); - return websiteDataStore; - } - - /// Default data store that stores data persistently to disk. - static final WKWebsiteDataStore defaultDataStore = - WKWebsiteDataStore._defaultDataStore(); - - final WKWebsiteDataStoreHostApiImpl _websiteDataStoreApi; - - /// Manages the HTTP cookies associated with a particular web view. - late final WKHttpCookieStore httpCookieStore = - WKHttpCookieStore.fromWebsiteDataStore(this); - - /// Removes website data that changed after the specified date. - /// - /// Returns whether any data was removed. - Future removeDataOfTypes( - Set dataTypes, - DateTime since, - ) { - return _websiteDataStoreApi.removeDataOfTypesForInstances( - this, - dataTypes, - secondsModifiedSinceEpoch: since.millisecondsSinceEpoch / 1000, - ); - } - - @override - WKWebsiteDataStore copy() { - return WKWebsiteDataStore.detached( - observeValue: observeValue, - binaryMessenger: _websiteDataStoreApi.binaryMessenger, - instanceManager: _websiteDataStoreApi.instanceManager, - ); - } -} - -/// An object that manages the HTTP cookies associated with a particular web view. -/// -/// Wraps [WKHTTPCookieStore](https://developer.apple.com/documentation/webkit/wkhttpcookiestore?language=objc). -@immutable -class WKHttpCookieStore extends NSObject { - /// Constructs a [WKHttpCookieStore] without creating the associated - /// Objective-C object. - /// - /// This should only be used by subclasses created by this library or to - /// create copies. - WKHttpCookieStore.detached({ - super.observeValue, - super.binaryMessenger, - super.instanceManager, - }) : _httpCookieStoreApi = WKHttpCookieStoreHostApiImpl( - binaryMessenger: binaryMessenger, - instanceManager: instanceManager, - ), - super.detached(); - - /// Constructs a [WKHttpCookieStore] that is owned by [dataStore]. - factory WKHttpCookieStore.fromWebsiteDataStore( - WKWebsiteDataStore dataStore, { - BinaryMessenger? binaryMessenger, - InstanceManager? instanceManager, - }) { - final WKHttpCookieStore cookieStore = WKHttpCookieStore.detached( - binaryMessenger: binaryMessenger, - instanceManager: instanceManager, - ); - cookieStore._httpCookieStoreApi.createFromWebsiteDataStoreForInstances( - cookieStore, - dataStore, - ); - return cookieStore; - } - - final WKHttpCookieStoreHostApiImpl _httpCookieStoreApi; - - /// Adds a cookie to the cookie store. - Future setCookie(NSHttpCookie cookie) { - return _httpCookieStoreApi.setCookieForInstances(this, cookie); - } - - @override - WKHttpCookieStore copy() { - return WKHttpCookieStore.detached( - observeValue: observeValue, - binaryMessenger: _httpCookieStoreApi.binaryMessenger, - instanceManager: _httpCookieStoreApi.instanceManager, - ); - } -} - -/// An interface for receiving messages from JavaScript code running in a webpage. -/// -/// Wraps [WKScriptMessageHandler](https://developer.apple.com/documentation/webkit/wkscriptmessagehandler?language=objc). -@immutable -class WKScriptMessageHandler extends NSObject { - /// Constructs a [WKScriptMessageHandler]. - WKScriptMessageHandler({ - required this.didReceiveScriptMessage, - super.observeValue, - super.binaryMessenger, - super.instanceManager, - }) : _scriptMessageHandlerApi = WKScriptMessageHandlerHostApiImpl( - binaryMessenger: binaryMessenger, - instanceManager: instanceManager, - ), - super.detached() { - // Ensures FlutterApis for the WebKit library are set up. - WebKitFlutterApis.instance.ensureSetUp(); - _scriptMessageHandlerApi.createForInstances(this); - } - - /// Constructs a [WKScriptMessageHandler] without creating the associated - /// Objective-C object. - /// - /// This should only be used by subclasses created by this library or to - /// create copies. - WKScriptMessageHandler.detached({ - required this.didReceiveScriptMessage, - super.observeValue, - super.binaryMessenger, - super.instanceManager, - }) : _scriptMessageHandlerApi = WKScriptMessageHandlerHostApiImpl( - binaryMessenger: binaryMessenger, - instanceManager: instanceManager, - ), - super.detached(); - - final WKScriptMessageHandlerHostApiImpl _scriptMessageHandlerApi; - - /// Tells the handler that a webpage sent a script message. - /// - /// Use this method to respond to a message sent from the webpage’s - /// JavaScript code. Use the [message] parameter to get the message contents and - /// to determine the originating web view. - /// - /// {@macro webview_flutter_wkwebview.foundation.callbacks} - final void Function( - WKUserContentController userContentController, - WKScriptMessage message, - ) didReceiveScriptMessage; - - @override - WKScriptMessageHandler copy() { - return WKScriptMessageHandler.detached( - didReceiveScriptMessage: didReceiveScriptMessage, - observeValue: observeValue, - binaryMessenger: _scriptMessageHandlerApi.binaryMessenger, - instanceManager: _scriptMessageHandlerApi.instanceManager, - ); - } -} - -/// Manages interactions between JavaScript code and your web view. -/// -/// Use this object to do the following: -/// -/// * Inject JavaScript code into webpages running in your web view. -/// * Install custom JavaScript functions that call through to your app’s native -/// code. -/// -/// Wraps [WKUserContentController](https://developer.apple.com/documentation/webkit/wkusercontentcontroller?language=objc). -@immutable -class WKUserContentController extends NSObject { - /// Constructs a [WKUserContentController] that is owned by [configuration]. - factory WKUserContentController.fromWebViewConfiguration( - WKWebViewConfiguration configuration, { - BinaryMessenger? binaryMessenger, - InstanceManager? instanceManager, - }) { - final WKUserContentController userContentController = - WKUserContentController.detached( - binaryMessenger: binaryMessenger, - instanceManager: instanceManager, - ); - userContentController._userContentControllerApi - .createFromWebViewConfigurationForInstances( - userContentController, - configuration, - ); - return userContentController; - } - - /// Constructs a [WKUserContentController] without creating the associated - /// Objective-C object. - /// - /// This should only be used outside of tests by subclasses created by this - /// library or to create a copy for an InstanceManager. - WKUserContentController.detached({ - super.observeValue, - super.binaryMessenger, - super.instanceManager, - }) : _userContentControllerApi = WKUserContentControllerHostApiImpl( - binaryMessenger: binaryMessenger, - instanceManager: instanceManager, - ), - super.detached(); - - final WKUserContentControllerHostApiImpl _userContentControllerApi; - - /// Installs a message handler that you can call from your JavaScript code. - /// - /// This name of the parameter must be unique within the user content - /// controller and must not be an empty string. The user content controller - /// uses this parameter to define a JavaScript function for your message - /// handler in the page’s main content world. The name of this function is - /// `window.webkit.messageHandlers..postMessage()`, where - /// `` corresponds to the value of this parameter. For example, if you - /// specify the string `MyFunction`, the user content controller defines the ` - /// `window.webkit.messageHandlers.MyFunction.postMessage()` function in - /// JavaScript. - Future addScriptMessageHandler( - WKScriptMessageHandler handler, - String name, - ) { - assert(name.isNotEmpty); - return _userContentControllerApi.addScriptMessageHandlerForInstances( - this, - handler, - name, - ); - } - - /// Uninstalls the custom message handler with the specified name from your JavaScript code. - /// - /// If no message handler with this name exists in the user content - /// controller, this method does nothing. - /// - /// Use this method to remove a message handler that you previously installed - /// using the [addScriptMessageHandler] method. This method removes the - /// message handler from the page content world. If you installed the message - /// handler in a different content world, this method doesn’t remove it. - Future removeScriptMessageHandler(String name) { - return _userContentControllerApi.removeScriptMessageHandlerForInstances( - this, - name, - ); - } - - /// Uninstalls all custom message handlers associated with the user content - /// controller. - /// - /// Only supported on iOS version 14+. - Future removeAllScriptMessageHandlers() { - return _userContentControllerApi.removeAllScriptMessageHandlersForInstances( - this, - ); - } - - /// Injects the specified script into the webpage’s content. - Future addUserScript(WKUserScript userScript) { - return _userContentControllerApi.addUserScriptForInstances( - this, userScript); - } - - /// Removes all user scripts from the web view. - Future removeAllUserScripts() { - return _userContentControllerApi.removeAllUserScriptsForInstances(this); - } - - @override - WKUserContentController copy() { - return WKUserContentController.detached( - observeValue: observeValue, - binaryMessenger: _userContentControllerApi.binaryMessenger, - instanceManager: _userContentControllerApi.instanceManager, - ); - } -} - -/// A collection of properties that you use to initialize a web view. -/// -/// Wraps [WKWebViewConfiguration](https://developer.apple.com/documentation/webkit/wkwebviewconfiguration?language=objc). -@immutable -class WKWebViewConfiguration extends NSObject { - /// Constructs a [WKWebViewConfiguration]. - WKWebViewConfiguration({ - super.observeValue, - super.binaryMessenger, - super.instanceManager, - }) : _webViewConfigurationApi = WKWebViewConfigurationHostApiImpl( - binaryMessenger: binaryMessenger, - instanceManager: instanceManager, - ), - super.detached() { - // Ensures FlutterApis for the WebKit library are set up. - WebKitFlutterApis.instance.ensureSetUp(); - _webViewConfigurationApi.createForInstances(this); - } - - /// A WKWebViewConfiguration that is owned by webView. - @visibleForTesting - factory WKWebViewConfiguration.fromWebView( - WKWebView webView, { - BinaryMessenger? binaryMessenger, - InstanceManager? instanceManager, - }) { - final WKWebViewConfiguration configuration = - WKWebViewConfiguration.detached( - binaryMessenger: binaryMessenger, - instanceManager: instanceManager, - ); - configuration._webViewConfigurationApi.createFromWebViewForInstances( - configuration, - webView, - ); - return configuration; - } - - /// Constructs a [WKWebViewConfiguration] without creating the associated - /// Objective-C object. - /// - /// This should only be used outside of tests by subclasses created by this - /// library or to create a copy for an InstanceManager. - WKWebViewConfiguration.detached({ - super.observeValue, - super.binaryMessenger, - super.instanceManager, - }) : _webViewConfigurationApi = WKWebViewConfigurationHostApiImpl( - binaryMessenger: binaryMessenger, - instanceManager: instanceManager, - ), - super.detached(); - - late final WKWebViewConfigurationHostApiImpl _webViewConfigurationApi; - - /// Coordinates interactions between your app’s code and the webpage’s scripts and other content. - late final WKUserContentController userContentController = - WKUserContentController.fromWebViewConfiguration( - this, - binaryMessenger: _webViewConfigurationApi.binaryMessenger, - instanceManager: _webViewConfigurationApi.instanceManager, - ); - - /// Manages the preference-related settings for the web view. - late final WKPreferences preferences = WKPreferences.fromWebViewConfiguration( - this, - binaryMessenger: _webViewConfigurationApi.binaryMessenger, - instanceManager: _webViewConfigurationApi.instanceManager, - ); - - /// Used to get and set the site’s cookies and to track the cached data objects. - /// - /// Represents [WKWebViewConfiguration.webSiteDataStore](https://developer.apple.com/documentation/webkit/wkwebviewconfiguration/1395661-websitedatastore?language=objc). - late final WKWebsiteDataStore websiteDataStore = - WKWebsiteDataStore.fromWebViewConfiguration( - this, - binaryMessenger: _webViewConfigurationApi.binaryMessenger, - instanceManager: _webViewConfigurationApi.instanceManager, - ); - - /// Indicates whether HTML5 videos play inline or use the native full-screen controller. - /// - /// Sets [WKWebViewConfiguration.allowsInlineMediaPlayback](https://developer.apple.com/documentation/webkit/wkwebviewconfiguration/1614793-allowsinlinemediaplayback?language=objc). - Future setAllowsInlineMediaPlayback(bool allow) { - return _webViewConfigurationApi.setAllowsInlineMediaPlaybackForInstances( - this, - allow, - ); - } - - /// Indicates whether the web view limits navigation to pages within the app’s domain. - /// - /// When navigation is limited, Javascript evaluation is unrestricted. - /// See https://webkit.org/blog/10882/app-bound-domains/ - /// - /// Sets [WKWebViewConfiguration.limitsNavigationsToAppBoundDomains](https://developer.apple.com/documentation/webkit/wkwebviewconfiguration/3585117-limitsnavigationstoappbounddomai?language=objc). - Future setLimitsNavigationsToAppBoundDomains(bool limit) { - return _webViewConfigurationApi - .setLimitsNavigationsToAppBoundDomainsForInstances( - this, - limit, - ); - } - - /// The media types that require a user gesture to begin playing. - /// - /// Use [WKAudiovisualMediaType.none] to indicate that no user gestures are - /// required to begin playing media. - /// - /// Sets [WKWebViewConfiguration.mediaTypesRequiringUserActionForPlayback](https://developer.apple.com/documentation/webkit/wkwebviewconfiguration/1851524-mediatypesrequiringuseractionfor?language=objc). - Future setMediaTypesRequiringUserActionForPlayback( - Set types, - ) { - assert(types.isNotEmpty); - return _webViewConfigurationApi - .setMediaTypesRequiringUserActionForPlaybackForInstances( - this, - types, - ); - } - - @override - WKWebViewConfiguration copy() { - return WKWebViewConfiguration.detached( - observeValue: observeValue, - binaryMessenger: _webViewConfigurationApi.binaryMessenger, - instanceManager: _webViewConfigurationApi.instanceManager, - ); - } -} - -/// The methods for presenting native user interface elements on behalf of a webpage. -/// -/// Wraps [WKUIDelegate](https://developer.apple.com/documentation/webkit/wkuidelegate?language=objc). -@immutable -class WKUIDelegate extends NSObject { - /// Constructs a [WKUIDelegate]. - WKUIDelegate({ - this.onCreateWebView, - this.requestMediaCapturePermission, - this.runJavaScriptAlertDialog, - this.runJavaScriptConfirmDialog, - this.runJavaScriptTextInputDialog, - super.observeValue, - super.binaryMessenger, - super.instanceManager, - }) : _uiDelegateApi = WKUIDelegateHostApiImpl( - binaryMessenger: binaryMessenger, - instanceManager: instanceManager, - ), - super.detached() { - // Ensures FlutterApis for the WebKit library are set up. - WebKitFlutterApis.instance.ensureSetUp(); - _uiDelegateApi.createForInstances(this); - } - - /// Constructs a [WKUIDelegate] without creating the associated Objective-C - /// object. - /// - /// This should only be used by subclasses created by this library or to - /// create copies. - WKUIDelegate.detached({ - this.onCreateWebView, - this.requestMediaCapturePermission, - this.runJavaScriptAlertDialog, - this.runJavaScriptConfirmDialog, - this.runJavaScriptTextInputDialog, - super.observeValue, - super.binaryMessenger, - super.instanceManager, - }) : _uiDelegateApi = WKUIDelegateHostApiImpl( - binaryMessenger: binaryMessenger, - instanceManager: instanceManager, - ), - super.detached(); - - final WKUIDelegateHostApiImpl _uiDelegateApi; - - /// Indicates a new [WKWebView] was requested to be created with [configuration]. - /// - /// {@macro webview_flutter_wkwebview.foundation.callbacks} - final void Function( - WKWebView webView, - WKWebViewConfiguration configuration, - WKNavigationAction navigationAction, - )? onCreateWebView; - - /// Determines whether a web resource, which the security origin object - /// describes, can gain access to the device’s microphone audio and camera - /// video. - final Future Function( - WKUIDelegate instance, - WKWebView webView, - WKSecurityOrigin origin, - WKFrameInfo frame, - WKMediaCaptureType type, - )? requestMediaCapturePermission; - - /// Notifies the host application that the web page - /// wants to display a JavaScript alert() dialog. - final Future Function(String message, WKFrameInfo frame)? - runJavaScriptAlertDialog; - - /// Notifies the host application that the web page - /// wants to display a JavaScript confirm() dialog. - final Future Function(String message, WKFrameInfo frame)? - runJavaScriptConfirmDialog; - - /// Notifies the host application that the web page - /// wants to display a JavaScript prompt() dialog. - final Future Function( - String prompt, String defaultText, WKFrameInfo frame)? - runJavaScriptTextInputDialog; - - @override - WKUIDelegate copy() { - return WKUIDelegate.detached( - onCreateWebView: onCreateWebView, - requestMediaCapturePermission: requestMediaCapturePermission, - runJavaScriptAlertDialog: runJavaScriptAlertDialog, - runJavaScriptConfirmDialog: runJavaScriptConfirmDialog, - runJavaScriptTextInputDialog: runJavaScriptTextInputDialog, - observeValue: observeValue, - binaryMessenger: _uiDelegateApi.binaryMessenger, - instanceManager: _uiDelegateApi.instanceManager, - ); - } -} - -/// An object that identifies the origin of a particular resource. -/// -/// Wraps https://developer.apple.com/documentation/webkit/wksecurityorigin?language=objc. -@immutable -class WKSecurityOrigin { - /// Constructs an [WKSecurityOrigin]. - const WKSecurityOrigin({ - required this.host, - required this.port, - required this.protocol, - }); - - /// The security origin’s host. - final String host; - - /// The security origin's port. - final int port; - - /// The security origin's protocol. - final String protocol; -} - -/// Methods for handling navigation changes and tracking navigation requests. -/// -/// Set the methods of the [WKNavigationDelegate] in the object you use to -/// coordinate changes in your web view’s main frame. -/// -/// Wraps [WKNavigationDelegate](https://developer.apple.com/documentation/webkit/wknavigationdelegate?language=objc). -@immutable -class WKNavigationDelegate extends NSObject { - /// Constructs a [WKNavigationDelegate]. - WKNavigationDelegate({ - this.didFinishNavigation, - this.didStartProvisionalNavigation, - this.decidePolicyForNavigationAction, - this.decidePolicyForNavigationResponse, - this.didFailNavigation, - this.didFailProvisionalNavigation, - this.webViewWebContentProcessDidTerminate, - this.didReceiveAuthenticationChallenge, - super.observeValue, - super.binaryMessenger, - super.instanceManager, - }) : _navigationDelegateApi = WKNavigationDelegateHostApiImpl( - binaryMessenger: binaryMessenger, - instanceManager: instanceManager, - ), - super.detached() { - // Ensures FlutterApis for the WebKit library are set up. - WebKitFlutterApis.instance.ensureSetUp(); - _navigationDelegateApi.createForInstances(this); - } - - /// Constructs a [WKNavigationDelegate] without creating the associated - /// Objective-C object. - /// - /// This should only be used outside of tests by subclasses created by this - /// library or to create a copy for an InstanceManager. - WKNavigationDelegate.detached({ - this.didFinishNavigation, - this.didStartProvisionalNavigation, - this.decidePolicyForNavigationAction, - this.decidePolicyForNavigationResponse, - this.didFailNavigation, - this.didFailProvisionalNavigation, - this.webViewWebContentProcessDidTerminate, - this.didReceiveAuthenticationChallenge, - super.observeValue, - super.binaryMessenger, - super.instanceManager, - }) : _navigationDelegateApi = WKNavigationDelegateHostApiImpl( - binaryMessenger: binaryMessenger, - instanceManager: instanceManager, - ), - super.detached(); - - final WKNavigationDelegateHostApiImpl _navigationDelegateApi; - - /// Called when navigation is complete. - /// - /// {@macro webview_flutter_wkwebview.foundation.callbacks} - final void Function(WKWebView webView, String? url)? didFinishNavigation; - - /// Called when navigation from the main frame has started. - /// - /// {@macro webview_flutter_wkwebview.foundation.callbacks} - final void Function(WKWebView webView, String? url)? - didStartProvisionalNavigation; - - /// Called when permission is needed to navigate to new content. - /// - /// {@macro webview_flutter_wkwebview.foundation.callbacks} - final Future Function( - WKWebView webView, - WKNavigationAction navigationAction, - )? decidePolicyForNavigationAction; - - /// Called when permission is needed to navigate to new content. - /// - /// {@macro webview_flutter_wkwebview.foundation.callbacks} - final Future Function( - WKWebView webView, - WKNavigationResponse navigationResponse, - )? decidePolicyForNavigationResponse; - - /// Called when an error occurred during navigation. - /// - /// {@macro webview_flutter_wkwebview.foundation.callbacks} - final void Function(WKWebView webView, NSError error)? didFailNavigation; - - /// Called when an error occurred during the early navigation process. - /// - /// {@macro webview_flutter_wkwebview.foundation.callbacks} - final void Function(WKWebView webView, NSError error)? - didFailProvisionalNavigation; - - /// Called when the web view’s content process was terminated. - /// - /// {@macro webview_flutter_wkwebview.foundation.callbacks} - final void Function(WKWebView webView)? webViewWebContentProcessDidTerminate; - - /// Called when the delegate needs a response to an authentication challenge. - final void Function( - WKWebView webView, - NSUrlAuthenticationChallenge challenge, - void Function( - NSUrlSessionAuthChallengeDisposition disposition, - NSUrlCredential? credential, - ) completionHandler, - )? didReceiveAuthenticationChallenge; - - @override - WKNavigationDelegate copy() { - return WKNavigationDelegate.detached( - didFinishNavigation: didFinishNavigation, - didStartProvisionalNavigation: didStartProvisionalNavigation, - decidePolicyForNavigationAction: decidePolicyForNavigationAction, - decidePolicyForNavigationResponse: decidePolicyForNavigationResponse, - didFailNavigation: didFailNavigation, - didFailProvisionalNavigation: didFailProvisionalNavigation, - webViewWebContentProcessDidTerminate: - webViewWebContentProcessDidTerminate, - didReceiveAuthenticationChallenge: didReceiveAuthenticationChallenge, - observeValue: observeValue, - binaryMessenger: _navigationDelegateApi.binaryMessenger, - instanceManager: _navigationDelegateApi.instanceManager, - ); - } -} - -/// Object that displays interactive web content, such as for an in-app browser. -/// -/// Wraps [WKWebView](https://developer.apple.com/documentation/webkit/wkwebview?language=objc). -/// -/// This is abstract, since iOS and macOS WKWebViews have different -/// implementation details; the concrete implementations are [WKWebViewIOS] and -/// [WKWebViewMacOS]. -@immutable -abstract class WKWebView extends NSObject { - /// Constructs a [WKWebView]. - /// - /// [configuration] contains the configuration details for the web view. This - /// method saves a copy of your configuration object. Changes you make to your - /// original object after calling this method have no effect on the web view’s - /// configuration. For a list of configuration options and their default - /// values, see [WKWebViewConfiguration]. If you didn’t create your web view - /// using the `configuration` parameter, this value uses a default - /// configuration object. - WKWebView( - WKWebViewConfiguration configuration, { - super.observeValue, - super.binaryMessenger, - super.instanceManager, - }) : _webViewApi = WKWebViewHostApiImpl( - binaryMessenger: binaryMessenger, - instanceManager: instanceManager, - ), - super.detached() { - // Ensures FlutterApis for the WebKit library are set up. - WebKitFlutterApis.instance.ensureSetUp(); - _webViewApi.createForInstances(this, configuration); - } - - /// Constructs a [WKWebView] without creating the associated Objective-C - /// object. - /// - /// This should only be used outside of tests by subclasses created by this - /// library or to create a copy for an InstanceManager. - WKWebView.detached({ - super.observeValue, - super.binaryMessenger, - super.instanceManager, - }) : _webViewApi = WKWebViewHostApiImpl( - binaryMessenger: binaryMessenger, - instanceManager: instanceManager, - ), - super.detached(); - - final WKWebViewHostApiImpl _webViewApi; - - /// Contains the configuration details for the web view. - /// - /// Use the object in this property to obtain information about your web - /// view’s configuration. Because this property returns a copy of the - /// configuration object, changes you make to that object don’t affect the web - /// view’s configuration. - /// - /// If you didn’t create your web view with a [WKWebViewConfiguration] this - /// property contains a default configuration object. - late final WKWebViewConfiguration configuration = - WKWebViewConfiguration.fromWebView( - this, - binaryMessenger: _webViewApi.binaryMessenger, - instanceManager: _webViewApi.instanceManager, - ); - - /// Used to integrate custom user interface elements into web view interactions. - /// - /// Sets [WKWebView.UIDelegate](https://developer.apple.com/documentation/webkit/wkwebview/1415009-uidelegate?language=objc). - Future setUIDelegate(WKUIDelegate? delegate) { - return _webViewApi.setUIDelegateForInstances(this, delegate); - } - - /// The object you use to manage navigation behavior for the web view. - /// - /// Sets [WKWebView.navigationDelegate](https://developer.apple.com/documentation/webkit/wkwebview/1414971-navigationdelegate?language=objc). - Future setNavigationDelegate(WKNavigationDelegate? delegate) { - return _webViewApi.setNavigationDelegateForInstances(this, delegate); - } - - /// The URL for the current webpage. - /// - /// Represents [WKWebView.URL](https://developer.apple.com/documentation/webkit/wkwebview/1415005-url?language=objc). - Future getUrl() { - return _webViewApi.getUrlForInstances(this); - } - - /// An estimate of what fraction of the current navigation has been loaded. - /// - /// This value ranges from 0.0 to 1.0. - /// - /// Represents [WKWebView.estimatedProgress](https://developer.apple.com/documentation/webkit/wkwebview/1415007-estimatedprogress?language=objc). - Future getEstimatedProgress() { - return _webViewApi.getEstimatedProgressForInstances(this); - } - - /// Loads the web content referenced by the specified URL request object and navigates to it. - /// - /// Use this method to load a page from a local or network-based URL. For - /// example, you might use it to navigate to a network-based webpage. - Future loadRequest(NSUrlRequest request) { - return _webViewApi.loadRequestForInstances(this, request); - } - - /// Loads the contents of the specified HTML string and navigates to it. - Future loadHtmlString(String string, {String? baseUrl}) { - return _webViewApi.loadHtmlStringForInstances(this, string, baseUrl); - } - - /// Loads the web content from the specified file and navigates to it. - Future loadFileUrl(String url, {required String readAccessUrl}) { - return _webViewApi.loadFileUrlForInstances(this, url, readAccessUrl); - } - - /// Loads the Flutter asset specified in the pubspec.yaml file. - /// - /// This method is not a part of WebKit and is only a Flutter specific helper - /// method. - Future loadFlutterAsset(String key) { - return _webViewApi.loadFlutterAssetForInstances(this, key); - } - - /// Indicates whether there is a valid back item in the back-forward list. - Future canGoBack() { - return _webViewApi.canGoBackForInstances(this); - } - - /// Indicates whether there is a valid forward item in the back-forward list. - Future canGoForward() { - return _webViewApi.canGoForwardForInstances(this); - } - - /// Navigates to the back item in the back-forward list. - Future goBack() { - return _webViewApi.goBackForInstances(this); - } - - /// Navigates to the forward item in the back-forward list. - Future goForward() { - return _webViewApi.goForwardForInstances(this); - } - - /// Reloads the current webpage. - Future reload() { - return _webViewApi.reloadForInstances(this); - } - - /// The page title. - /// - /// Represents [WKWebView.title](https://developer.apple.com/documentation/webkit/wkwebview/1415015-title?language=objc). - Future getTitle() { - return _webViewApi.getTitleForInstances(this); - } - - /// The custom user agent string. - /// - /// Represents [WKWebView.customUserAgent](https://developer.apple.com/documentation/webkit/wkwebview/1414950-customuseragent?language=objc). - Future getCustomUserAgent() { - return _webViewApi.getCustomUserAgentForInstances(this); - } - - /// Indicates whether horizontal swipe gestures trigger page navigation. - /// - /// The default value is false. - /// - /// Sets [WKWebView.allowsBackForwardNavigationGestures](https://developer.apple.com/documentation/webkit/wkwebview/1414995-allowsbackforwardnavigationgestu?language=objc). - Future setAllowsBackForwardNavigationGestures(bool allow) { - return _webViewApi.setAllowsBackForwardNavigationGesturesForInstances( - this, - allow, - ); - } - - /// The custom user agent string. - /// - /// The default value of this property is null. - /// - /// Sets [WKWebView.customUserAgent](https://developer.apple.com/documentation/webkit/wkwebview/1414950-customuseragent?language=objc). - Future setCustomUserAgent(String? userAgent) { - return _webViewApi.setCustomUserAgentForInstances(this, userAgent); - } - - /// Evaluates the specified JavaScript string. - /// - /// Throws a `PlatformException` if an error occurs or return value is not - /// supported. - Future evaluateJavaScript(String javaScriptString) { - return _webViewApi.evaluateJavaScriptForInstances( - this, - javaScriptString, - ); - } - - /// Enables debugging of web contents (HTML / CSS / JavaScript) in the - /// underlying WebView. - /// - /// This flag can be enabled in order to facilitate debugging of web layouts - /// and JavaScript code running inside WebViews. Please refer to [WKWebView](https://developer.apple.com/documentation/webkit/wkwebview?language=objc). - /// documentation for the debugging guide. - /// - /// Starting from macOS version 13.3, iOS version 16.4, and tvOS version 16.4, - /// the default value is set to false. - /// - /// Defaults to true in previous versions. - Future setInspectable(bool inspectable) { - return _webViewApi.setInspectableForInstances( - this, - inspectable, - ); - } -} - -/// The iOS version of a WKWebView. -class WKWebViewIOS extends WKWebView implements UIView { - /// Constructs a new iOS WKWebView; see [WKWebView] for details. - WKWebViewIOS( - super.configuration, { - super.observeValue, - super.binaryMessenger, - super.instanceManager, - }) : _viewApi = UIViewHostApiImpl( - binaryMessenger: binaryMessenger, - instanceManager: instanceManager, - ), - super(); - - /// See [WKWebView.detached]. - WKWebViewIOS.detached({ - super.observeValue, - super.binaryMessenger, - super.instanceManager, - }) : _viewApi = UIViewHostApiImpl( - binaryMessenger: binaryMessenger, - instanceManager: instanceManager, - ), - super.detached(); - - /// The scrollable view associated with the web view. - late final UIScrollView scrollView = UIScrollView.fromWebView( - this, - binaryMessenger: _webViewApi.binaryMessenger, - instanceManager: _webViewApi.instanceManager, - ); - - @override - WKWebView copy() { - return WKWebViewIOS.detached( - observeValue: observeValue, - binaryMessenger: _webViewApi.binaryMessenger, - instanceManager: _webViewApi.instanceManager, - ); - } - - final UIViewHostApiImpl _viewApi; - - // UIView implementations. This is duplicated from the UIViewBase class since - // WKWebView can't inherit from UIView, so this is a workaround to multiple - // inheritance limitations. This is a way of dealing with the lack of - // preprocessor in Dart, which is how the native side has different base - // classes. If the amount of code here grows, this could become a mixin used - // by both UIViewBase and this class (at the cost of exposing the view API - // object, or adjusting files to allow it to stay private). - @override - Future setBackgroundColor(Color? color) { - return _viewApi.setBackgroundColorForInstances(this, color); - } - - @override - Future setOpaque(bool opaque) { - return _viewApi.setOpaqueForInstances(this, opaque); - } -} - -/// The macOS version of a WKWebView. -class WKWebViewMacOS extends WKWebView { - /// Constructs a new macOS WKWebView; see [WKWebView] for details. - WKWebViewMacOS( - super.configuration, { - super.observeValue, - super.binaryMessenger, - super.instanceManager, - }) : super(); - - /// See [WKWebView.detached]. - WKWebViewMacOS.detached({ - super.observeValue, - super.binaryMessenger, - super.instanceManager, - }) : super.detached(); - - @override - WKWebView copy() { - return WKWebViewMacOS.detached( - observeValue: observeValue, - binaryMessenger: _webViewApi.binaryMessenger, - instanceManager: _webViewApi.instanceManager, - ); - } -} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/web_kit/web_kit_api_impls.dart b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/web_kit/web_kit_api_impls.dart deleted file mode 100644 index 1caa1ccc5b0..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/web_kit/web_kit_api_impls.dart +++ /dev/null @@ -1,1213 +0,0 @@ -// 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 'dart:async'; - -import 'package:flutter/foundation.dart'; -import 'package:flutter/services.dart'; - -import '../common/instance_manager.dart'; -import '../common/web_kit.g.dart'; -import '../foundation/foundation.dart'; -import '../ui_kit/ui_kit.dart'; -import '../ui_kit/ui_kit_api_impls.dart'; -import 'web_kit.dart'; - -export '../common/web_kit.g.dart' - show WKMediaCaptureType, WKNavigationType, WKPermissionDecision; - -Iterable _toWKWebsiteDataTypeEnumData( - Iterable types) { - return types.map((WKWebsiteDataType type) { - late final WKWebsiteDataTypeEnum value; - switch (type) { - case WKWebsiteDataType.cookies: - value = WKWebsiteDataTypeEnum.cookies; - case WKWebsiteDataType.memoryCache: - value = WKWebsiteDataTypeEnum.memoryCache; - case WKWebsiteDataType.diskCache: - value = WKWebsiteDataTypeEnum.diskCache; - case WKWebsiteDataType.offlineWebApplicationCache: - value = WKWebsiteDataTypeEnum.offlineWebApplicationCache; - case WKWebsiteDataType.localStorage: - value = WKWebsiteDataTypeEnum.localStorage; - case WKWebsiteDataType.sessionStorage: - value = WKWebsiteDataTypeEnum.sessionStorage; - case WKWebsiteDataType.webSQLDatabases: - value = WKWebsiteDataTypeEnum.webSQLDatabases; - case WKWebsiteDataType.indexedDBDatabases: - value = WKWebsiteDataTypeEnum.indexedDBDatabases; - } - - return WKWebsiteDataTypeEnumData(value: value); - }); -} - -extension _NSHttpCookieConverter on NSHttpCookie { - NSHttpCookieData toNSHttpCookieData() { - final Iterable keys = properties.keys; - return NSHttpCookieData( - propertyKeys: keys.map( - (NSHttpCookiePropertyKey key) { - return key.toNSHttpCookiePropertyKeyEnumData(); - }, - ).toList(), - propertyValues: keys - .map((NSHttpCookiePropertyKey key) => properties[key]!) - .toList(), - ); - } -} - -extension _WKNavigationActionPolicyConverter on WKNavigationActionPolicy { - WKNavigationActionPolicyEnumData toWKNavigationActionPolicyEnumData() { - return WKNavigationActionPolicyEnumData( - value: WKNavigationActionPolicyEnum.values.firstWhere( - (WKNavigationActionPolicyEnum element) => element.name == name, - ), - ); - } -} - -extension _WKNavigationResponsePolicyConverter on WKNavigationResponsePolicy { - WKNavigationResponsePolicyEnum toWKNavigationResponsePolicyEnumData() { - return WKNavigationResponsePolicyEnum.values.firstWhere( - (WKNavigationResponsePolicyEnum element) => element.name == name, - ); - } -} - -extension _NSHttpCookiePropertyKeyConverter on NSHttpCookiePropertyKey { - NSHttpCookiePropertyKeyEnumData toNSHttpCookiePropertyKeyEnumData() { - late final NSHttpCookiePropertyKeyEnum value; - switch (this) { - case NSHttpCookiePropertyKey.comment: - value = NSHttpCookiePropertyKeyEnum.comment; - case NSHttpCookiePropertyKey.commentUrl: - value = NSHttpCookiePropertyKeyEnum.commentUrl; - case NSHttpCookiePropertyKey.discard: - value = NSHttpCookiePropertyKeyEnum.discard; - case NSHttpCookiePropertyKey.domain: - value = NSHttpCookiePropertyKeyEnum.domain; - case NSHttpCookiePropertyKey.expires: - value = NSHttpCookiePropertyKeyEnum.expires; - case NSHttpCookiePropertyKey.maximumAge: - value = NSHttpCookiePropertyKeyEnum.maximumAge; - case NSHttpCookiePropertyKey.name: - value = NSHttpCookiePropertyKeyEnum.name; - case NSHttpCookiePropertyKey.originUrl: - value = NSHttpCookiePropertyKeyEnum.originUrl; - case NSHttpCookiePropertyKey.path: - value = NSHttpCookiePropertyKeyEnum.path; - case NSHttpCookiePropertyKey.port: - value = NSHttpCookiePropertyKeyEnum.port; - case NSHttpCookiePropertyKey.sameSitePolicy: - value = NSHttpCookiePropertyKeyEnum.sameSitePolicy; - case NSHttpCookiePropertyKey.secure: - value = NSHttpCookiePropertyKeyEnum.secure; - case NSHttpCookiePropertyKey.value: - value = NSHttpCookiePropertyKeyEnum.value; - case NSHttpCookiePropertyKey.version: - value = NSHttpCookiePropertyKeyEnum.version; - } - - return NSHttpCookiePropertyKeyEnumData(value: value); - } -} - -extension _WKUserScriptInjectionTimeConverter on WKUserScriptInjectionTime { - WKUserScriptInjectionTimeEnumData toWKUserScriptInjectionTimeEnumData() { - late final WKUserScriptInjectionTimeEnum value; - switch (this) { - case WKUserScriptInjectionTime.atDocumentStart: - value = WKUserScriptInjectionTimeEnum.atDocumentStart; - case WKUserScriptInjectionTime.atDocumentEnd: - value = WKUserScriptInjectionTimeEnum.atDocumentEnd; - } - - return WKUserScriptInjectionTimeEnumData(value: value); - } -} - -Iterable _toWKAudiovisualMediaTypeEnumData( - Iterable types, -) { - return types - .map((WKAudiovisualMediaType type) { - late final WKAudiovisualMediaTypeEnum value; - switch (type) { - case WKAudiovisualMediaType.none: - value = WKAudiovisualMediaTypeEnum.none; - case WKAudiovisualMediaType.audio: - value = WKAudiovisualMediaTypeEnum.audio; - case WKAudiovisualMediaType.video: - value = WKAudiovisualMediaTypeEnum.video; - case WKAudiovisualMediaType.all: - value = WKAudiovisualMediaTypeEnum.all; - } - - return WKAudiovisualMediaTypeEnumData(value: value); - }); -} - -extension _NavigationActionDataConverter on WKNavigationActionData { - WKNavigationAction toNavigationAction() { - return WKNavigationAction( - request: request.toNSUrlRequest(), - targetFrame: targetFrame.toWKFrameInfo(), - navigationType: navigationType, - ); - } -} - -extension _NavigationResponseDataConverter on WKNavigationResponseData { - WKNavigationResponse toNavigationResponse() { - return WKNavigationResponse( - response: response.toNSUrlResponse(), forMainFrame: forMainFrame); - } -} - -extension _WKFrameInfoDataConverter on WKFrameInfoData { - WKFrameInfo toWKFrameInfo() { - return WKFrameInfo( - isMainFrame: isMainFrame, - request: request.toNSUrlRequest(), - ); - } -} - -extension _NSUrlRequestDataConverter on NSUrlRequestData { - NSUrlRequest toNSUrlRequest() { - return NSUrlRequest( - url: url, - httpBody: httpBody, - httpMethod: httpMethod, - allHttpHeaderFields: allHttpHeaderFields.cast(), - ); - } -} - -extension _NSUrlResponseDataConverter on NSHttpUrlResponseData { - NSHttpUrlResponse toNSUrlResponse() { - return NSHttpUrlResponse(statusCode: statusCode); - } -} - -extension _WKNSErrorDataConverter on NSErrorData { - NSError toNSError() { - return NSError( - domain: domain, - code: code, - userInfo: userInfo?.cast() ?? {}, - ); - } -} - -extension _WKScriptMessageDataConverter on WKScriptMessageData { - WKScriptMessage toWKScriptMessage() { - return WKScriptMessage(name: name, body: body); - } -} - -extension _WKUserScriptConverter on WKUserScript { - WKUserScriptData toWKUserScriptData() { - return WKUserScriptData( - source: source, - injectionTime: injectionTime.toWKUserScriptInjectionTimeEnumData(), - isMainFrameOnly: isMainFrameOnly, - ); - } -} - -extension _NSUrlRequestConverter on NSUrlRequest { - NSUrlRequestData toNSUrlRequestData() { - return NSUrlRequestData( - url: url, - httpMethod: httpMethod, - httpBody: httpBody, - allHttpHeaderFields: allHttpHeaderFields, - ); - } -} - -extension _WKSecurityOriginConverter on WKSecurityOriginData { - WKSecurityOrigin toWKSecurityOrigin() { - return WKSecurityOrigin(host: host, port: port, protocol: protocol); - } -} - -/// Handles initialization of Flutter APIs for WebKit. -class WebKitFlutterApis { - /// Constructs a [WebKitFlutterApis]. - @visibleForTesting - WebKitFlutterApis({ - BinaryMessenger? binaryMessenger, - InstanceManager? instanceManager, - }) : _binaryMessenger = binaryMessenger, - navigationDelegate = WKNavigationDelegateFlutterApiImpl( - instanceManager: instanceManager, - ), - scriptMessageHandler = WKScriptMessageHandlerFlutterApiImpl( - instanceManager: instanceManager, - ), - uiDelegate = WKUIDelegateFlutterApiImpl( - instanceManager: instanceManager, - ), - webViewConfiguration = WKWebViewConfigurationFlutterApiImpl( - binaryMessenger: binaryMessenger, - instanceManager: instanceManager, - ), - uiScrollViewDelegate = UIScrollViewDelegateFlutterApiImpl( - instanceManager: instanceManager, - ); - - static WebKitFlutterApis _instance = WebKitFlutterApis(); - - /// Sets the global instance containing the Flutter Apis for the WebKit library. - @visibleForTesting - static set instance(WebKitFlutterApis instance) { - _instance = instance; - } - - /// Global instance containing the Flutter Apis for the WebKit library. - static WebKitFlutterApis get instance { - return _instance; - } - - final BinaryMessenger? _binaryMessenger; - bool _hasBeenSetUp = false; - - /// Flutter Api for [WKNavigationDelegate]. - @visibleForTesting - final WKNavigationDelegateFlutterApiImpl navigationDelegate; - - /// Flutter Api for [WKScriptMessageHandler]. - @visibleForTesting - final WKScriptMessageHandlerFlutterApiImpl scriptMessageHandler; - - /// Flutter Api for [WKUIDelegate]. - @visibleForTesting - final WKUIDelegateFlutterApiImpl uiDelegate; - - /// Flutter Api for [WKWebViewConfiguration]. - @visibleForTesting - final WKWebViewConfigurationFlutterApiImpl webViewConfiguration; - - /// Flutter Api for [UIScrollViewDelegate]. - @visibleForTesting - final UIScrollViewDelegateFlutterApiImpl uiScrollViewDelegate; - - /// Ensures all the Flutter APIs have been set up to receive calls from native code. - void ensureSetUp() { - if (!_hasBeenSetUp) { - WKNavigationDelegateFlutterApi.setUp( - navigationDelegate, - binaryMessenger: _binaryMessenger, - ); - WKScriptMessageHandlerFlutterApi.setUp( - scriptMessageHandler, - binaryMessenger: _binaryMessenger, - ); - WKUIDelegateFlutterApi.setUp( - uiDelegate, - binaryMessenger: _binaryMessenger, - ); - WKWebViewConfigurationFlutterApi.setUp( - webViewConfiguration, - binaryMessenger: _binaryMessenger, - ); - UIScrollViewDelegateFlutterApi.setUp(uiScrollViewDelegate, - binaryMessenger: _binaryMessenger); - _hasBeenSetUp = true; - } - } -} - -/// Host api implementation for [WKWebSiteDataStore]. -class WKWebsiteDataStoreHostApiImpl extends WKWebsiteDataStoreHostApi { - /// Constructs a [WebsiteDataStoreHostApiImpl]. - WKWebsiteDataStoreHostApiImpl({ - this.binaryMessenger, - InstanceManager? instanceManager, - }) : instanceManager = instanceManager ?? NSObject.globalInstanceManager, - super(binaryMessenger: binaryMessenger); - - /// Sends binary data across the Flutter platform barrier. - /// - /// If it is null, the default BinaryMessenger will be used which routes to - /// the host platform. - final BinaryMessenger? binaryMessenger; - - /// Maintains instances stored to communicate with Objective-C objects. - final InstanceManager instanceManager; - - /// Calls [createFromWebViewConfiguration] with the ids of the provided object instances. - Future createFromWebViewConfigurationForInstances( - WKWebsiteDataStore instance, - WKWebViewConfiguration configuration, - ) { - return createFromWebViewConfiguration( - instanceManager.addDartCreatedInstance(instance), - instanceManager.getIdentifier(configuration)!, - ); - } - - /// Calls [createDefaultDataStore] with the ids of the provided object instances. - Future createDefaultDataStoreForInstances( - WKWebsiteDataStore instance, - ) { - return createDefaultDataStore( - instanceManager.addDartCreatedInstance(instance), - ); - } - - /// Calls [removeDataOfTypes] with the ids of the provided object instances. - Future removeDataOfTypesForInstances( - WKWebsiteDataStore instance, - Set dataTypes, { - required double secondsModifiedSinceEpoch, - }) { - return removeDataOfTypes( - instanceManager.getIdentifier(instance)!, - _toWKWebsiteDataTypeEnumData(dataTypes).toList(), - secondsModifiedSinceEpoch, - ); - } -} - -/// Host api implementation for [WKScriptMessageHandler]. -class WKScriptMessageHandlerHostApiImpl extends WKScriptMessageHandlerHostApi { - /// Constructs a [WKScriptMessageHandlerHostApiImpl]. - WKScriptMessageHandlerHostApiImpl({ - this.binaryMessenger, - InstanceManager? instanceManager, - }) : instanceManager = instanceManager ?? NSObject.globalInstanceManager, - super(binaryMessenger: binaryMessenger); - - /// Sends binary data across the Flutter platform barrier. - /// - /// If it is null, the default BinaryMessenger will be used which routes to - /// the host platform. - final BinaryMessenger? binaryMessenger; - - /// Maintains instances stored to communicate with Objective-C objects. - final InstanceManager instanceManager; - - /// Calls [create] with the ids of the provided object instances. - Future createForInstances(WKScriptMessageHandler instance) { - return create(instanceManager.addDartCreatedInstance(instance)); - } -} - -/// Flutter api implementation for [WKScriptMessageHandler]. -class WKScriptMessageHandlerFlutterApiImpl - extends WKScriptMessageHandlerFlutterApi { - /// Constructs a [WKScriptMessageHandlerFlutterApiImpl]. - WKScriptMessageHandlerFlutterApiImpl({InstanceManager? instanceManager}) - : instanceManager = instanceManager ?? NSObject.globalInstanceManager; - - /// Maintains instances stored to communicate with native language objects. - final InstanceManager instanceManager; - - WKScriptMessageHandler _getHandler(int identifier) { - return instanceManager.getInstanceWithWeakReference(identifier)!; - } - - @override - void didReceiveScriptMessage( - int identifier, - int userContentControllerIdentifier, - WKScriptMessageData message, - ) { - _getHandler(identifier).didReceiveScriptMessage( - instanceManager.getInstanceWithWeakReference( - userContentControllerIdentifier, - )! as WKUserContentController, - message.toWKScriptMessage(), - ); - } -} - -/// Host api implementation for [WKPreferences]. -class WKPreferencesHostApiImpl extends WKPreferencesHostApi { - /// Constructs a [WKPreferencesHostApiImpl]. - WKPreferencesHostApiImpl({ - this.binaryMessenger, - InstanceManager? instanceManager, - }) : instanceManager = instanceManager ?? NSObject.globalInstanceManager, - super(binaryMessenger: binaryMessenger); - - /// Sends binary data across the Flutter platform barrier. - /// - /// If it is null, the default BinaryMessenger will be used which routes to - /// the host platform. - final BinaryMessenger? binaryMessenger; - - /// Maintains instances stored to communicate with Objective-C objects. - final InstanceManager instanceManager; - - /// Calls [createFromWebViewConfiguration] with the ids of the provided object instances. - Future createFromWebViewConfigurationForInstances( - WKPreferences instance, - WKWebViewConfiguration configuration, - ) { - return createFromWebViewConfiguration( - instanceManager.addDartCreatedInstance(instance), - instanceManager.getIdentifier(configuration)!, - ); - } - - /// Calls [setJavaScriptEnabled] with the ids of the provided object instances. - Future setJavaScriptEnabledForInstances( - WKPreferences instance, - bool enabled, - ) { - return setJavaScriptEnabled( - instanceManager.getIdentifier(instance)!, - enabled, - ); - } -} - -/// Host api implementation for [WKHttpCookieStore]. -class WKHttpCookieStoreHostApiImpl extends WKHttpCookieStoreHostApi { - /// Constructs a [WKHttpCookieStoreHostApiImpl]. - WKHttpCookieStoreHostApiImpl({ - this.binaryMessenger, - InstanceManager? instanceManager, - }) : instanceManager = instanceManager ?? NSObject.globalInstanceManager, - super(binaryMessenger: binaryMessenger); - - /// Sends binary data across the Flutter platform barrier. - /// - /// If it is null, the default BinaryMessenger will be used which routes to - /// the host platform. - final BinaryMessenger? binaryMessenger; - - /// Maintains instances stored to communicate with Objective-C objects. - final InstanceManager instanceManager; - - /// Calls [createFromWebsiteDataStore] with the ids of the provided object instances. - Future createFromWebsiteDataStoreForInstances( - WKHttpCookieStore instance, - WKWebsiteDataStore dataStore, - ) { - return createFromWebsiteDataStore( - instanceManager.addDartCreatedInstance(instance), - instanceManager.getIdentifier(dataStore)!, - ); - } - - /// Calls [setCookie] with the ids of the provided object instances. - Future setCookieForInstances( - WKHttpCookieStore instance, - NSHttpCookie cookie, - ) { - return setCookie( - instanceManager.getIdentifier(instance)!, - cookie.toNSHttpCookieData(), - ); - } -} - -/// Host api implementation for [WKUserContentController]. -class WKUserContentControllerHostApiImpl - extends WKUserContentControllerHostApi { - /// Constructs a [WKUserContentControllerHostApiImpl]. - WKUserContentControllerHostApiImpl({ - this.binaryMessenger, - InstanceManager? instanceManager, - }) : instanceManager = instanceManager ?? NSObject.globalInstanceManager, - super(binaryMessenger: binaryMessenger); - - /// Sends binary data across the Flutter platform barrier. - /// - /// If it is null, the default BinaryMessenger will be used which routes to - /// the host platform. - final BinaryMessenger? binaryMessenger; - - /// Maintains instances stored to communicate with Objective-C objects. - final InstanceManager instanceManager; - - /// Calls [createFromWebViewConfiguration] with the ids of the provided object instances. - Future createFromWebViewConfigurationForInstances( - WKUserContentController instance, - WKWebViewConfiguration configuration, - ) { - return createFromWebViewConfiguration( - instanceManager.addDartCreatedInstance(instance), - instanceManager.getIdentifier(configuration)!, - ); - } - - /// Calls [addScriptMessageHandler] with the ids of the provided object instances. - Future addScriptMessageHandlerForInstances( - WKUserContentController instance, - WKScriptMessageHandler handler, - String name, - ) { - return addScriptMessageHandler( - instanceManager.getIdentifier(instance)!, - instanceManager.getIdentifier(handler)!, - name, - ); - } - - /// Calls [removeScriptMessageHandler] with the ids of the provided object instances. - Future removeScriptMessageHandlerForInstances( - WKUserContentController instance, - String name, - ) { - return removeScriptMessageHandler( - instanceManager.getIdentifier(instance)!, - name, - ); - } - - /// Calls [removeAllScriptMessageHandlers] with the ids of the provided object instances. - Future removeAllScriptMessageHandlersForInstances( - WKUserContentController instance, - ) { - return removeAllScriptMessageHandlers( - instanceManager.getIdentifier(instance)!, - ); - } - - /// Calls [addUserScript] with the ids of the provided object instances. - Future addUserScriptForInstances( - WKUserContentController instance, - WKUserScript userScript, - ) { - return addUserScript( - instanceManager.getIdentifier(instance)!, - userScript.toWKUserScriptData(), - ); - } - - /// Calls [removeAllUserScripts] with the ids of the provided object instances. - Future removeAllUserScriptsForInstances( - WKUserContentController instance, - ) { - return removeAllUserScripts(instanceManager.getIdentifier(instance)!); - } -} - -/// Host api implementation for [WKWebViewConfiguration]. -class WKWebViewConfigurationHostApiImpl extends WKWebViewConfigurationHostApi { - /// Constructs a [WKWebViewConfigurationHostApiImpl]. - WKWebViewConfigurationHostApiImpl({ - this.binaryMessenger, - InstanceManager? instanceManager, - }) : instanceManager = instanceManager ?? NSObject.globalInstanceManager, - super(binaryMessenger: binaryMessenger); - - /// Sends binary data across the Flutter platform barrier. - /// - /// If it is null, the default BinaryMessenger will be used which routes to - /// the host platform. - final BinaryMessenger? binaryMessenger; - - /// Maintains instances stored to communicate with Objective-C objects. - final InstanceManager instanceManager; - - /// Calls [create] with the ids of the provided object instances. - Future createForInstances(WKWebViewConfiguration instance) { - return create(instanceManager.addDartCreatedInstance(instance)); - } - - /// Calls [createFromWebView] with the ids of the provided object instances. - Future createFromWebViewForInstances( - WKWebViewConfiguration instance, - WKWebView webView, - ) { - return createFromWebView( - instanceManager.addDartCreatedInstance(instance), - instanceManager.getIdentifier(webView)!, - ); - } - - /// Calls [setAllowsInlineMediaPlayback] with the ids of the provided object instances. - Future setAllowsInlineMediaPlaybackForInstances( - WKWebViewConfiguration instance, - bool allow, - ) { - return setAllowsInlineMediaPlayback( - instanceManager.getIdentifier(instance)!, - allow, - ); - } - - /// Calls [setLimitsNavigationsToAppBoundDomains] with the ids of the provided object instances. - Future setLimitsNavigationsToAppBoundDomainsForInstances( - WKWebViewConfiguration instance, - bool limit, - ) { - return setLimitsNavigationsToAppBoundDomains( - instanceManager.getIdentifier(instance)!, - limit, - ); - } - - /// Calls [setMediaTypesRequiringUserActionForPlayback] with the ids of the provided object instances. - Future setMediaTypesRequiringUserActionForPlaybackForInstances( - WKWebViewConfiguration instance, - Set types, - ) { - return setMediaTypesRequiringUserActionForPlayback( - instanceManager.getIdentifier(instance)!, - _toWKAudiovisualMediaTypeEnumData(types).toList(), - ); - } -} - -/// Flutter api implementation for [WKWebViewConfiguration]. -@immutable -class WKWebViewConfigurationFlutterApiImpl - extends WKWebViewConfigurationFlutterApi { - /// Constructs a [WKWebViewConfigurationFlutterApiImpl]. - WKWebViewConfigurationFlutterApiImpl({ - this.binaryMessenger, - InstanceManager? instanceManager, - }) : instanceManager = instanceManager ?? NSObject.globalInstanceManager; - - /// Receives binary data across the Flutter platform barrier. - /// - /// If it is null, the default BinaryMessenger will be used which routes to - /// the host platform. - final BinaryMessenger? binaryMessenger; - - /// Maintains instances stored to communicate with native language objects. - final InstanceManager instanceManager; - - @override - void create(int identifier) { - instanceManager.addHostCreatedInstance( - WKWebViewConfiguration.detached( - binaryMessenger: binaryMessenger, - instanceManager: instanceManager, - ), - identifier, - ); - } -} - -/// Host api implementation for [WKUIDelegate]. -class WKUIDelegateHostApiImpl extends WKUIDelegateHostApi { - /// Constructs a [WKUIDelegateHostApiImpl]. - WKUIDelegateHostApiImpl({ - this.binaryMessenger, - InstanceManager? instanceManager, - }) : instanceManager = instanceManager ?? NSObject.globalInstanceManager, - super(binaryMessenger: binaryMessenger); - - /// Sends binary data across the Flutter platform barrier. - /// - /// If it is null, the default BinaryMessenger will be used which routes to - /// the host platform. - final BinaryMessenger? binaryMessenger; - - /// Maintains instances stored to communicate with Objective-C objects. - final InstanceManager instanceManager; - - /// Calls [create] with the ids of the provided object instances. - Future createForInstances(WKUIDelegate instance) async { - return create(instanceManager.addDartCreatedInstance(instance)); - } -} - -/// Flutter api implementation for [WKUIDelegate]. -class WKUIDelegateFlutterApiImpl extends WKUIDelegateFlutterApi { - /// Constructs a [WKUIDelegateFlutterApiImpl]. - WKUIDelegateFlutterApiImpl({InstanceManager? instanceManager}) - : instanceManager = instanceManager ?? NSObject.globalInstanceManager; - - /// Maintains instances stored to communicate with native language objects. - final InstanceManager instanceManager; - - WKUIDelegate _getDelegate(int identifier) { - return instanceManager.getInstanceWithWeakReference(identifier)!; - } - - @override - void onCreateWebView( - int identifier, - int webViewIdentifier, - int configurationIdentifier, - WKNavigationActionData navigationAction, - ) { - final void Function(WKWebView, WKWebViewConfiguration, WKNavigationAction)? - function = _getDelegate(identifier).onCreateWebView; - function?.call( - instanceManager.getInstanceWithWeakReference(webViewIdentifier)! - as WKWebView, - instanceManager.getInstanceWithWeakReference(configurationIdentifier)! - as WKWebViewConfiguration, - navigationAction.toNavigationAction(), - ); - } - - @override - Future requestMediaCapturePermission( - int identifier, - int webViewIdentifier, - WKSecurityOriginData origin, - WKFrameInfoData frame, - WKMediaCaptureTypeData type, - ) async { - final WKUIDelegate instance = - instanceManager.getInstanceWithWeakReference(identifier)!; - - late final WKPermissionDecision decision; - if (instance.requestMediaCapturePermission != null) { - decision = await instance.requestMediaCapturePermission!( - instance, - instanceManager.getInstanceWithWeakReference(webViewIdentifier)! - as WKWebView, - origin.toWKSecurityOrigin(), - frame.toWKFrameInfo(), - type.value, - ); - } else { - // The default response for iOS is to prompt. See - // https://developer.apple.com/documentation/webkit/wkuidelegate/3763087-webview?language=objc - decision = WKPermissionDecision.prompt; - } - - return WKPermissionDecisionData(value: decision); - } - - @override - Future runJavaScriptAlertPanel( - int identifier, String message, WKFrameInfoData frame) { - final WKUIDelegate instance = - instanceManager.getInstanceWithWeakReference(identifier)!; - return instance.runJavaScriptAlertDialog! - .call(message, frame.toWKFrameInfo()); - } - - @override - Future runJavaScriptConfirmPanel( - int identifier, String message, WKFrameInfoData frame) { - final WKUIDelegate instance = - instanceManager.getInstanceWithWeakReference(identifier)!; - return instance.runJavaScriptConfirmDialog! - .call(message, frame.toWKFrameInfo()); - } - - @override - Future runJavaScriptTextInputPanel(int identifier, String prompt, - String defaultText, WKFrameInfoData frame) { - final WKUIDelegate instance = - instanceManager.getInstanceWithWeakReference(identifier)!; - return instance.runJavaScriptTextInputDialog! - .call(prompt, defaultText, frame.toWKFrameInfo()); - } -} - -/// Host api implementation for [WKNavigationDelegate]. -class WKNavigationDelegateHostApiImpl extends WKNavigationDelegateHostApi { - /// Constructs a [WKNavigationDelegateHostApiImpl]. - WKNavigationDelegateHostApiImpl({ - this.binaryMessenger, - InstanceManager? instanceManager, - }) : instanceManager = instanceManager ?? NSObject.globalInstanceManager, - super(binaryMessenger: binaryMessenger); - - /// Sends binary data across the Flutter platform barrier. - /// - /// If it is null, the default BinaryMessenger will be used which routes to - /// the host platform. - final BinaryMessenger? binaryMessenger; - - /// Maintains instances stored to communicate with Objective-C objects. - final InstanceManager instanceManager; - - /// Calls [create] with the ids of the provided object instances. - Future createForInstances(WKNavigationDelegate instance) async { - return create(instanceManager.addDartCreatedInstance(instance)); - } -} - -/// Flutter api implementation for [WKNavigationDelegate]. -class WKNavigationDelegateFlutterApiImpl - extends WKNavigationDelegateFlutterApi { - /// Constructs a [WKNavigationDelegateFlutterApiImpl]. - WKNavigationDelegateFlutterApiImpl({InstanceManager? instanceManager}) - : instanceManager = instanceManager ?? NSObject.globalInstanceManager; - - /// Maintains instances stored to communicate with native language objects. - final InstanceManager instanceManager; - - WKNavigationDelegate _getDelegate(int identifier) { - return instanceManager.getInstanceWithWeakReference(identifier)!; - } - - @override - void didFinishNavigation( - int identifier, - int webViewIdentifier, - String? url, - ) { - final void Function(WKWebView, String?)? function = - _getDelegate(identifier).didFinishNavigation; - function?.call( - instanceManager.getInstanceWithWeakReference(webViewIdentifier)! - as WKWebView, - url, - ); - } - - @override - Future decidePolicyForNavigationAction( - int identifier, - int webViewIdentifier, - WKNavigationActionData navigationAction, - ) async { - final Future Function( - WKWebView, - WKNavigationAction navigationAction, - )? function = _getDelegate(identifier).decidePolicyForNavigationAction; - - if (function == null) { - return WKNavigationActionPolicyEnumData( - value: WKNavigationActionPolicyEnum.allow, - ); - } - - final WKNavigationActionPolicy policy = await function( - instanceManager.getInstanceWithWeakReference(webViewIdentifier)! - as WKWebView, - navigationAction.toNavigationAction(), - ); - return policy.toWKNavigationActionPolicyEnumData(); - } - - @override - void didFailNavigation( - int identifier, - int webViewIdentifier, - NSErrorData error, - ) { - final void Function(WKWebView, NSError)? function = - _getDelegate(identifier).didFailNavigation; - function?.call( - instanceManager.getInstanceWithWeakReference(webViewIdentifier)! - as WKWebView, - error.toNSError(), - ); - } - - @override - void didFailProvisionalNavigation( - int identifier, - int webViewIdentifier, - NSErrorData error, - ) { - final void Function(WKWebView, NSError)? function = - _getDelegate(identifier).didFailProvisionalNavigation; - function?.call( - instanceManager.getInstanceWithWeakReference(webViewIdentifier)! - as WKWebView, - error.toNSError(), - ); - } - - @override - void didStartProvisionalNavigation( - int identifier, - int webViewIdentifier, - String? url, - ) { - final void Function(WKWebView, String?)? function = - _getDelegate(identifier).didStartProvisionalNavigation; - function?.call( - instanceManager.getInstanceWithWeakReference(webViewIdentifier)! - as WKWebView, - url, - ); - } - - @override - Future decidePolicyForNavigationResponse( - int identifier, - int webViewIdentifier, - WKNavigationResponseData navigationResponse, - ) async { - final Future Function( - WKWebView, - WKNavigationResponse navigationResponse, - )? function = _getDelegate(identifier).decidePolicyForNavigationResponse; - - if (function == null) { - return WKNavigationResponsePolicyEnum.allow; - } - - final WKNavigationResponsePolicy policy = await function( - instanceManager.getInstanceWithWeakReference(webViewIdentifier)! - as WKWebView, - navigationResponse.toNavigationResponse(), - ); - return policy.toWKNavigationResponsePolicyEnumData(); - } - - @override - void webViewWebContentProcessDidTerminate( - int identifier, - int webViewIdentifier, - ) { - final void Function(WKWebView)? function = - _getDelegate(identifier).webViewWebContentProcessDidTerminate; - function?.call( - instanceManager.getInstanceWithWeakReference(webViewIdentifier)! - as WKWebView, - ); - } - - @override - Future didReceiveAuthenticationChallenge( - int identifier, - int webViewIdentifier, - int challengeIdentifier, - ) async { - final void Function( - WKWebView webView, - NSUrlAuthenticationChallenge challenge, - void Function( - NSUrlSessionAuthChallengeDisposition disposition, - NSUrlCredential? credential, - ), - )? function = _getDelegate(identifier).didReceiveAuthenticationChallenge; - - if (function == null) { - return AuthenticationChallengeResponse( - disposition: NSUrlSessionAuthChallengeDisposition.rejectProtectionSpace, - ); - } - - final Completer responseCompleter = - Completer(); - - function.call( - instanceManager.getInstanceWithWeakReference(webViewIdentifier)! - as WKWebView, - instanceManager.getInstanceWithWeakReference(challengeIdentifier)! - as NSUrlAuthenticationChallenge, - ( - NSUrlSessionAuthChallengeDisposition disposition, - NSUrlCredential? credential, - ) { - responseCompleter.complete( - AuthenticationChallengeResponse( - disposition: disposition, - credentialIdentifier: credential != null - ? instanceManager.getIdentifier(credential) - : null, - ), - ); - }, - ); - - return responseCompleter.future; - } -} - -/// Host api implementation for [WKWebView]. -class WKWebViewHostApiImpl extends WKWebViewHostApi { - /// Constructs a [WKWebViewHostApiImpl]. - WKWebViewHostApiImpl({ - this.binaryMessenger, - InstanceManager? instanceManager, - }) : instanceManager = instanceManager ?? NSObject.globalInstanceManager, - super(binaryMessenger: binaryMessenger); - - /// Sends binary data across the Flutter platform barrier. - /// - /// If it is null, the default BinaryMessenger will be used which routes to - /// the host platform. - final BinaryMessenger? binaryMessenger; - - /// Maintains instances stored to communicate with Objective-C objects. - final InstanceManager instanceManager; - - /// Calls [create] with the ids of the provided object instances. - Future createForInstances( - WKWebView instance, - WKWebViewConfiguration configuration, - ) { - return create( - instanceManager.addDartCreatedInstance(instance), - instanceManager.getIdentifier(configuration)!, - ); - } - - /// Calls [loadRequest] with the ids of the provided object instances. - Future loadRequestForInstances( - WKWebView webView, - NSUrlRequest request, - ) { - return loadRequest( - instanceManager.getIdentifier(webView)!, - request.toNSUrlRequestData(), - ); - } - - /// Calls [loadHtmlString] with the ids of the provided object instances. - Future loadHtmlStringForInstances( - WKWebView instance, - String string, - String? baseUrl, - ) { - return loadHtmlString( - instanceManager.getIdentifier(instance)!, - string, - baseUrl, - ); - } - - /// Calls [loadFileUrl] with the ids of the provided object instances. - Future loadFileUrlForInstances( - WKWebView instance, - String url, - String readAccessUrl, - ) { - return loadFileUrl( - instanceManager.getIdentifier(instance)!, - url, - readAccessUrl, - ); - } - - /// Calls [loadFlutterAsset] with the ids of the provided object instances. - Future loadFlutterAssetForInstances(WKWebView instance, String key) { - return loadFlutterAsset( - instanceManager.getIdentifier(instance)!, - key, - ); - } - - /// Calls [canGoBack] with the ids of the provided object instances. - Future canGoBackForInstances(WKWebView instance) { - return canGoBack(instanceManager.getIdentifier(instance)!); - } - - /// Calls [canGoForward] with the ids of the provided object instances. - Future canGoForwardForInstances(WKWebView instance) { - return canGoForward(instanceManager.getIdentifier(instance)!); - } - - /// Calls [goBack] with the ids of the provided object instances. - Future goBackForInstances(WKWebView instance) { - return goBack(instanceManager.getIdentifier(instance)!); - } - - /// Calls [goForward] with the ids of the provided object instances. - Future goForwardForInstances(WKWebView instance) { - return goForward(instanceManager.getIdentifier(instance)!); - } - - /// Calls [reload] with the ids of the provided object instances. - Future reloadForInstances(WKWebView instance) { - return reload(instanceManager.getIdentifier(instance)!); - } - - /// Calls [getUrl] with the ids of the provided object instances. - Future getUrlForInstances(WKWebView instance) { - return getUrl(instanceManager.getIdentifier(instance)!); - } - - /// Calls [getTitle] with the ids of the provided object instances. - Future getTitleForInstances(WKWebView instance) { - return getTitle(instanceManager.getIdentifier(instance)!); - } - - /// Calls [getEstimatedProgress] with the ids of the provided object instances. - Future getEstimatedProgressForInstances(WKWebView instance) { - return getEstimatedProgress(instanceManager.getIdentifier(instance)!); - } - - /// Calls [setAllowsBackForwardNavigationGestures] with the ids of the provided object instances. - Future setAllowsBackForwardNavigationGesturesForInstances( - WKWebView instance, - bool allow, - ) { - return setAllowsBackForwardNavigationGestures( - instanceManager.getIdentifier(instance)!, - allow, - ); - } - - /// Calls [setCustomUserAgent] with the ids of the provided object instances. - Future setCustomUserAgentForInstances( - WKWebView instance, - String? userAgent, - ) { - return setCustomUserAgent( - instanceManager.getIdentifier(instance)!, - userAgent, - ); - } - - /// Calls [evaluateJavaScript] with the ids of the provided object instances. - Future evaluateJavaScriptForInstances( - WKWebView instance, - String javaScriptString, - ) async { - try { - final Object? result = await evaluateJavaScript( - instanceManager.getIdentifier(instance)!, - javaScriptString, - ); - return result; - } on PlatformException catch (exception) { - if (exception.details is! NSErrorData) { - rethrow; - } - - throw PlatformException( - code: exception.code, - message: exception.message, - stacktrace: exception.stacktrace, - details: (exception.details as NSErrorData).toNSError(), - ); - } - } - - /// Calls [setInspectable] with the ids of the provided object instances. - Future setInspectableForInstances( - WKWebView instance, - bool inspectable, - ) async { - return setInspectable( - instanceManager.getIdentifier(instance)!, - inspectable, - ); - } - - /// Calls [getCustomUserAgent] with the ids of the provided object instances. - Future getCustomUserAgentForInstances(WKWebView instance) { - return getCustomUserAgent(instanceManager.getIdentifier(instance)!); - } - - /// Calls [setNavigationDelegate] with the ids of the provided object instances. - Future setNavigationDelegateForInstances( - WKWebView instance, - WKNavigationDelegate? delegate, - ) { - return setNavigationDelegate( - instanceManager.getIdentifier(instance)!, - delegate != null ? instanceManager.getIdentifier(delegate)! : null, - ); - } - - /// Calls [setUIDelegate] with the ids of the provided object instances. - Future setUIDelegateForInstances( - WKWebView instance, - WKUIDelegate? delegate, - ) { - return setUIDelegate( - instanceManager.getIdentifier(instance)!, - delegate != null ? instanceManager.getIdentifier(delegate)! : null, - ); - } -} 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 82277babade..a9ecf777fef 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 @@ -2,147 +2,189 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'dart:io'; - -import 'common/instance_manager.dart'; -import 'foundation/foundation.dart'; -import 'ui_kit/ui_kit.dart'; -import 'web_kit/web_kit.dart'; - -// This convenience method was added because Dart doesn't support constant -// function literals: https://github.com/dart-lang/language/issues/1048. -WKWebsiteDataStore _defaultWebsiteDataStore() => - WKWebsiteDataStore.defaultDataStore; - -// This convenience method was added because Dart doesn't support constant -// function literals: https://github.com/dart-lang/language/issues/1048. -WKWebView _platformWebViewConstructor( - WKWebViewConfiguration configuration, { - void Function( - String keyPath, - NSObject object, - Map change, - )? observeValue, - InstanceManager? instanceManager, -}) { - return Platform.isIOS - ? WKWebViewIOS(configuration, - observeValue: observeValue, instanceManager: instanceManager) - : WKWebViewMacOS(configuration, - observeValue: observeValue, instanceManager: instanceManager); -} +import 'common/platform_webview.dart'; +import 'common/web_kit.g.dart'; -/// Handles constructing objects and calling static methods for the WebKit -/// native library. +/// Handles constructing objects and calling static methods for the Darwin +/// WebKit native library. /// /// This class provides dependency injection for the implementations of the /// platform interface classes. Improving the ease of unit testing and/or -/// overriding the underlying WebKit classes. +/// overriding the underlying Darwin classes. /// -/// By default each function calls the default constructor of the WebKit class -/// it intends to return. +/// By default each function calls the default constructor of the class it +/// intends to return. class WebKitProxy { - /// Constructs a [WebKitProxy]. + /// Constructs an [WebKitProxy]. const WebKitProxy({ - this.createWebView = _platformWebViewConstructor, - this.createWebViewConfiguration = WKWebViewConfiguration.new, - this.createScriptMessageHandler = WKScriptMessageHandler.new, - this.defaultWebsiteDataStore = _defaultWebsiteDataStore, - this.createNavigationDelegate = WKNavigationDelegate.new, - this.createUIDelegate = WKUIDelegate.new, - this.createUIScrollViewDelegate = UIScrollViewDelegate.new, + this.newURLRequest = URLRequest.new, + this.newWKUserScript = WKUserScript.new, + this.newHTTPCookie = HTTPCookie.new, + this.newAuthenticationChallengeResponse = + AuthenticationChallengeResponse.new, + this.newWKWebViewConfiguration = WKWebViewConfiguration.new, + this.newWKScriptMessageHandler = WKScriptMessageHandler.new, + this.newWKNavigationDelegate = WKNavigationDelegate.new, + this.newNSObject = NSObject.new, + this.newPlatformWebView = PlatformWebView.new, + this.newWKUIDelegate = WKUIDelegate.new, + this.newUIScrollViewDelegate = UIScrollViewDelegate.new, + this.withUserURLCredential = URLCredential.withUser, + this.defaultDataStoreWKWebsiteDataStore = + _defaultDataStoreWKWebsiteDataStore, }); - /// Constructs a [WKWebView]. - final WKWebView Function( - WKWebViewConfiguration configuration, { - void Function( - String keyPath, - NSObject object, - Map change, - )? observeValue, - InstanceManager? instanceManager, - }) createWebView; + /// Constructs [URLRequest]. + final URLRequest Function({required String url}) newURLRequest; + + /// Constructs [WKUserScript]. + final WKUserScript Function({ + required String source, + required UserScriptInjectionTime injectionTime, + required bool isForMainFrameOnly, + }) newWKUserScript; + + /// Constructs [HTTPCookie]. + final HTTPCookie Function( + {required Map properties}) newHTTPCookie; - /// Constructs a [WKWebViewConfiguration]. - final WKWebViewConfiguration Function({ - InstanceManager? instanceManager, - }) createWebViewConfiguration; + /// Constructs [AuthenticationChallengeResponse]. + final AuthenticationChallengeResponse Function({ + required UrlSessionAuthChallengeDisposition disposition, + URLCredential? credential, + }) newAuthenticationChallengeResponse; - /// Constructs a [WKScriptMessageHandler]. + /// Constructs [WKWebViewConfiguration]. + final WKWebViewConfiguration Function() newWKWebViewConfiguration; + + /// Constructs [WKScriptMessageHandler]. final WKScriptMessageHandler Function({ required void Function( - WKUserContentController userContentController, - WKScriptMessage message, + WKScriptMessageHandler, + WKUserContentController, + WKScriptMessage, ) didReceiveScriptMessage, - }) createScriptMessageHandler; - - /// The default [WKWebsiteDataStore]. - final WKWebsiteDataStore Function() defaultWebsiteDataStore; + }) newWKScriptMessageHandler; - /// Constructs a [WKNavigationDelegate]. + /// Constructs [WKNavigationDelegate]. final WKNavigationDelegate Function({ - void Function(WKWebView webView, String? url)? didFinishNavigation, - void Function(WKWebView webView, String? url)? - didStartProvisionalNavigation, - Future Function( - WKWebView webView, - WKNavigationAction navigationAction, - )? decidePolicyForNavigationAction, - Future Function( - WKWebView webView, - WKNavigationResponse navigationResponse, - )? decidePolicyForNavigationResponse, - void Function(WKWebView webView, NSError error)? didFailNavigation, - void Function(WKWebView webView, NSError error)? - didFailProvisionalNavigation, - void Function(WKWebView webView)? webViewWebContentProcessDidTerminate, void Function( - WKWebView webView, - NSUrlAuthenticationChallenge challenge, - void Function( - NSUrlSessionAuthChallengeDisposition disposition, - NSUrlCredential? credential, - ) completionHandler, - )? didReceiveAuthenticationChallenge, - }) createNavigationDelegate; - - /// Constructs a [WKUIDelegate]. + WKNavigationDelegate, + WKWebView, + String?, + )? didFinishNavigation, + void Function( + WKNavigationDelegate, + WKWebView, + String?, + )? didStartProvisionalNavigation, + required Future Function( + WKNavigationDelegate, + WKWebView, + WKNavigationAction, + ) decidePolicyForNavigationAction, + required Future Function( + WKNavigationDelegate, + WKWebView, + WKNavigationResponse, + ) decidePolicyForNavigationResponse, + void Function( + WKNavigationDelegate, + WKWebView, + NSError, + )? didFailNavigation, + void Function( + WKNavigationDelegate, + WKWebView, + NSError, + )? didFailProvisionalNavigation, + void Function( + WKNavigationDelegate, + WKWebView, + )? webViewWebContentProcessDidTerminate, + required Future> Function( + WKNavigationDelegate, + WKWebView, + URLAuthenticationChallenge, + ) didReceiveAuthenticationChallenge, + }) newWKNavigationDelegate; + + /// Constructs [NSObject]. + final NSObject Function( + {void Function( + NSObject, + String?, + NSObject?, + Map?, + )? observeValue}) newNSObject; + + /// Constructs [PlatformWebView]. + final PlatformWebView Function({ + required WKWebViewConfiguration initialConfiguration, + void Function( + NSObject, + String?, + NSObject?, + Map?, + )? observeValue, + }) newPlatformWebView; + + /// Constructs [WKUIDelegate]. final WKUIDelegate Function({ void Function( - WKWebView webView, - WKWebViewConfiguration configuration, - WKNavigationAction navigationAction, + WKUIDelegate, + WKWebView, + WKWebViewConfiguration, + WKNavigationAction, )? onCreateWebView, - Future Function( - WKUIDelegate instance, - WKWebView webView, - WKSecurityOrigin origin, - WKFrameInfo frame, - WKMediaCaptureType type, - )? requestMediaCapturePermission, + required Future Function( + WKUIDelegate, + WKWebView, + WKSecurityOrigin, + WKFrameInfo, + MediaCaptureType, + ) requestMediaCapturePermission, Future Function( - String message, - WKFrameInfo frame, - )? runJavaScriptAlertDialog, - Future Function( - String message, - WKFrameInfo frame, - )? runJavaScriptConfirmDialog, - Future Function( - String prompt, - String defaultText, - WKFrameInfo frame, - )? runJavaScriptTextInputDialog, - InstanceManager? instanceManager, - }) createUIDelegate; - - /// Constructs a [UIScrollViewDelegate]. + WKUIDelegate, + WKWebView, + String, + WKFrameInfo, + )? runJavaScriptAlertPanel, + required Future Function( + WKUIDelegate, + WKWebView, + String, + WKFrameInfo, + ) runJavaScriptConfirmPanel, + Future Function( + WKUIDelegate, + WKWebView, + String, + String?, + WKFrameInfo, + )? runJavaScriptTextInputPanel, + }) newWKUIDelegate; + + /// Constructs [UIScrollViewDelegate]. final UIScrollViewDelegate Function({ void Function( - UIScrollView scrollView, - double x, - double y, + UIScrollViewDelegate, + UIScrollView, + double, + double, )? scrollViewDidScroll, - }) createUIScrollViewDelegate; + }) newUIScrollViewDelegate; + + /// Constructs [URLCredential]. + final URLCredential Function({ + required String user, + required String password, + required UrlCredentialPersistence persistence, + }) withUserURLCredential; + + /// Calls to [WKWebsiteDataStore.defaultDataStore]. + final WKWebsiteDataStore Function() defaultDataStoreWKWebsiteDataStore; + + static WKWebsiteDataStore _defaultDataStoreWKWebsiteDataStore() => + WKWebsiteDataStore.defaultDataStore; } 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 c93f66587fc..843c73f3de3 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 @@ -4,19 +4,17 @@ import 'dart:async'; import 'dart:convert'; -import 'dart:io'; -import 'dart:math'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:path/path.dart' as path; import 'package:webview_flutter_platform_interface/webview_flutter_platform_interface.dart'; -import 'common/instance_manager.dart'; +import 'common/platform_webview.dart'; import 'common/weak_reference_utils.dart'; -import 'foundation/foundation.dart'; -import 'ui_kit/ui_kit.dart'; -import 'web_kit/web_kit.dart'; +import 'common/web_kit.g.dart'; +import 'common/webkit_constants.dart'; import 'webkit_proxy.dart'; /// Media types that can require a user gesture to begin playing. @@ -29,12 +27,12 @@ enum PlaybackMediaTypes { /// A media type that contains video. video; - WKAudiovisualMediaType _toWKAudiovisualMediaType() { + AudiovisualMediaType _toWKAudiovisualMediaType() { switch (this) { case PlaybackMediaTypes.audio: - return WKAudiovisualMediaType.audio; + return AudiovisualMediaType.audio; case PlaybackMediaTypes.video: - return WKAudiovisualMediaType.video; + return AudiovisualMediaType.video; } } } @@ -52,23 +50,21 @@ class WebKitWebViewControllerCreationParams }, this.allowsInlineMediaPlayback = false, this.limitsNavigationsToAppBoundDomains = false, - @visibleForTesting InstanceManager? instanceManager, - }) : _instanceManager = instanceManager ?? NSObject.globalInstanceManager { - _configuration = webKitProxy.createWebViewConfiguration( - instanceManager: _instanceManager, - ); + @visibleForTesting PigeonInstanceManager? instanceManager, + }) : _instanceManager = instanceManager ?? PigeonInstanceManager.instance { + _configuration = webKitProxy.newWKWebViewConfiguration(); if (mediaTypesRequiringUserAction.isEmpty) { _configuration.setMediaTypesRequiringUserActionForPlayback( - {WKAudiovisualMediaType.none}, + AudiovisualMediaType.none, + ); + } else if (mediaTypesRequiringUserAction.length == 1) { + _configuration.setMediaTypesRequiringUserActionForPlayback( + mediaTypesRequiringUserAction.single._toWKAudiovisualMediaType(), ); } else { _configuration.setMediaTypesRequiringUserActionForPlayback( - mediaTypesRequiringUserAction - .map( - (PlaybackMediaTypes type) => type._toWKAudiovisualMediaType(), - ) - .toSet(), + AudiovisualMediaType.all, ); } _configuration.setAllowsInlineMediaPlayback(allowsInlineMediaPlayback); @@ -96,7 +92,7 @@ class WebKitWebViewControllerCreationParams }, bool allowsInlineMediaPlayback = false, bool limitsNavigationsToAppBoundDomains = false, - @visibleForTesting InstanceManager? instanceManager, + @visibleForTesting PigeonInstanceManager? instanceManager, }) : this( webKitProxy: webKitProxy, mediaTypesRequiringUserAction: mediaTypesRequiringUserAction, @@ -133,7 +129,7 @@ class WebKitWebViewControllerCreationParams // Maintains instances used to communicate with the native objects they // represent. - final InstanceManager _instanceManager; + final PigeonInstanceManager _instanceManager; } /// An implementation of [PlatformWebViewController] with the WebKit api. @@ -145,32 +141,37 @@ class WebKitWebViewController extends PlatformWebViewController { : WebKitWebViewControllerCreationParams .fromPlatformWebViewControllerCreationParams(params)) { _webView.addObserver( - _webView, - keyPath: 'estimatedProgress', - options: { - NSKeyValueObservingOptions.newValue, - }, + _webView.nativeWebView, + 'estimatedProgress', + [KeyValueObservingOptions.newValue], + ); + _webView.addObserver( + _webView.nativeWebView, + 'URL', + [KeyValueObservingOptions.newValue], ); _webView.addObserver( - _webView, - keyPath: 'URL', - options: { - NSKeyValueObservingOptions.newValue, - }, + _webView.nativeWebView, + 'canGoBack', + [KeyValueObservingOptions.newValue], ); final WeakReference weakThis = WeakReference(this); - _uiDelegate = _webKitParams.webKitProxy.createUIDelegate( - instanceManager: _webKitParams._instanceManager, + _uiDelegate = _webKitParams.webKitProxy.newWKUIDelegate( onCreateWebView: ( + _, WKWebView webView, WKWebViewConfiguration configuration, WKNavigationAction navigationAction, ) { - if (!navigationAction.targetFrame.isMainFrame) { - webView.loadRequest(navigationAction.request); + final bool isForMainFrame = + navigationAction.targetFrame?.isMainFrame ?? false; + if (!isForMainFrame) { + PlatformWebView.fromNativeWebView(webView).load( + navigationAction.request, + ); } }, requestMediaCapturePermission: ( @@ -178,7 +179,7 @@ class WebKitWebViewController extends PlatformWebViewController { WKWebView webView, WKSecurityOrigin origin, WKFrameInfo frame, - WKMediaCaptureType type, + MediaCaptureType type, ) async { final void Function(PlatformWebViewPermissionRequest)? callback = weakThis.target?._onPermissionRequestCallback; @@ -186,31 +187,31 @@ class WebKitWebViewController extends PlatformWebViewController { if (callback == null) { // The default response for iOS is to prompt. See // https://developer.apple.com/documentation/webkit/wkuidelegate/3763087-webview?language=objc - return WKPermissionDecision.prompt; + return PermissionDecision.prompt; } else { late final Set types; switch (type) { - case WKMediaCaptureType.camera: + case MediaCaptureType.camera: types = { WebViewPermissionResourceType.camera }; - case WKMediaCaptureType.cameraAndMicrophone: + case MediaCaptureType.cameraAndMicrophone: types = { WebViewPermissionResourceType.camera, WebViewPermissionResourceType.microphone }; - case WKMediaCaptureType.microphone: + case MediaCaptureType.microphone: types = { WebViewPermissionResourceType.microphone }; - case WKMediaCaptureType.unknown: + case MediaCaptureType.unknown: // The default response for iOS is to prompt. See // https://developer.apple.com/documentation/webkit/wkuidelegate/3763087-webview?language=objc - return WKPermissionDecision.prompt; + return PermissionDecision.prompt; } - final Completer decisionCompleter = - Completer(); + final Completer decisionCompleter = + Completer(); callback( WebKitWebViewPermissionRequest._( @@ -222,39 +223,58 @@ class WebKitWebViewController extends PlatformWebViewController { return decisionCompleter.future; } }, - runJavaScriptAlertDialog: (String message, WKFrameInfo frame) async { + runJavaScriptAlertPanel: ( + _, + __, + String message, + WKFrameInfo frame, + ) async { final Future Function(JavaScriptAlertDialogRequest request)? callback = weakThis.target?._onJavaScriptAlertDialog; if (callback != null) { final JavaScriptAlertDialogRequest request = JavaScriptAlertDialogRequest( - message: message, url: frame.request.url); + message: message, + url: await frame.request?.getUrl() ?? '', + ); await callback.call(request); return; } }, - runJavaScriptConfirmDialog: (String message, WKFrameInfo frame) async { + runJavaScriptConfirmPanel: ( + _, + __, + String message, + WKFrameInfo frame, + ) async { final Future Function(JavaScriptConfirmDialogRequest request)? callback = weakThis.target?._onJavaScriptConfirmDialog; if (callback != null) { final JavaScriptConfirmDialogRequest request = JavaScriptConfirmDialogRequest( - message: message, url: frame.request.url); + message: message, + url: await frame.request?.getUrl() ?? '', + ); final bool result = await callback.call(request); return result; } return false; }, - runJavaScriptTextInputDialog: - (String prompt, String defaultText, WKFrameInfo frame) async { + runJavaScriptTextInputPanel: ( + _, + __, + String prompt, + String? defaultText, + WKFrameInfo frame, + ) async { final Future Function(JavaScriptTextInputDialogRequest request)? callback = weakThis.target?._onJavaScriptTextInputDialog; if (callback != null) { final JavaScriptTextInputDialogRequest request = JavaScriptTextInputDialogRequest( message: prompt, - url: frame.request.url, + url: await frame.request?.getUrl() ?? '', defaultText: defaultText); final String result = await callback.call(request); return result; @@ -268,18 +288,20 @@ class WebKitWebViewController extends PlatformWebViewController { } /// The WebKit WebView being controlled. - late final WKWebView _webView = _webKitParams.webKitProxy.createWebView( - _webKitParams._configuration, + late final PlatformWebView _webView = + _webKitParams.webKitProxy.newPlatformWebView( + initialConfiguration: _webKitParams._configuration, observeValue: withWeakReferenceTo(this, ( WeakReference weakReference, ) { return ( - String keyPath, - NSObject object, - Map change, + _, + String? keyPath, + NSObject? object, + Map? change, ) async { final WebKitWebViewController? controller = weakReference.target; - if (controller == null) { + if (controller == null || change == null) { return; } @@ -289,20 +311,25 @@ class WebKitWebViewController extends PlatformWebViewController { controller._currentNavigationDelegate?._onProgress; if (progressCallback != null) { final double progress = - change[NSKeyValueChangeKey.newValue]! as double; + change[KeyValueChangeKey.newValue]! as double; progressCallback((progress * 100).round()); } case 'URL': final UrlChangeCallback? urlChangeCallback = controller._currentNavigationDelegate?._onUrlChange; if (urlChangeCallback != null) { - final NSUrl? url = change[NSKeyValueChangeKey.newValue] as NSUrl?; + final URL? url = change[KeyValueChangeKey.newValue] as URL?; urlChangeCallback(UrlChange(url: await url?.getAbsoluteString())); } + case 'canGoBack': + if (controller._onCanGoBackChangeCallback != null) { + final bool canGoBack = + change[KeyValueChangeKey.newValue]! as bool; + controller._onCanGoBackChangeCallback!(canGoBack); + } } }; }), - instanceManager: _webKitParams._instanceManager, ); late final WKUIDelegate _uiDelegate; @@ -315,6 +342,7 @@ class WebKitWebViewController extends PlatformWebViewController { bool _zoomEnabled = true; WebKitNavigationDelegate? _currentNavigationDelegate; + void Function(bool)? _onCanGoBackChangeCallback; void Function(JavaScriptConsoleMessage)? _onConsoleMessageCallback; void Function(PlatformWebViewPermissionRequest)? _onPermissionRequestCallback; @@ -339,13 +367,13 @@ class WebKitWebViewController extends PlatformWebViewController { /// See Objective-C method /// `FLTWebViewFlutterPlugin:webViewForIdentifier:withPluginRegistry`. int get webViewIdentifier => - _webKitParams._instanceManager.getIdentifier(_webView)!; + _webKitParams._instanceManager.getIdentifier(_webView.nativeWebView)!; @override Future loadFile(String absoluteFilePath) { return _webView.loadFileUrl( absoluteFilePath, - readAccessUrl: path.dirname(absoluteFilePath), + path.dirname(absoluteFilePath), ); } @@ -357,7 +385,7 @@ class WebKitWebViewController extends PlatformWebViewController { @override Future loadHtmlString(String html, {String? baseUrl}) { - return _webView.loadHtmlString(html, baseUrl: baseUrl); + return _webView.loadHtmlString(html, baseUrl); } @override @@ -368,18 +396,18 @@ class WebKitWebViewController extends PlatformWebViewController { ); } - return _webView.loadRequest(NSUrlRequest( - url: params.uri.toString(), - allHttpHeaderFields: params.headers, - httpMethod: params.method.name, - httpBody: params.body, - )); + return _webView.load( + _webKitParams.webKitProxy.newURLRequest(url: params.uri.toString()) + ..setAllHttpHeaderFields(params.headers) + ..setHttpMethod(params.method.name) + ..setHttpBody(params.body), + ); } @override Future addJavaScriptChannel( JavaScriptChannelParams javaScriptChannelParams, - ) { + ) async { final String channelName = javaScriptChannelParams.name; if (_javaScriptChannelParams.containsKey(channelName)) { throw ArgumentError( @@ -398,16 +426,23 @@ class WebKitWebViewController extends PlatformWebViewController { final String wrapperSource = 'window.${webKitParams.name} = webkit.messageHandlers.${webKitParams.name};'; - final WKUserScript wrapperScript = WKUserScript( - wrapperSource, - WKUserScriptInjectionTime.atDocumentStart, - isMainFrameOnly: false, - ); - _webView.configuration.userContentController.addUserScript(wrapperScript); - return _webView.configuration.userContentController.addScriptMessageHandler( - webKitParams._messageHandler, - webKitParams.name, + final WKUserScript wrapperScript = + _webKitParams.webKitProxy.newWKUserScript( + source: wrapperSource, + injectionTime: UserScriptInjectionTime.atDocumentStart, + isForMainFrameOnly: false, ); + + final WKUserContentController contentController = + await _webView.configuration.getUserContentController(); + + await Future.wait(>[ + contentController.addUserScript(wrapperScript), + contentController.addScriptMessageHandler( + webKitParams._messageHandler, + webKitParams.name, + ), + ]); } @override @@ -438,22 +473,26 @@ class WebKitWebViewController extends PlatformWebViewController { Future reload() => _webView.reload(); @override - Future clearCache() { - return _webView.configuration.websiteDataStore.removeDataOfTypes( - { - WKWebsiteDataType.memoryCache, - WKWebsiteDataType.diskCache, - WKWebsiteDataType.offlineWebApplicationCache, - }, - DateTime.fromMillisecondsSinceEpoch(0), + Future clearCache() async { + final WKWebsiteDataStore dataStore = + await _webView.configuration.getWebsiteDataStore(); + await dataStore.removeDataOfTypes( + [ + WebsiteDataType.memoryCache, + WebsiteDataType.diskCache, + WebsiteDataType.offlineWebApplicationCache, + ], + 0, ); } @override - Future clearLocalStorage() { - return _webView.configuration.websiteDataStore.removeDataOfTypes( - {WKWebsiteDataType.localStorage}, - DateTime.fromMillisecondsSinceEpoch(0), + Future clearLocalStorage() async { + final WKWebsiteDataStore dataStore = + await _webView.configuration.getWebsiteDataStore(); + await dataStore.removeDataOfTypes( + [WebsiteDataType.localStorage], + 0, ); } @@ -491,64 +530,21 @@ class WebKitWebViewController extends PlatformWebViewController { @override Future scrollTo(int x, int y) { - final WKWebView webView = _webView; - if (webView is WKWebViewIOS) { - return webView.scrollView.setContentOffset(Point( - x.toDouble(), - y.toDouble(), - )); - } else { - // TODO(stuartmorgan): Investigate doing this via JS instead. - throw UnimplementedError('scrollTo is not implemented on macOS'); - } + // TODO(stuartmorgan): Investigate doing this via on macOS with JS instead. + return _webView.scrollView.setContentOffset(x.toDouble(), y.toDouble()); } @override - Future scrollBy(int x, int y) { - final WKWebView webView = _webView; - if (webView is WKWebViewIOS) { - return webView.scrollView.scrollBy(Point( - x.toDouble(), - y.toDouble(), - )); - } else { - // TODO(stuartmorgan): Investigate doing this via JS instead. - throw UnimplementedError('scrollBy is not implemented on macOS'); - } - } - - @override - Future verticalScrollBarEnabled(bool enabled) { - final WKWebView webView = _webView; - if (webView is WKWebViewIOS) { - return webView.scrollView.verticalScrollBarEnabled(enabled); - } else { - // TODO(stuartmorgan): Investigate doing this via JS instead. - throw UnimplementedError('verticalScrollBarEnabled is not implemented on macOS'); - } - } - - @override - Future horizontalScrollBarEnabled(bool enabled) { - final WKWebView webView = _webView; - if (webView is WKWebViewIOS) { - return webView.scrollView.horizontalScrollBarEnabled(enabled); - } else { - // TODO(stuartmorgan): Investigate doing this via JS instead. - throw UnimplementedError('horizontalScrollBarEnabled is not implemented on macOS'); - } + Future scrollBy(int x, int y) async { + // TODO(stuartmorgan): Investigate doing this via on macOS with JS instead. + return _webView.scrollView.scrollBy(x.toDouble(), y.toDouble()); } @override Future getScrollPosition() async { - final WKWebView webView = _webView; - if (webView is WKWebViewIOS) { - final Point offset = await webView.scrollView.getContentOffset(); - return Offset(offset.x, offset.y); - } else { - // TODO(stuartmorgan): Investigate doing this via JS instead. - throw UnimplementedError('scrollTo is not implemented on macOS'); - } + // TODO(stuartmorgan): Investigate doing this via on macOS with JS instead. + final List position = await _webView.scrollView.getContentOffset(); + return Offset(position[0], position[1]); } /// Whether horizontal swipe gestures trigger page navigation. @@ -558,28 +554,42 @@ class WebKitWebViewController extends PlatformWebViewController { @override Future setBackgroundColor(Color color) { - final WKWebView webView = _webView; - if (webView is WKWebViewIOS) { - return Future.wait(>[ - webView.setOpaque(false), - webView.setBackgroundColor(Colors.transparent), - // This method must be called last. - webView.scrollView.setBackgroundColor(color), - ]); - } else { - // TODO(stuartmorgan): Implement background color support. - throw UnimplementedError( - 'Background color is not yet supported on macOS.'); - } + return Future.wait(>[ + _webView.setOpaque(false), + _webView.setBackgroundColor(Colors.transparent.value), + // This method must be called last. + _webView.scrollView.setBackgroundColor(color.value), + ]); } @override - Future setJavaScriptMode(JavaScriptMode javaScriptMode) { + 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) { case JavaScriptMode.disabled: - return _webView.configuration.preferences.setJavaScriptEnabled(false); + await preferences.setJavaScriptEnabled(false); case JavaScriptMode.unrestricted: - return _webView.configuration.preferences.setJavaScriptEnabled(true); + await preferences.setJavaScriptEnabled(true); } } @@ -610,18 +620,25 @@ class WebKitWebViewController extends PlatformWebViewController { return _webView.setNavigationDelegate(handler._navigationDelegate); } - Future _disableZoom() { - const WKUserScript userScript = WKUserScript( - "var meta = document.createElement('meta');\n" - "meta.name = 'viewport';\n" - "meta.content = 'width=device-width, initial-scale=1.0, maximum-scale=1.0, " - "user-scalable=no';\n" - "var head = document.getElementsByTagName('head')[0];head.appendChild(meta);", - WKUserScriptInjectionTime.atDocumentEnd, - isMainFrameOnly: true, + Future _disableZoom() async { + final WKUserScript userScript = _webKitParams.webKitProxy.newWKUserScript( + source: "var meta = document.createElement('meta');\n" + "meta.name = 'viewport';\n" + "meta.content = 'width=device-width, initial-scale=1.0, maximum-scale=1.0, " + "user-scalable=no';\n" + "var head = document.getElementsByTagName('head')[0];head.appendChild(meta);", + injectionTime: UserScriptInjectionTime.atDocumentEnd, + isForMainFrameOnly: true, ); - return _webView.configuration.userContentController - .addUserScript(userScript); + final WKUserContentController controller = + await _webView.configuration.getUserContentController(); + await controller.addUserScript(userScript); + } + + /// Sets the listener for canGoBack changes. + Future setOnCanGoBackChange( + void Function(bool) onCanGoBackChangeCallback) async { + _onCanGoBackChangeCallback = onCanGoBackChangeCallback; } /// Sets a callback that notifies the host application of any log messages @@ -676,7 +693,7 @@ class WebKitWebViewController extends PlatformWebViewController { return _injectConsoleOverride(); } - Future _injectConsoleOverride() { + Future _injectConsoleOverride() async { // Within overrideScript, a series of console output methods such as // console.log will be rewritten to pass the output content to the Flutter // end. @@ -691,8 +708,9 @@ class WebKitWebViewController extends PlatformWebViewController { // the cyclic object is not important, so remove it. // Therefore, the replacer parameter of JSON.stringify() is used and the // removeCyclicObject method is passed in to solve the error. - const WKUserScript overrideScript = WKUserScript( - ''' + final WKUserScript overrideScript = + _webKitParams.webKitProxy.newWKUserScript( + source: ''' var _flutter_webview_plugin_overrides = _flutter_webview_plugin_overrides || { removeCyclicObject: function() { const traversalStack = []; @@ -741,12 +759,13 @@ window.addEventListener("error", function(e) { log("error", e.message + " at " + e.filename + ":" + e.lineno + ":" + e.colno); }); ''', - WKUserScriptInjectionTime.atDocumentStart, - isMainFrameOnly: true, + injectionTime: UserScriptInjectionTime.atDocumentStart, + isForMainFrameOnly: true, ); - return _webView.configuration.userContentController - .addUserScript(overrideScript); + final WKUserContentController controller = + await _webView.configuration.getUserContentController(); + await controller.addUserScript(overrideScript); } // WKWebView does not support removing a single user script, so all user @@ -755,14 +774,14 @@ window.addEventListener("error", function(e) { // workaround could interfere with exposing support for custom scripts from // applications. Future _resetUserScripts({String? removedJavaScriptChannel}) async { - unawaited( - _webView.configuration.userContentController.removeAllUserScripts(), - ); + final WKUserContentController controller = + await _webView.configuration.getUserContentController(); + unawaited(controller.removeAllUserScripts()); // TODO(bparrishMines): This can be replaced with // `removeAllScriptMessageHandlers` once Dart supports runtime version // checking. (e.g. The equivalent to @availability in Objective-C.) _javaScriptChannelParams.keys.forEach( - _webView.configuration.userContentController.removeScriptMessageHandler, + controller.removeScriptMessageHandler, ); final Map remainingChannelParams = Map.from( @@ -794,26 +813,25 @@ window.addEventListener("error", function(e) { @override Future setOnScrollPositionChange( void Function(ScrollPositionChange scrollPositionChange)? - onScrollPositionChange) async { - final WKWebView webView = _webView; - if (webView is WKWebViewIOS) { + onScrollPositionChange) { + if (defaultTargetPlatform == TargetPlatform.iOS) { _onScrollPositionChangeCallback = onScrollPositionChange; if (onScrollPositionChange != null) { final WeakReference weakThis = WeakReference(this); _uiScrollViewDelegate = - _webKitParams.webKitProxy.createUIScrollViewDelegate( - scrollViewDidScroll: (UIScrollView uiScrollView, double x, double y) { + _webKitParams.webKitProxy.newUIScrollViewDelegate( + scrollViewDidScroll: (_, __, double x, double y) { weakThis.target?._onScrollPositionChangeCallback?.call( ScrollPositionChange(x, y), ); }, ); - return webView.scrollView.setDelegate(_uiScrollViewDelegate); + return _webView.scrollView.setDelegate(_uiScrollViewDelegate); } else { _uiScrollViewDelegate = null; - return webView.scrollView.setDelegate(null); + return _webView.scrollView.setDelegate(null); } } else { // TODO(stuartmorgan): Investigate doing this via JS instead. @@ -881,17 +899,19 @@ class WebKitJavaScriptChannelParams extends JavaScriptChannelParams { required super.onMessageReceived, @visibleForTesting WebKitProxy webKitProxy = const WebKitProxy(), }) : assert(name.isNotEmpty), - _messageHandler = webKitProxy.createScriptMessageHandler( + _messageHandler = webKitProxy.newWKScriptMessageHandler( didReceiveScriptMessage: withWeakReferenceTo( onMessageReceived, (WeakReference weakReference) { - return ( - WKUserContentController controller, - WKScriptMessage message, - ) { + return (_, __, WKScriptMessage message) { if (weakReference.target != null) { + // When message.body is null, return '(null)' for consistency + // with previous implementations. weakReference.target!( - JavaScriptMessage(message: message.body!.toString()), + JavaScriptMessage( + message: message.body == null + ? '(null)' + : message.body.toString()), ); } }; @@ -923,14 +943,14 @@ class WebKitWebViewWidgetCreationParams required super.controller, super.layoutDirection, super.gestureRecognizers, - @visibleForTesting InstanceManager? instanceManager, - }) : _instanceManager = instanceManager ?? NSObject.globalInstanceManager; + @visibleForTesting PigeonInstanceManager? instanceManager, + }) : _instanceManager = instanceManager ?? PigeonInstanceManager.instance; /// Constructs a [WebKitWebViewWidgetCreationParams] using a /// [PlatformWebViewWidgetCreationParams]. WebKitWebViewWidgetCreationParams.fromPlatformWebViewWidgetCreationParams( PlatformWebViewWidgetCreationParams params, { - InstanceManager? instanceManager, + PigeonInstanceManager? instanceManager, }) : this( key: params.key, controller: params.controller, @@ -941,7 +961,7 @@ class WebKitWebViewWidgetCreationParams // Maintains instances used to communicate with the native objects they // represent. - final InstanceManager _instanceManager; + final PigeonInstanceManager _instanceManager; @override int get hashCode => Object.hash( @@ -980,7 +1000,7 @@ class WebKitWebViewWidget extends PlatformWebViewWidget { final Key key = _webKitParams.key ?? ValueKey( params as WebKitWebViewWidgetCreationParams); - if (Platform.isMacOS) { + if (defaultTargetPlatform == TargetPlatform.macOS) { return AppKitView( key: key, viewType: 'plugins.flutter.io/webview', @@ -988,7 +1008,8 @@ class WebKitWebViewWidget extends PlatformWebViewWidget { layoutDirection: params.layoutDirection, gestureRecognizers: params.gestureRecognizers, creationParams: _webKitParams._instanceManager.getIdentifier( - (params.controller as WebKitWebViewController)._webView), + (params.controller as WebKitWebViewController)._webView.nativeWebView, + ), creationParamsCodec: const StandardMessageCodec(), ); } else { @@ -999,7 +1020,9 @@ class WebKitWebViewWidget extends PlatformWebViewWidget { layoutDirection: params.layoutDirection, gestureRecognizers: params.gestureRecognizers, creationParams: _webKitParams._instanceManager.getIdentifier( - (params.controller as WebKitWebViewController)._webView), + (params.controller as WebKitWebViewController) + ._webView + .nativeWebView), creationParamsCodec: const StandardMessageCodec(), ); } @@ -1014,7 +1037,10 @@ class WebKitWebResourceError extends WebResourceError { required super.url, }) : super( errorCode: _nsError.code, - description: _nsError.localizedDescription ?? '', + description: + _nsError.userInfo[NSErrorUserInfoKey.NSLocalizedDescription] + as String? ?? + '', errorType: _toWebResourceErrorType(_nsError.code), isForMainFrame: isForMainFrame, ); @@ -1079,53 +1105,56 @@ class WebKitNavigationDelegate extends PlatformNavigationDelegate { _navigationDelegate = (this.params as WebKitNavigationDelegateCreationParams) .webKitProxy - .createNavigationDelegate( - didFinishNavigation: (WKWebView webView, String? url) { + .newWKNavigationDelegate( + didFinishNavigation: (_, __, String? url) { if (weakThis.target?._onPageFinished != null) { weakThis.target!._onPageFinished!(url ?? ''); } }, - didStartProvisionalNavigation: (WKWebView webView, String? url) { + didStartProvisionalNavigation: (_, __, String? url) { if (weakThis.target?._onPageStarted != null) { weakThis.target!._onPageStarted!(url ?? ''); } }, decidePolicyForNavigationResponse: - (WKWebView webView, WKNavigationResponse response) async { + (_, __, WKNavigationResponse response) async { + final URLResponse urlResponse = response.response; if (weakThis.target?._onHttpError != null && - response.response.statusCode >= 400) { + urlResponse is HTTPURLResponse && + urlResponse.statusCode >= 400) { weakThis.target!._onHttpError!( HttpResponseError( response: WebResourceResponse( uri: null, - statusCode: response.response.statusCode, + statusCode: urlResponse.statusCode, ), ), ); } - return WKNavigationResponsePolicy.allow; + return NavigationResponsePolicy.allow; }, decidePolicyForNavigationAction: ( - WKWebView webView, + _, + __, WKNavigationAction action, ) async { if (weakThis.target?._onNavigationRequest != null) { final NavigationDecision decision = await weakThis.target!._onNavigationRequest!(NavigationRequest( - url: action.request.url, - isMainFrame: action.targetFrame.isMainFrame, + url: await action.request.getUrl() ?? '', + isMainFrame: action.targetFrame?.isMainFrame ?? false, )); switch (decision) { case NavigationDecision.prevent: - return WKNavigationActionPolicy.cancel; + return NavigationActionPolicy.cancel; case NavigationDecision.navigate: - return WKNavigationActionPolicy.allow; + return NavigationActionPolicy.allow; } } - return WKNavigationActionPolicy.allow; + return NavigationActionPolicy.allow; }, - didFailNavigation: (WKWebView webView, NSError error) { + didFailNavigation: (_, __, NSError error) { if (weakThis.target?._onWebResourceError != null) { weakThis.target!._onWebResourceError!( WebKitWebResourceError._( @@ -1137,7 +1166,7 @@ class WebKitNavigationDelegate extends PlatformNavigationDelegate { ); } }, - didFailProvisionalNavigation: (WKWebView webView, NSError error) { + didFailProvisionalNavigation: (_, __, NSError error) { if (weakThis.target?._onWebResourceError != null) { weakThis.target!._onWebResourceError!( WebKitWebResourceError._( @@ -1149,14 +1178,15 @@ class WebKitNavigationDelegate extends PlatformNavigationDelegate { ); } }, - webViewWebContentProcessDidTerminate: (WKWebView webView) { + webViewWebContentProcessDidTerminate: (_, __) { if (weakThis.target?._onWebResourceError != null) { weakThis.target!._onWebResourceError!( WebKitWebResourceError._( - const NSError( + NSError.pigeon_detached( code: WKErrorCode.webContentProcessTerminated, // Value from https://developer.apple.com/documentation/webkit/wkerrordomain?language=objc. domain: 'WKErrorDomain', + userInfo: const {}, ), isForMainFrame: true, url: null, @@ -1165,54 +1195,67 @@ class WebKitNavigationDelegate extends PlatformNavigationDelegate { } }, didReceiveAuthenticationChallenge: ( - WKWebView webView, - NSUrlAuthenticationChallenge challenge, - void Function( - NSUrlSessionAuthChallengeDisposition disposition, - NSUrlCredential? credential, - ) completionHandler, - ) { - if (challenge.protectionSpace.authenticationMethod == + _, + __, + URLAuthenticationChallenge challenge, + ) async { + final URLProtectionSpace protectionSpace = + await challenge.getProtectionSpace(); + + final bool isBasicOrNtlm = protectionSpace.authenticationMethod == NSUrlAuthenticationMethod.httpBasic || - challenge.protectionSpace.authenticationMethod == - NSUrlAuthenticationMethod.httpNtlm) { - final void Function(HttpAuthRequest)? callback = - weakThis.target?._onHttpAuthRequest; - final String? host = challenge.protectionSpace.host; - final String? realm = challenge.protectionSpace.realm; - - if (callback != null && host != null) { - callback( - HttpAuthRequest( - onProceed: (WebViewCredential credential) { - completionHandler( - NSUrlSessionAuthChallengeDisposition.useCredential, - NSUrlCredential.withUser( - user: credential.user, - password: credential.password, - persistence: NSUrlCredentialPersistence.session, - ), - ); - }, - onCancel: () { - completionHandler( - NSUrlSessionAuthChallengeDisposition + protectionSpace.authenticationMethod == + NSUrlAuthenticationMethod.httpNtlm; + + final void Function(HttpAuthRequest)? callback = + weakThis.target?._onHttpAuthRequest; + + final WebKitProxy? proxy = + (weakThis.target?.params as WebKitNavigationDelegateCreationParams?) + ?.webKitProxy; + + if (isBasicOrNtlm && callback != null && proxy != null) { + final String host = protectionSpace.host; + final String? realm = protectionSpace.realm; + + final Completer> responseCompleter = + Completer>(); + + callback( + HttpAuthRequest( + host: host, + realm: realm, + onProceed: (WebViewCredential credential) { + responseCompleter.complete( + [ + UrlSessionAuthChallengeDisposition.useCredential, + { + 'user': credential.user, + 'password': credential.password, + 'persistence': UrlCredentialPersistence.forSession, + }, + ], + ); + }, + onCancel: () { + responseCompleter.complete( + [ + UrlSessionAuthChallengeDisposition .cancelAuthenticationChallenge, null, - ); - }, - host: host, - realm: realm, - ), - ); - return; - } + ], + ); + }, + ), + ); + + return responseCompleter.future; } - completionHandler( - NSUrlSessionAuthChallengeDisposition.performDefaultHandling, + return [ + UrlSessionAuthChallengeDisposition.performDefaultHandling, null, - ); + ]; }, ); } @@ -1280,23 +1323,23 @@ class WebKitNavigationDelegate extends PlatformNavigationDelegate { class WebKitWebViewPermissionRequest extends PlatformWebViewPermissionRequest { const WebKitWebViewPermissionRequest._({ required super.types, - required void Function(WKPermissionDecision decision) onDecision, + required void Function(PermissionDecision decision) onDecision, }) : _onDecision = onDecision; - final void Function(WKPermissionDecision) _onDecision; + final void Function(PermissionDecision) _onDecision; @override Future grant() async { - _onDecision(WKPermissionDecision.grant); + _onDecision(PermissionDecision.grant); } @override Future deny() async { - _onDecision(WKPermissionDecision.deny); + _onDecision(PermissionDecision.deny); } /// Prompt the user for permission for the requested resource. Future prompt() async { - _onDecision(WKPermissionDecision.prompt); + _onDecision(PermissionDecision.prompt); } } diff --git a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/webkit_webview_cookie_manager.dart b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/webkit_webview_cookie_manager.dart index 00e97011c55..1350eee52ae 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/webkit_webview_cookie_manager.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/webkit_webview_cookie_manager.dart @@ -5,8 +5,7 @@ import 'package:flutter/foundation.dart'; import 'package:webview_flutter_platform_interface/webview_flutter_platform_interface.dart'; -import 'foundation/foundation.dart'; -import 'web_kit/web_kit.dart'; +import 'common/web_kit.g.dart'; import 'webkit_proxy.dart'; /// Object specifying creation parameters for a [WebKitWebViewCookieManager]. @@ -33,7 +32,7 @@ class WebKitWebViewCookieManagerCreationParams /// Manages stored data for [WKWebView]s. late final WKWebsiteDataStore _websiteDataStore = - webKitProxy.defaultWebsiteDataStore(); + webKitProxy.defaultDataStoreWKWebsiteDataStore(); } /// An implementation of [PlatformWebViewCookieManager] with the WebKit api. @@ -53,8 +52,8 @@ class WebKitWebViewCookieManager extends PlatformWebViewCookieManager { @override Future clearCookies() { return _webkitParams._websiteDataStore.removeDataOfTypes( - {WKWebsiteDataType.cookies}, - DateTime.fromMillisecondsSinceEpoch(0), + [WebsiteDataType.cookies], + 0.0, ); } @@ -67,12 +66,12 @@ class WebKitWebViewCookieManager extends PlatformWebViewCookieManager { } return _webkitParams._websiteDataStore.httpCookieStore.setCookie( - NSHttpCookie.withProperties( - { - NSHttpCookiePropertyKey.name: cookie.name, - NSHttpCookiePropertyKey.value: cookie.value, - NSHttpCookiePropertyKey.domain: cookie.domain, - NSHttpCookiePropertyKey.path: cookie.path, + _webkitParams.webKitProxy.newHTTPCookie( + properties: { + HttpCookiePropertyKey.name: cookie.name, + HttpCookiePropertyKey.value: cookie.value, + HttpCookiePropertyKey.domain: cookie.domain, + HttpCookiePropertyKey.path: cookie.path, }, ), ); 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 c62a0dd2a83..20b74cc72ad 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/pigeons/web_kit.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/pigeons/web_kit.dart @@ -2,1013 +2,1133 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +// ignore_for_file: avoid_unused_constructor_parameters + import 'package:pigeon/pigeon.dart'; @ConfigurePigeon( PigeonOptions( dartOut: 'lib/src/common/web_kit.g.dart', - dartTestOut: 'test/src/common/test_web_kit.g.dart', - objcHeaderOut: - 'darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFGeneratedWebKitApis.h', - objcSourceOut: - 'darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFGeneratedWebKitApis.m', - objcOptions: ObjcOptions( - headerIncludePath: - './include/webview_flutter_wkwebview/FWFGeneratedWebKitApis.h', - prefix: 'FWF', - ), copyrightHeader: 'pigeons/copyright.txt', + swiftOut: + 'darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebKitLibrary.g.swift', ), ) -/// Mirror of NSKeyValueObservingOptions. +/// The values that can be returned in a change dictionary. /// -/// See https://developer.apple.com/documentation/foundation/nskeyvalueobservingoptions?language=objc. -enum NSKeyValueObservingOptionsEnum { +/// See https://developer.apple.com/documentation/foundation/nskeyvalueobservingoptions. +enum KeyValueObservingOptions { + /// Indicates that the change dictionary should provide the new attribute + /// value, if applicable. newValue, + + /// Indicates that the change dictionary should contain the old attribute + /// value, if applicable. oldValue, + + /// If specified, a notification should be sent to the observer immediately, + /// before the observer registration method even returns. initialValue, - priorNotification, -} -// TODO(bparrishMines): Enums need be wrapped in a data class because they can't -// be used as primitive arguments. See https://github.com/flutter/flutter/issues/87307 -class NSKeyValueObservingOptionsEnumData { - late NSKeyValueObservingOptionsEnum value; + /// Whether separate notifications should be sent to the observer before and + /// after each change, instead of a single notification after the change. + priorNotification, } -/// Mirror of NSKeyValueChange. +/// The kinds of changes that can be observed. /// -/// See https://developer.apple.com/documentation/foundation/nskeyvaluechange?language=objc. -enum NSKeyValueChangeEnum { +/// See https://developer.apple.com/documentation/foundation/nskeyvaluechange. +enum KeyValueChange { + /// Indicates that the value of the observed key path was set to a new value. setting, + + /// Indicates that an object has been inserted into the to-many relationship + /// that is being observed. insertion, + + /// Indicates that an object has been removed from the to-many relationship + /// that is being observed. removal, + + /// Indicates that an object has been replaced in the to-many relationship + /// that is being observed. replacement, -} -// TODO(bparrishMines): Enums need be wrapped in a data class because they can't -// be used as primitive arguments. See https://github.com/flutter/flutter/issues/87307 -class NSKeyValueChangeEnumData { - late NSKeyValueChangeEnum value; + /// The value is not recognized by the wrapper. + unknown, } -/// Mirror of NSKeyValueChangeKey. +/// The keys that can appear in the change dictionary. /// -/// See https://developer.apple.com/documentation/foundation/nskeyvaluechangekey?language=objc. -enum NSKeyValueChangeKeyEnum { +/// See https://developer.apple.com/documentation/foundation/nskeyvaluechangekey. +enum KeyValueChangeKey { + /// If the value of the `KeyValueChangeKey.kind` entry is + /// `KeyValueChange.insertion`, `KeyValueChange.removal`, or + /// `KeyValueChange.replacement`, the value of this key is a Set object that + /// contains the indexes of the inserted, removed, or replaced objects. indexes, + + /// An object that contains a value corresponding to one of the + /// `KeyValueChange` enum, indicating what sort of change has occurred. kind, + + /// If the value of the `KeyValueChange.kind` entry is + /// `KeyValueChange.setting, and `KeyValueObservingOptions.newValue` was + /// specified when the observer was registered, the value of this key is the + /// new value for the attribute. newValue, + + /// If the `KeyValueObservingOptions.priorNotification` option was specified + /// when the observer was registered this notification is sent prior to a + /// change. notificationIsPrior, + + /// If the value of the `KeyValueChange.kind` entry is + /// `KeyValueChange.setting`, and `KeyValueObservingOptions.old` was specified + /// when the observer was registered, the value of this key is the value + /// before the attribute was changed. oldValue, - unknown, -} -// TODO(bparrishMines): Enums need be wrapped in a data class because they can't -// be used as primitive arguments. See https://github.com/flutter/flutter/issues/87307 -class NSKeyValueChangeKeyEnumData { - late NSKeyValueChangeKeyEnum value; + /// The value is not recognized by the wrapper. + unknown, } -/// Mirror of WKUserScriptInjectionTime. +/// Constants for the times at which to inject script content into a webpage. /// -/// See https://developer.apple.com/documentation/webkit/wkuserscriptinjectiontime?language=objc. -enum WKUserScriptInjectionTimeEnum { +/// See https://developer.apple.com/documentation/webkit/wkuserscriptinjectiontime. +enum UserScriptInjectionTime { + /// A constant to inject the script after the creation of the webpage’s + /// document element, but before loading any other content. atDocumentStart, + + /// A constant to inject the script after the document finishes loading, but + /// before loading any other subresources. atDocumentEnd, -} -// TODO(bparrishMines): Enums need be wrapped in a data class because they can't -// be used as primitive arguments. See https://github.com/flutter/flutter/issues/87307 -class WKUserScriptInjectionTimeEnumData { - late WKUserScriptInjectionTimeEnum value; + /// The value is not recognized by the wrapper. + unknown, } -/// Mirror of WKAudiovisualMediaTypes. +/// The media types that require a user gesture to begin playing. /// -/// See [WKAudiovisualMediaTypes](https://developer.apple.com/documentation/webkit/wkaudiovisualmediatypes?language=objc). -enum WKAudiovisualMediaTypeEnum { +/// See https://developer.apple.com/documentation/webkit/wkaudiovisualmediatypes. +enum AudiovisualMediaType { + /// No media types require a user gesture to begin playing. none, + + /// Media types that contain audio require a user gesture to begin playing. audio, + + /// Media types that contain video require a user gesture to begin playing. video, - all, -} -// TODO(bparrishMines): Enums need be wrapped in a data class because they can't -// be used as primitive arguments. See https://github.com/flutter/flutter/issues/87307 -class WKAudiovisualMediaTypeEnumData { - late WKAudiovisualMediaTypeEnum value; + /// All media types require a user gesture to begin playing. + all, } -/// Mirror of WKWebsiteDataTypes. +/// A `WKWebsiteDataRecord` object includes these constants in its dataTypes +/// property. /// -/// See https://developer.apple.com/documentation/webkit/wkwebsitedatarecord/data_store_record_types?language=objc. -enum WKWebsiteDataTypeEnum { +/// See https://developer.apple.com/documentation/webkit/wkwebsitedatarecord/data_store_record_types. +enum WebsiteDataType { + /// Cookies. cookies, + + /// In-memory caches. memoryCache, + + /// On-disk caches. diskCache, + + /// HTML offline web app caches. offlineWebApplicationCache, + + /// HTML local storage. localStorage, + + /// HTML session storage. sessionStorage, + + /// WebSQL databases. webSQLDatabases, - indexedDBDatabases, -} -// TODO(bparrishMines): Enums need be wrapped in a data class because they can't -// be used as primitive arguments. See https://github.com/flutter/flutter/issues/87307 -class WKWebsiteDataTypeEnumData { - late WKWebsiteDataTypeEnum value; + /// IndexedDB databases. + indexedDBDatabases, } -/// Mirror of WKNavigationActionPolicy. +/// Constants that indicate whether to allow or cancel navigation to a webpage +/// from an action. /// -/// See https://developer.apple.com/documentation/webkit/wknavigationactionpolicy?language=objc. -enum WKNavigationActionPolicyEnum { +/// See https://developer.apple.com/documentation/webkit/wknavigationactionpolicy. +enum NavigationActionPolicy { + /// Allow the navigation to continue. allow, + + /// Cancel the navigation. cancel, -} -// TODO(bparrishMines): Enums need be wrapped in a data class because they can't -// be used as primitive arguments. See https://github.com/flutter/flutter/issues/87307 -class WKNavigationActionPolicyEnumData { - late WKNavigationActionPolicyEnum value; + /// Allow the download to proceed. + download, } -/// Mirror of WKNavigationResponsePolicy. +/// Constants that indicate whether to allow or cancel navigation to a webpage +/// from a response. /// -/// See https://developer.apple.com/documentation/webkit/wknavigationactionpolicy?language=objc. -enum WKNavigationResponsePolicyEnum { +/// See https://developer.apple.com/documentation/webkit/wknavigationresponsepolicy. +enum NavigationResponsePolicy { + /// Allow the navigation to continue. allow, + + /// Cancel the navigation. cancel, + + /// Allow the download to proceed. + download, } -/// Mirror of NSHTTPCookiePropertyKey. +/// Constants that define the supported keys in a cookie attributes dictionary. /// -/// See https://developer.apple.com/documentation/foundation/nshttpcookiepropertykey. -enum NSHttpCookiePropertyKeyEnum { +/// See https://developer.apple.com/documentation/foundation/httpcookiepropertykey. +enum HttpCookiePropertyKey { + /// A String object containing the comment for the cookie. comment, + + /// An Uri object or String object containing the comment URL for the cookie. commentUrl, + + /// Aa String object stating whether the cookie should be discarded at the end + /// of the session. discard, + + /// An String object containing the domain for the cookie. domain, + + /// An Date object or String object specifying the expiration date for the + /// cookie. expires, + + /// An String object containing an integer value stating how long in seconds + /// the cookie should be kept, at most. maximumAge, + + /// An String object containing the name of the cookie (required). name, + + /// A URL or String object containing the URL that set this cookie. originUrl, + + /// A String object containing the path for the cookie. path, + + /// An String object containing comma-separated integer values specifying the + /// ports for the cookie. port, + + /// A string indicating the same-site policy for the cookie. sameSitePolicy, + + /// A String object indicating that the cookie should be transmitted only over + /// secure channels. secure, + + /// A String object containing the value of the cookie. value, + + /// A String object that specifies the version of the cookie. version, -} -// TODO(bparrishMines): Enums need be wrapped in a data class because they can't -// be used as primitive arguments. See https://github.com/flutter/flutter/issues/87307 -class NSHttpCookiePropertyKeyEnumData { - late NSHttpCookiePropertyKeyEnum value; + /// The value is not recognized by the wrapper. + unknown, } -/// An object that contains information about an action that causes navigation -/// to occur. +/// The type of action that triggered the navigation. /// -/// Wraps [WKNavigationType](https://developer.apple.com/documentation/webkit/wknavigationaction?language=objc). -enum WKNavigationType { +/// See https://developer.apple.com/documentation/webkit/wknavigationtype. +enum NavigationType { /// A link activation. - /// - /// See https://developer.apple.com/documentation/webkit/wknavigationtype/wknavigationtypelinkactivated?language=objc. linkActivated, /// A request to submit a form. - /// - /// See https://developer.apple.com/documentation/webkit/wknavigationtype/wknavigationtypeformsubmitted?language=objc. - submitted, + formSubmitted, /// A request for the frame’s next or previous item. - /// - /// See https://developer.apple.com/documentation/webkit/wknavigationtype/wknavigationtypebackforward?language=objc. backForward, /// A request to reload the webpage. - /// - /// See https://developer.apple.com/documentation/webkit/wknavigationtype/wknavigationtypereload?language=objc. reload, /// A request to resubmit a form. - /// - /// See https://developer.apple.com/documentation/webkit/wknavigationtype/wknavigationtypeformresubmitted?language=objc. formResubmitted, /// A navigation request that originates for some other reason. - /// - /// See https://developer.apple.com/documentation/webkit/wknavigationtype/wknavigationtypeother?language=objc. other, - /// An unknown navigation type. - /// - /// This does not represent an actual value provided by the platform and only - /// indicates a value was provided that isn't currently supported. + /// The value is not recognized by the wrapper. unknown, } /// Possible permission decisions for device resource access. /// -/// See https://developer.apple.com/documentation/webkit/wkpermissiondecision?language=objc. -enum WKPermissionDecision { +/// See https://developer.apple.com/documentation/webkit/wkpermissiondecision. +enum PermissionDecision { /// Deny permission for the requested resource. - /// - /// See https://developer.apple.com/documentation/webkit/wkpermissiondecision/wkpermissiondecisiondeny?language=objc. deny, /// Deny permission for the requested resource. - /// - /// See https://developer.apple.com/documentation/webkit/wkpermissiondecision/wkpermissiondecisiongrant?language=objc. grant, /// Prompt the user for permission for the requested resource. - /// - /// See https://developer.apple.com/documentation/webkit/wkpermissiondecision/wkpermissiondecisionprompt?language=objc. prompt, } -// TODO(bparrishMines): Enums need be wrapped in a data class because they can't -// be used as primitive arguments. See https://github.com/flutter/flutter/issues/87307 -class WKPermissionDecisionData { - late WKPermissionDecision value; -} - /// List of the types of media devices that can capture audio, video, or both. /// -/// See https://developer.apple.com/documentation/webkit/wkmediacapturetype?language=objc. -enum WKMediaCaptureType { +/// See https://developer.apple.com/documentation/webkit/wkmediacapturetype. +enum MediaCaptureType { /// A media device that can capture video. - /// - /// See https://developer.apple.com/documentation/webkit/wkmediacapturetype/wkmediacapturetypecamera?language=objc. camera, /// A media device or devices that can capture audio and video. - /// - /// See https://developer.apple.com/documentation/webkit/wkmediacapturetype/wkmediacapturetypecameraandmicrophone?language=objc. cameraAndMicrophone, /// A media device that can capture audio. - /// - /// See https://developer.apple.com/documentation/webkit/wkmediacapturetype/wkmediacapturetypemicrophone?language=objc. microphone, - /// An unknown media device. - /// - /// This does not represent an actual value provided by the platform and only - /// indicates a value was provided that isn't currently supported. + /// The value is not recognized by the wrapper. unknown, } -// TODO(bparrishMines): Enums need be wrapped in a data class because they can't -// be used as primitive arguments. See https://github.com/flutter/flutter/issues/87307 -class WKMediaCaptureTypeData { - late WKMediaCaptureType value; -} - /// Responses to an authentication challenge. /// -/// See https://developer.apple.com/documentation/foundation/nsurlsessionauthchallengedisposition?language=objc. -enum NSUrlSessionAuthChallengeDisposition { +/// See https://developer.apple.com/documentation/foundation/urlsession/authchallengedisposition. +enum UrlSessionAuthChallengeDisposition { /// Use the specified credential, which may be nil. - /// - /// See https://developer.apple.com/documentation/foundation/nsurlsessionauthchallengedisposition/nsurlsessionauthchallengeusecredential?language=objc. useCredential, /// Use the default handling for the challenge as though this delegate method /// were not implemented. - /// - /// See https://developer.apple.com/documentation/foundation/nsurlsessionauthchallengedisposition/nsurlsessionauthchallengeperformdefaulthandling?language=objc. performDefaultHandling, /// Cancel the entire request. - /// - /// See https://developer.apple.com/documentation/foundation/nsurlsessionauthchallengedisposition/nsurlsessionauthchallengecancelauthenticationchallenge?language=objc. cancelAuthenticationChallenge, /// Reject this challenge, and call the authentication delegate method again /// with the next authentication protection space. - /// - /// See https://developer.apple.com/documentation/foundation/nsurlsessionauthchallengedisposition/nsurlsessionauthchallengerejectprotectionspace?language=objc. rejectProtectionSpace, + + /// The value is not recognized by the wrapper. + unknown, } /// Specifies how long a credential will be kept. -enum NSUrlCredentialPersistence { +/// +/// See https://developer.apple.com/documentation/foundation/nsurlcredentialpersistence. +enum UrlCredentialPersistence { /// The credential should not be stored. - /// - /// See https://developer.apple.com/documentation/foundation/nsurlcredentialpersistence/nsurlcredentialpersistencenone?language=objc. none, /// The credential should be stored only for this session. - /// - /// See https://developer.apple.com/documentation/foundation/nsurlcredentialpersistence/nsurlcredentialpersistenceforsession?language=objc. - session, + forSession, /// The credential should be stored in the keychain. - /// - /// See https://developer.apple.com/documentation/foundation/nsurlcredentialpersistence/nsurlcredentialpersistencepermanent?language=objc. permanent, /// The credential should be stored permanently in the keychain, and in /// addition should be distributed to other devices based on the owning Apple /// ID. - /// - /// See https://developer.apple.com/documentation/foundation/nsurlcredentialpersistence/nsurlcredentialpersistencesynchronizable?language=objc. synchronizable, } -/// Mirror of NSURLRequest. +/// A URL load request that is independent of protocol or URL scheme. /// -/// See https://developer.apple.com/documentation/foundation/nsurlrequest?language=objc. -class NSUrlRequestData { - late String url; - late String? httpMethod; - late Uint8List? httpBody; - late Map allHttpHeaderFields; +/// See https://developer.apple.com/documentation/foundation/urlrequest. +@ProxyApi(swiftOptions: SwiftProxyApiOptions(name: 'URLRequestWrapper')) +abstract class URLRequest extends NSObject { + URLRequest(String url); + + /// The URL being requested. + String? getUrl(); + + /// The HTTP request method. + void setHttpMethod(String? method); + + /// The HTTP request method. + String? getHttpMethod(); + + /// The request body. + void setHttpBody(Uint8List? body); + + /// The request body. + Uint8List? getHttpBody(); + + /// A dictionary containing all of the HTTP header fields for a request. + void setAllHttpHeaderFields(Map? fields); + + /// A dictionary containing all of the HTTP header fields for a request. + Map? getAllHttpHeaderFields(); } -/// Mirror of NSURLResponse. +/// The metadata associated with the response to an HTTP protocol URL load +/// request. /// -/// See https://developer.apple.com/documentation/foundation/nshttpurlresponse?language=objc. -class NSHttpUrlResponseData { +/// See https://developer.apple.com/documentation/foundation/httpurlresponse. +@ProxyApi() +abstract class HTTPURLResponse extends URLResponse { + /// The response’s HTTP status code. late int statusCode; } -/// Mirror of WKUserScript. +/// The metadata associated with the response to a URL load request, independent +/// of protocol and URL scheme. +/// +/// See https://developer.apple.com/documentation/foundation/urlresponse. +@ProxyApi() +abstract class URLResponse extends NSObject {} + +/// A script that the web view injects into a webpage. /// -/// See https://developer.apple.com/documentation/webkit/wkuserscript?language=objc. -class WKUserScriptData { +/// See https://developer.apple.com/documentation/webkit/wkuserscript. +@ProxyApi(swiftOptions: SwiftProxyApiOptions(import: 'WebKit')) +abstract class WKUserScript extends NSObject { + /// Creates a user script object that contains the specified source code and + /// attributes. + WKUserScript(); + + /// The script’s source code. late String source; - late WKUserScriptInjectionTimeEnumData? injectionTime; - late bool isMainFrameOnly; + + /// The time at which to inject the script into the webpage. + late UserScriptInjectionTime injectionTime; + + /// A Boolean value that indicates whether to inject the script into the main + /// frame or all frames. + late bool isForMainFrameOnly; } -/// Mirror of WKNavigationAction. +/// An object that contains information about an action that causes navigation +/// to occur. /// /// See https://developer.apple.com/documentation/webkit/wknavigationaction. -class WKNavigationActionData { - late NSUrlRequestData request; - late WKFrameInfoData targetFrame; - late WKNavigationType navigationType; +@ProxyApi(swiftOptions: SwiftProxyApiOptions(import: 'WebKit')) +abstract class WKNavigationAction extends NSObject { + /// The URL request object associated with the navigation action. + late URLRequest request; + + /// The frame in which to display the new content. + /// + /// If the target of the navigation is a new window, this property is nil. + late WKFrameInfo? targetFrame; + + /// The type of action that triggered the navigation. + late NavigationType navigationType; } -/// Mirror of WKNavigationResponse. +/// An object that contains the response to a navigation request, and which you +/// use to make navigation-related policy decisions. /// /// See https://developer.apple.com/documentation/webkit/wknavigationresponse. -class WKNavigationResponseData { - late NSHttpUrlResponseData response; - late bool forMainFrame; +@ProxyApi(swiftOptions: SwiftProxyApiOptions(import: 'WebKit')) +abstract class WKNavigationResponse extends NSObject { + /// The frame’s response. + late URLResponse response; + + /// A Boolean value that indicates whether the response targets the web view’s + /// main frame. + late bool isForMainFrame; } -/// Mirror of WKFrameInfo. +/// An object that contains information about a frame on a webpage. /// -/// See https://developer.apple.com/documentation/webkit/wkframeinfo?language=objc. -class WKFrameInfoData { +/// See https://developer.apple.com/documentation/webkit/wkframeinfo. +@ProxyApi(swiftOptions: SwiftProxyApiOptions(import: 'WebKit')) +abstract class WKFrameInfo extends NSObject { + /// A Boolean value indicating whether the frame is the web site's main frame + /// or a subframe. late bool isMainFrame; - late NSUrlRequestData request; + + /// The frame’s current request. + late URLRequest? request; } -/// Mirror of NSError. +/// Information about an error condition including a domain, a domain-specific +/// error code, and application-specific information. /// -/// See https://developer.apple.com/documentation/foundation/nserror?language=objc. -class NSErrorData { +/// See https://developer.apple.com/documentation/foundation/nserror. +@ProxyApi() +abstract class NSError extends NSObject { + /// The error code. late int code; + + /// A string containing the error domain. late String domain; - late Map? userInfo; + + /// The user info dictionary. + late Map userInfo; } -/// Mirror of WKScriptMessage. +/// An object that encapsulates a message sent by JavaScript code from a +/// webpage. /// -/// See https://developer.apple.com/documentation/webkit/wkscriptmessage?language=objc. -class WKScriptMessageData { +/// See https://developer.apple.com/documentation/webkit/wkscriptmessage. +@ProxyApi(swiftOptions: SwiftProxyApiOptions(import: 'WebKit')) +abstract class WKScriptMessage extends NSObject { + /// The name of the message handler to which the message is sent. late String name; + + /// The body of the message. late Object? body; } -/// Mirror of WKSecurityOrigin. +/// An object that identifies the origin of a particular resource. /// -/// See https://developer.apple.com/documentation/webkit/wksecurityorigin?language=objc. -class WKSecurityOriginData { +/// See https://developer.apple.com/documentation/webkit/wksecurityorigin. +@ProxyApi(swiftOptions: SwiftProxyApiOptions(import: 'WebKit')) +abstract class WKSecurityOrigin extends NSObject { + /// The security origin’s host. late String host; + + /// The security origin's port. late int port; - late String protocol; -} -/// Mirror of NSHttpCookieData. -/// -/// See https://developer.apple.com/documentation/foundation/nshttpcookie?language=objc. -class NSHttpCookieData { - // TODO(bparrishMines): Change to a map when Objective-C data classes conform - // to `NSCopying`. See https://github.com/flutter/flutter/issues/103383. - // `NSDictionary`s are unable to use data classes as keys because they don't - // conform to `NSCopying`. This splits the map of properties into a list of - // keys and values with the ordered maintained. - late List propertyKeys; - late List propertyValues; + /// The security origin's protocol. + late String securityProtocol; } -/// An object that can represent either a value supported by -/// `StandardMessageCodec`, a data class in this pigeon file, or an identifier -/// of an object stored in an `InstanceManager`. -class ObjectOrIdentifier { - late Object? value; +/// A representation of an HTTP cookie. +/// +/// See https://developer.apple.com/documentation/foundation/httpcookie. +@ProxyApi() +abstract class HTTPCookie extends NSObject { + HTTPCookie(Map properties); - /// Whether value is an int that is used to retrieve an instance stored in an - /// `InstanceManager`. - late bool isIdentifier; + /// The cookie’s properties. + Map? getProperties(); } -class AuthenticationChallengeResponse { - late NSUrlSessionAuthChallengeDisposition disposition; - late int? credentialIdentifier; +/// Response object used to return multiple values to an auth challenge received +/// by a `WKNavigationDelegate` auth challenge. +/// +/// The `webView(_:didReceive:completionHandler:)` method in +/// `WKNavigationDelegate` responds with a completion handler that takes two +/// values. The wrapper returns this class instead to handle this scenario. +@ProxyApi() +abstract class AuthenticationChallengeResponse { + AuthenticationChallengeResponse(); + + /// The option to use to handle the challenge. + late UrlSessionAuthChallengeDisposition disposition; + + /// The credential to use for authentication when the disposition parameter + /// contains the value URLSession.AuthChallengeDisposition.useCredential. + late URLCredential? credential; } -/// Mirror of WKWebsiteDataStore. +/// An object that manages cookies, disk and memory caches, and other types of +/// data for a web view. /// -/// See https://developer.apple.com/documentation/webkit/wkwebsitedatastore?language=objc. -@HostApi(dartHostTestHandler: 'TestWKWebsiteDataStoreHostApi') -abstract class WKWebsiteDataStoreHostApi { - @ObjCSelector( - 'createFromWebViewConfigurationWithIdentifier:configurationIdentifier:', - ) - void createFromWebViewConfiguration( - int identifier, - int configurationIdentifier, - ); - - @ObjCSelector('createDefaultDataStoreWithIdentifier:') - void createDefaultDataStore(int identifier); - - @ObjCSelector( - 'removeDataFromDataStoreWithIdentifier:ofTypes:modifiedSince:', - ) +/// See https://developer.apple.com/documentation/webkit/wkwebsitedatastore. +@ProxyApi(swiftOptions: SwiftProxyApiOptions(import: 'WebKit')) +abstract class WKWebsiteDataStore extends NSObject { + /// The default data store, which stores data persistently to disk. + @static + late WKWebsiteDataStore defaultDataStore; + + /// The object that manages the HTTP cookies for your website. + @attached + late WKHTTPCookieStore httpCookieStore; + + /// Removes the specified types of website data from one or more data records. @async bool removeDataOfTypes( - int identifier, - List dataTypes, + List dataTypes, double modificationTimeInSecondsSinceEpoch, ); } -/// Mirror of UIView. +/// An object that manages the content for a rectangular area on the screen. /// -/// See https://developer.apple.com/documentation/uikit/uiview?language=objc. -@HostApi(dartHostTestHandler: 'TestUIViewHostApi') -abstract class UIViewHostApi { - @ObjCSelector('setBackgroundColorForViewWithIdentifier:toValue:') - void setBackgroundColor(int identifier, int? value); +/// See https://developer.apple.com/documentation/uikit/uiview. +@ProxyApi( + swiftOptions: SwiftProxyApiOptions(import: 'UIKit', supportsMacos: false), +) +abstract class UIView extends NSObject { + /// The view’s background color. + void setBackgroundColor(int? value); - @ObjCSelector('setOpaqueForViewWithIdentifier:isOpaque:') - void setOpaque(int identifier, bool opaque); + /// A Boolean value that determines whether the view is opaque. + void setOpaque(bool opaque); } -/// Mirror of UIScrollView. +/// A view that allows the scrolling and zooming of its contained views. /// -/// See https://developer.apple.com/documentation/uikit/uiscrollview?language=objc. -@HostApi(dartHostTestHandler: 'TestUIScrollViewHostApi') -abstract class UIScrollViewHostApi { - @ObjCSelector('createFromWebViewWithIdentifier:webViewIdentifier:') - void createFromWebView(int identifier, int webViewIdentifier); +/// See https://developer.apple.com/documentation/uikit/uiscrollview. +@ProxyApi( + swiftOptions: SwiftProxyApiOptions(import: 'UIKit', supportsMacos: false), +) +abstract class UIScrollView extends UIView { + /// The point at which the origin of the content view is offset from the + /// origin of the scroll view. + List getContentOffset(); + + /// Move the scrolled position of your view. + /// + /// Convenience method to synchronize change to the x and y scroll position. + void scrollBy(double x, double y); - @ObjCSelector('contentOffsetForScrollViewWithIdentifier:') - List getContentOffset(int identifier); + /// The point at which the origin of the content view is offset from the + /// origin of the scroll view. + void setContentOffset(double x, double y); - @ObjCSelector('scrollByForScrollViewWithIdentifier:x:y:') - void scrollBy(int identifier, double x, double y); + /// The delegate of the scroll view. + void setDelegate(UIScrollViewDelegate? delegate); - @ObjCSelector('verticalScrollBarEnabledForScrollViewWithIdentifier:isEnabled:') - void verticalScrollBarEnabled(int identifier, bool enabled); + /// Whether the scroll view bounces past the edge of content and back again. + void setBounces(bool value); - @ObjCSelector('horizontalScrollBarEnabledForScrollViewWithIdentifier:isEnabled:') - void horizontalScrollBarEnabled(int identifier, bool enabled); + /// Whether the scroll view bounces when it reaches the ends of its horizontal + /// axis. + void setBouncesHorizontally(bool value); - @ObjCSelector('setContentOffsetForScrollViewWithIdentifier:toX:y:') - void setContentOffset(int identifier, double x, double y); + /// Whether the scroll view bounces when it reaches the ends of its vertical + /// axis. + void setBouncesVertically(bool value); - @ObjCSelector( - 'setDelegateForScrollViewWithIdentifier:uiScrollViewDelegateIdentifier:') - void setDelegate(int identifier, int? uiScrollViewDelegateIdentifier); + /// Whether bouncing always occurs when vertical scrolling reaches the end of + /// the content. + /// + /// If the value of this property is true and `bouncesVertically` is true, the + /// scroll view allows vertical dragging even if the content is smaller than + /// the bounds of the scroll view. + void setAlwaysBounceVertical(bool value); + + /// Whether bouncing always occurs when horizontal scrolling reaches the end + /// of the content view. + /// + /// If the value of this property is true and `bouncesHorizontally` is true, + /// the scroll view allows horizontal dragging even if the content is smaller + /// than the bounds of the scroll view. + void setAlwaysBounceHorizontal(bool value); } -/// Mirror of WKWebViewConfiguration. +/// A collection of properties that you use to initialize a web view.. /// -/// See https://developer.apple.com/documentation/webkit/wkwebviewconfiguration?language=objc. -@HostApi(dartHostTestHandler: 'TestWKWebViewConfigurationHostApi') -abstract class WKWebViewConfigurationHostApi { - @ObjCSelector('createWithIdentifier:') - void create(int identifier); +/// See https://developer.apple.com/documentation/webkit/wkwebviewconfiguration. +@ProxyApi(swiftOptions: SwiftProxyApiOptions(import: 'WebKit')) +abstract class WKWebViewConfiguration extends NSObject { + WKWebViewConfiguration(); - @ObjCSelector('createFromWebViewWithIdentifier:webViewIdentifier:') - void createFromWebView(int identifier, int webViewIdentifier); + /// The object that coordinates interactions between your app’s native code + /// and the webpage’s scripts and other content. + void setUserContentController(WKUserContentController controller); - @ObjCSelector( - 'setAllowsInlineMediaPlaybackForConfigurationWithIdentifier:isAllowed:', - ) - void setAllowsInlineMediaPlayback(int identifier, bool allow); + /// The object that coordinates interactions between your app’s native code + /// and the webpage’s scripts and other content. + WKUserContentController getUserContentController(); - @ObjCSelector( - 'setLimitsNavigationsToAppBoundDomainsForConfigurationWithIdentifier:isLimited:', - ) - void setLimitsNavigationsToAppBoundDomains(int identifier, bool limit); + /// The object you use to get and set the site’s cookies and to track the + /// cached data objects. + void setWebsiteDataStore(WKWebsiteDataStore dataStore); - @ObjCSelector( - 'setMediaTypesRequiresUserActionForConfigurationWithIdentifier:forTypes:', - ) - void setMediaTypesRequiringUserActionForPlayback( - int identifier, - List types, - ); -} + /// The object you use to get and set the site’s cookies and to track the + /// cached data objects. + WKWebsiteDataStore getWebsiteDataStore(); -/// Handles callbacks from a WKWebViewConfiguration instance. -/// -/// See https://developer.apple.com/documentation/webkit/wkwebviewconfiguration?language=objc. -@FlutterApi() -abstract class WKWebViewConfigurationFlutterApi { - @ObjCSelector('createWithIdentifier:') - void create(int identifier); -} + /// The object that manages the preference-related settings for the web view. + void setPreferences(WKPreferences preferences); -/// Mirror of WKUserContentController. -/// -/// See https://developer.apple.com/documentation/webkit/wkusercontentcontroller?language=objc. -@HostApi(dartHostTestHandler: 'TestWKUserContentControllerHostApi') -abstract class WKUserContentControllerHostApi { - @ObjCSelector( - 'createFromWebViewConfigurationWithIdentifier:configurationIdentifier:', - ) - void createFromWebViewConfiguration( - int identifier, - int configurationIdentifier, - ); - - @ObjCSelector( - 'addScriptMessageHandlerForControllerWithIdentifier:handlerIdentifier:ofName:', - ) - void addScriptMessageHandler( - int identifier, - int handlerIdentifier, - String name, - ); + /// The object that manages the preference-related settings for the web view. + WKPreferences getPreferences(); - @ObjCSelector('removeScriptMessageHandlerForControllerWithIdentifier:name:') - void removeScriptMessageHandler(int identifier, String name); + /// A Boolean value that indicates whether HTML5 videos play inline or use the + /// native full-screen controller. + void setAllowsInlineMediaPlayback(bool allow); - @ObjCSelector('removeAllScriptMessageHandlersForControllerWithIdentifier:') - void removeAllScriptMessageHandlers(int identifier); + /// A Boolean value that indicates whether the web view limits navigation to + /// pages within the app’s domain. + void setLimitsNavigationsToAppBoundDomains(bool limit); - @ObjCSelector('addUserScriptForControllerWithIdentifier:userScript:') - void addUserScript(int identifier, WKUserScriptData userScript); + /// The media types that require a user gesture to begin playing. + void setMediaTypesRequiringUserActionForPlayback(AudiovisualMediaType type); - @ObjCSelector('removeAllUserScriptsForControllerWithIdentifier:') - void removeAllUserScripts(int identifier); + /// The default preferences to use when loading and rendering content. + WKWebpagePreferences getDefaultWebpagePreferences(); } -/// Mirror of WKUserPreferences. +/// An object for managing interactions between JavaScript code and your web +/// view, and for filtering content in your web view. /// -/// See https://developer.apple.com/documentation/webkit/wkpreferences?language=objc. -@HostApi(dartHostTestHandler: 'TestWKPreferencesHostApi') -abstract class WKPreferencesHostApi { - @ObjCSelector( - 'createFromWebViewConfigurationWithIdentifier:configurationIdentifier:', - ) - void createFromWebViewConfiguration( - int identifier, - int configurationIdentifier, - ); +/// See https://developer.apple.com/documentation/webkit/wkusercontentcontroller. +@ProxyApi(swiftOptions: SwiftProxyApiOptions(import: 'WebKit')) +abstract class WKUserContentController extends NSObject { + /// Installs a message handler that you can call from your JavaScript code. + void addScriptMessageHandler(WKScriptMessageHandler handler, String name); - @ObjCSelector('setJavaScriptEnabledForPreferencesWithIdentifier:isEnabled:') - void setJavaScriptEnabled(int identifier, bool enabled); -} + /// Uninstalls the custom message handler with the specified name from your + /// JavaScript code. + void removeScriptMessageHandler(String name); -/// Mirror of WKScriptMessageHandler. -/// -/// See https://developer.apple.com/documentation/webkit/wkscriptmessagehandler?language=objc. -@HostApi(dartHostTestHandler: 'TestWKScriptMessageHandlerHostApi') -abstract class WKScriptMessageHandlerHostApi { - @ObjCSelector('createWithIdentifier:') - void create(int identifier); + /// Uninstalls all custom message handlers associated with the user content + /// controller. + void removeAllScriptMessageHandlers(); + + /// Injects the specified script into the webpage’s content. + void addUserScript(WKUserScript userScript); + + /// Removes all user scripts from the web view. + void removeAllUserScripts(); } -/// Handles callbacks from a WKScriptMessageHandler instance. +/// An object that encapsulates the standard behaviors to apply to websites. /// -/// See https://developer.apple.com/documentation/webkit/wkscriptmessagehandler?language=objc. -@FlutterApi() -abstract class WKScriptMessageHandlerFlutterApi { - @ObjCSelector( - 'didReceiveScriptMessageForHandlerWithIdentifier:userContentControllerIdentifier:message:', - ) - void didReceiveScriptMessage( - int identifier, - int userContentControllerIdentifier, - WKScriptMessageData message, - ); +/// See https://developer.apple.com/documentation/webkit/wkpreferences. +@ProxyApi(swiftOptions: SwiftProxyApiOptions(import: 'WebKit')) +abstract class WKPreferences extends NSObject { + /// A Boolean value that indicates whether JavaScript is enabled. + void setJavaScriptEnabled(bool enabled); } -/// Mirror of WKNavigationDelegate. +/// An interface for receiving messages from JavaScript code running in a webpage. /// -/// See https://developer.apple.com/documentation/webkit/wknavigationdelegate?language=objc. -@HostApi(dartHostTestHandler: 'TestWKNavigationDelegateHostApi') -abstract class WKNavigationDelegateHostApi { - @ObjCSelector('createWithIdentifier:') - void create(int identifier); +/// See https://developer.apple.com/documentation/webkit/wkscriptmessagehandler. +@ProxyApi(swiftOptions: SwiftProxyApiOptions(import: 'WebKit')) +abstract class WKScriptMessageHandler extends NSObject { + WKScriptMessageHandler(); + + /// Tells the handler that a webpage sent a script message. + late void Function( + WKUserContentController controller, + WKScriptMessage message, + ) didReceiveScriptMessage; } -/// Handles callbacks from a WKNavigationDelegate instance. +/// Methods for accepting or rejecting navigation changes, and for tracking the +/// progress of navigation requests. /// -/// See https://developer.apple.com/documentation/webkit/wknavigationdelegate?language=objc. -@FlutterApi() -abstract class WKNavigationDelegateFlutterApi { - @ObjCSelector( - 'didFinishNavigationForDelegateWithIdentifier:webViewIdentifier:URL:', - ) - void didFinishNavigation( - int identifier, - int webViewIdentifier, - String? url, - ); +/// See https://developer.apple.com/documentation/webkit/wknavigationdelegate. +@ProxyApi(swiftOptions: SwiftProxyApiOptions(import: 'WebKit')) +abstract class WKNavigationDelegate extends NSObject { + WKNavigationDelegate(); - @ObjCSelector( - 'didStartProvisionalNavigationForDelegateWithIdentifier:webViewIdentifier:URL:', - ) - void didStartProvisionalNavigation( - int identifier, - int webViewIdentifier, + /// Tells the delegate that navigation is complete. + late void Function(WKWebView webView, String? url)? didFinishNavigation; + + /// Tells the delegate that navigation from the main frame has started. + late void Function( + WKWebView webView, String? url, - ); + )? didStartProvisionalNavigation; - @ObjCSelector( - 'decidePolicyForNavigationActionForDelegateWithIdentifier:webViewIdentifier:navigationAction:', - ) + /// Asks the delegate for permission to navigate to new content based on the + /// specified action information. @async - WKNavigationActionPolicyEnumData decidePolicyForNavigationAction( - int identifier, - int webViewIdentifier, - WKNavigationActionData navigationAction, - ); + late NavigationActionPolicy Function( + WKWebView webView, + WKNavigationAction navigationAction, + ) decidePolicyForNavigationAction; - @ObjCSelector( - 'decidePolicyForNavigationResponseForDelegateWithIdentifier:webViewIdentifier:navigationResponse:', - ) + /// Asks the delegate for permission to navigate to new content after the + /// response to the navigation request is known. @async - WKNavigationResponsePolicyEnum decidePolicyForNavigationResponse( - int identifier, - int webViewIdentifier, - WKNavigationResponseData navigationResponse, - ); + late NavigationResponsePolicy Function( + WKWebView webView, + WKNavigationResponse navigationResponse, + ) decidePolicyForNavigationResponse; - @ObjCSelector( - 'didFailNavigationForDelegateWithIdentifier:webViewIdentifier:error:', - ) - void didFailNavigation( - int identifier, - int webViewIdentifier, - NSErrorData error, - ); + /// Tells the delegate that an error occurred during navigation. + void Function(WKWebView webView, NSError error)? didFailNavigation; - @ObjCSelector( - 'didFailProvisionalNavigationForDelegateWithIdentifier:webViewIdentifier:error:', - ) - void didFailProvisionalNavigation( - int identifier, - int webViewIdentifier, - NSErrorData error, - ); + /// Tells the delegate that an error occurred during the early navigation + /// process. + void Function(WKWebView webView, NSError error)? didFailProvisionalNavigation; - @ObjCSelector( - 'webViewWebContentProcessDidTerminateForDelegateWithIdentifier:webViewIdentifier:', - ) - void webViewWebContentProcessDidTerminate( - int identifier, - int webViewIdentifier, - ); + /// Tells the delegate that the web view’s content process was terminated. + void Function(WKWebView webView)? webViewWebContentProcessDidTerminate; + // TODO(bparrishMines): This method should return an + // `AuthenticationChallengeResponse` once the cause of + // https://github.com/flutter/flutter/issues/162437 can be found and fixed. + /// Asks the delegate to respond to an authentication challenge. + /// + /// This return value expects a List with: + /// + /// 1. `UrlSessionAuthChallengeDisposition` + /// 2. A nullable map to instantiate a `URLCredential`. The map structure is + /// [ + /// "user": "", + /// "password": "", + /// "persistence": , + /// ] @async - @ObjCSelector( - 'didReceiveAuthenticationChallengeForDelegateWithIdentifier:webViewIdentifier:challengeIdentifier:', - ) - AuthenticationChallengeResponse didReceiveAuthenticationChallenge( - int identifier, - int webViewIdentifier, - int challengeIdentifier, - ); + late List Function( + WKWebView webView, + URLAuthenticationChallenge challenge, + ) didReceiveAuthenticationChallenge; } -/// Mirror of NSObject. +/// The root class of most Objective-C class hierarchies, from which subclasses +/// inherit a basic interface to the runtime system and the ability to behave as +/// Objective-C objects. /// /// See https://developer.apple.com/documentation/objectivec/nsobject. -@HostApi(dartHostTestHandler: 'TestNSObjectHostApi') -abstract class NSObjectHostApi { - @ObjCSelector('disposeObjectWithIdentifier:') - void dispose(int identifier); - - @ObjCSelector( - 'addObserverForObjectWithIdentifier:observerIdentifier:keyPath:options:', - ) +@ProxyApi() +abstract class NSObject { + NSObject(); + + /// Informs the observing object when the value at the specified key path + /// relative to the observed object has changed. + late void Function( + String? keyPath, + NSObject? object, + Map? change, + )? observeValue; + + /// Registers the observer object to receive KVO notifications for the key + /// path relative to the object receiving this message. void addObserver( - int identifier, - int observerIdentifier, + NSObject observer, String keyPath, - List options, + List options, ); - @ObjCSelector( - 'removeObserverForObjectWithIdentifier:observerIdentifier:keyPath:', - ) - void removeObserver(int identifier, int observerIdentifier, String keyPath); + /// Stops the observer object from receiving change notifications for the + /// property specified by the key path relative to the object receiving this + /// message. + void removeObserver(NSObject observer, String keyPath); } -/// Handles callbacks from an NSObject instance. +/// An object that displays interactive web content, such as for an in-app +/// browser. /// -/// See https://developer.apple.com/documentation/objectivec/nsobject. -@FlutterApi() -abstract class NSObjectFlutterApi { - @ObjCSelector( - 'observeValueForObjectWithIdentifier:keyPath:objectIdentifier:changeKeys:changeValues:', - ) - void observeValue( - int identifier, - String keyPath, - int objectIdentifier, - // TODO(bparrishMines): Change to a map when Objective-C data classes conform - // to `NSCopying`. See https://github.com/flutter/flutter/issues/103383. - // `NSDictionary`s are unable to use data classes as keys because they don't - // conform to `NSCopying`. This splits the map of properties into a list of - // keys and values with the ordered maintained. - List changeKeys, - List changeValues, - ); +/// See https://developer.apple.com/documentation/webkit/wkwebview. +@ProxyApi( + swiftOptions: SwiftProxyApiOptions( + import: 'WebKit', + name: 'WKWebView', + supportsMacos: false, + ), +) +abstract class UIViewWKWebView extends UIView implements WKWebView { + UIViewWKWebView(WKWebViewConfiguration initialConfiguration); - @ObjCSelector('disposeObjectWithIdentifier:') - void dispose(int identifier); -} + /// The object that contains the configuration details for the web view. + @attached + late WKWebViewConfiguration configuration; -/// Mirror of WKWebView. -/// -/// See https://developer.apple.com/documentation/webkit/wkwebview?language=objc. -@HostApi(dartHostTestHandler: 'TestWKWebViewHostApi') -abstract class WKWebViewHostApi { - @ObjCSelector('createWithIdentifier:configurationIdentifier:') - void create(int identifier, int configurationIdentifier); + /// The scroll view associated with the web view. + @attached + late UIScrollView scrollView; - @ObjCSelector('setUIDelegateForWebViewWithIdentifier:delegateIdentifier:') - void setUIDelegate(int identifier, int? uiDelegateIdentifier); + /// The object you use to integrate custom user interface elements, such as + /// contextual menus or panels, into web view interactions. + void setUIDelegate(WKUIDelegate delegate); - @ObjCSelector( - 'setNavigationDelegateForWebViewWithIdentifier:delegateIdentifier:', - ) - void setNavigationDelegate(int identifier, int? navigationDelegateIdentifier); + /// The object you use to manage navigation behavior for the web view. + void setNavigationDelegate(WKNavigationDelegate delegate); - @ObjCSelector('URLForWebViewWithIdentifier:') - String? getUrl(int identifier); + /// The URL for the current webpage. + String? getUrl(); - @ObjCSelector('estimatedProgressForWebViewWithIdentifier:') - double getEstimatedProgress(int identifier); + /// An estimate of what fraction of the current navigation has been loaded. + double getEstimatedProgress(); - @ObjCSelector('loadRequestForWebViewWithIdentifier:request:') - void loadRequest(int identifier, NSUrlRequestData request); + /// Loads the web content that the specified URL request object references and + /// navigates to that content. + void load(URLRequest request); - @ObjCSelector('loadHTMLForWebViewWithIdentifier:HTMLString:baseURL:') - void loadHtmlString(int identifier, String string, String? baseUrl); + /// Loads the contents of the specified HTML string and navigates to it. + void loadHtmlString(String string, String? baseUrl); - @ObjCSelector('loadFileForWebViewWithIdentifier:fileURL:readAccessURL:') - void loadFileUrl(int identifier, String url, String readAccessUrl); + /// Loads the web content from the specified file and navigates to it. + void loadFileUrl(String url, String readAccessUrl); - @ObjCSelector('loadAssetForWebViewWithIdentifier:assetKey:') - void loadFlutterAsset(int identifier, String key); + /// Convenience method to load a Flutter asset. + void loadFlutterAsset(String key); - @ObjCSelector('canGoBackForWebViewWithIdentifier:') - bool canGoBack(int identifier); + /// A Boolean value that indicates whether there is a valid back item in the + /// back-forward list. + bool canGoBack(); - @ObjCSelector('canGoForwardForWebViewWithIdentifier:') - bool canGoForward(int identifier); + /// A Boolean value that indicates whether there is a valid forward item in + /// the back-forward list. + bool canGoForward(); - @ObjCSelector('goBackForWebViewWithIdentifier:') - void goBack(int identifier); + /// Navigates to the back item in the back-forward list. + void goBack(); - @ObjCSelector('goForwardForWebViewWithIdentifier:') - void goForward(int identifier); + /// Navigates to the forward item in the back-forward list. + void goForward(); - @ObjCSelector('reloadWebViewWithIdentifier:') - void reload(int identifier); + /// Reloads the current webpage. + void reload(); - @ObjCSelector('titleForWebViewWithIdentifier:') - String? getTitle(int identifier); + /// The page title. + String? getTitle(); - @ObjCSelector('setAllowsBackForwardForWebViewWithIdentifier:isAllowed:') - void setAllowsBackForwardNavigationGestures(int identifier, bool allow); + /// A Boolean value that indicates whether horizontal swipe gestures trigger + /// backward and forward page navigation. + void setAllowsBackForwardNavigationGestures(bool allow); - @ObjCSelector('setCustomUserAgentForWebViewWithIdentifier:userAgent:') - void setCustomUserAgent(int identifier, String? userAgent); + /// The custom user agent string. + void setCustomUserAgent(String? userAgent); - @ObjCSelector('evaluateJavaScriptForWebViewWithIdentifier:javaScriptString:') + /// Evaluates the specified JavaScript string. @async - Object? evaluateJavaScript(int identifier, String javaScriptString); + Object? evaluateJavaScript(String javaScriptString); - @ObjCSelector('setInspectableForWebViewWithIdentifier:inspectable:') - void setInspectable(int identifier, bool inspectable); + /// A Boolean value that indicates whether you can inspect the view with + /// Safari Web Inspector. + void setInspectable(bool inspectable); - @ObjCSelector('customUserAgentForWebViewWithIdentifier:') - String? getCustomUserAgent(int identifier); + /// The custom user agent string. + String? getCustomUserAgent(); } -/// Mirror of WKUIDelegate. +/// An object that displays interactive web content, such as for an in-app +/// browser. /// -/// See https://developer.apple.com/documentation/webkit/wkuidelegate?language=objc. -@HostApi(dartHostTestHandler: 'TestWKUIDelegateHostApi') -abstract class WKUIDelegateHostApi { - @ObjCSelector('createWithIdentifier:') - void create(int identifier); +/// See https://developer.apple.com/documentation/webkit/wkwebview. +@ProxyApi( + swiftOptions: SwiftProxyApiOptions( + import: 'WebKit', + name: 'WKWebView', + supportsIos: false, + ), +) +abstract class NSViewWKWebView extends NSObject implements WKWebView { + NSViewWKWebView(WKWebViewConfiguration initialConfiguration); + + /// The object that contains the configuration details for the web view. + @attached + late WKWebViewConfiguration configuration; + + /// The object you use to integrate custom user interface elements, such as + /// contextual menus or panels, into web view interactions. + void setUIDelegate(WKUIDelegate delegate); + + /// The object you use to manage navigation behavior for the web view. + void setNavigationDelegate(WKNavigationDelegate delegate); + + /// The URL for the current webpage. + String? getUrl(); + + /// An estimate of what fraction of the current navigation has been loaded. + double getEstimatedProgress(); + + /// Loads the web content that the specified URL request object references and + /// navigates to that content. + void load(URLRequest request); + + /// Loads the contents of the specified HTML string and navigates to it. + void loadHtmlString(String string, String? baseUrl); + + /// Loads the web content from the specified file and navigates to it. + void loadFileUrl(String url, String readAccessUrl); + + /// Convenience method to load a Flutter asset. + void loadFlutterAsset(String key); + + /// A Boolean value that indicates whether there is a valid back item in the + /// back-forward list. + bool canGoBack(); + + /// A Boolean value that indicates whether there is a valid forward item in + /// the back-forward list. + bool canGoForward(); + + /// Navigates to the back item in the back-forward list. + void goBack(); + + /// Navigates to the forward item in the back-forward list. + void goForward(); + + /// Reloads the current webpage. + void reload(); + + /// The page title. + String? getTitle(); + + /// A Boolean value that indicates whether horizontal swipe gestures trigger + /// backward and forward page navigation. + void setAllowsBackForwardNavigationGestures(bool allow); + + /// The custom user agent string. + void setCustomUserAgent(String? userAgent); + + /// Evaluates the specified JavaScript string. + @async + Object? evaluateJavaScript(String javaScriptString); + + /// A Boolean value that indicates whether you can inspect the view with + /// Safari Web Inspector. + void setInspectable(bool inspectable); + + /// The custom user agent string. + String? getCustomUserAgent(); } -/// Handles callbacks from a WKUIDelegate instance. +/// An object that displays interactive web content, such as for an in-app +/// browser. /// -/// See https://developer.apple.com/documentation/webkit/wkuidelegate?language=objc. -@FlutterApi() -abstract class WKUIDelegateFlutterApi { - @ObjCSelector( - 'onCreateWebViewForDelegateWithIdentifier:webViewIdentifier:configurationIdentifier:navigationAction:', - ) - void onCreateWebView( - int identifier, - int webViewIdentifier, - int configurationIdentifier, - WKNavigationActionData navigationAction, - ); +/// See https://developer.apple.com/documentation/webkit/wkwebview. +@ProxyApi( + swiftOptions: SwiftProxyApiOptions( + import: 'WebKit', + name: 'WKWebView', + ), +) +abstract class WKWebView extends NSObject {} - /// Callback to Dart function `WKUIDelegate.requestMediaCapturePermission`. - @ObjCSelector( - 'requestMediaCapturePermissionForDelegateWithIdentifier:webViewIdentifier:origin:frame:type:', - ) +/// The methods for presenting native user interface elements on behalf of a +/// webpage. +/// +/// See https://developer.apple.com/documentation/webkit/wkuidelegate. +@ProxyApi(swiftOptions: SwiftProxyApiOptions(import: 'WebKit')) +abstract class WKUIDelegate extends NSObject { + WKUIDelegate(); + + /// Creates a new web view. + void Function( + WKWebView webView, + WKWebViewConfiguration configuration, + WKNavigationAction navigationAction, + )? onCreateWebView; + + /// Determines whether a web resource, which the security origin object + /// describes, can access to the device’s microphone audio and camera video. @async - WKPermissionDecisionData requestMediaCapturePermission( - int identifier, - int webViewIdentifier, - WKSecurityOriginData origin, - WKFrameInfoData frame, - WKMediaCaptureTypeData type, - ); - - /// Callback to Dart function `WKUIDelegate.runJavaScriptAlertPanel`. - @ObjCSelector( - 'runJavaScriptAlertPanelForDelegateWithIdentifier:message:frame:', - ) + late PermissionDecision Function( + WKWebView webView, + WKSecurityOrigin origin, + WKFrameInfo frame, + MediaCaptureType type, + ) requestMediaCapturePermission; + + /// Displays a JavaScript alert panel. @async - void runJavaScriptAlertPanel( - int identifier, + void Function( + WKWebView webView, String message, - WKFrameInfoData frame, - ); + WKFrameInfo frame, + )? runJavaScriptAlertPanel; - /// Callback to Dart function `WKUIDelegate.runJavaScriptConfirmPanel`. - @ObjCSelector( - 'runJavaScriptConfirmPanelForDelegateWithIdentifier:message:frame:', - ) + /// Displays a JavaScript confirm panel. @async - bool runJavaScriptConfirmPanel( - int identifier, + late bool Function( + WKWebView webView, String message, - WKFrameInfoData frame, - ); + WKFrameInfo frame, + ) runJavaScriptConfirmPanel; - /// Callback to Dart function `WKUIDelegate.runJavaScriptTextInputPanel`. - @ObjCSelector( - 'runJavaScriptTextInputPanelForDelegateWithIdentifier:prompt:defaultText:frame:', - ) + /// Displays a JavaScript text input panel. @async - String runJavaScriptTextInputPanel( - int identifier, + String? Function( + WKWebView webView, String prompt, - String defaultText, - WKFrameInfoData frame, - ); + String? defaultText, + WKFrameInfo frame, + )? runJavaScriptTextInputPanel; } -/// Mirror of WKHttpCookieStore. +/// An object that manages the HTTP cookies associated with a particular web +/// view. /// -/// See https://developer.apple.com/documentation/webkit/wkhttpcookiestore?language=objc. -@HostApi(dartHostTestHandler: 'TestWKHttpCookieStoreHostApi') -abstract class WKHttpCookieStoreHostApi { - @ObjCSelector('createFromWebsiteDataStoreWithIdentifier:dataStoreIdentifier:') - void createFromWebsiteDataStore( - int identifier, - int websiteDataStoreIdentifier, - ); - - @ObjCSelector('setCookieForStoreWithIdentifier:cookie:') +/// See https://developer.apple.com/documentation/webkit/wkhttpcookiestore. +@ProxyApi(swiftOptions: SwiftProxyApiOptions(import: 'WebKit')) +abstract class WKHTTPCookieStore extends NSObject { + /// Sets a cookie policy that indicates whether the cookie store allows cookie + /// storage. @async - void setCookie(int identifier, NSHttpCookieData cookie); + void setCookie(HTTPCookie cookie); } -/// Host API for `NSUrl`. -/// -/// This class may handle instantiating and adding native object instances that -/// are attached to a Dart instance or method calls on the associated native -/// class or an instance of the class. +/// The interface for the delegate of a scroll view. /// -/// See https://developer.apple.com/documentation/foundation/nsurl?language=objc. -@HostApi(dartHostTestHandler: 'TestNSUrlHostApi') -abstract class NSUrlHostApi { - @ObjCSelector('absoluteStringForNSURLWithIdentifier:') - String? getAbsoluteString(int identifier); -} - -/// Flutter API for `NSUrl`. -/// -/// This class may handle instantiating and adding Dart instances that are -/// attached to a native instance or receiving callback methods from an -/// overridden native class. -/// -/// See https://developer.apple.com/documentation/foundation/nsurl?language=objc. -@FlutterApi() -abstract class NSUrlFlutterApi { - @ObjCSelector('createWithIdentifier:') - void create(int identifier); -} - -/// Host API for `UIScrollViewDelegate`. -/// -/// This class may handle instantiating and adding native object instances that -/// are attached to a Dart instance or method calls on the associated native -/// class or an instance of the class. -/// -/// See https://developer.apple.com/documentation/uikit/uiscrollviewdelegate?language=objc. -@HostApi(dartHostTestHandler: 'TestUIScrollViewDelegateHostApi') -abstract class UIScrollViewDelegateHostApi { - @ObjCSelector('createWithIdentifier:') - void create(int identifier); -} +/// See https://developer.apple.com/documentation/uikit/uiscrollviewdelegate. +@ProxyApi( + swiftOptions: SwiftProxyApiOptions(import: 'UIKit', supportsMacos: false), +) +abstract class UIScrollViewDelegate extends NSObject { + UIScrollViewDelegate(); -/// Flutter API for `UIScrollViewDelegate`. -/// -/// See https://developer.apple.com/documentation/uikit/uiscrollviewdelegate?language=objc. -@FlutterApi() -abstract class UIScrollViewDelegateFlutterApi { - @ObjCSelector( - 'scrollViewDidScrollWithIdentifier:UIScrollViewIdentifier:x:y:', - ) - void scrollViewDidScroll( - int identifier, - int uiScrollViewIdentifier, + /// Tells the delegate when the user scrolls the content view within the + /// scroll view. + /// + /// Note that this is a convenient method that includes the `contentOffset` of + /// the `scrollView`. + void Function( + UIScrollView scrollView, double x, double y, - ); + )? scrollViewDidScroll; } -/// Host API for `NSUrlCredential`. +/// An authentication credential consisting of information specific to the type +/// of credential and the type of persistent storage to use, if any. /// -/// This class may handle instantiating and adding native object instances that -/// are attached to a Dart instance or handle method calls on the associated -/// native class or an instance of the class. -/// -/// See https://developer.apple.com/documentation/foundation/nsurlcredential?language=objc. -@HostApi(dartHostTestHandler: 'TestNSUrlCredentialHostApi') -abstract class NSUrlCredentialHostApi { - /// Create a new native instance and add it to the `InstanceManager`. - @ObjCSelector( - 'createWithUserWithIdentifier:user:password:persistence:', - ) - void createWithUser( - int identifier, +/// See https://developer.apple.com/documentation/foundation/urlcredential. +@ProxyApi() +abstract class URLCredential extends NSObject { + /// Creates a URL credential instance for internet password authentication + /// with a given user name and password, using a given persistence setting. + URLCredential.withUser( String user, String password, - NSUrlCredentialPersistence persistence, + UrlCredentialPersistence persistence, ); } -/// Flutter API for `NSUrlProtectionSpace`. +/// A server or an area on a server, commonly referred to as a realm, that +/// requires authentication. /// -/// This class may handle instantiating and adding Dart instances that are -/// attached to a native instance or receiving callback methods from an -/// overridden native class. +/// See https://developer.apple.com/documentation/foundation/urlprotectionspace. +@ProxyApi() +abstract class URLProtectionSpace extends NSObject { + /// The receiver’s host. + late String host; + + /// The receiver’s port. + late int port; + + /// The receiver’s authentication realm. + late String? realm; + + /// The authentication method used by the receiver. + late String? authenticationMethod; +} + +/// A challenge from a server requiring authentication from the client. /// -/// See https://developer.apple.com/documentation/foundation/nsurlprotectionspace?language=objc. -@FlutterApi() -abstract class NSUrlProtectionSpaceFlutterApi { - /// Create a new Dart instance and add it to the `InstanceManager`. - @ObjCSelector('createWithIdentifier:host:realm:authenticationMethod:') - void create( - int identifier, - String? host, - String? realm, - String? authenticationMethod, - ); +/// See https://developer.apple.com/documentation/foundation/urlauthenticationchallenge. +@ProxyApi() +abstract class URLAuthenticationChallenge extends NSObject { + /// The receiver’s protection space. + URLProtectionSpace getProtectionSpace(); } -/// Flutter API for `NSUrlAuthenticationChallenge`. +/// A value that identifies the location of a resource, such as an item on a +/// remote server or the path to a local file. /// -/// This class may handle instantiating and adding Dart instances that are -/// attached to a native instance or receiving callback methods from an -/// overridden native class. +/// See https://developer.apple.com/documentation/foundation/url. +@ProxyApi(swiftOptions: SwiftProxyApiOptions(name: 'URL')) +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/foundation/nsurlauthenticationchallenge?language=objc. -@FlutterApi() -abstract class NSUrlAuthenticationChallengeFlutterApi { - /// Create a new Dart instance and add it to the `InstanceManager`. - @ObjCSelector('createWithIdentifier:protectionSpaceIdentifier:') - void create(int identifier, int protectionSpaceIdentifier); +/// 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); } diff --git a/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml b/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml index cb7796bc487..67f2f644cd6 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.16.3 +version: 3.18.5 environment: sdk: ^3.5.0 @@ -13,11 +13,11 @@ flutter: implements: webview_flutter platforms: ios: - pluginClass: FLTWebViewFlutterPlugin + pluginClass: WebViewFlutterPlugin dartPluginClass: WebKitWebViewPlatform sharedDarwinSource: true macos: - pluginClass: FLTWebViewFlutterPlugin + pluginClass: WebViewFlutterPlugin dartPluginClass: WebKitWebViewPlatform sharedDarwinSource: true @@ -25,15 +25,14 @@ dependencies: flutter: sdk: flutter path: ^1.8.0 - webview_flutter_platform_interface: - path: ../webview_flutter_platform_interface + webview_flutter_platform_interface: ^2.10.0 dev_dependencies: build_runner: ^2.1.5 flutter_test: sdk: flutter mockito: ^5.4.4 - pigeon: ^18.0.0 + pigeon: ^24.2.1 topics: - html diff --git a/packages/webview_flutter/webview_flutter_wkwebview/test/legacy/web_kit_cookie_manager_test.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/legacy/web_kit_cookie_manager_test.dart index 4f775df9e11..9b5dca1393a 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/legacy/web_kit_cookie_manager_test.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/test/legacy/web_kit_cookie_manager_test.dart @@ -6,14 +6,14 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; import 'package:webview_flutter_platform_interface/src/webview_flutter_platform_interface_legacy.dart'; -import 'package:webview_flutter_wkwebview/src/foundation/foundation.dart'; +import 'package:webview_flutter_wkwebview/src/common/web_kit.g.dart'; import 'package:webview_flutter_wkwebview/src/legacy/wkwebview_cookie_manager.dart'; -import 'package:webview_flutter_wkwebview/src/web_kit/web_kit.dart'; +import 'package:webview_flutter_wkwebview/src/webkit_proxy.dart'; import 'web_kit_cookie_manager_test.mocks.dart'; @GenerateMocks([ - WKHttpCookieStore, + WKHTTPCookieStore, WKWebsiteDataStore, ]) void main() { @@ -21,28 +21,41 @@ void main() { group('WebKitWebViewWidget', () { late MockWKWebsiteDataStore mockWebsiteDataStore; - late MockWKHttpCookieStore mockWKHttpCookieStore; + late MockWKHTTPCookieStore mockWKHttpCookieStore; late WKWebViewCookieManager cookieManager; + late HTTPCookie cookie; + late Map cookieProperties; setUp(() { mockWebsiteDataStore = MockWKWebsiteDataStore(); - mockWKHttpCookieStore = MockWKHttpCookieStore(); + mockWKHttpCookieStore = MockWKHTTPCookieStore(); when(mockWebsiteDataStore.httpCookieStore) .thenReturn(mockWKHttpCookieStore); - cookieManager = - WKWebViewCookieManager(websiteDataStore: mockWebsiteDataStore); + cookieManager = WKWebViewCookieManager( + websiteDataStore: mockWebsiteDataStore, + webKitProxy: WebKitProxy( + newHTTPCookie: ({ + required Map properties, + }) { + cookieProperties = properties; + return cookie = HTTPCookie.pigeon_detached( + pigeon_instanceManager: TestInstanceManager(), + ); + }, + ), + ); }); test('clearCookies', () async { when(mockWebsiteDataStore.removeDataOfTypes( - {WKWebsiteDataType.cookies}, any)) + [WebsiteDataType.cookies], any)) .thenAnswer((_) => Future.value(true)); expect(cookieManager.clearCookies(), completion(true)); when(mockWebsiteDataStore.removeDataOfTypes( - {WKWebsiteDataType.cookies}, any)) + [WebsiteDataType.cookies], any)) .thenAnswer((_) => Future.value(false)); expect(cookieManager.clearCookies(), completion(false)); }); @@ -52,16 +65,14 @@ void main() { const WebViewCookie(name: 'a', value: 'b', domain: 'c', path: 'd'), ); - final NSHttpCookie cookie = - verify(mockWKHttpCookieStore.setCookie(captureAny)).captured.single - as NSHttpCookie; + verify(mockWKHttpCookieStore.setCookie(cookie)); expect( - cookie.properties, - { - NSHttpCookiePropertyKey.name: 'a', - NSHttpCookiePropertyKey.value: 'b', - NSHttpCookiePropertyKey.domain: 'c', - NSHttpCookiePropertyKey.path: 'd', + cookieProperties, + { + HttpCookiePropertyKey.name: 'a', + HttpCookiePropertyKey.value: 'b', + HttpCookiePropertyKey.domain: 'c', + HttpCookiePropertyKey.path: 'd', }, ); }); @@ -81,3 +92,8 @@ void main() { }); }); } + +// Test InstanceManager that sets `onWeakReferenceRemoved` as a noop. +class TestInstanceManager extends PigeonInstanceManager { + TestInstanceManager() : super(onWeakReferenceRemoved: (_) {}); +} 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 fe13a87048e..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 @@ -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. @@ -6,9 +6,7 @@ import 'dart:async' as _i3; import 'package:mockito/mockito.dart' as _i1; -import 'package:webview_flutter_wkwebview/src/foundation/foundation.dart' - as _i4; -import 'package:webview_flutter_wkwebview/src/web_kit/web_kit.dart' as _i2; +import 'package:webview_flutter_wkwebview/src/common/web_kit.g.dart' as _i2; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -18,97 +16,79 @@ import 'package:webview_flutter_wkwebview/src/web_kit/web_kit.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 // ignore_for_file: subtype_of_sealed_class -class _FakeWKHttpCookieStore_0 extends _i1.SmartFake - implements _i2.WKHttpCookieStore { - _FakeWKHttpCookieStore_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); +class _FakePigeonInstanceManager_0 extends _i1.SmartFake + implements _i2.PigeonInstanceManager { + _FakePigeonInstanceManager_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeWKWebsiteDataStore_1 extends _i1.SmartFake +class _FakeWKHTTPCookieStore_1 extends _i1.SmartFake + implements _i2.WKHTTPCookieStore { + _FakeWKHTTPCookieStore_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); +} + +class _FakeWKWebsiteDataStore_2 extends _i1.SmartFake implements _i2.WKWebsiteDataStore { - _FakeWKWebsiteDataStore_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWKWebsiteDataStore_2(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -/// A class which mocks [WKHttpCookieStore]. +/// A class which mocks [WKHTTPCookieStore]. /// /// See the documentation for Mockito's code generation for more information. -// ignore: must_be_immutable -class MockWKHttpCookieStore extends _i1.Mock implements _i2.WKHttpCookieStore { - MockWKHttpCookieStore() { +class MockWKHTTPCookieStore extends _i1.Mock implements _i2.WKHTTPCookieStore { + MockWKHTTPCookieStore() { _i1.throwOnMissingStub(this); } @override - _i3.Future setCookie(_i4.NSHttpCookie? cookie) => (super.noSuchMethod( - Invocation.method( - #setCookie, - [cookie], + _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); @override - _i2.WKHttpCookieStore copy() => (super.noSuchMethod( - Invocation.method( - #copy, - [], - ), - returnValue: _FakeWKHttpCookieStore_0( + _i2.WKHTTPCookieStore pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKHTTPCookieStore_1( this, - Invocation.method( - #copy, - [], - ), + Invocation.method(#pigeon_copy, []), ), - ) as _i2.WKHttpCookieStore); + ) as _i2.WKHTTPCookieStore); @override _i3.Future addObserver( - _i4.NSObject? observer, { - required String? keyPath, - required Set<_i4.NSKeyValueObservingOptions>? options, - }) => + _i2.NSObject? observer, + String? keyPath, + List<_i2.KeyValueObservingOptions>? options, + ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [observer], - { - #keyPath: keyPath, - #options: options, - }, - ), + Invocation.method(#addObserver, [observer, keyPath, options]), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override - _i3.Future removeObserver( - _i4.NSObject? observer, { - required String? keyPath, - }) => + _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method( - #removeObserver, - [observer], - {#keyPath: keyPath}, - ), + Invocation.method(#removeObserver, [observer, keyPath]), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @@ -117,7 +97,6 @@ class MockWKHttpCookieStore extends _i1.Mock implements _i2.WKHttpCookieStore { /// A class which mocks [WKWebsiteDataStore]. /// /// See the documentation for Mockito's code generation for more information. -// ignore: must_be_immutable class MockWKWebsiteDataStore extends _i1.Mock implements _i2.WKWebsiteDataStore { MockWKWebsiteDataStore() { @@ -125,75 +104,70 @@ class MockWKWebsiteDataStore extends _i1.Mock } @override - _i2.WKHttpCookieStore get httpCookieStore => (super.noSuchMethod( + _i2.WKHTTPCookieStore get httpCookieStore => (super.noSuchMethod( Invocation.getter(#httpCookieStore), - returnValue: _FakeWKHttpCookieStore_0( + returnValue: _FakeWKHTTPCookieStore_1( this, Invocation.getter(#httpCookieStore), ), - ) as _i2.WKHttpCookieStore); + ) 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); + + @override + _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( - Set<_i2.WKWebsiteDataType>? dataTypes, - DateTime? since, + List<_i2.WebsiteDataType>? dataTypes, + double? modificationTimeInSecondsSinceEpoch, ) => (super.noSuchMethod( - Invocation.method( - #removeDataOfTypes, - [ - dataTypes, - since, - ], - ), + Invocation.method(#removeDataOfTypes, [ + dataTypes, + modificationTimeInSecondsSinceEpoch, + ]), returnValue: _i3.Future.value(false), ) as _i3.Future); @override - _i2.WKWebsiteDataStore copy() => (super.noSuchMethod( - Invocation.method( - #copy, - [], - ), - returnValue: _FakeWKWebsiteDataStore_1( + _i2.WKWebsiteDataStore pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKWebsiteDataStore_2( this, - Invocation.method( - #copy, - [], - ), + Invocation.method(#pigeon_copy, []), ), ) as _i2.WKWebsiteDataStore); @override _i3.Future addObserver( - _i4.NSObject? observer, { - required String? keyPath, - required Set<_i4.NSKeyValueObservingOptions>? options, - }) => + _i2.NSObject? observer, + String? keyPath, + List<_i2.KeyValueObservingOptions>? options, + ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [observer], - { - #keyPath: keyPath, - #options: options, - }, - ), + Invocation.method(#addObserver, [observer, keyPath, options]), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override - _i3.Future removeObserver( - _i4.NSObject? observer, { - required String? keyPath, - }) => + _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method( - #removeObserver, - [observer], - {#keyPath: keyPath}, - ), + 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.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/legacy/web_kit_webview_widget_test.dart index ac2f19804ff..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 @@ -3,28 +3,29 @@ // found in the LICENSE file. import 'dart:async'; -import 'dart:math'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; import 'package:webview_flutter_platform_interface/src/webview_flutter_platform_interface_legacy.dart'; -import 'package:webview_flutter_wkwebview/src/foundation/foundation.dart'; +import 'package:webview_flutter_wkwebview/src/common/platform_webview.dart'; +import 'package:webview_flutter_wkwebview/src/common/web_kit.g.dart'; +import 'package:webview_flutter_wkwebview/src/common/webkit_constants.dart'; import 'package:webview_flutter_wkwebview/src/legacy/web_kit_webview_widget.dart'; -import 'package:webview_flutter_wkwebview/src/ui_kit/ui_kit.dart'; -import 'package:webview_flutter_wkwebview/src/web_kit/web_kit.dart'; import 'web_kit_webview_widget_test.mocks.dart'; @GenerateMocks([ UIScrollView, + URLRequest, WKNavigationDelegate, WKPreferences, WKScriptMessageHandler, - WKWebViewIOS, - WKWebViewMacOS, + WKWebView, + UIViewWKWebView, WKWebViewConfiguration, WKWebsiteDataStore, WKUIDelegate, @@ -32,6 +33,7 @@ import 'web_kit_webview_widget_test.mocks.dart'; JavascriptChannelRegistry, WebViewPlatformCallbacksHandler, WebViewWidgetProxy, + WKWebpagePreferences, ]) void main() { TestWidgetsFlutterBinding.ensureInitialized(); @@ -39,7 +41,7 @@ void main() { group('WebKitWebViewWidget', () { _WebViewMocks configureMocks() { final _WebViewMocks mocks = _WebViewMocks( - webView: MockWKWebViewIOS(), + webView: MockUIViewWKWebView(), webViewWidgetProxy: MockWebViewWidgetProxy(), userContentController: MockWKUserContentController(), preferences: MockWKPreferences(), @@ -49,14 +51,15 @@ void main() { websiteDataStore: MockWKWebsiteDataStore(), navigationDelegate: MockWKNavigationDelegate(), callbacksHandler: MockWebViewPlatformCallbacksHandler(), - javascriptChannelRegistry: MockJavascriptChannelRegistry()); + javascriptChannelRegistry: MockJavascriptChannelRegistry(), + webpagePreferences: MockWKWebpagePreferences()); when( mocks.webViewWidgetProxy.createWebView( any, observeValue: anyNamed('observeValue'), ), - ).thenReturn(mocks.webView); + ).thenReturn(PlatformWebView.fromNativeWebView(mocks.webView)); when( mocks.webViewWidgetProxy.createUIDelgate( onCreateWebView: captureAnyNamed('onCreateWebView'), @@ -72,18 +75,27 @@ void main() { didFailProvisionalNavigation: anyNamed('didFailProvisionalNavigation'), webViewWebContentProcessDidTerminate: anyNamed('webViewWebContentProcessDidTerminate'), + decidePolicyForNavigationResponse: + anyNamed('decidePolicyForNavigationResponse'), + didReceiveAuthenticationChallenge: + anyNamed('didReceiveAuthenticationChallenge'), )).thenReturn(mocks.navigationDelegate); when(mocks.webView.configuration).thenReturn(mocks.webViewConfiguration); - when(mocks.webViewConfiguration.userContentController).thenReturn( - mocks.userContentController, + when(mocks.webViewConfiguration.getUserContentController()).thenAnswer( + (_) => Future.value( + mocks.userContentController, + ), ); - when(mocks.webViewConfiguration.preferences) - .thenReturn(mocks.preferences); + 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); - when(mocks.webViewConfiguration.websiteDataStore).thenReturn( - mocks.websiteDataStore, + when(mocks.webViewConfiguration.getWebsiteDataStore()).thenAnswer( + (_) => Future.value(mocks.websiteDataStore), ); return mocks; } @@ -130,31 +142,50 @@ void main() { final _WebViewMocks mocks = configureMocks(); await buildWidget(tester, mocks); - final void Function(WKWebView, WKWebViewConfiguration, WKNavigationAction) - onCreateWebView = verify(mocks.webViewWidgetProxy.createUIDelgate( - onCreateWebView: captureAnyNamed('onCreateWebView'))) - .captured - .single - as void Function( - WKWebView, WKWebViewConfiguration, WKNavigationAction); + final void Function( + WKUIDelegate, + WKWebView, + WKWebViewConfiguration, + WKNavigationAction, + ) onCreateWebView = verify(mocks.webViewWidgetProxy.createUIDelgate( + onCreateWebView: captureAnyNamed('onCreateWebView'))) + .captured + .single as void Function( + WKUIDelegate, + WKWebView, + WKWebViewConfiguration, + WKNavigationAction, + ); - const NSUrlRequest request = NSUrlRequest(url: 'https://google.com'); + final URLRequest request = URLRequest.pigeon_detached( + pigeon_instanceManager: TestInstanceManager(), + ); onCreateWebView( + MockWKUIDelegate(), mocks.webView, mocks.webViewConfiguration, - const WKNavigationAction( + WKNavigationAction.pigeon_detached( request: request, - targetFrame: WKFrameInfo(isMainFrame: false, request: request), - navigationType: WKNavigationType.linkActivated, + targetFrame: WKFrameInfo.pigeon_detached( + isMainFrame: false, + request: request, + pigeon_instanceManager: TestInstanceManager(), + ), + navigationType: NavigationType.linkActivated, + pigeon_instanceManager: TestInstanceManager(), ), ); - verify(mocks.webView.loadRequest(request)); + verify(mocks.webView.load(request)); }); group('CreationParams', () { testWidgets('initialUrl', (WidgetTester tester) async { final _WebViewMocks mocks = configureMocks(); + when( + mocks.webViewWidgetProxy.createRequest(url: 'https://www.google.com'), + ).thenReturn(MockURLRequest()); + await buildWidget( tester, mocks, @@ -166,14 +197,15 @@ void main() { ), ), ); - final NSUrlRequest request = - verify(mocks.webView.loadRequest(captureAny)).captured.single - as NSUrlRequest; - expect(request.url, 'https://www.google.com'); + + verify(mocks.webView.load(captureAny)).captured.single as URLRequest; }); testWidgets('backgroundColor', (WidgetTester tester) async { final _WebViewMocks mocks = configureMocks(); + + debugDefaultTargetPlatformOverride = TargetPlatform.iOS; + await buildWidget( tester, mocks, @@ -187,8 +219,10 @@ void main() { ); verify(mocks.webView.setOpaque(false)); - verify(mocks.webView.setBackgroundColor(Colors.transparent)); - verify(mocks.scrollView.setBackgroundColor(Colors.red)); + verify(mocks.webView.setBackgroundColor(Colors.transparent.value)); + verify(mocks.scrollView.setBackgroundColor(Colors.red.value)); + + debugDefaultTargetPlatformOverride = null; }); testWidgets('userAgent', (WidgetTester tester) async { @@ -222,9 +256,9 @@ void main() { ); verify(mocks.webViewConfiguration - .setMediaTypesRequiringUserActionForPlayback({ - WKAudiovisualMediaType.all, - })); + .setMediaTypesRequiringUserActionForPlayback( + AudiovisualMediaType.all, + )); }); testWidgets('autoMediaPlaybackPolicy false', (WidgetTester tester) async { @@ -242,9 +276,9 @@ void main() { ); verify(mocks.webViewConfiguration - .setMediaTypesRequiringUserActionForPlayback({ - WKAudiovisualMediaType.none, - })); + .setMediaTypesRequiringUserActionForPlayback( + AudiovisualMediaType.none, + )); }); testWidgets('javascriptChannelNames', (WidgetTester tester) async { @@ -302,7 +336,7 @@ void main() { ), ); - verify(mocks.preferences.setJavaScriptEnabled(true)); + verify(mocks.webpagePreferences.setAllowsContentJavaScript(true)); }); testWidgets('userAgent', (WidgetTester tester) async { @@ -422,9 +456,9 @@ void main() { verify(mocks.userContentController.addUserScript(captureAny)) .captured .first as WKUserScript; - expect(zoomScript.isMainFrameOnly, isTrue); - expect(zoomScript.injectionTime, - WKUserScriptInjectionTime.atDocumentEnd); + expect(zoomScript.isForMainFrameOnly, isTrue); + expect( + zoomScript.injectionTime, UserScriptInjectionTime.atDocumentEnd); expect( zoomScript.source, "var meta = document.createElement('meta');\n" @@ -460,12 +494,9 @@ void main() { await buildWidget(tester, mocks); await testController.loadFile('/path/to/file.html'); - verify(mocks.webView.loadFileUrl( - '/path/to/file.html', - readAccessUrl: '/path/to', - )); + verify(mocks.webView.loadFileUrl('/path/to/file.html', '/path/to')); }); - + // testWidgets('loadFlutterAsset', (WidgetTester tester) async { final _WebViewMocks mocks = configureMocks(); final WebKitWebViewPlatformController testController = @@ -480,12 +511,13 @@ void main() { final WebKitWebViewPlatformController testController = await buildWidget(tester, mocks); - const String htmlString = 'Test data.'; + const String htmlString = + 'Test data.'; await testController.loadHtmlString(htmlString, baseUrl: 'baseUrl'); verify(mocks.webView.loadHtmlString( - 'Test data.', - baseUrl: 'baseUrl', + 'Test data.', + 'baseUrl', )); }); @@ -494,16 +526,19 @@ void main() { final WebKitWebViewPlatformController testController = await buildWidget(tester, mocks); + when( + mocks.webViewWidgetProxy.createRequest(url: 'https://www.google.com'), + ).thenReturn(MockURLRequest()); + await testController.loadUrl( 'https://www.google.com', {'a': 'header'}, ); - final NSUrlRequest request = - verify(mocks.webView.loadRequest(captureAny)).captured.single - as NSUrlRequest; - expect(request.url, 'https://www.google.com'); - expect(request.allHttpHeaderFields, {'a': 'header'}); + final URLRequest request = verify(mocks.webView.load(captureAny)) + .captured + .single as URLRequest; + verify(request.setAllHttpHeaderFields({'a': 'header'})); }); group('loadRequest', () { @@ -528,17 +563,21 @@ void main() { final WebKitWebViewPlatformController testController = await buildWidget(tester, mocks); + when( + mocks.webViewWidgetProxy + .createRequest(url: 'https://www.google.com'), + ).thenReturn(MockURLRequest()); + await testController.loadRequest(WebViewRequest( uri: Uri.parse('https://www.google.com'), method: WebViewRequestMethod.get, )); - final NSUrlRequest request = - verify(mocks.webView.loadRequest(captureAny)).captured.single - as NSUrlRequest; - expect(request.url, 'https://www.google.com'); - expect(request.allHttpHeaderFields, {}); - expect(request.httpMethod, 'get'); + final URLRequest request = verify(mocks.webView.load(captureAny)) + .captured + .single as URLRequest; + verify(request.setAllHttpHeaderFields({})); + verify(request.setHttpMethod('get')); }); testWidgets('GET with headers', (WidgetTester tester) async { @@ -546,18 +585,24 @@ void main() { final WebKitWebViewPlatformController testController = await buildWidget(tester, mocks); + when( + mocks.webViewWidgetProxy + .createRequest(url: 'https://www.google.com'), + ).thenReturn(MockURLRequest()); + await testController.loadRequest(WebViewRequest( uri: Uri.parse('https://www.google.com'), method: WebViewRequestMethod.get, headers: {'a': 'header'}, )); - final NSUrlRequest request = - verify(mocks.webView.loadRequest(captureAny)).captured.single - as NSUrlRequest; - expect(request.url, 'https://www.google.com'); - expect(request.allHttpHeaderFields, {'a': 'header'}); - expect(request.httpMethod, 'get'); + final URLRequest request = verify(mocks.webView.load(captureAny)) + .captured + .single as URLRequest; + verify( + request.setAllHttpHeaderFields({'a': 'header'}), + ); + verify(request.setHttpMethod('get')); }); testWidgets('POST without body', (WidgetTester tester) async { @@ -565,16 +610,20 @@ void main() { final WebKitWebViewPlatformController testController = await buildWidget(tester, mocks); + when( + mocks.webViewWidgetProxy + .createRequest(url: 'https://www.google.com'), + ).thenReturn(MockURLRequest()); + await testController.loadRequest(WebViewRequest( uri: Uri.parse('https://www.google.com'), method: WebViewRequestMethod.post, )); - final NSUrlRequest request = - verify(mocks.webView.loadRequest(captureAny)).captured.single - as NSUrlRequest; - expect(request.url, 'https://www.google.com'); - expect(request.httpMethod, 'post'); + final URLRequest request = verify(mocks.webView.load(captureAny)) + .captured + .single as URLRequest; + verify(request.setHttpMethod('post')); }); testWidgets('POST with body', (WidgetTester tester) async { @@ -582,19 +631,22 @@ void main() { final WebKitWebViewPlatformController testController = await buildWidget(tester, mocks); + when( + mocks.webViewWidgetProxy + .createRequest(url: 'https://www.google.com'), + ).thenReturn(MockURLRequest()); + await testController.loadRequest(WebViewRequest( uri: Uri.parse('https://www.google.com'), method: WebViewRequestMethod.post, body: Uint8List.fromList('Test Body'.codeUnits))); - final NSUrlRequest request = - verify(mocks.webView.loadRequest(captureAny)).captured.single - as NSUrlRequest; - expect(request.url, 'https://www.google.com'); - expect(request.httpMethod, 'post'); - expect( - request.httpBody, - Uint8List.fromList('Test Body'.codeUnits), + final URLRequest request = verify(mocks.webView.load(captureAny)) + .captured + .single as URLRequest; + verify(request.setHttpMethod('post')); + verify( + request.setHttpBody(Uint8List.fromList('Test Body'.codeUnits)), ); }); }); @@ -846,9 +898,10 @@ void main() { when(mocks.webView.evaluateJavaScript('runJavaScript')) .thenThrow(PlatformException( code: '', - details: const NSError( + details: NSError.pigeon_detached( code: WKErrorCode.javaScriptResultTypeIsUnsupported, domain: '', + userInfo: const {}, ), )); expect( @@ -882,9 +935,12 @@ void main() { final WebKitWebViewPlatformController testController = await buildWidget(tester, mocks); + debugDefaultTargetPlatformOverride = TargetPlatform.iOS; + await testController.scrollTo(2, 4); - verify( - mocks.scrollView.setContentOffset(const Point(2.0, 4.0))); + verify(mocks.scrollView.setContentOffset(2.0, 4.0)); + + debugDefaultTargetPlatformOverride = null; }); testWidgets('scrollBy', (WidgetTester tester) async { @@ -892,8 +948,12 @@ void main() { final WebKitWebViewPlatformController testController = await buildWidget(tester, mocks); + debugDefaultTargetPlatformOverride = TargetPlatform.iOS; + await testController.scrollBy(2, 4); - verify(mocks.scrollView.scrollBy(const Point(2.0, 4.0))); + verify(mocks.scrollView.scrollBy(2.0, 4.0)); + + debugDefaultTargetPlatformOverride = null; }); testWidgets('getScrollX', (WidgetTester tester) async { @@ -901,9 +961,13 @@ void main() { final WebKitWebViewPlatformController testController = await buildWidget(tester, mocks); + debugDefaultTargetPlatformOverride = TargetPlatform.iOS; + when(mocks.scrollView.getContentOffset()).thenAnswer( - (_) => Future>.value(const Point(8.0, 16.0))); + (_) => Future>.value(const [8.0, 16.0])); expect(testController.getScrollX(), completion(8.0)); + + debugDefaultTargetPlatformOverride = null; }); testWidgets('getScrollY', (WidgetTester tester) async { @@ -911,9 +975,13 @@ void main() { final WebKitWebViewPlatformController testController = await buildWidget(tester, mocks); + debugDefaultTargetPlatformOverride = TargetPlatform.iOS; + when(mocks.scrollView.getContentOffset()).thenAnswer( - (_) => Future>.value(const Point(8.0, 16.0))); + (_) => Future>.value(const [8.0, 16.0])); expect(testController.getScrollY(), completion(16.0)); + + debugDefaultTargetPlatformOverride = null; }); testWidgets('clearCache', (WidgetTester tester) async { @@ -922,13 +990,13 @@ void main() { await buildWidget(tester, mocks); when( mocks.websiteDataStore.removeDataOfTypes( - { - WKWebsiteDataType.memoryCache, - WKWebsiteDataType.diskCache, - WKWebsiteDataType.offlineWebApplicationCache, - WKWebsiteDataType.localStorage, - }, - DateTime.fromMillisecondsSinceEpoch(0), + [ + WebsiteDataType.memoryCache, + WebsiteDataType.diskCache, + WebsiteDataType.offlineWebApplicationCache, + WebsiteDataType.localStorage, + ], + 0, ), ).thenAnswer((_) => Future.value(false)); @@ -971,15 +1039,15 @@ void main() { expect(userScripts[0].source, 'window.c = webkit.messageHandlers.c;'); expect( userScripts[0].injectionTime, - WKUserScriptInjectionTime.atDocumentStart, + UserScriptInjectionTime.atDocumentStart, ); - expect(userScripts[0].isMainFrameOnly, false); + expect(userScripts[0].isForMainFrameOnly, false); expect(userScripts[1].source, 'window.d = webkit.messageHandlers.d;'); expect( userScripts[1].injectionTime, - WKUserScriptInjectionTime.atDocumentStart, + UserScriptInjectionTime.atDocumentStart, ); - expect(userScripts[0].isMainFrameOnly, false); + expect(userScripts[0].isForMainFrameOnly, false); }); testWidgets('removeJavascriptChannels', (WidgetTester tester) async { @@ -1023,9 +1091,9 @@ void main() { expect(userScripts[0].source, 'window.d = webkit.messageHandlers.d;'); expect( userScripts[0].injectionTime, - WKUserScriptInjectionTime.atDocumentStart, + UserScriptInjectionTime.atDocumentStart, ); - expect(userScripts[0].isMainFrameOnly, false); + expect(userScripts[0].isForMainFrameOnly, false); }); testWidgets('removeJavascriptChannels with zoom disabled', @@ -1060,9 +1128,8 @@ void main() { verify(mocks.userContentController.addUserScript(captureAny)) .captured .first as WKUserScript; - expect(zoomScript.isMainFrameOnly, isTrue); - expect( - zoomScript.injectionTime, WKUserScriptInjectionTime.atDocumentEnd); + expect(zoomScript.isForMainFrameOnly, isTrue); + expect(zoomScript.injectionTime, UserScriptInjectionTime.atDocumentEnd); expect( zoomScript.source, "var meta = document.createElement('meta');\n" @@ -1079,7 +1146,8 @@ void main() { final _WebViewMocks mocks = configureMocks(); await buildWidget(tester, mocks); - final void Function(WKWebView, String) didStartProvisionalNavigation = + final void Function(WKNavigationDelegate, WKWebView, String) + didStartProvisionalNavigation = verify(mocks.webViewWidgetProxy.createNavigationDelegate( didFinishNavigation: anyNamed('didFinishNavigation'), didStartProvisionalNavigation: @@ -1091,8 +1159,17 @@ void main() { anyNamed('didFailProvisionalNavigation'), webViewWebContentProcessDidTerminate: anyNamed('webViewWebContentProcessDidTerminate'), - )).captured.single as void Function(WKWebView, String); - didStartProvisionalNavigation(mocks.webView, 'https://google.com'); + decidePolicyForNavigationResponse: + anyNamed('decidePolicyForNavigationResponse'), + didReceiveAuthenticationChallenge: + anyNamed('didReceiveAuthenticationChallenge'), + )).captured.single as void Function( + WKNavigationDelegate, WKWebView, String); + didStartProvisionalNavigation( + mocks.navigationDelegate, + mocks.webView, + 'https://google.com', + ); verify(mocks.callbacksHandler.onPageStarted('https://google.com')); }); @@ -1101,7 +1178,8 @@ void main() { final _WebViewMocks mocks = configureMocks(); await buildWidget(tester, mocks); - final void Function(WKWebView, String) didFinishNavigation = + final void Function(WKNavigationDelegate, WKWebView, String) + didFinishNavigation = verify(mocks.webViewWidgetProxy.createNavigationDelegate( didFinishNavigation: captureAnyNamed('didFinishNavigation'), didStartProvisionalNavigation: @@ -1113,8 +1191,17 @@ void main() { anyNamed('didFailProvisionalNavigation'), webViewWebContentProcessDidTerminate: anyNamed('webViewWebContentProcessDidTerminate'), - )).captured.single as void Function(WKWebView, String); - didFinishNavigation(mocks.webView, 'https://google.com'); + decidePolicyForNavigationResponse: + anyNamed('decidePolicyForNavigationResponse'), + didReceiveAuthenticationChallenge: + anyNamed('didReceiveAuthenticationChallenge'), + )).captured.single as void Function( + WKNavigationDelegate, WKWebView, String); + didFinishNavigation( + mocks.navigationDelegate, + mocks.webView, + 'https://google.com', + ); verify(mocks.callbacksHandler.onPageFinished('https://google.com')); }); @@ -1124,7 +1211,8 @@ void main() { final _WebViewMocks mocks = configureMocks(); await buildWidget(tester, mocks); - final void Function(WKWebView, NSError) didFailNavigation = + final void Function(WKNavigationDelegate, WKWebView, NSError) + didFailNavigation = verify(mocks.webViewWidgetProxy.createNavigationDelegate( didFinishNavigation: anyNamed('didFinishNavigation'), didStartProvisionalNavigation: @@ -1136,16 +1224,23 @@ void main() { anyNamed('didFailProvisionalNavigation'), webViewWebContentProcessDidTerminate: anyNamed('webViewWebContentProcessDidTerminate'), - )).captured.single as void Function(WKWebView, NSError); + decidePolicyForNavigationResponse: + anyNamed('decidePolicyForNavigationResponse'), + didReceiveAuthenticationChallenge: + anyNamed('didReceiveAuthenticationChallenge'), + )).captured.single as void Function( + WKNavigationDelegate, WKWebView, NSError); didFailNavigation( + mocks.navigationDelegate, mocks.webView, - const NSError( + NSError.pigeon_detached( code: WKErrorCode.webViewInvalidated, domain: 'domain', - userInfo: { + userInfo: const { NSErrorUserInfoKey.NSLocalizedDescription: 'my desc', }, + pigeon_instanceManager: TestInstanceManager(), ), ); @@ -1164,7 +1259,8 @@ void main() { final _WebViewMocks mocks = configureMocks(); await buildWidget(tester, mocks); - final void Function(WKWebView, NSError) didFailProvisionalNavigation = + final void Function(WKNavigationDelegate, WKWebView, NSError) + didFailProvisionalNavigation = verify(mocks.webViewWidgetProxy.createNavigationDelegate( didFinishNavigation: anyNamed('didFinishNavigation'), didStartProvisionalNavigation: @@ -1176,16 +1272,23 @@ void main() { captureAnyNamed('didFailProvisionalNavigation'), webViewWebContentProcessDidTerminate: anyNamed('webViewWebContentProcessDidTerminate'), - )).captured.single as void Function(WKWebView, NSError); + decidePolicyForNavigationResponse: + anyNamed('decidePolicyForNavigationResponse'), + didReceiveAuthenticationChallenge: + anyNamed('didReceiveAuthenticationChallenge'), + )).captured.single as void Function( + WKNavigationDelegate, WKWebView, NSError); didFailProvisionalNavigation( + mocks.navigationDelegate, mocks.webView, - const NSError( + NSError.pigeon_detached( code: WKErrorCode.webContentProcessTerminated, domain: 'domain', - userInfo: { + userInfo: const { NSErrorUserInfoKey.NSLocalizedDescription: 'my desc', }, + pigeon_instanceManager: TestInstanceManager(), ), ); @@ -1208,7 +1311,8 @@ void main() { final _WebViewMocks mocks = configureMocks(); await buildWidget(tester, mocks); - final void Function(WKWebView) webViewWebContentProcessDidTerminate = + final void Function(WKNavigationDelegate, WKWebView) + webViewWebContentProcessDidTerminate = verify(mocks.webViewWidgetProxy.createNavigationDelegate( didFinishNavigation: anyNamed('didFinishNavigation'), didStartProvisionalNavigation: @@ -1220,8 +1324,15 @@ void main() { anyNamed('didFailProvisionalNavigation'), webViewWebContentProcessDidTerminate: captureAnyNamed('webViewWebContentProcessDidTerminate'), - )).captured.single as void Function(WKWebView); - webViewWebContentProcessDidTerminate(mocks.webView); + decidePolicyForNavigationResponse: + anyNamed('decidePolicyForNavigationResponse'), + didReceiveAuthenticationChallenge: + anyNamed('didReceiveAuthenticationChallenge'), + )).captured.single as void Function(WKNavigationDelegate, WKWebView); + webViewWebContentProcessDidTerminate( + mocks.navigationDelegate, + mocks.webView, + ); final WebResourceError error = verify(mocks.callbacksHandler.onWebResourceError(captureAny)) @@ -1241,8 +1352,9 @@ void main() { final _WebViewMocks mocks = configureMocks(); await buildWidget(tester, mocks, hasNavigationDelegate: true); - final Future Function( - WKWebView, WKNavigationAction) decidePolicyForNavigationAction = + final Future Function( + WKNavigationDelegate, WKWebView, WKNavigationAction) + decidePolicyForNavigationAction = verify(mocks.webViewWidgetProxy.createNavigationDelegate( didFinishNavigation: anyNamed('didFinishNavigation'), didStartProvisionalNavigation: @@ -1254,26 +1366,39 @@ void main() { anyNamed('didFailProvisionalNavigation'), webViewWebContentProcessDidTerminate: anyNamed('webViewWebContentProcessDidTerminate'), - )).captured.single as Future Function( - WKWebView, WKNavigationAction); + decidePolicyForNavigationResponse: + anyNamed('decidePolicyForNavigationResponse'), + didReceiveAuthenticationChallenge: + anyNamed('didReceiveAuthenticationChallenge'), + )).captured.single as Future Function( + WKNavigationDelegate, WKWebView, WKNavigationAction); when(mocks.callbacksHandler.onNavigationRequest( isForMainFrame: argThat(isFalse, named: 'isForMainFrame'), url: 'https://google.com', )).thenReturn(true); + final MockURLRequest mockRequest = MockURLRequest(); + when(mockRequest.getUrl()).thenAnswer( + (_) => Future.value('https://google.com'), + ); + expect( - decidePolicyForNavigationAction( + await decidePolicyForNavigationAction( + mocks.navigationDelegate, mocks.webView, - const WKNavigationAction( - request: NSUrlRequest(url: 'https://google.com'), - targetFrame: WKFrameInfo( - isMainFrame: false, - request: NSUrlRequest(url: 'https://google.com')), - navigationType: WKNavigationType.linkActivated, + WKNavigationAction.pigeon_detached( + request: mockRequest, + targetFrame: WKFrameInfo.pigeon_detached( + isMainFrame: false, + request: mockRequest, + pigeon_instanceManager: TestInstanceManager(), + ), + navigationType: NavigationType.linkActivated, + pigeon_instanceManager: TestInstanceManager(), ), ), - completion(WKNavigationActionPolicy.allow), + NavigationActionPolicy.allow, ); verify(mocks.callbacksHandler.onNavigationRequest( @@ -1288,24 +1413,22 @@ void main() { verify(mocks.webView.addObserver( mocks.webView, - keyPath: 'estimatedProgress', - options: { - NSKeyValueObservingOptions.newValue, - }, + 'estimatedProgress', + [KeyValueObservingOptions.newValue], )); - final void Function(String, NSObject, Map) + final void Function(String, NSObject, Map) observeValue = verify(mocks.webViewWidgetProxy.createWebView(any, observeValue: captureAnyNamed('observeValue'))) .captured .single as void Function( - String, NSObject, Map); + String, NSObject, Map); observeValue( 'estimatedProgress', mocks.webView, - {NSKeyValueChangeKey.newValue: 0.32}, + {KeyValueChangeKey.newValue: 0.32}, ); verify(mocks.callbacksHandler.onProgress(32)); @@ -1318,7 +1441,7 @@ void main() { verifyNever(mocks.webView.removeObserver( mocks.webView, - keyPath: 'estimatedProgress', + 'estimatedProgress', )); }); }); @@ -1338,18 +1461,24 @@ void main() { await buildWidget(tester, mocks); await testController.addJavascriptChannels({'hello'}); - final void Function(WKUserContentController, WKScriptMessage) - didReceiveScriptMessage = verify(mocks.webViewWidgetProxy - .createScriptMessageHandler( - didReceiveScriptMessage: - captureAnyNamed('didReceiveScriptMessage'))) - .captured - .single - as void Function(WKUserContentController, WKScriptMessage); + final void Function(WKScriptMessageHandler, WKUserContentController, + WKScriptMessage) didReceiveScriptMessage = verify( + mocks.webViewWidgetProxy.createScriptMessageHandler( + didReceiveScriptMessage: + captureAnyNamed('didReceiveScriptMessage'))) + .captured + .single + as void Function(WKScriptMessageHandler, WKUserContentController, + WKScriptMessage); didReceiveScriptMessage( + MockWKScriptMessageHandler(), mocks.userContentController, - const WKScriptMessage(name: 'hello', body: 'A message.'), + WKScriptMessage.pigeon_detached( + name: 'hello', + body: 'A message.', + pigeon_instanceManager: TestInstanceManager(), + ), ); verify(mocks.javascriptChannelRegistry.onJavascriptChannelMessage( 'hello', @@ -1374,9 +1503,10 @@ class _WebViewMocks { required this.navigationDelegate, required this.callbacksHandler, required this.javascriptChannelRegistry, + required this.webpagePreferences, }); - final MockWKWebViewIOS webView; + final MockUIViewWKWebView webView; final MockWebViewWidgetProxy webViewWidgetProxy; final MockWKUserContentController userContentController; final MockWKPreferences preferences; @@ -1387,4 +1517,10 @@ class _WebViewMocks { final MockWKNavigationDelegate navigationDelegate; final MockWebViewPlatformCallbacksHandler callbacksHandler; final MockJavascriptChannelRegistry javascriptChannelRegistry; + final MockWKWebpagePreferences webpagePreferences; +} + +// Test InstanceManager that sets `onWeakReferenceRemoved` as a noop. +class TestInstanceManager extends PigeonInstanceManager { + TestInstanceManager() : super(onWeakReferenceRemoved: (_) {}); } 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 0c8876b9df0..94e5749c461 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,25 +1,23 @@ -// 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. // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i5; -import 'dart:math' as _i2; -import 'dart:ui' as _i6; +import 'dart:async' as _i4; +import 'dart:typed_data' as _i5; import 'package:mockito/mockito.dart' as _i1; import 'package:webview_flutter_platform_interface/src/legacy/types/javascript_channel.dart' - as _i9; + as _i7; import 'package:webview_flutter_platform_interface/src/legacy/types/types.dart' - as _i10; -import 'package:webview_flutter_platform_interface/src/webview_flutter_platform_interface_legacy.dart' as _i8; -import 'package:webview_flutter_wkwebview/src/foundation/foundation.dart' - as _i7; +import 'package:webview_flutter_platform_interface/src/webview_flutter_platform_interface_legacy.dart' + as _i6; +import 'package:webview_flutter_wkwebview/src/common/platform_webview.dart' + as _i3; +import 'package:webview_flutter_wkwebview/src/common/web_kit.g.dart' as _i2; import 'package:webview_flutter_wkwebview/src/legacy/web_kit_webview_widget.dart' - as _i11; -import 'package:webview_flutter_wkwebview/src/ui_kit/ui_kit.dart' as _i3; -import 'package:webview_flutter_wkwebview/src/web_kit/web_kit.dart' as _i4; + as _i9; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -29,1439 +27,1261 @@ import 'package:webview_flutter_wkwebview/src/web_kit/web_kit.dart' as _i4; // 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 // ignore_for_file: subtype_of_sealed_class -class _FakePoint_0 extends _i1.SmartFake - implements _i2.Point { - _FakePoint_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); +class _FakePigeonInstanceManager_0 extends _i1.SmartFake + implements _i2.PigeonInstanceManager { + _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); } -class _FakeUIScrollView_1 extends _i1.SmartFake implements _i3.UIScrollView { - _FakeUIScrollView_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); +class _FakeURLRequest_2 extends _i1.SmartFake implements _i2.URLRequest { + _FakeURLRequest_2(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeWKNavigationDelegate_2 extends _i1.SmartFake - implements _i4.WKNavigationDelegate { - _FakeWKNavigationDelegate_2( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); +class _FakeWKNavigationDelegate_3 extends _i1.SmartFake + implements _i2.WKNavigationDelegate { + _FakeWKNavigationDelegate_3(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeWKPreferences_3 extends _i1.SmartFake implements _i4.WKPreferences { - _FakeWKPreferences_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); } -class _FakeWKScriptMessageHandler_4 extends _i1.SmartFake - implements _i4.WKScriptMessageHandler { - _FakeWKScriptMessageHandler_4( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); +class _FakeWKScriptMessageHandler_5 extends _i1.SmartFake + implements _i2.WKScriptMessageHandler { + _FakeWKScriptMessageHandler_5(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeWKWebViewConfiguration_5 extends _i1.SmartFake - implements _i4.WKWebViewConfiguration { - _FakeWKWebViewConfiguration_5( - 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_6 extends _i1.SmartFake implements _i4.WKWebView { - _FakeWKWebView_6( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); +class _FakeWKWebViewConfiguration_7 extends _i1.SmartFake + implements _i2.WKWebViewConfiguration { + _FakeWKWebViewConfiguration_7(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeWKUserContentController_7 extends _i1.SmartFake - implements _i4.WKUserContentController { - _FakeWKUserContentController_7( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); +class _FakeUIViewWKWebView_8 extends _i1.SmartFake + implements _i2.UIViewWKWebView { + _FakeUIViewWKWebView_8(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeWKWebsiteDataStore_8 extends _i1.SmartFake - implements _i4.WKWebsiteDataStore { - _FakeWKWebsiteDataStore_8( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); +class _FakeWKUserContentController_9 extends _i1.SmartFake + implements _i2.WKUserContentController { + _FakeWKUserContentController_9(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeWKHttpCookieStore_9 extends _i1.SmartFake - implements _i4.WKHttpCookieStore { - _FakeWKHttpCookieStore_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); } -class _FakeWKUIDelegate_10 extends _i1.SmartFake implements _i4.WKUIDelegate { - _FakeWKUIDelegate_10( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); +class _FakeWKWebpagePreferences_11 extends _i1.SmartFake + implements _i2.WKWebpagePreferences { + _FakeWKWebpagePreferences_11(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); +} + +class _FakeWKHTTPCookieStore_12 extends _i1.SmartFake + implements _i2.WKHTTPCookieStore { + _FakeWKHTTPCookieStore_12(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); +} + +class _FakeWKUIDelegate_13 extends _i1.SmartFake implements _i2.WKUIDelegate { + _FakeWKUIDelegate_13(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); +} + +class _FakePlatformWebView_14 extends _i1.SmartFake + implements _i3.PlatformWebView { + _FakePlatformWebView_14(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [UIScrollView]. /// /// See the documentation for Mockito's code generation for more information. -// ignore: must_be_immutable -class MockUIScrollView extends _i1.Mock implements _i3.UIScrollView { +class MockUIScrollView extends _i1.Mock implements _i2.UIScrollView { MockUIScrollView() { _i1.throwOnMissingStub(this); } @override - _i5.Future<_i2.Point> getContentOffset() => (super.noSuchMethod( - Invocation.method( - #getContentOffset, - [], - ), - returnValue: _i5.Future<_i2.Point>.value(_FakePoint_0( + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( this, - Invocation.method( - #getContentOffset, - [], - ), - )), - ) as _i5.Future<_i2.Point>); + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); @override - _i5.Future scrollBy(_i2.Point? offset) => (super.noSuchMethod( - Invocation.method( - #scrollBy, - [offset], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.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); @override - _i5.Future setContentOffset(_i2.Point? offset) => + _i4.Future setContentOffset(double? x, double? y) => (super.noSuchMethod( - Invocation.method( - #setContentOffset, - [offset], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setContentOffset, [x, y]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future setDelegate(_i3.UIScrollViewDelegate? delegate) => + _i4.Future setDelegate(_i2.UIScrollViewDelegate? delegate) => (super.noSuchMethod( - Invocation.method( - #setDelegate, - [delegate], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setDelegate, [delegate]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.UIScrollView copy() => (super.noSuchMethod( - Invocation.method( - #copy, - [], - ), + _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( - #copy, - [], - ), + Invocation.method(#pigeon_copy, []), ), - ) as _i3.UIScrollView); + ) as _i2.UIScrollView); @override - _i5.Future setBackgroundColor(_i6.Color? color) => (super.noSuchMethod( - Invocation.method( - #setBackgroundColor, - [color], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i4.Future setBackgroundColor(int? value) => (super.noSuchMethod( + Invocation.method(#setBackgroundColor, [value]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future setOpaque(bool? opaque) => (super.noSuchMethod( - Invocation.method( - #setOpaque, - [opaque], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i4.Future setOpaque(bool? opaque) => (super.noSuchMethod( + Invocation.method(#setOpaque, [opaque]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future addObserver( - _i7.NSObject? observer, { - required String? keyPath, - required Set<_i7.NSKeyValueObservingOptions>? options, - }) => + _i4.Future addObserver( + _i2.NSObject? observer, + String? keyPath, + List<_i2.KeyValueObservingOptions>? options, + ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [observer], - { - #keyPath: keyPath, - #options: options, - }, - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future removeObserver( - _i7.NSObject? observer, { - required String? keyPath, - }) => + _i4.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method( - #removeObserver, - [observer], - {#keyPath: keyPath}, - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); } -/// A class which mocks [WKNavigationDelegate]. +/// A class which mocks [URLRequest]. /// /// See the documentation for Mockito's code generation for more information. -// ignore: must_be_immutable -class MockWKNavigationDelegate extends _i1.Mock - implements _i4.WKNavigationDelegate { - MockWKNavigationDelegate() { +class MockURLRequest extends _i1.Mock implements _i2.URLRequest { + MockURLRequest() { _i1.throwOnMissingStub(this); } @override - _i4.WKNavigationDelegate copy() => (super.noSuchMethod( - Invocation.method( - #copy, - [], - ), - returnValue: _FakeWKNavigationDelegate_2( + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( this, - Invocation.method( - #copy, - [], - ), + Invocation.getter(#pigeon_instanceManager), ), - ) as _i4.WKNavigationDelegate); + ) as _i2.PigeonInstanceManager); @override - _i5.Future addObserver( - _i7.NSObject? observer, { - required String? keyPath, - required Set<_i7.NSKeyValueObservingOptions>? options, - }) => - (super.noSuchMethod( - Invocation.method( - #addObserver, - [observer], - { - #keyPath: keyPath, - #options: options, - }, - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i4.Future getUrl() => (super.noSuchMethod( + Invocation.method(#getUrl, []), + returnValue: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future removeObserver( - _i7.NSObject? observer, { - required String? keyPath, - }) => - (super.noSuchMethod( - Invocation.method( - #removeObserver, - [observer], - {#keyPath: keyPath}, - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); -} - -/// A class which mocks [WKPreferences]. -/// -/// See the documentation for Mockito's code generation for more information. -// ignore: must_be_immutable -class MockWKPreferences extends _i1.Mock implements _i4.WKPreferences { - MockWKPreferences() { - _i1.throwOnMissingStub(this); - } + _i4.Future setHttpMethod(String? method) => (super.noSuchMethod( + Invocation.method(#setHttpMethod, [method]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future setJavaScriptEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method( - #setJavaScriptEnabled, - [enabled], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i4.Future getHttpMethod() => (super.noSuchMethod( + Invocation.method(#getHttpMethod, []), + returnValue: _i4.Future.value(), + ) as _i4.Future); @override - _i4.WKPreferences copy() => (super.noSuchMethod( - Invocation.method( - #copy, - [], - ), - returnValue: _FakeWKPreferences_3( - this, - Invocation.method( - #copy, - [], - ), - ), - ) as _i4.WKPreferences); + _i4.Future setHttpBody(_i5.Uint8List? body) => (super.noSuchMethod( + Invocation.method(#setHttpBody, [body]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future addObserver( - _i7.NSObject? observer, { - required String? keyPath, - required Set<_i7.NSKeyValueObservingOptions>? options, - }) => - (super.noSuchMethod( - Invocation.method( - #addObserver, - [observer], - { - #keyPath: keyPath, - #options: options, - }, - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i4.Future<_i5.Uint8List?> getHttpBody() => (super.noSuchMethod( + Invocation.method(#getHttpBody, []), + returnValue: _i4.Future<_i5.Uint8List?>.value(), + ) as _i4.Future<_i5.Uint8List?>); @override - _i5.Future removeObserver( - _i7.NSObject? observer, { - required String? keyPath, - }) => + _i4.Future setAllHttpHeaderFields(Map? fields) => (super.noSuchMethod( - Invocation.method( - #removeObserver, - [observer], - {#keyPath: keyPath}, - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); -} - -/// A class which mocks [WKScriptMessageHandler]. -/// -/// See the documentation for Mockito's code generation for more information. -// ignore: must_be_immutable -class MockWKScriptMessageHandler extends _i1.Mock - implements _i4.WKScriptMessageHandler { - MockWKScriptMessageHandler() { - _i1.throwOnMissingStub(this); - } + Invocation.method(#setAllHttpHeaderFields, [fields]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - void Function( - _i4.WKUserContentController, - _i4.WKScriptMessage, - ) get didReceiveScriptMessage => (super.noSuchMethod( - Invocation.getter(#didReceiveScriptMessage), - returnValue: ( - _i4.WKUserContentController userContentController, - _i4.WKScriptMessage message, - ) {}, - ) as void Function( - _i4.WKUserContentController, - _i4.WKScriptMessage, - )); + _i4.Future?> getAllHttpHeaderFields() => + (super.noSuchMethod( + Invocation.method(#getAllHttpHeaderFields, []), + returnValue: _i4.Future?>.value(), + ) as _i4.Future?>); @override - _i4.WKScriptMessageHandler copy() => (super.noSuchMethod( - Invocation.method( - #copy, - [], - ), - returnValue: _FakeWKScriptMessageHandler_4( + _i2.URLRequest pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeURLRequest_2( this, - Invocation.method( - #copy, - [], - ), + Invocation.method(#pigeon_copy, []), ), - ) as _i4.WKScriptMessageHandler); + ) as _i2.URLRequest); @override - _i5.Future addObserver( - _i7.NSObject? observer, { - required String? keyPath, - required Set<_i7.NSKeyValueObservingOptions>? options, - }) => + _i4.Future addObserver( + _i2.NSObject? observer, + String? keyPath, + List<_i2.KeyValueObservingOptions>? options, + ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [observer], - { - #keyPath: keyPath, - #options: options, - }, - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future removeObserver( - _i7.NSObject? observer, { - required String? keyPath, - }) => + _i4.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method( - #removeObserver, - [observer], - {#keyPath: keyPath}, - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); } -/// A class which mocks [WKWebViewIOS]. +/// A class which mocks [WKNavigationDelegate]. /// /// See the documentation for Mockito's code generation for more information. -class MockWKWebViewIOS extends _i1.Mock implements _i4.WKWebViewIOS { - MockWKWebViewIOS() { +class MockWKNavigationDelegate extends _i1.Mock + implements _i2.WKNavigationDelegate { + MockWKNavigationDelegate() { _i1.throwOnMissingStub(this); } @override - _i3.UIScrollView get scrollView => (super.noSuchMethod( - Invocation.getter(#scrollView), - returnValue: _FakeUIScrollView_1( - this, - Invocation.getter(#scrollView), - ), - ) as _i3.UIScrollView); + _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.WKWebViewConfiguration get configuration => (super.noSuchMethod( - Invocation.getter(#configuration), - returnValue: _FakeWKWebViewConfiguration_5( - this, - Invocation.getter(#configuration), - ), - ) as _i4.WKWebViewConfiguration); + _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.WKWebView copy() => (super.noSuchMethod( - Invocation.method( - #copy, - [], - ), - returnValue: _FakeWKWebView_6( - this, - Invocation.method( - #copy, - [], - ), - ), - ) as _i4.WKWebView); + _i4.Future> 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>.value([]), + ) as _i4.Future> Function( + _i2.WKNavigationDelegate, + _i2.WKWebView, + _i2.URLAuthenticationChallenge, + )); @override - _i5.Future setBackgroundColor(_i6.Color? color) => (super.noSuchMethod( - Invocation.method( - #setBackgroundColor, - [color], + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + ) as _i2.PigeonInstanceManager); @override - _i5.Future setOpaque(bool? opaque) => (super.noSuchMethod( - Invocation.method( - #setOpaque, - [opaque], + _i2.WKNavigationDelegate pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKNavigationDelegate_3( + this, + Invocation.method(#pigeon_copy, []), ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + ) as _i2.WKNavigationDelegate); @override - _i5.Future setUIDelegate(_i4.WKUIDelegate? delegate) => + _i4.Future addObserver( + _i2.NSObject? observer, + String? keyPath, + List<_i2.KeyValueObservingOptions>? options, + ) => (super.noSuchMethod( - Invocation.method( - #setUIDelegate, - [delegate], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future setNavigationDelegate(_i4.WKNavigationDelegate? delegate) => + _i4.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method( - #setNavigationDelegate, - [delegate], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); +} - @override - _i5.Future getUrl() => (super.noSuchMethod( - Invocation.method( - #getUrl, - [], - ), - returnValue: _i5.Future.value(), - ) as _i5.Future); +/// A class which mocks [WKPreferences]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockWKPreferences extends _i1.Mock implements _i2.WKPreferences { + MockWKPreferences() { + _i1.throwOnMissingStub(this); + } @override - _i5.Future getEstimatedProgress() => (super.noSuchMethod( - Invocation.method( - #getEstimatedProgress, - [], + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), ), - returnValue: _i5.Future.value(0.0), - ) as _i5.Future); + ) as _i2.PigeonInstanceManager); @override - _i5.Future loadRequest(_i7.NSUrlRequest? request) => - (super.noSuchMethod( - Invocation.method( - #loadRequest, - [request], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i4.Future setJavaScriptEnabled(bool? enabled) => (super.noSuchMethod( + Invocation.method(#setJavaScriptEnabled, [enabled]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future loadHtmlString( - String? string, { - String? baseUrl, - }) => - (super.noSuchMethod( - Invocation.method( - #loadHtmlString, - [string], - {#baseUrl: baseUrl}, + _i2.WKPreferences pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKPreferences_4( + this, + Invocation.method(#pigeon_copy, []), ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + ) as _i2.WKPreferences); @override - _i5.Future loadFileUrl( - String? url, { - required String? readAccessUrl, - }) => + _i4.Future addObserver( + _i2.NSObject? observer, + String? keyPath, + List<_i2.KeyValueObservingOptions>? options, + ) => (super.noSuchMethod( - Invocation.method( - #loadFileUrl, - [url], - {#readAccessUrl: readAccessUrl}, - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - - @override - _i5.Future loadFlutterAsset(String? key) => (super.noSuchMethod( - Invocation.method( - #loadFlutterAsset, - [key], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - - @override - _i5.Future canGoBack() => (super.noSuchMethod( - Invocation.method( - #canGoBack, - [], - ), - returnValue: _i5.Future.value(false), - ) as _i5.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future canGoForward() => (super.noSuchMethod( - Invocation.method( - #canGoForward, - [], - ), - returnValue: _i5.Future.value(false), - ) as _i5.Future); + _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); +} - @override - _i5.Future goBack() => (super.noSuchMethod( - Invocation.method( - #goBack, - [], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); +/// A class which mocks [WKScriptMessageHandler]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockWKScriptMessageHandler extends _i1.Mock + implements _i2.WKScriptMessageHandler { + MockWKScriptMessageHandler() { + _i1.throwOnMissingStub(this); + } @override - _i5.Future goForward() => (super.noSuchMethod( - Invocation.method( - #goForward, - [], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + void Function( + _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 - _i5.Future reload() => (super.noSuchMethod( - Invocation.method( - #reload, - [], + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + ) as _i2.PigeonInstanceManager); @override - _i5.Future getTitle() => (super.noSuchMethod( - Invocation.method( - #getTitle, - [], + _i2.WKScriptMessageHandler pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKScriptMessageHandler_5( + this, + Invocation.method(#pigeon_copy, []), ), - returnValue: _i5.Future.value(), - ) as _i5.Future); + ) as _i2.WKScriptMessageHandler); @override - _i5.Future getCustomUserAgent() => (super.noSuchMethod( - Invocation.method( - #getCustomUserAgent, - [], - ), - returnValue: _i5.Future.value(), - ) as _i5.Future); + _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 - _i5.Future setAllowsBackForwardNavigationGestures(bool? allow) => + _i4.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method( - #setAllowsBackForwardNavigationGestures, - [allow], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); +} - @override - _i5.Future setCustomUserAgent(String? userAgent) => (super.noSuchMethod( - Invocation.method( - #setCustomUserAgent, - [userAgent], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); +/// A class which mocks [WKWebView]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockWKWebView extends _i1.Mock implements _i2.WKWebView { + MockWKWebView() { + _i1.throwOnMissingStub(this); + } @override - _i5.Future evaluateJavaScript(String? javaScriptString) => - (super.noSuchMethod( - Invocation.method( - #evaluateJavaScript, - [javaScriptString], + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), ), - returnValue: _i5.Future.value(), - ) as _i5.Future); + ) as _i2.PigeonInstanceManager); @override - _i5.Future setInspectable(bool? inspectable) => (super.noSuchMethod( - Invocation.method( - #setInspectable, - [inspectable], + _i2.WKWebView pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKWebView_6( + this, + Invocation.method(#pigeon_copy, []), ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + ) as _i2.WKWebView); @override - _i5.Future addObserver( - _i7.NSObject? observer, { - required String? keyPath, - required Set<_i7.NSKeyValueObservingOptions>? options, - }) => + _i4.Future addObserver( + _i2.NSObject? observer, + String? keyPath, + List<_i2.KeyValueObservingOptions>? options, + ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [observer], - { - #keyPath: keyPath, - #options: options, - }, - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future removeObserver( - _i7.NSObject? observer, { - required String? keyPath, - }) => + _i4.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method( - #removeObserver, - [observer], - {#keyPath: keyPath}, - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); } -/// A class which mocks [WKWebViewMacOS]. +/// A class which mocks [UIViewWKWebView]. /// /// See the documentation for Mockito's code generation for more information. -class MockWKWebViewMacOS extends _i1.Mock implements _i4.WKWebViewMacOS { - MockWKWebViewMacOS() { +class MockUIViewWKWebView extends _i1.Mock implements _i2.UIViewWKWebView { + MockUIViewWKWebView() { _i1.throwOnMissingStub(this); } @override - _i4.WKWebViewConfiguration get configuration => (super.noSuchMethod( + _i2.WKWebViewConfiguration get configuration => (super.noSuchMethod( Invocation.getter(#configuration), - returnValue: _FakeWKWebViewConfiguration_5( + returnValue: _FakeWKWebViewConfiguration_7( this, Invocation.getter(#configuration), ), - ) as _i4.WKWebViewConfiguration); + ) as _i2.WKWebViewConfiguration); @override - _i4.WKWebView copy() => (super.noSuchMethod( - Invocation.method( - #copy, - [], - ), - returnValue: _FakeWKWebView_6( + _i2.UIScrollView get scrollView => (super.noSuchMethod( + Invocation.getter(#scrollView), + returnValue: _FakeUIScrollView_1( this, - Invocation.method( - #copy, - [], - ), + Invocation.getter(#scrollView), ), - ) as _i4.WKWebView); + ) as _i2.UIScrollView); @override - _i5.Future setUIDelegate(_i4.WKUIDelegate? delegate) => - (super.noSuchMethod( - Invocation.method( - #setUIDelegate, - [delegate], + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + ) as _i2.PigeonInstanceManager); @override - _i5.Future setNavigationDelegate(_i4.WKNavigationDelegate? delegate) => - (super.noSuchMethod( - Invocation.method( - #setNavigationDelegate, - [delegate], + _i2.WKWebViewConfiguration pigeonVar_configuration() => (super.noSuchMethod( + Invocation.method(#pigeonVar_configuration, []), + returnValue: _FakeWKWebViewConfiguration_7( + this, + Invocation.method(#pigeonVar_configuration, []), ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + ) as _i2.WKWebViewConfiguration); @override - _i5.Future getUrl() => (super.noSuchMethod( - Invocation.method( - #getUrl, - [], + _i2.UIScrollView pigeonVar_scrollView() => (super.noSuchMethod( + Invocation.method(#pigeonVar_scrollView, []), + returnValue: _FakeUIScrollView_1( + this, + Invocation.method(#pigeonVar_scrollView, []), ), - returnValue: _i5.Future.value(), - ) as _i5.Future); + ) as _i2.UIScrollView); @override - _i5.Future getEstimatedProgress() => (super.noSuchMethod( - Invocation.method( - #getEstimatedProgress, - [], - ), - returnValue: _i5.Future.value(0.0), - ) as _i5.Future); + _i4.Future setUIDelegate(_i2.WKUIDelegate? delegate) => + (super.noSuchMethod( + Invocation.method(#setUIDelegate, [delegate]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future loadRequest(_i7.NSUrlRequest? request) => + _i4.Future setNavigationDelegate(_i2.WKNavigationDelegate? delegate) => (super.noSuchMethod( - Invocation.method( - #loadRequest, - [request], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setNavigationDelegate, [delegate]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future loadHtmlString( - String? string, { - String? baseUrl, - }) => - (super.noSuchMethod( - Invocation.method( - #loadHtmlString, - [string], - {#baseUrl: baseUrl}, - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i4.Future getUrl() => (super.noSuchMethod( + Invocation.method(#getUrl, []), + returnValue: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future loadFileUrl( - String? url, { - required String? readAccessUrl, - }) => + _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( - #loadFileUrl, - [url], - {#readAccessUrl: readAccessUrl}, - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#loadHtmlString, [string, baseUrl]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future loadFlutterAsset(String? key) => (super.noSuchMethod( - Invocation.method( - #loadFlutterAsset, - [key], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _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 - _i5.Future canGoBack() => (super.noSuchMethod( - Invocation.method( - #canGoBack, - [], - ), - returnValue: _i5.Future.value(false), - ) as _i5.Future); + _i4.Future loadFlutterAsset(String? key) => (super.noSuchMethod( + Invocation.method(#loadFlutterAsset, [key]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future canGoForward() => (super.noSuchMethod( - Invocation.method( - #canGoForward, - [], - ), - returnValue: _i5.Future.value(false), - ) as _i5.Future); + _i4.Future canGoBack() => (super.noSuchMethod( + Invocation.method(#canGoBack, []), + returnValue: _i4.Future.value(false), + ) as _i4.Future); @override - _i5.Future goBack() => (super.noSuchMethod( - Invocation.method( - #goBack, - [], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i4.Future canGoForward() => (super.noSuchMethod( + Invocation.method(#canGoForward, []), + returnValue: _i4.Future.value(false), + ) as _i4.Future); @override - _i5.Future goForward() => (super.noSuchMethod( - Invocation.method( - #goForward, - [], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i4.Future goBack() => (super.noSuchMethod( + Invocation.method(#goBack, []), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future reload() => (super.noSuchMethod( - Invocation.method( - #reload, - [], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i4.Future goForward() => (super.noSuchMethod( + Invocation.method(#goForward, []), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future getTitle() => (super.noSuchMethod( - Invocation.method( - #getTitle, - [], - ), - returnValue: _i5.Future.value(), - ) as _i5.Future); + _i4.Future reload() => (super.noSuchMethod( + Invocation.method(#reload, []), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future getCustomUserAgent() => (super.noSuchMethod( - Invocation.method( - #getCustomUserAgent, - [], - ), - returnValue: _i5.Future.value(), - ) as _i5.Future); + _i4.Future getTitle() => (super.noSuchMethod( + Invocation.method(#getTitle, []), + returnValue: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future setAllowsBackForwardNavigationGestures(bool? allow) => + _i4.Future setAllowsBackForwardNavigationGestures(bool? allow) => (super.noSuchMethod( - Invocation.method( - #setAllowsBackForwardNavigationGestures, - [allow], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setAllowsBackForwardNavigationGestures, [allow]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future setCustomUserAgent(String? userAgent) => (super.noSuchMethod( - Invocation.method( - #setCustomUserAgent, - [userAgent], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i4.Future setCustomUserAgent(String? userAgent) => (super.noSuchMethod( + Invocation.method(#setCustomUserAgent, [userAgent]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future evaluateJavaScript(String? javaScriptString) => + _i4.Future evaluateJavaScript(String? javaScriptString) => (super.noSuchMethod( - Invocation.method( - #evaluateJavaScript, - [javaScriptString], - ), - returnValue: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#evaluateJavaScript, [javaScriptString]), + returnValue: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future setInspectable(bool? inspectable) => (super.noSuchMethod( - Invocation.method( - #setInspectable, - [inspectable], + _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, []), ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + ) as _i2.UIViewWKWebView); @override - _i5.Future addObserver( - _i7.NSObject? observer, { - required String? keyPath, - required Set<_i7.NSKeyValueObservingOptions>? options, - }) => + _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( + _i2.NSObject? observer, + String? keyPath, + List<_i2.KeyValueObservingOptions>? options, + ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [observer], - { - #keyPath: keyPath, - #options: options, - }, - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future removeObserver( - _i7.NSObject? observer, { - required String? keyPath, - }) => + _i4.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method( - #removeObserver, - [observer], - {#keyPath: keyPath}, - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); } /// A class which mocks [WKWebViewConfiguration]. /// /// See the documentation for Mockito's code generation for more information. -// ignore: must_be_immutable class MockWKWebViewConfiguration extends _i1.Mock - implements _i4.WKWebViewConfiguration { + implements _i2.WKWebViewConfiguration { MockWKWebViewConfiguration() { _i1.throwOnMissingStub(this); } @override - _i4.WKUserContentController get userContentController => (super.noSuchMethod( - Invocation.getter(#userContentController), - returnValue: _FakeWKUserContentController_7( + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( this, - Invocation.getter(#userContentController), + Invocation.getter(#pigeon_instanceManager), ), - ) as _i4.WKUserContentController); + ) as _i2.PigeonInstanceManager); @override - _i4.WKPreferences get preferences => (super.noSuchMethod( - Invocation.getter(#preferences), - returnValue: _FakeWKPreferences_3( - this, - Invocation.getter(#preferences), - ), - ) as _i4.WKPreferences); + _i4.Future setUserContentController( + _i2.WKUserContentController? controller, + ) => + (super.noSuchMethod( + Invocation.method(#setUserContentController, [controller]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.WKWebsiteDataStore get websiteDataStore => (super.noSuchMethod( - Invocation.getter(#websiteDataStore), - returnValue: _FakeWKWebsiteDataStore_8( - this, - Invocation.getter(#websiteDataStore), + _i4.Future<_i2.WKUserContentController> getUserContentController() => + (super.noSuchMethod( + Invocation.method(#getUserContentController, []), + returnValue: _i4.Future<_i2.WKUserContentController>.value( + _FakeWKUserContentController_9( + this, + Invocation.method(#getUserContentController, []), + ), ), - ) as _i4.WKWebsiteDataStore); + ) as _i4.Future<_i2.WKUserContentController>); @override - _i5.Future setAllowsInlineMediaPlayback(bool? allow) => + _i4.Future setWebsiteDataStore(_i2.WKWebsiteDataStore? dataStore) => (super.noSuchMethod( - Invocation.method( - #setAllowsInlineMediaPlayback, - [allow], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setWebsiteDataStore, [dataStore]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future setLimitsNavigationsToAppBoundDomains(bool? limit) => + _i4.Future<_i2.WKWebsiteDataStore> getWebsiteDataStore() => (super.noSuchMethod( - Invocation.method( - #setLimitsNavigationsToAppBoundDomains, - [limit], + Invocation.method(#getWebsiteDataStore, []), + returnValue: _i4.Future<_i2.WKWebsiteDataStore>.value( + _FakeWKWebsiteDataStore_10( + this, + Invocation.method(#getWebsiteDataStore, []), + ), ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + ) as _i4.Future<_i2.WKWebsiteDataStore>); @override - _i5.Future setMediaTypesRequiringUserActionForPlayback( - Set<_i4.WKAudiovisualMediaType>? types) => + _i4.Future setPreferences(_i2.WKPreferences? preferences) => (super.noSuchMethod( - Invocation.method( - #setMediaTypesRequiringUserActionForPlayback, - [types], + 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, []), + ), ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + ) as _i4.Future<_i2.WKPreferences>); @override - _i4.WKWebViewConfiguration copy() => (super.noSuchMethod( - Invocation.method( - #copy, - [], + _i4.Future setAllowsInlineMediaPlayback(bool? allow) => + (super.noSuchMethod( + 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); + + @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 + _i4.Future<_i2.WKWebpagePreferences> getDefaultWebpagePreferences() => + (super.noSuchMethod( + Invocation.method(#getDefaultWebpagePreferences, []), + returnValue: _i4.Future<_i2.WKWebpagePreferences>.value( + _FakeWKWebpagePreferences_11( + this, + Invocation.method(#getDefaultWebpagePreferences, []), + ), ), - returnValue: _FakeWKWebViewConfiguration_5( + ) as _i4.Future<_i2.WKWebpagePreferences>); + + @override + _i2.WKWebViewConfiguration pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKWebViewConfiguration_7( this, - Invocation.method( - #copy, - [], - ), + Invocation.method(#pigeon_copy, []), ), - ) as _i4.WKWebViewConfiguration); + ) as _i2.WKWebViewConfiguration); @override - _i5.Future addObserver( - _i7.NSObject? observer, { - required String? keyPath, - required Set<_i7.NSKeyValueObservingOptions>? options, - }) => + _i4.Future addObserver( + _i2.NSObject? observer, + String? keyPath, + List<_i2.KeyValueObservingOptions>? options, + ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [observer], - { - #keyPath: keyPath, - #options: options, - }, - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future removeObserver( - _i7.NSObject? observer, { - required String? keyPath, - }) => + _i4.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method( - #removeObserver, - [observer], - {#keyPath: keyPath}, - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); } /// A class which mocks [WKWebsiteDataStore]. /// /// See the documentation for Mockito's code generation for more information. -// ignore: must_be_immutable class MockWKWebsiteDataStore extends _i1.Mock - implements _i4.WKWebsiteDataStore { + implements _i2.WKWebsiteDataStore { MockWKWebsiteDataStore() { _i1.throwOnMissingStub(this); } @override - _i4.WKHttpCookieStore get httpCookieStore => (super.noSuchMethod( + _i2.WKHTTPCookieStore get httpCookieStore => (super.noSuchMethod( Invocation.getter(#httpCookieStore), - returnValue: _FakeWKHttpCookieStore_9( + returnValue: _FakeWKHTTPCookieStore_12( this, Invocation.getter(#httpCookieStore), ), - ) as _i4.WKHttpCookieStore); + ) as _i2.WKHTTPCookieStore); @override - _i5.Future removeDataOfTypes( - Set<_i4.WKWebsiteDataType>? dataTypes, - DateTime? since, - ) => - (super.noSuchMethod( - Invocation.method( - #removeDataOfTypes, - [ - dataTypes, - since, - ], + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), ), - returnValue: _i5.Future.value(false), - ) as _i5.Future); + ) as _i2.PigeonInstanceManager); @override - _i4.WKWebsiteDataStore copy() => (super.noSuchMethod( - Invocation.method( - #copy, - [], - ), - returnValue: _FakeWKWebsiteDataStore_8( + _i2.WKHTTPCookieStore pigeonVar_httpCookieStore() => (super.noSuchMethod( + Invocation.method(#pigeonVar_httpCookieStore, []), + returnValue: _FakeWKHTTPCookieStore_12( this, - Invocation.method( - #copy, - [], - ), + Invocation.method(#pigeonVar_httpCookieStore, []), ), - ) as _i4.WKWebsiteDataStore); + ) as _i2.WKHTTPCookieStore); @override - _i5.Future addObserver( - _i7.NSObject? observer, { - required String? keyPath, - required Set<_i7.NSKeyValueObservingOptions>? options, - }) => + _i4.Future removeDataOfTypes( + List<_i2.WebsiteDataType>? dataTypes, + double? modificationTimeInSecondsSinceEpoch, + ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [observer], - { - #keyPath: keyPath, - #options: options, - }, + 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, []), ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + ) as _i2.WKWebsiteDataStore); @override - _i5.Future removeObserver( - _i7.NSObject? observer, { - required String? keyPath, - }) => + _i4.Future addObserver( + _i2.NSObject? observer, + String? keyPath, + List<_i2.KeyValueObservingOptions>? options, + ) => (super.noSuchMethod( - Invocation.method( - #removeObserver, - [observer], - {#keyPath: keyPath}, - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.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); } /// A class which mocks [WKUIDelegate]. /// /// See the documentation for Mockito's code generation for more information. -// ignore: must_be_immutable -class MockWKUIDelegate extends _i1.Mock implements _i4.WKUIDelegate { +class MockWKUIDelegate extends _i1.Mock implements _i2.WKUIDelegate { MockWKUIDelegate() { _i1.throwOnMissingStub(this); } @override - _i4.WKUIDelegate copy() => (super.noSuchMethod( - Invocation.method( - #copy, - [], + _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), ), - returnValue: _FakeWKUIDelegate_10( + ) as _i2.PigeonInstanceManager); + + @override + _i2.WKUIDelegate pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKUIDelegate_13( this, - Invocation.method( - #copy, - [], - ), + Invocation.method(#pigeon_copy, []), ), - ) as _i4.WKUIDelegate); + ) as _i2.WKUIDelegate); @override - _i5.Future addObserver( - _i7.NSObject? observer, { - required String? keyPath, - required Set<_i7.NSKeyValueObservingOptions>? options, - }) => + _i4.Future addObserver( + _i2.NSObject? observer, + String? keyPath, + List<_i2.KeyValueObservingOptions>? options, + ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [observer], - { - #keyPath: keyPath, - #options: options, - }, - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future removeObserver( - _i7.NSObject? observer, { - required String? keyPath, - }) => + _i4.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method( - #removeObserver, - [observer], - {#keyPath: keyPath}, - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); } /// A class which mocks [WKUserContentController]. /// /// See the documentation for Mockito's code generation for more information. -// ignore: must_be_immutable class MockWKUserContentController extends _i1.Mock - implements _i4.WKUserContentController { + implements _i2.WKUserContentController { MockWKUserContentController() { _i1.throwOnMissingStub(this); } @override - _i5.Future addScriptMessageHandler( - _i4.WKScriptMessageHandler? handler, + _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( + _i2.WKScriptMessageHandler? handler, String? name, ) => (super.noSuchMethod( - Invocation.method( - #addScriptMessageHandler, - [ - handler, - name, - ], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#addScriptMessageHandler, [handler, name]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future removeScriptMessageHandler(String? name) => + _i4.Future removeScriptMessageHandler(String? name) => (super.noSuchMethod( - Invocation.method( - #removeScriptMessageHandler, - [name], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#removeScriptMessageHandler, [name]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future removeAllScriptMessageHandlers() => (super.noSuchMethod( - Invocation.method( - #removeAllScriptMessageHandlers, - [], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i4.Future removeAllScriptMessageHandlers() => (super.noSuchMethod( + Invocation.method(#removeAllScriptMessageHandlers, []), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future addUserScript(_i4.WKUserScript? userScript) => + _i4.Future addUserScript(_i2.WKUserScript? userScript) => (super.noSuchMethod( - Invocation.method( - #addUserScript, - [userScript], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#addUserScript, [userScript]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future removeAllUserScripts() => (super.noSuchMethod( - Invocation.method( - #removeAllUserScripts, - [], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i4.Future removeAllUserScripts() => (super.noSuchMethod( + Invocation.method(#removeAllUserScripts, []), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.WKUserContentController copy() => (super.noSuchMethod( - Invocation.method( - #copy, - [], - ), - returnValue: _FakeWKUserContentController_7( + _i2.WKUserContentController pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKUserContentController_9( this, - Invocation.method( - #copy, - [], - ), + Invocation.method(#pigeon_copy, []), ), - ) as _i4.WKUserContentController); + ) as _i2.WKUserContentController); @override - _i5.Future addObserver( - _i7.NSObject? observer, { - required String? keyPath, - required Set<_i7.NSKeyValueObservingOptions>? options, - }) => + _i4.Future addObserver( + _i2.NSObject? observer, + String? keyPath, + List<_i2.KeyValueObservingOptions>? options, + ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [observer], - { - #keyPath: keyPath, - #options: options, - }, - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future removeObserver( - _i7.NSObject? observer, { - required String? keyPath, - }) => + _i4.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method( - #removeObserver, - [observer], - {#keyPath: keyPath}, - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); } /// A class which mocks [JavascriptChannelRegistry]. /// /// See the documentation for Mockito's code generation for more information. class MockJavascriptChannelRegistry extends _i1.Mock - implements _i8.JavascriptChannelRegistry { + implements _i6.JavascriptChannelRegistry { MockJavascriptChannelRegistry() { _i1.throwOnMissingStub(this); } @override - Map get channels => (super.noSuchMethod( + Map get channels => (super.noSuchMethod( Invocation.getter(#channels), - returnValue: {}, - ) as Map); + 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<_i9.JavascriptChannel>? channels) => + void updateJavascriptChannelsFromSet(Set<_i7.JavascriptChannel>? channels) => super.noSuchMethod( - Invocation.method( - #updateJavascriptChannelsFromSet, - [channels], - ), + Invocation.method(#updateJavascriptChannelsFromSet, [channels]), returnValueForMissingStub: null, ); } @@ -1470,61 +1290,45 @@ class MockJavascriptChannelRegistry extends _i1.Mock /// /// See the documentation for Mockito's code generation for more information. class MockWebViewPlatformCallbacksHandler extends _i1.Mock - implements _i8.WebViewPlatformCallbacksHandler { + implements _i6.WebViewPlatformCallbacksHandler { MockWebViewPlatformCallbacksHandler() { _i1.throwOnMissingStub(this); } @override - _i5.FutureOr onNavigationRequest({ + _i4.FutureOr onNavigationRequest({ required String? url, required bool? isForMainFrame, }) => (super.noSuchMethod( - Invocation.method( - #onNavigationRequest, - [], - { - #url: url, - #isForMainFrame: isForMainFrame, - }, - ), - returnValue: _i5.Future.value(false), - ) as _i5.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], - ), + Invocation.method(#onPageStarted, [url]), returnValueForMissingStub: null, ); @override void onPageFinished(String? url) => super.noSuchMethod( - Invocation.method( - #onPageFinished, - [url], - ), + Invocation.method(#onPageFinished, [url]), returnValueForMissingStub: null, ); @override void onProgress(int? progress) => super.noSuchMethod( - Invocation.method( - #onProgress, - [progress], - ), + Invocation.method(#onProgress, [progress]), returnValueForMissingStub: null, ); @override - void onWebResourceError(_i10.WebResourceError? error) => super.noSuchMethod( - Invocation.method( - #onWebResourceError, - [error], - ), + void onWebResourceError(_i8.WebResourceError? error) => super.noSuchMethod( + Invocation.method(#onWebResourceError, [error]), returnValueForMissingStub: null, ); } @@ -1533,19 +1337,16 @@ class MockWebViewPlatformCallbacksHandler extends _i1.Mock /// /// See the documentation for Mockito's code generation for more information. class MockWebViewWidgetProxy extends _i1.Mock - implements _i11.WebViewWidgetProxy { + implements _i9.WebViewWidgetProxy { MockWebViewWidgetProxy() { _i1.throwOnMissingStub(this); } @override - _i4.WKWebView createWebView( - _i4.WKWebViewConfiguration? configuration, { - void Function( - String, - _i7.NSObject, - Map<_i7.NSKeyValueChangeKey, Object?>, - )? observeValue, + _i3.PlatformWebView createWebView( + _i2.WKWebViewConfiguration? configuration, { + void Function(String, _i2.NSObject, Map<_i2.KeyValueChangeKey, Object?>)? + observeValue, }) => (super.noSuchMethod( Invocation.method( @@ -1553,7 +1354,7 @@ class MockWebViewWidgetProxy extends _i1.Mock [configuration], {#observeValue: observeValue}, ), - returnValue: _FakeWKWebView_6( + returnValue: _FakePlatformWebView_14( this, Invocation.method( #createWebView, @@ -1561,82 +1362,101 @@ class MockWebViewWidgetProxy extends _i1.Mock {#observeValue: observeValue}, ), ), - ) as _i4.WKWebView); + ) as _i3.PlatformWebView); @override - _i4.WKScriptMessageHandler createScriptMessageHandler( - {required void Function( - _i4.WKUserContentController, - _i4.WKScriptMessage, - )? didReceiveScriptMessage}) => - (super.noSuchMethod( - Invocation.method( - #createScriptMessageHandler, - [], - {#didReceiveScriptMessage: didReceiveScriptMessage}, - ), - returnValue: _FakeWKScriptMessageHandler_4( + _i2.URLRequest createRequest({required String? url}) => (super.noSuchMethod( + Invocation.method(#createRequest, [], {#url: url}), + returnValue: _FakeURLRequest_2( this, - Invocation.method( - #createScriptMessageHandler, - [], - {#didReceiveScriptMessage: didReceiveScriptMessage}, - ), + Invocation.method(#createRequest, [], {#url: url}), ), - ) as _i4.WKScriptMessageHandler); + ) as _i2.URLRequest); @override - _i4.WKUIDelegate createUIDelgate( - {void Function( - _i4.WKWebView, - _i4.WKWebViewConfiguration, - _i4.WKNavigationAction, - )? onCreateWebView}) => + _i2.WKScriptMessageHandler createScriptMessageHandler({ + required void Function( + _i2.WKScriptMessageHandler, + _i2.WKUserContentController, + _i2.WKScriptMessage, + )? didReceiveScriptMessage, + }) => (super.noSuchMethod( - Invocation.method( - #createUIDelgate, - [], - {#onCreateWebView: onCreateWebView}, - ), - returnValue: _FakeWKUIDelegate_10( + Invocation.method(#createScriptMessageHandler, [], { + #didReceiveScriptMessage: didReceiveScriptMessage, + }), + returnValue: _FakeWKScriptMessageHandler_5( this, - Invocation.method( - #createUIDelgate, - [], - {#onCreateWebView: onCreateWebView}, - ), + Invocation.method(#createScriptMessageHandler, [], { + #didReceiveScriptMessage: didReceiveScriptMessage, + }), ), - ) as _i4.WKUIDelegate); + ) as _i2.WKScriptMessageHandler); @override - _i4.WKNavigationDelegate createNavigationDelegate({ + _i2.WKUIDelegate createUIDelgate({ void Function( - _i4.WKWebView, - String?, - )? didFinishNavigation, - void Function( - _i4.WKWebView, - String?, - )? didStartProvisionalNavigation, - _i5.Future<_i4.WKNavigationActionPolicy> Function( - _i4.WKWebView, - _i4.WKNavigationAction, + _i2.WKUIDelegate, + _i2.WKWebView, + _i2.WKWebViewConfiguration, + _i2.WKNavigationAction, + )? onCreateWebView, + }) => + (super.noSuchMethod( + Invocation.method(#createUIDelgate, [], { + #onCreateWebView: onCreateWebView, + }), + returnValue: _FakeWKUIDelegate_13( + 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, + required _i4.Future<_i2.NavigationActionPolicy> Function( + _i2.WKNavigationDelegate, + _i2.WKWebView, + _i2.WKNavigationAction, )? decidePolicyForNavigationAction, - void Function( - _i4.WKWebView, - _i7.NSError, - )? didFailNavigation, - void Function( - _i4.WKWebView, - _i7.NSError, - )? didFailProvisionalNavigation, - void Function(_i4.WKWebView)? webViewWebContentProcessDidTerminate, + 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, + required _i4.Future> Function( + _i2.WKNavigationDelegate, + _i2.WKWebView, + _i2.URLAuthenticationChallenge, + )? didReceiveAuthenticationChallenge, }) => (super.noSuchMethod( - Invocation.method( - #createNavigationDelegate, - [], - { + 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, [], { #didFinishNavigation: didFinishNavigation, #didStartProvisionalNavigation: didStartProvisionalNavigation, #decidePolicyForNavigationAction: decidePolicyForNavigationAction, @@ -1644,23 +1464,67 @@ class MockWebViewWidgetProxy extends _i1.Mock #didFailProvisionalNavigation: didFailProvisionalNavigation, #webViewWebContentProcessDidTerminate: webViewWebContentProcessDidTerminate, - }, + #decidePolicyForNavigationResponse: + decidePolicyForNavigationResponse, + #didReceiveAuthenticationChallenge: + didReceiveAuthenticationChallenge, + }), ), - returnValue: _FakeWKNavigationDelegate_2( + ) 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.method( - #createNavigationDelegate, - [], - { - #didFinishNavigation: didFinishNavigation, - #didStartProvisionalNavigation: didStartProvisionalNavigation, - #decidePolicyForNavigationAction: decidePolicyForNavigationAction, - #didFailNavigation: didFailNavigation, - #didFailProvisionalNavigation: didFailProvisionalNavigation, - #webViewWebContentProcessDidTerminate: - webViewWebContentProcessDidTerminate, - }, - ), + Invocation.getter(#pigeon_instanceManager), ), - ) as _i4.WKNavigationDelegate); + ) 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_11( + 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); } diff --git a/packages/webview_flutter/webview_flutter_wkwebview/test/src/common/instance_manager_test.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/src/common/instance_manager_test.dart deleted file mode 100644 index 2fc68a489b6..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/src/common/instance_manager_test.dart +++ /dev/null @@ -1,153 +0,0 @@ -// 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 'package:flutter_test/flutter_test.dart'; -import 'package:webview_flutter_wkwebview/src/common/instance_manager.dart'; - -void main() { - group('InstanceManager', () { - test('addHostCreatedInstance', () { - final CopyableObject object = CopyableObject(); - - final InstanceManager instanceManager = - InstanceManager(onWeakReferenceRemoved: (_) {}); - - instanceManager.addHostCreatedInstance(object, 0); - - expect(instanceManager.getIdentifier(object), 0); - expect( - instanceManager.getInstanceWithWeakReference(0), - object, - ); - }); - - test('addHostCreatedInstance prevents already used objects and ids', () { - final CopyableObject object = CopyableObject(); - - final InstanceManager instanceManager = - InstanceManager(onWeakReferenceRemoved: (_) {}); - - instanceManager.addHostCreatedInstance(object, 0); - - expect( - () => instanceManager.addHostCreatedInstance(object, 0), - throwsAssertionError, - ); - - expect( - () => instanceManager.addHostCreatedInstance(CopyableObject(), 0), - throwsAssertionError, - ); - }); - - test('addFlutterCreatedInstance', () { - final CopyableObject object = CopyableObject(); - - final InstanceManager instanceManager = - InstanceManager(onWeakReferenceRemoved: (_) {}); - - instanceManager.addDartCreatedInstance(object); - - final int? instanceId = instanceManager.getIdentifier(object); - expect(instanceId, isNotNull); - expect( - instanceManager.getInstanceWithWeakReference(instanceId!), - object, - ); - }); - - test('removeWeakReference', () { - final CopyableObject object = CopyableObject(); - - int? weakInstanceId; - final InstanceManager instanceManager = - InstanceManager(onWeakReferenceRemoved: (int instanceId) { - weakInstanceId = instanceId; - }); - - instanceManager.addHostCreatedInstance(object, 0); - - expect(instanceManager.removeWeakReference(object), 0); - expect( - instanceManager.getInstanceWithWeakReference(0), - isA(), - ); - expect(weakInstanceId, 0); - }); - - test('removeWeakReference removes only weak reference', () { - final CopyableObject object = CopyableObject(); - - final InstanceManager instanceManager = - InstanceManager(onWeakReferenceRemoved: (_) {}); - - instanceManager.addHostCreatedInstance(object, 0); - - expect(instanceManager.removeWeakReference(object), 0); - final CopyableObject copy = instanceManager.getInstanceWithWeakReference( - 0, - )!; - expect(identical(object, copy), isFalse); - }); - - test('removeStrongReference', () { - final CopyableObject object = CopyableObject(); - - final InstanceManager instanceManager = - InstanceManager(onWeakReferenceRemoved: (_) {}); - - instanceManager.addHostCreatedInstance(object, 0); - instanceManager.removeWeakReference(object); - expect(instanceManager.remove(0), isA()); - expect(instanceManager.containsIdentifier(0), isFalse); - }); - - test('removeStrongReference removes only strong reference', () { - final CopyableObject object = CopyableObject(); - - final InstanceManager instanceManager = - InstanceManager(onWeakReferenceRemoved: (_) {}); - - instanceManager.addHostCreatedInstance(object, 0); - expect(instanceManager.remove(0), isA()); - expect( - instanceManager.getInstanceWithWeakReference(0), - object, - ); - }); - - test('getInstance can add a new weak reference', () { - final CopyableObject object = CopyableObject(); - - final InstanceManager instanceManager = - InstanceManager(onWeakReferenceRemoved: (_) {}); - - instanceManager.addHostCreatedInstance(object, 0); - instanceManager.removeWeakReference(object); - - final CopyableObject newWeakCopy = - instanceManager.getInstanceWithWeakReference( - 0, - )!; - expect(identical(object, newWeakCopy), isFalse); - }); - }); -} - -class CopyableObject with Copyable { - @override - Copyable copy() { - return CopyableObject(); - } - - @override - int get hashCode { - return 0; - } - - @override - bool operator ==(Object other) { - return other is CopyableObject; - } -} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/test/src/common/test_web_kit.g.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/src/common/test_web_kit.g.dart deleted file mode 100644 index 0a9e645fecd..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/src/common/test_web_kit.g.dart +++ /dev/null @@ -1,2500 +0,0 @@ -// 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 (v18.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, unnecessary_import, no_leading_underscores_for_local_identifiers -// ignore_for_file: avoid_relative_lib_imports -import 'dart:async'; -import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; -import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer; -import 'package:flutter/services.dart'; -import 'package:flutter_test/flutter_test.dart'; - -import 'package:webview_flutter_wkwebview/src/common/web_kit.g.dart'; - -class _TestWKWebsiteDataStoreHostApiCodec extends StandardMessageCodec { - const _TestWKWebsiteDataStoreHostApiCodec(); - @override - void writeValue(WriteBuffer buffer, Object? value) { - if (value is WKWebsiteDataTypeEnumData) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); - } else { - super.writeValue(buffer, value); - } - } - - @override - Object? readValueOfType(int type, ReadBuffer buffer) { - switch (type) { - case 128: - return WKWebsiteDataTypeEnumData.decode(readValue(buffer)!); - default: - return super.readValueOfType(type, buffer); - } - } -} - -/// Mirror of WKWebsiteDataStore. -/// -/// See https://developer.apple.com/documentation/webkit/wkwebsitedatastore?language=objc. -abstract class TestWKWebsiteDataStoreHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec pigeonChannelCodec = - _TestWKWebsiteDataStoreHostApiCodec(); - - void createFromWebViewConfiguration( - int identifier, int configurationIdentifier); - - void createDefaultDataStore(int identifier); - - Future removeDataOfTypes( - int identifier, - List dataTypes, - double modificationTimeInSecondsSinceEpoch); - - static void setUp( - TestWKWebsiteDataStoreHostApi? api, { - BinaryMessenger? binaryMessenger, - String messageChannelSuffix = '', - }) { - messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStoreHostApi.createFromWebViewConfiguration$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStoreHostApi.createFromWebViewConfiguration was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStoreHostApi.createFromWebViewConfiguration was null, expected non-null int.'); - final int? arg_configurationIdentifier = (args[1] as int?); - assert(arg_configurationIdentifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStoreHostApi.createFromWebViewConfiguration was null, expected non-null int.'); - try { - api.createFromWebViewConfiguration( - arg_identifier!, arg_configurationIdentifier!); - 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 __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStoreHostApi.createDefaultDataStore$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStoreHostApi.createDefaultDataStore was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStoreHostApi.createDefaultDataStore was null, expected non-null int.'); - try { - api.createDefaultDataStore(arg_identifier!); - 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 __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStoreHostApi.removeDataOfTypes$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStoreHostApi.removeDataOfTypes was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStoreHostApi.removeDataOfTypes was null, expected non-null int.'); - final List? arg_dataTypes = - (args[1] as List?)?.cast(); - assert(arg_dataTypes != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStoreHostApi.removeDataOfTypes was null, expected non-null List.'); - final double? arg_modificationTimeInSecondsSinceEpoch = - (args[2] as double?); - assert(arg_modificationTimeInSecondsSinceEpoch != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStoreHostApi.removeDataOfTypes was null, expected non-null double.'); - try { - final bool output = await api.removeDataOfTypes(arg_identifier!, - arg_dataTypes!, arg_modificationTimeInSecondsSinceEpoch!); - return [output]; - } on PlatformException catch (e) { - return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); - } - }); - } - } - } -} - -/// Mirror of UIView. -/// -/// See https://developer.apple.com/documentation/uikit/uiview?language=objc. -abstract class TestUIViewHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec pigeonChannelCodec = - StandardMessageCodec(); - - void setBackgroundColor(int identifier, int? value); - - void setOpaque(int identifier, bool opaque); - - static void setUp( - TestUIViewHostApi? api, { - BinaryMessenger? binaryMessenger, - String messageChannelSuffix = '', - }) { - messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.UIViewHostApi.setBackgroundColor$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.UIViewHostApi.setBackgroundColor was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.UIViewHostApi.setBackgroundColor was null, expected non-null int.'); - final int? arg_value = (args[1] as int?); - try { - api.setBackgroundColor(arg_identifier!, arg_value); - 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 __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.UIViewHostApi.setOpaque$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.UIViewHostApi.setOpaque was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.UIViewHostApi.setOpaque was null, expected non-null int.'); - final bool? arg_opaque = (args[1] as bool?); - assert(arg_opaque != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.UIViewHostApi.setOpaque was null, expected non-null bool.'); - try { - api.setOpaque(arg_identifier!, arg_opaque!); - return wrapResponse(empty: true); - } on PlatformException catch (e) { - return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); - } - }); - } - } - } -} - -/// Mirror of UIScrollView. -/// -/// See https://developer.apple.com/documentation/uikit/uiscrollview?language=objc. -abstract class TestUIScrollViewHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec pigeonChannelCodec = - StandardMessageCodec(); - - void createFromWebView(int identifier, int webViewIdentifier); - - List getContentOffset(int identifier); - - void scrollBy(int identifier, double x, double y); - - void setContentOffset(int identifier, double x, double y); - - void setDelegate(int identifier, int? uiScrollViewDelegateIdentifier); - - static void setUp( - TestUIScrollViewHostApi? api, { - BinaryMessenger? binaryMessenger, - String messageChannelSuffix = '', - }) { - messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.createFromWebView$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.createFromWebView was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.createFromWebView was null, expected non-null int.'); - final int? arg_webViewIdentifier = (args[1] as int?); - assert(arg_webViewIdentifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.createFromWebView was null, expected non-null int.'); - try { - api.createFromWebView(arg_identifier!, arg_webViewIdentifier!); - 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 __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.getContentOffset$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.getContentOffset was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.getContentOffset was null, expected non-null int.'); - try { - final List output = api.getContentOffset(arg_identifier!); - return [output]; - } on PlatformException catch (e) { - return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); - } - }); - } - } - { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.scrollBy$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.scrollBy was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.scrollBy was null, expected non-null int.'); - final double? arg_x = (args[1] as double?); - assert(arg_x != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.scrollBy was null, expected non-null double.'); - final double? arg_y = (args[2] as double?); - assert(arg_y != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.scrollBy was null, expected non-null double.'); - try { - api.scrollBy(arg_identifier!, arg_x!, arg_y!); - 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 __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.setContentOffset$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.setContentOffset was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.setContentOffset was null, expected non-null int.'); - final double? arg_x = (args[1] as double?); - assert(arg_x != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.setContentOffset was null, expected non-null double.'); - final double? arg_y = (args[2] as double?); - assert(arg_y != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.setContentOffset was null, expected non-null double.'); - try { - api.setContentOffset(arg_identifier!, arg_x!, arg_y!); - 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 __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.setDelegate$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.setDelegate was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.setDelegate was null, expected non-null int.'); - final int? arg_uiScrollViewDelegateIdentifier = (args[1] as int?); - try { - api.setDelegate( - arg_identifier!, arg_uiScrollViewDelegateIdentifier); - return wrapResponse(empty: true); - } on PlatformException catch (e) { - return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); - } - }); - } - } - } -} - -class _TestWKWebViewConfigurationHostApiCodec extends StandardMessageCodec { - const _TestWKWebViewConfigurationHostApiCodec(); - @override - void writeValue(WriteBuffer buffer, Object? value) { - if (value is WKAudiovisualMediaTypeEnumData) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); - } else { - super.writeValue(buffer, value); - } - } - - @override - Object? readValueOfType(int type, ReadBuffer buffer) { - switch (type) { - case 128: - return WKAudiovisualMediaTypeEnumData.decode(readValue(buffer)!); - default: - return super.readValueOfType(type, buffer); - } - } -} - -/// Mirror of WKWebViewConfiguration. -/// -/// See https://developer.apple.com/documentation/webkit/wkwebviewconfiguration?language=objc. -abstract class TestWKWebViewConfigurationHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec pigeonChannelCodec = - _TestWKWebViewConfigurationHostApiCodec(); - - void create(int identifier); - - void createFromWebView(int identifier, int webViewIdentifier); - - void setAllowsInlineMediaPlayback(int identifier, bool allow); - - void setLimitsNavigationsToAppBoundDomains(int identifier, bool limit); - - void setMediaTypesRequiringUserActionForPlayback( - int identifier, List types); - - static void setUp( - TestWKWebViewConfigurationHostApi? api, { - BinaryMessenger? binaryMessenger, - String messageChannelSuffix = '', - }) { - messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationHostApi.create$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationHostApi.create was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationHostApi.create was null, expected non-null int.'); - try { - api.create(arg_identifier!); - 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 __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationHostApi.createFromWebView$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationHostApi.createFromWebView was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationHostApi.createFromWebView was null, expected non-null int.'); - final int? arg_webViewIdentifier = (args[1] as int?); - assert(arg_webViewIdentifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationHostApi.createFromWebView was null, expected non-null int.'); - try { - api.createFromWebView(arg_identifier!, arg_webViewIdentifier!); - 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 __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationHostApi.setAllowsInlineMediaPlayback$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationHostApi.setAllowsInlineMediaPlayback was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationHostApi.setAllowsInlineMediaPlayback was null, expected non-null int.'); - final bool? arg_allow = (args[1] as bool?); - assert(arg_allow != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationHostApi.setAllowsInlineMediaPlayback was null, expected non-null bool.'); - try { - api.setAllowsInlineMediaPlayback(arg_identifier!, arg_allow!); - 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 __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationHostApi.setLimitsNavigationsToAppBoundDomains$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationHostApi.setLimitsNavigationsToAppBoundDomains was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationHostApi.setLimitsNavigationsToAppBoundDomains was null, expected non-null int.'); - final bool? arg_limit = (args[1] as bool?); - assert(arg_limit != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationHostApi.setLimitsNavigationsToAppBoundDomains was null, expected non-null bool.'); - try { - api.setLimitsNavigationsToAppBoundDomains( - arg_identifier!, arg_limit!); - 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 __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationHostApi.setMediaTypesRequiringUserActionForPlayback$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationHostApi.setMediaTypesRequiringUserActionForPlayback was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationHostApi.setMediaTypesRequiringUserActionForPlayback was null, expected non-null int.'); - final List? arg_types = - (args[1] as List?) - ?.cast(); - assert(arg_types != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationHostApi.setMediaTypesRequiringUserActionForPlayback was null, expected non-null List.'); - try { - api.setMediaTypesRequiringUserActionForPlayback( - arg_identifier!, arg_types!); - return wrapResponse(empty: true); - } on PlatformException catch (e) { - return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); - } - }); - } - } - } -} - -class _TestWKUserContentControllerHostApiCodec extends StandardMessageCodec { - const _TestWKUserContentControllerHostApiCodec(); - @override - void writeValue(WriteBuffer buffer, Object? value) { - if (value is WKUserScriptData) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); - } else if (value is WKUserScriptInjectionTimeEnumData) { - buffer.putUint8(129); - writeValue(buffer, value.encode()); - } else { - super.writeValue(buffer, value); - } - } - - @override - Object? readValueOfType(int type, ReadBuffer buffer) { - switch (type) { - case 128: - return WKUserScriptData.decode(readValue(buffer)!); - case 129: - return WKUserScriptInjectionTimeEnumData.decode(readValue(buffer)!); - default: - return super.readValueOfType(type, buffer); - } - } -} - -/// Mirror of WKUserContentController. -/// -/// See https://developer.apple.com/documentation/webkit/wkusercontentcontroller?language=objc. -abstract class TestWKUserContentControllerHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec pigeonChannelCodec = - _TestWKUserContentControllerHostApiCodec(); - - void createFromWebViewConfiguration( - int identifier, int configurationIdentifier); - - void addScriptMessageHandler( - int identifier, int handlerIdentifier, String name); - - void removeScriptMessageHandler(int identifier, String name); - - void removeAllScriptMessageHandlers(int identifier); - - void addUserScript(int identifier, WKUserScriptData userScript); - - void removeAllUserScripts(int identifier); - - static void setUp( - TestWKUserContentControllerHostApi? api, { - BinaryMessenger? binaryMessenger, - String messageChannelSuffix = '', - }) { - messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.createFromWebViewConfiguration$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.createFromWebViewConfiguration was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.createFromWebViewConfiguration was null, expected non-null int.'); - final int? arg_configurationIdentifier = (args[1] as int?); - assert(arg_configurationIdentifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.createFromWebViewConfiguration was null, expected non-null int.'); - try { - api.createFromWebViewConfiguration( - arg_identifier!, arg_configurationIdentifier!); - 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 __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.addScriptMessageHandler$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.addScriptMessageHandler was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.addScriptMessageHandler was null, expected non-null int.'); - final int? arg_handlerIdentifier = (args[1] as int?); - assert(arg_handlerIdentifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.addScriptMessageHandler was null, expected non-null int.'); - final String? arg_name = (args[2] as String?); - assert(arg_name != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.addScriptMessageHandler was null, expected non-null String.'); - try { - api.addScriptMessageHandler( - arg_identifier!, arg_handlerIdentifier!, arg_name!); - 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 __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.removeScriptMessageHandler$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.removeScriptMessageHandler was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.removeScriptMessageHandler was null, expected non-null int.'); - final String? arg_name = (args[1] as String?); - assert(arg_name != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.removeScriptMessageHandler was null, expected non-null String.'); - try { - api.removeScriptMessageHandler(arg_identifier!, arg_name!); - 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 __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.removeAllScriptMessageHandlers$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.removeAllScriptMessageHandlers was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.removeAllScriptMessageHandlers was null, expected non-null int.'); - try { - api.removeAllScriptMessageHandlers(arg_identifier!); - 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 __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.addUserScript$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.addUserScript was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.addUserScript was null, expected non-null int.'); - final WKUserScriptData? arg_userScript = - (args[1] as WKUserScriptData?); - assert(arg_userScript != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.addUserScript was null, expected non-null WKUserScriptData.'); - try { - api.addUserScript(arg_identifier!, arg_userScript!); - 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 __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.removeAllUserScripts$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.removeAllUserScripts was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.removeAllUserScripts was null, expected non-null int.'); - try { - api.removeAllUserScripts(arg_identifier!); - return wrapResponse(empty: true); - } on PlatformException catch (e) { - return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); - } - }); - } - } - } -} - -/// Mirror of WKUserPreferences. -/// -/// See https://developer.apple.com/documentation/webkit/wkpreferences?language=objc. -abstract class TestWKPreferencesHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec pigeonChannelCodec = - StandardMessageCodec(); - - void createFromWebViewConfiguration( - int identifier, int configurationIdentifier); - - void setJavaScriptEnabled(int identifier, bool enabled); - - static void setUp( - TestWKPreferencesHostApi? api, { - BinaryMessenger? binaryMessenger, - String messageChannelSuffix = '', - }) { - messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKPreferencesHostApi.createFromWebViewConfiguration$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKPreferencesHostApi.createFromWebViewConfiguration was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKPreferencesHostApi.createFromWebViewConfiguration was null, expected non-null int.'); - final int? arg_configurationIdentifier = (args[1] as int?); - assert(arg_configurationIdentifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKPreferencesHostApi.createFromWebViewConfiguration was null, expected non-null int.'); - try { - api.createFromWebViewConfiguration( - arg_identifier!, arg_configurationIdentifier!); - 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 __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKPreferencesHostApi.setJavaScriptEnabled$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKPreferencesHostApi.setJavaScriptEnabled was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKPreferencesHostApi.setJavaScriptEnabled was null, expected non-null int.'); - final bool? arg_enabled = (args[1] as bool?); - assert(arg_enabled != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKPreferencesHostApi.setJavaScriptEnabled was null, expected non-null bool.'); - try { - api.setJavaScriptEnabled(arg_identifier!, arg_enabled!); - return wrapResponse(empty: true); - } on PlatformException catch (e) { - return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); - } - }); - } - } - } -} - -/// Mirror of WKScriptMessageHandler. -/// -/// See https://developer.apple.com/documentation/webkit/wkscriptmessagehandler?language=objc. -abstract class TestWKScriptMessageHandlerHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec pigeonChannelCodec = - StandardMessageCodec(); - - void create(int identifier); - - static void setUp( - TestWKScriptMessageHandlerHostApi? api, { - BinaryMessenger? binaryMessenger, - String messageChannelSuffix = '', - }) { - messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKScriptMessageHandlerHostApi.create$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKScriptMessageHandlerHostApi.create was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKScriptMessageHandlerHostApi.create was null, expected non-null int.'); - try { - api.create(arg_identifier!); - return wrapResponse(empty: true); - } on PlatformException catch (e) { - return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); - } - }); - } - } - } -} - -/// Mirror of WKNavigationDelegate. -/// -/// See https://developer.apple.com/documentation/webkit/wknavigationdelegate?language=objc. -abstract class TestWKNavigationDelegateHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec pigeonChannelCodec = - StandardMessageCodec(); - - void create(int identifier); - - static void setUp( - TestWKNavigationDelegateHostApi? api, { - BinaryMessenger? binaryMessenger, - String messageChannelSuffix = '', - }) { - messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateHostApi.create$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateHostApi.create was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateHostApi.create was null, expected non-null int.'); - try { - api.create(arg_identifier!); - return wrapResponse(empty: true); - } on PlatformException catch (e) { - return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); - } - }); - } - } - } -} - -class _TestNSObjectHostApiCodec extends StandardMessageCodec { - const _TestNSObjectHostApiCodec(); - @override - void writeValue(WriteBuffer buffer, Object? value) { - if (value is NSKeyValueObservingOptionsEnumData) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); - } else { - super.writeValue(buffer, value); - } - } - - @override - Object? readValueOfType(int type, ReadBuffer buffer) { - switch (type) { - case 128: - return NSKeyValueObservingOptionsEnumData.decode(readValue(buffer)!); - default: - return super.readValueOfType(type, buffer); - } - } -} - -/// Mirror of NSObject. -/// -/// See https://developer.apple.com/documentation/objectivec/nsobject. -abstract class TestNSObjectHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec pigeonChannelCodec = - _TestNSObjectHostApiCodec(); - - void dispose(int identifier); - - void addObserver(int identifier, int observerIdentifier, String keyPath, - List options); - - void removeObserver(int identifier, int observerIdentifier, String keyPath); - - static void setUp( - TestNSObjectHostApi? api, { - BinaryMessenger? binaryMessenger, - String messageChannelSuffix = '', - }) { - messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectHostApi.dispose$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectHostApi.dispose was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectHostApi.dispose was null, expected non-null int.'); - try { - api.dispose(arg_identifier!); - 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 __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectHostApi.addObserver$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectHostApi.addObserver was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectHostApi.addObserver was null, expected non-null int.'); - final int? arg_observerIdentifier = (args[1] as int?); - assert(arg_observerIdentifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectHostApi.addObserver was null, expected non-null int.'); - final String? arg_keyPath = (args[2] as String?); - assert(arg_keyPath != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectHostApi.addObserver was null, expected non-null String.'); - final List? arg_options = - (args[3] as List?) - ?.cast(); - assert(arg_options != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectHostApi.addObserver was null, expected non-null List.'); - try { - api.addObserver(arg_identifier!, arg_observerIdentifier!, - arg_keyPath!, arg_options!); - 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 __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectHostApi.removeObserver$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectHostApi.removeObserver was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectHostApi.removeObserver was null, expected non-null int.'); - final int? arg_observerIdentifier = (args[1] as int?); - assert(arg_observerIdentifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectHostApi.removeObserver was null, expected non-null int.'); - final String? arg_keyPath = (args[2] as String?); - assert(arg_keyPath != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectHostApi.removeObserver was null, expected non-null String.'); - try { - api.removeObserver( - arg_identifier!, arg_observerIdentifier!, arg_keyPath!); - return wrapResponse(empty: true); - } on PlatformException catch (e) { - return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); - } - }); - } - } - } -} - -class _TestWKWebViewHostApiCodec extends StandardMessageCodec { - const _TestWKWebViewHostApiCodec(); - @override - void writeValue(WriteBuffer buffer, Object? value) { - if (value is AuthenticationChallengeResponse) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); - } else if (value is NSErrorData) { - buffer.putUint8(129); - writeValue(buffer, value.encode()); - } else if (value is NSHttpCookieData) { - buffer.putUint8(130); - writeValue(buffer, value.encode()); - } else if (value is NSHttpCookiePropertyKeyEnumData) { - buffer.putUint8(131); - writeValue(buffer, value.encode()); - } else if (value is NSHttpUrlResponseData) { - buffer.putUint8(132); - writeValue(buffer, value.encode()); - } else if (value is NSKeyValueChangeKeyEnumData) { - buffer.putUint8(133); - writeValue(buffer, value.encode()); - } else if (value is NSKeyValueObservingOptionsEnumData) { - buffer.putUint8(134); - writeValue(buffer, value.encode()); - } else if (value is NSUrlRequestData) { - buffer.putUint8(135); - writeValue(buffer, value.encode()); - } else if (value is ObjectOrIdentifier) { - buffer.putUint8(136); - writeValue(buffer, value.encode()); - } else if (value is WKAudiovisualMediaTypeEnumData) { - buffer.putUint8(137); - writeValue(buffer, value.encode()); - } else if (value is WKFrameInfoData) { - buffer.putUint8(138); - writeValue(buffer, value.encode()); - } else if (value is WKMediaCaptureTypeData) { - buffer.putUint8(139); - writeValue(buffer, value.encode()); - } else if (value is WKNavigationActionData) { - buffer.putUint8(140); - writeValue(buffer, value.encode()); - } else if (value is WKNavigationActionPolicyEnumData) { - buffer.putUint8(141); - writeValue(buffer, value.encode()); - } else if (value is WKNavigationResponseData) { - buffer.putUint8(142); - writeValue(buffer, value.encode()); - } else if (value is WKPermissionDecisionData) { - buffer.putUint8(143); - writeValue(buffer, value.encode()); - } else if (value is WKScriptMessageData) { - buffer.putUint8(144); - writeValue(buffer, value.encode()); - } else if (value is WKSecurityOriginData) { - buffer.putUint8(145); - writeValue(buffer, value.encode()); - } else if (value is WKUserScriptData) { - buffer.putUint8(146); - writeValue(buffer, value.encode()); - } else if (value is WKUserScriptInjectionTimeEnumData) { - buffer.putUint8(147); - writeValue(buffer, value.encode()); - } else if (value is WKWebsiteDataTypeEnumData) { - buffer.putUint8(148); - writeValue(buffer, value.encode()); - } else { - super.writeValue(buffer, value); - } - } - - @override - Object? readValueOfType(int type, ReadBuffer buffer) { - switch (type) { - case 128: - return AuthenticationChallengeResponse.decode(readValue(buffer)!); - case 129: - return NSErrorData.decode(readValue(buffer)!); - case 130: - return NSHttpCookieData.decode(readValue(buffer)!); - case 131: - return NSHttpCookiePropertyKeyEnumData.decode(readValue(buffer)!); - case 132: - return NSHttpUrlResponseData.decode(readValue(buffer)!); - case 133: - return NSKeyValueChangeKeyEnumData.decode(readValue(buffer)!); - case 134: - return NSKeyValueObservingOptionsEnumData.decode(readValue(buffer)!); - case 135: - return NSUrlRequestData.decode(readValue(buffer)!); - case 136: - return ObjectOrIdentifier.decode(readValue(buffer)!); - case 137: - return WKAudiovisualMediaTypeEnumData.decode(readValue(buffer)!); - case 138: - return WKFrameInfoData.decode(readValue(buffer)!); - case 139: - return WKMediaCaptureTypeData.decode(readValue(buffer)!); - case 140: - return WKNavigationActionData.decode(readValue(buffer)!); - case 141: - return WKNavigationActionPolicyEnumData.decode(readValue(buffer)!); - case 142: - return WKNavigationResponseData.decode(readValue(buffer)!); - case 143: - return WKPermissionDecisionData.decode(readValue(buffer)!); - case 144: - return WKScriptMessageData.decode(readValue(buffer)!); - case 145: - return WKSecurityOriginData.decode(readValue(buffer)!); - case 146: - return WKUserScriptData.decode(readValue(buffer)!); - case 147: - return WKUserScriptInjectionTimeEnumData.decode(readValue(buffer)!); - case 148: - return WKWebsiteDataTypeEnumData.decode(readValue(buffer)!); - default: - return super.readValueOfType(type, buffer); - } - } -} - -/// Mirror of WKWebView. -/// -/// See https://developer.apple.com/documentation/webkit/wkwebview?language=objc. -abstract class TestWKWebViewHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec pigeonChannelCodec = - _TestWKWebViewHostApiCodec(); - - void create(int identifier, int configurationIdentifier); - - void setUIDelegate(int identifier, int? uiDelegateIdentifier); - - void setNavigationDelegate(int identifier, int? navigationDelegateIdentifier); - - String? getUrl(int identifier); - - double getEstimatedProgress(int identifier); - - void loadRequest(int identifier, NSUrlRequestData request); - - void loadHtmlString(int identifier, String string, String? baseUrl); - - void loadFileUrl(int identifier, String url, String readAccessUrl); - - void loadFlutterAsset(int identifier, String key); - - bool canGoBack(int identifier); - - bool canGoForward(int identifier); - - void goBack(int identifier); - - void goForward(int identifier); - - void reload(int identifier); - - String? getTitle(int identifier); - - void setAllowsBackForwardNavigationGestures(int identifier, bool allow); - - void setCustomUserAgent(int identifier, String? userAgent); - - Future evaluateJavaScript(int identifier, String javaScriptString); - - void setInspectable(int identifier, bool inspectable); - - String? getCustomUserAgent(int identifier); - - static void setUp( - TestWKWebViewHostApi? api, { - BinaryMessenger? binaryMessenger, - String messageChannelSuffix = '', - }) { - messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.create$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.create was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.create was null, expected non-null int.'); - final int? arg_configurationIdentifier = (args[1] as int?); - assert(arg_configurationIdentifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.create was null, expected non-null int.'); - try { - api.create(arg_identifier!, arg_configurationIdentifier!); - 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 __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.setUIDelegate$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.setUIDelegate was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.setUIDelegate was null, expected non-null int.'); - final int? arg_uiDelegateIdentifier = (args[1] as int?); - try { - api.setUIDelegate(arg_identifier!, arg_uiDelegateIdentifier); - 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 __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.setNavigationDelegate$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.setNavigationDelegate was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.setNavigationDelegate was null, expected non-null int.'); - final int? arg_navigationDelegateIdentifier = (args[1] as int?); - try { - api.setNavigationDelegate( - arg_identifier!, arg_navigationDelegateIdentifier); - 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 __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.getUrl$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.getUrl was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.getUrl was null, expected non-null int.'); - try { - final String? output = api.getUrl(arg_identifier!); - return [output]; - } on PlatformException catch (e) { - return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); - } - }); - } - } - { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.getEstimatedProgress$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.getEstimatedProgress was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.getEstimatedProgress was null, expected non-null int.'); - try { - final double output = api.getEstimatedProgress(arg_identifier!); - return [output]; - } on PlatformException catch (e) { - return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); - } - }); - } - } - { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.loadRequest$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.loadRequest was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.loadRequest was null, expected non-null int.'); - final NSUrlRequestData? arg_request = (args[1] as NSUrlRequestData?); - assert(arg_request != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.loadRequest was null, expected non-null NSUrlRequestData.'); - try { - api.loadRequest(arg_identifier!, arg_request!); - 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 __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.loadHtmlString$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.loadHtmlString was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.loadHtmlString was null, expected non-null int.'); - final String? arg_string = (args[1] as String?); - assert(arg_string != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.loadHtmlString was null, expected non-null String.'); - final String? arg_baseUrl = (args[2] as String?); - try { - api.loadHtmlString(arg_identifier!, arg_string!, arg_baseUrl); - 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 __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.loadFileUrl$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.loadFileUrl was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.loadFileUrl was null, expected non-null int.'); - final String? arg_url = (args[1] as String?); - assert(arg_url != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.loadFileUrl was null, expected non-null String.'); - final String? arg_readAccessUrl = (args[2] as String?); - assert(arg_readAccessUrl != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.loadFileUrl was null, expected non-null String.'); - try { - api.loadFileUrl(arg_identifier!, arg_url!, arg_readAccessUrl!); - 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 __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.loadFlutterAsset$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.loadFlutterAsset was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.loadFlutterAsset was null, expected non-null int.'); - final String? arg_key = (args[1] as String?); - assert(arg_key != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.loadFlutterAsset was null, expected non-null String.'); - try { - api.loadFlutterAsset(arg_identifier!, arg_key!); - 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 __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.canGoBack$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.canGoBack was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.canGoBack was null, expected non-null int.'); - try { - final bool output = api.canGoBack(arg_identifier!); - return [output]; - } on PlatformException catch (e) { - return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); - } - }); - } - } - { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.canGoForward$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.canGoForward was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.canGoForward was null, expected non-null int.'); - try { - final bool output = api.canGoForward(arg_identifier!); - return [output]; - } on PlatformException catch (e) { - return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); - } - }); - } - } - { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.goBack$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.goBack was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.goBack was null, expected non-null int.'); - try { - api.goBack(arg_identifier!); - 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 __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.goForward$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.goForward was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.goForward was null, expected non-null int.'); - try { - api.goForward(arg_identifier!); - 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 __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.reload$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.reload was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.reload was null, expected non-null int.'); - try { - api.reload(arg_identifier!); - 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 __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.getTitle$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.getTitle was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.getTitle was null, expected non-null int.'); - try { - final String? output = api.getTitle(arg_identifier!); - return [output]; - } on PlatformException catch (e) { - return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); - } - }); - } - } - { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.setAllowsBackForwardNavigationGestures$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.setAllowsBackForwardNavigationGestures was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.setAllowsBackForwardNavigationGestures was null, expected non-null int.'); - final bool? arg_allow = (args[1] as bool?); - assert(arg_allow != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.setAllowsBackForwardNavigationGestures was null, expected non-null bool.'); - try { - api.setAllowsBackForwardNavigationGestures( - arg_identifier!, arg_allow!); - 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 __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.setCustomUserAgent$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.setCustomUserAgent was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.setCustomUserAgent was null, expected non-null int.'); - final String? arg_userAgent = (args[1] as String?); - try { - api.setCustomUserAgent(arg_identifier!, arg_userAgent); - 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 __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.evaluateJavaScript$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.evaluateJavaScript was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.evaluateJavaScript was null, expected non-null int.'); - final String? arg_javaScriptString = (args[1] as String?); - assert(arg_javaScriptString != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.evaluateJavaScript was null, expected non-null String.'); - try { - final Object? output = await api.evaluateJavaScript( - arg_identifier!, arg_javaScriptString!); - return [output]; - } on PlatformException catch (e) { - return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); - } - }); - } - } - { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.setInspectable$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.setInspectable was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.setInspectable was null, expected non-null int.'); - final bool? arg_inspectable = (args[1] as bool?); - assert(arg_inspectable != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.setInspectable was null, expected non-null bool.'); - try { - api.setInspectable(arg_identifier!, arg_inspectable!); - 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 __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.getCustomUserAgent$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.getCustomUserAgent was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.getCustomUserAgent was null, expected non-null int.'); - try { - final String? output = api.getCustomUserAgent(arg_identifier!); - return [output]; - } on PlatformException catch (e) { - return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); - } - }); - } - } - } -} - -/// Mirror of WKUIDelegate. -/// -/// See https://developer.apple.com/documentation/webkit/wkuidelegate?language=objc. -abstract class TestWKUIDelegateHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec pigeonChannelCodec = - StandardMessageCodec(); - - void create(int identifier); - - static void setUp( - TestWKUIDelegateHostApi? api, { - BinaryMessenger? binaryMessenger, - String messageChannelSuffix = '', - }) { - messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateHostApi.create$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateHostApi.create was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateHostApi.create was null, expected non-null int.'); - try { - api.create(arg_identifier!); - return wrapResponse(empty: true); - } on PlatformException catch (e) { - return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); - } - }); - } - } - } -} - -class _TestWKHttpCookieStoreHostApiCodec extends StandardMessageCodec { - const _TestWKHttpCookieStoreHostApiCodec(); - @override - void writeValue(WriteBuffer buffer, Object? value) { - if (value is NSHttpCookieData) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); - } else if (value is NSHttpCookiePropertyKeyEnumData) { - buffer.putUint8(129); - writeValue(buffer, value.encode()); - } else { - super.writeValue(buffer, value); - } - } - - @override - Object? readValueOfType(int type, ReadBuffer buffer) { - switch (type) { - case 128: - return NSHttpCookieData.decode(readValue(buffer)!); - case 129: - return NSHttpCookiePropertyKeyEnumData.decode(readValue(buffer)!); - default: - return super.readValueOfType(type, buffer); - } - } -} - -/// Mirror of WKHttpCookieStore. -/// -/// See https://developer.apple.com/documentation/webkit/wkhttpcookiestore?language=objc. -abstract class TestWKHttpCookieStoreHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec pigeonChannelCodec = - _TestWKHttpCookieStoreHostApiCodec(); - - void createFromWebsiteDataStore( - int identifier, int websiteDataStoreIdentifier); - - Future setCookie(int identifier, NSHttpCookieData cookie); - - static void setUp( - TestWKHttpCookieStoreHostApi? api, { - BinaryMessenger? binaryMessenger, - String messageChannelSuffix = '', - }) { - messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKHttpCookieStoreHostApi.createFromWebsiteDataStore$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKHttpCookieStoreHostApi.createFromWebsiteDataStore was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKHttpCookieStoreHostApi.createFromWebsiteDataStore was null, expected non-null int.'); - final int? arg_websiteDataStoreIdentifier = (args[1] as int?); - assert(arg_websiteDataStoreIdentifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKHttpCookieStoreHostApi.createFromWebsiteDataStore was null, expected non-null int.'); - try { - api.createFromWebsiteDataStore( - arg_identifier!, arg_websiteDataStoreIdentifier!); - 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 __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKHttpCookieStoreHostApi.setCookie$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKHttpCookieStoreHostApi.setCookie was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKHttpCookieStoreHostApi.setCookie was null, expected non-null int.'); - final NSHttpCookieData? arg_cookie = (args[1] as NSHttpCookieData?); - assert(arg_cookie != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKHttpCookieStoreHostApi.setCookie was null, expected non-null NSHttpCookieData.'); - try { - await api.setCookie(arg_identifier!, arg_cookie!); - return wrapResponse(empty: true); - } on PlatformException catch (e) { - return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); - } - }); - } - } - } -} - -/// Host API for `NSUrl`. -/// -/// This class may handle instantiating and adding native object instances that -/// are attached to a Dart instance or method calls on the associated native -/// class or an instance of the class. -/// -/// See https://developer.apple.com/documentation/foundation/nsurl?language=objc. -abstract class TestNSUrlHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec pigeonChannelCodec = - StandardMessageCodec(); - - String? getAbsoluteString(int identifier); - - static void setUp( - TestNSUrlHostApi? api, { - BinaryMessenger? binaryMessenger, - String messageChannelSuffix = '', - }) { - messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.NSUrlHostApi.getAbsoluteString$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.NSUrlHostApi.getAbsoluteString was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.NSUrlHostApi.getAbsoluteString was null, expected non-null int.'); - try { - final String? output = api.getAbsoluteString(arg_identifier!); - return [output]; - } on PlatformException catch (e) { - return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); - } - }); - } - } - } -} - -/// Host API for `UIScrollViewDelegate`. -/// -/// This class may handle instantiating and adding native object instances that -/// are attached to a Dart instance or method calls on the associated native -/// class or an instance of the class. -/// -/// See https://developer.apple.com/documentation/uikit/uiscrollviewdelegate?language=objc. -abstract class TestUIScrollViewDelegateHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec pigeonChannelCodec = - StandardMessageCodec(); - - void create(int identifier); - - static void setUp( - TestUIScrollViewDelegateHostApi? api, { - BinaryMessenger? binaryMessenger, - String messageChannelSuffix = '', - }) { - messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewDelegateHostApi.create$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewDelegateHostApi.create was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewDelegateHostApi.create was null, expected non-null int.'); - try { - api.create(arg_identifier!); - return wrapResponse(empty: true); - } on PlatformException catch (e) { - return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); - } - }); - } - } - } -} - -/// Host API for `NSUrlCredential`. -/// -/// This class may handle instantiating and adding native object instances that -/// are attached to a Dart instance or handle method calls on the associated -/// native class or an instance of the class. -/// -/// See https://developer.apple.com/documentation/foundation/nsurlcredential?language=objc. -abstract class TestNSUrlCredentialHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec pigeonChannelCodec = - StandardMessageCodec(); - - /// Create a new native instance and add it to the `InstanceManager`. - void createWithUser(int identifier, String user, String password, - NSUrlCredentialPersistence persistence); - - static void setUp( - TestNSUrlCredentialHostApi? api, { - BinaryMessenger? binaryMessenger, - String messageChannelSuffix = '', - }) { - messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_wkwebview.NSUrlCredentialHostApi.createWithUser$messageChannelSuffix', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.NSUrlCredentialHostApi.createWithUser was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.NSUrlCredentialHostApi.createWithUser was null, expected non-null int.'); - final String? arg_user = (args[1] as String?); - assert(arg_user != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.NSUrlCredentialHostApi.createWithUser was null, expected non-null String.'); - final String? arg_password = (args[2] as String?); - assert(arg_password != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.NSUrlCredentialHostApi.createWithUser was null, expected non-null String.'); - final NSUrlCredentialPersistence? arg_persistence = args[3] == null - ? null - : NSUrlCredentialPersistence.values[args[3]! as int]; - assert(arg_persistence != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.NSUrlCredentialHostApi.createWithUser was null, expected non-null NSUrlCredentialPersistence.'); - try { - api.createWithUser( - arg_identifier!, arg_user!, arg_password!, arg_persistence!); - return wrapResponse(empty: true); - } on PlatformException catch (e) { - return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); - } - }); - } - } - } -} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/test/src/foundation/foundation_test.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/src/foundation/foundation_test.dart deleted file mode 100644 index 5eb821fdfcb..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/src/foundation/foundation_test.dart +++ /dev/null @@ -1,389 +0,0 @@ -// 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 'dart:async'; - -import 'package:flutter_test/flutter_test.dart'; -import 'package:mockito/annotations.dart'; -import 'package:mockito/mockito.dart'; -import 'package:webview_flutter_wkwebview/src/common/instance_manager.dart'; -import 'package:webview_flutter_wkwebview/src/common/web_kit.g.dart'; -import 'package:webview_flutter_wkwebview/src/foundation/foundation.dart'; -import 'package:webview_flutter_wkwebview/src/foundation/foundation_api_impls.dart'; - -import '../common/test_web_kit.g.dart'; -import 'foundation_test.mocks.dart'; - -@GenerateMocks([ - TestNSObjectHostApi, - TestNSUrlCredentialHostApi, - TestNSUrlHostApi, -]) -void main() { - TestWidgetsFlutterBinding.ensureInitialized(); - - group('Foundation', () { - late InstanceManager instanceManager; - - setUp(() { - instanceManager = InstanceManager(onWeakReferenceRemoved: (_) {}); - }); - - group('NSObject', () { - late MockTestNSObjectHostApi mockPlatformHostApi; - - late NSObject object; - - setUp(() { - mockPlatformHostApi = MockTestNSObjectHostApi(); - TestNSObjectHostApi.setUp(mockPlatformHostApi); - - object = NSObject.detached(instanceManager: instanceManager); - instanceManager.addDartCreatedInstance(object); - }); - - tearDown(() { - TestNSObjectHostApi.setUp(null); - }); - - test('addObserver', () async { - final NSObject observer = NSObject.detached( - instanceManager: instanceManager, - ); - instanceManager.addDartCreatedInstance(observer); - - await object.addObserver( - observer, - keyPath: 'aKeyPath', - options: { - NSKeyValueObservingOptions.initialValue, - NSKeyValueObservingOptions.priorNotification, - }, - ); - - final List optionsData = - verify(mockPlatformHostApi.addObserver( - instanceManager.getIdentifier(object), - instanceManager.getIdentifier(observer), - 'aKeyPath', - captureAny, - )).captured.single as List; - - expect(optionsData, hasLength(2)); - expect( - optionsData[0]!.value, - NSKeyValueObservingOptionsEnum.initialValue, - ); - expect( - optionsData[1]!.value, - NSKeyValueObservingOptionsEnum.priorNotification, - ); - }); - - test('removeObserver', () async { - final NSObject observer = NSObject.detached( - instanceManager: instanceManager, - ); - instanceManager.addDartCreatedInstance(observer); - - await object.removeObserver(observer, keyPath: 'aKeyPath'); - - verify(mockPlatformHostApi.removeObserver( - instanceManager.getIdentifier(object), - instanceManager.getIdentifier(observer), - 'aKeyPath', - )); - }); - - test('NSObjectHostApi.dispose', () async { - int? callbackIdentifier; - final InstanceManager instanceManager = - InstanceManager(onWeakReferenceRemoved: (int identifier) { - callbackIdentifier = identifier; - }); - - final NSObject object = NSObject.detached( - instanceManager: instanceManager, - ); - final int identifier = instanceManager.addDartCreatedInstance(object); - - NSObject.dispose(object); - expect(callbackIdentifier, identifier); - }); - - test('observeValue', () async { - final Completer> argsCompleter = - Completer>(); - - FoundationFlutterApis.instance = FoundationFlutterApis( - instanceManager: instanceManager, - ); - - object = NSObject.detached( - instanceManager: instanceManager, - observeValue: ( - String keyPath, - NSObject object, - Map change, - ) { - argsCompleter.complete([keyPath, object, change]); - }, - ); - instanceManager.addHostCreatedInstance(object, 1); - - FoundationFlutterApis.instance.object.observeValue( - 1, - 'keyPath', - 1, - [ - NSKeyValueChangeKeyEnumData(value: NSKeyValueChangeKeyEnum.oldValue) - ], - [ - ObjectOrIdentifier(isIdentifier: false, value: 'value'), - ], - ); - - expect( - argsCompleter.future, - completion([ - 'keyPath', - object, - { - NSKeyValueChangeKey.oldValue: 'value', - }, - ]), - ); - }); - - test('observeValue returns object in an `InstanceManager`', () async { - final Completer> argsCompleter = - Completer>(); - - FoundationFlutterApis.instance = FoundationFlutterApis( - instanceManager: instanceManager, - ); - - object = NSObject.detached( - instanceManager: instanceManager, - observeValue: ( - String keyPath, - NSObject object, - Map change, - ) { - argsCompleter.complete([keyPath, object, change]); - }, - ); - instanceManager.addHostCreatedInstance(object, 1); - - final NSObject returnedObject = NSObject.detached( - instanceManager: instanceManager, - ); - instanceManager.addHostCreatedInstance(returnedObject, 2); - - FoundationFlutterApis.instance.object.observeValue( - 1, - 'keyPath', - 1, - [ - NSKeyValueChangeKeyEnumData(value: NSKeyValueChangeKeyEnum.oldValue) - ], - [ - ObjectOrIdentifier(isIdentifier: true, value: 2), - ], - ); - - expect( - argsCompleter.future, - completion([ - 'keyPath', - object, - { - NSKeyValueChangeKey.oldValue: returnedObject, - }, - ]), - ); - }); - - test('NSObjectFlutterApi.dispose', () { - FoundationFlutterApis.instance = FoundationFlutterApis( - instanceManager: instanceManager, - ); - - object = NSObject.detached(instanceManager: instanceManager); - instanceManager.addHostCreatedInstance(object, 1); - - instanceManager.removeWeakReference(object); - FoundationFlutterApis.instance.object.dispose(1); - - expect(instanceManager.containsIdentifier(1), isFalse); - }); - }); - - group('NSUrl', () { - // Ensure the test host api is removed after each test run. - tearDown(() => TestNSUrlHostApi.setUp(null)); - - test('getAbsoluteString', () async { - final MockTestNSUrlHostApi mockApi = MockTestNSUrlHostApi(); - TestNSUrlHostApi.setUp(mockApi); - - final NSUrl url = NSUrl.detached(instanceManager: instanceManager); - instanceManager.addHostCreatedInstance(url, 0); - - when(mockApi.getAbsoluteString(0)).thenReturn('myString'); - - expect(await url.getAbsoluteString(), 'myString'); - }); - - test('Flutter API create', () { - final NSUrlFlutterApi flutterApi = NSUrlFlutterApiImpl( - instanceManager: instanceManager, - ); - - flutterApi.create(0); - - expect(instanceManager.getInstanceWithWeakReference(0), isA()); - }); - }); - - group('NSUrlCredential', () { - tearDown(() { - TestNSUrlCredentialHostApi.setUp(null); - }); - - test('HostApi createWithUser', () { - final MockTestNSUrlCredentialHostApi mockApi = - MockTestNSUrlCredentialHostApi(); - TestNSUrlCredentialHostApi.setUp(mockApi); - - final InstanceManager instanceManager = InstanceManager( - onWeakReferenceRemoved: (_) {}, - ); - - const String user = 'testString'; - const String password = 'testString2'; - - const NSUrlCredentialPersistence persistence = - NSUrlCredentialPersistence.permanent; - - final NSUrlCredential instance = NSUrlCredential.withUser( - user: user, - password: password, - persistence: persistence, - instanceManager: instanceManager, - ); - - verify(mockApi.createWithUser( - instanceManager.getIdentifier(instance), - user, - password, - persistence, - )); - }); - }); - - group('NSUrlProtectionSpace', () { - test('FlutterAPI create', () { - final InstanceManager instanceManager = InstanceManager( - onWeakReferenceRemoved: (_) {}, - ); - - final NSUrlProtectionSpaceFlutterApiImpl api = - NSUrlProtectionSpaceFlutterApiImpl( - instanceManager: instanceManager, - ); - - const int instanceIdentifier = 0; - - api.create( - instanceIdentifier, - 'testString', - 'testString', - 'testAuthenticationMethod', - ); - - expect( - instanceManager.getInstanceWithWeakReference(instanceIdentifier), - isA(), - ); - }); - }); - - group('NSUrlAuthenticationChallenge', () { - test('FlutterAPI create', () { - final InstanceManager instanceManager = InstanceManager( - onWeakReferenceRemoved: (_) {}, - ); - - final NSUrlAuthenticationChallengeFlutterApiImpl api = - NSUrlAuthenticationChallengeFlutterApiImpl( - instanceManager: instanceManager, - ); - - const int instanceIdentifier = 0; - - const int protectionSpaceIdentifier = 1; - instanceManager.addHostCreatedInstance( - NSUrlProtectionSpace.detached( - host: null, - realm: null, - authenticationMethod: null, - instanceManager: instanceManager, - ), - protectionSpaceIdentifier, - ); - - api.create(instanceIdentifier, protectionSpaceIdentifier); - - expect( - instanceManager.getInstanceWithWeakReference(instanceIdentifier), - isA(), - ); - }); - }); - }); - - test('NSError', () { - expect( - const NSError( - code: 0, - domain: 'domain', - userInfo: { - NSErrorUserInfoKey.NSLocalizedDescription: 'desc', - }, - ).toString(), - 'desc (domain:0:{NSLocalizedDescription: desc})', - ); - expect( - const NSError( - code: 0, - domain: 'domain', - userInfo: { - NSErrorUserInfoKey.NSLocalizedDescription: '', - }, - ).toString(), - 'Error domain:0:{NSLocalizedDescription: }', - ); - expect( - const NSError( - code: 255, - domain: 'bar', - userInfo: { - NSErrorUserInfoKey.NSLocalizedDescription: 'baz', - }, - ).toString(), - 'baz (bar:255:{NSLocalizedDescription: baz})', - ); - expect( - const NSError( - code: 255, - domain: 'bar', - userInfo: { - NSErrorUserInfoKey.NSLocalizedDescription: '', - }, - ).toString(), - 'Error bar:255:{NSLocalizedDescription: }', - ); - }); -} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/test/src/foundation/foundation_test.mocks.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/src/foundation/foundation_test.mocks.dart deleted file mode 100644 index df4e12e6082..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/src/foundation/foundation_test.mocks.dart +++ /dev/null @@ -1,125 +0,0 @@ -// Mocks generated by Mockito 5.4.4 from annotations -// in webview_flutter_wkwebview/test/src/foundation/foundation_test.dart. -// Do not manually edit this file. - -// ignore_for_file: no_leading_underscores_for_library_prefixes -import 'package:mockito/mockito.dart' as _i1; -import 'package:webview_flutter_wkwebview/src/common/web_kit.g.dart' as _i3; - -import '../common/test_web_kit.g.dart' as _i2; - -// ignore_for_file: type=lint -// ignore_for_file: avoid_redundant_argument_values -// ignore_for_file: avoid_setters_without_getters -// ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// 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: prefer_const_constructors -// ignore_for_file: unnecessary_parenthesis -// ignore_for_file: camel_case_types -// ignore_for_file: subtype_of_sealed_class - -/// A class which mocks [TestNSObjectHostApi]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockTestNSObjectHostApi extends _i1.Mock - implements _i2.TestNSObjectHostApi { - MockTestNSObjectHostApi() { - _i1.throwOnMissingStub(this); - } - - @override - void dispose(int? identifier) => super.noSuchMethod( - Invocation.method( - #dispose, - [identifier], - ), - returnValueForMissingStub: null, - ); - - @override - void addObserver( - int? identifier, - int? observerIdentifier, - String? keyPath, - List<_i3.NSKeyValueObservingOptionsEnumData?>? options, - ) => - super.noSuchMethod( - Invocation.method( - #addObserver, - [ - identifier, - observerIdentifier, - keyPath, - options, - ], - ), - returnValueForMissingStub: null, - ); - - @override - void removeObserver( - int? identifier, - int? observerIdentifier, - String? keyPath, - ) => - super.noSuchMethod( - Invocation.method( - #removeObserver, - [ - identifier, - observerIdentifier, - keyPath, - ], - ), - returnValueForMissingStub: null, - ); -} - -/// A class which mocks [TestNSUrlCredentialHostApi]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockTestNSUrlCredentialHostApi extends _i1.Mock - implements _i2.TestNSUrlCredentialHostApi { - MockTestNSUrlCredentialHostApi() { - _i1.throwOnMissingStub(this); - } - - @override - void createWithUser( - int? identifier, - String? user, - String? password, - _i3.NSUrlCredentialPersistence? persistence, - ) => - super.noSuchMethod( - Invocation.method( - #createWithUser, - [ - identifier, - user, - password, - persistence, - ], - ), - returnValueForMissingStub: null, - ); -} - -/// A class which mocks [TestNSUrlHostApi]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockTestNSUrlHostApi extends _i1.Mock implements _i2.TestNSUrlHostApi { - MockTestNSUrlHostApi() { - _i1.throwOnMissingStub(this); - } - - @override - String? getAbsoluteString(int? identifier) => - (super.noSuchMethod(Invocation.method( - #getAbsoluteString, - [identifier], - )) as String?); -} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/test/src/ui_kit/ui_kit_test.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/src/ui_kit/ui_kit_test.dart deleted file mode 100644 index c6458b9d933..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/src/ui_kit/ui_kit_test.dart +++ /dev/null @@ -1,177 +0,0 @@ -// 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 'dart:math'; - -import 'package:flutter/material.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:mockito/annotations.dart'; -import 'package:mockito/mockito.dart'; -import 'package:webview_flutter_wkwebview/src/common/instance_manager.dart'; -import 'package:webview_flutter_wkwebview/src/common/web_kit.g.dart'; -import 'package:webview_flutter_wkwebview/src/ui_kit/ui_kit.dart'; -import 'package:webview_flutter_wkwebview/src/ui_kit/ui_kit_api_impls.dart'; -import 'package:webview_flutter_wkwebview/src/web_kit/web_kit.dart'; - -import '../common/test_web_kit.g.dart'; -import 'ui_kit_test.mocks.dart'; - -@GenerateMocks([ - TestWKWebViewConfigurationHostApi, - TestWKWebViewHostApi, - TestUIScrollViewHostApi, - TestUIScrollViewDelegateHostApi, - TestUIViewHostApi, -]) -void main() { - TestWidgetsFlutterBinding.ensureInitialized(); - - group('UIKit', () { - late InstanceManager instanceManager; - - setUp(() { - instanceManager = InstanceManager(onWeakReferenceRemoved: (_) {}); - }); - - group('UIScrollView', () { - late MockTestUIScrollViewHostApi mockPlatformHostApi; - - late UIScrollView scrollView; - late int scrollViewInstanceId; - - setUp(() { - mockPlatformHostApi = MockTestUIScrollViewHostApi(); - TestUIScrollViewHostApi.setUp(mockPlatformHostApi); - - TestWKWebViewConfigurationHostApi.setUp( - MockTestWKWebViewConfigurationHostApi(), - ); - TestWKWebViewHostApi.setUp(MockTestWKWebViewHostApi()); - final WKWebView webView = WKWebViewIOS( - WKWebViewConfiguration(instanceManager: instanceManager), - instanceManager: instanceManager, - ); - - scrollView = UIScrollView.fromWebView( - webView, - instanceManager: instanceManager, - ); - scrollViewInstanceId = instanceManager.getIdentifier(scrollView)!; - }); - - tearDown(() { - TestUIScrollViewHostApi.setUp(null); - TestWKWebViewConfigurationHostApi.setUp(null); - TestWKWebViewHostApi.setUp(null); - }); - - test('getContentOffset', () async { - when(mockPlatformHostApi.getContentOffset(scrollViewInstanceId)) - .thenReturn([4.0, 10.0]); - expect( - scrollView.getContentOffset(), - completion(const Point(4.0, 10.0)), - ); - }); - - test('scrollBy', () async { - await scrollView.scrollBy(const Point(4.0, 10.0)); - verify(mockPlatformHostApi.scrollBy(scrollViewInstanceId, 4.0, 10.0)); - }); - - test('setContentOffset', () async { - await scrollView.setContentOffset(const Point(4.0, 10.0)); - verify(mockPlatformHostApi.setContentOffset( - scrollViewInstanceId, - 4.0, - 10.0, - )); - }); - - test('setDelegate', () async { - final UIScrollViewDelegate delegate = UIScrollViewDelegate.detached( - instanceManager: instanceManager, - ); - const int delegateIdentifier = 10; - instanceManager.addHostCreatedInstance(delegate, delegateIdentifier); - await scrollView.setDelegate(delegate); - verify(mockPlatformHostApi.setDelegate( - scrollViewInstanceId, - delegateIdentifier, - )); - }); - }); - - group('UIScrollViewDelegate', () { - // Ensure the test host api is removed after each test run. - tearDown(() => TestUIScrollViewDelegateHostApi.setUp(null)); - - test('Host API create', () { - final MockTestUIScrollViewDelegateHostApi mockApi = - MockTestUIScrollViewDelegateHostApi(); - TestUIScrollViewDelegateHostApi.setUp(mockApi); - - UIScrollViewDelegate(instanceManager: instanceManager); - verify(mockApi.create(0)); - }); - - test('scrollViewDidScroll', () { - final UIScrollViewDelegateFlutterApi flutterApi = - UIScrollViewDelegateFlutterApiImpl( - instanceManager: instanceManager, - ); - - final UIScrollView scrollView = UIScrollView.detached( - instanceManager: instanceManager, - ); - instanceManager.addHostCreatedInstance(scrollView, 0); - - List? args; - final UIScrollViewDelegate scrollViewDelegate = - UIScrollViewDelegate.detached( - scrollViewDidScroll: (UIScrollView scrollView, double x, double y) { - args = [scrollView, x, y]; - }, - instanceManager: instanceManager, - ); - instanceManager.addHostCreatedInstance(scrollViewDelegate, 1); - - flutterApi.scrollViewDidScroll(1, 0, 5, 6); - expect(args, [scrollView, 5, 6]); - }); - }); - - group('UIView', () { - late MockTestUIViewHostApi mockPlatformHostApi; - - late UIView view; - late int viewInstanceId; - - setUp(() { - mockPlatformHostApi = MockTestUIViewHostApi(); - TestUIViewHostApi.setUp(mockPlatformHostApi); - - view = UIViewBase.detached(instanceManager: instanceManager); - viewInstanceId = instanceManager.addDartCreatedInstance(view); - }); - - tearDown(() { - TestUIViewHostApi.setUp(null); - }); - - test('setBackgroundColor', () async { - await view.setBackgroundColor(Colors.red); - verify(mockPlatformHostApi.setBackgroundColor( - viewInstanceId, - Colors.red.value, - )); - }); - - test('setOpaque', () async { - await view.setOpaque(false); - verify(mockPlatformHostApi.setOpaque(viewInstanceId, false)); - }); - }); - }); -} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/test/src/ui_kit/ui_kit_test.mocks.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/src/ui_kit/ui_kit_test.mocks.dart deleted file mode 100644 index 66bbc7275e6..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/src/ui_kit/ui_kit_test.mocks.dart +++ /dev/null @@ -1,517 +0,0 @@ -// Mocks generated by Mockito 5.4.4 from annotations -// in webview_flutter_wkwebview/test/src/ui_kit/ui_kit_test.dart. -// Do not manually edit this file. - -// ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i4; - -import 'package:mockito/mockito.dart' as _i1; -import 'package:webview_flutter_wkwebview/src/common/web_kit.g.dart' as _i3; - -import '../common/test_web_kit.g.dart' as _i2; - -// ignore_for_file: type=lint -// ignore_for_file: avoid_redundant_argument_values -// ignore_for_file: avoid_setters_without_getters -// ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// 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: prefer_const_constructors -// ignore_for_file: unnecessary_parenthesis -// ignore_for_file: camel_case_types -// ignore_for_file: subtype_of_sealed_class - -/// A class which mocks [TestWKWebViewConfigurationHostApi]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockTestWKWebViewConfigurationHostApi extends _i1.Mock - implements _i2.TestWKWebViewConfigurationHostApi { - MockTestWKWebViewConfigurationHostApi() { - _i1.throwOnMissingStub(this); - } - - @override - void create(int? identifier) => super.noSuchMethod( - Invocation.method( - #create, - [identifier], - ), - returnValueForMissingStub: null, - ); - - @override - void createFromWebView( - int? identifier, - int? webViewIdentifier, - ) => - super.noSuchMethod( - Invocation.method( - #createFromWebView, - [ - identifier, - webViewIdentifier, - ], - ), - returnValueForMissingStub: null, - ); - - @override - void setAllowsInlineMediaPlayback( - int? identifier, - bool? allow, - ) => - super.noSuchMethod( - Invocation.method( - #setAllowsInlineMediaPlayback, - [ - identifier, - allow, - ], - ), - returnValueForMissingStub: null, - ); - - @override - void setLimitsNavigationsToAppBoundDomains( - int? identifier, - bool? limit, - ) => - super.noSuchMethod( - Invocation.method( - #setLimitsNavigationsToAppBoundDomains, - [ - identifier, - limit, - ], - ), - returnValueForMissingStub: null, - ); - - @override - void setMediaTypesRequiringUserActionForPlayback( - int? identifier, - List<_i3.WKAudiovisualMediaTypeEnumData?>? types, - ) => - super.noSuchMethod( - Invocation.method( - #setMediaTypesRequiringUserActionForPlayback, - [ - identifier, - types, - ], - ), - returnValueForMissingStub: null, - ); -} - -/// A class which mocks [TestWKWebViewHostApi]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockTestWKWebViewHostApi extends _i1.Mock - implements _i2.TestWKWebViewHostApi { - MockTestWKWebViewHostApi() { - _i1.throwOnMissingStub(this); - } - - @override - void create( - int? identifier, - int? configurationIdentifier, - ) => - super.noSuchMethod( - Invocation.method( - #create, - [ - identifier, - configurationIdentifier, - ], - ), - returnValueForMissingStub: null, - ); - - @override - void setUIDelegate( - int? identifier, - int? uiDelegateIdentifier, - ) => - super.noSuchMethod( - Invocation.method( - #setUIDelegate, - [ - identifier, - uiDelegateIdentifier, - ], - ), - returnValueForMissingStub: null, - ); - - @override - void setNavigationDelegate( - int? identifier, - int? navigationDelegateIdentifier, - ) => - super.noSuchMethod( - Invocation.method( - #setNavigationDelegate, - [ - identifier, - navigationDelegateIdentifier, - ], - ), - returnValueForMissingStub: null, - ); - - @override - String? getUrl(int? identifier) => (super.noSuchMethod(Invocation.method( - #getUrl, - [identifier], - )) as String?); - - @override - double getEstimatedProgress(int? identifier) => (super.noSuchMethod( - Invocation.method( - #getEstimatedProgress, - [identifier], - ), - returnValue: 0.0, - ) as double); - - @override - void loadRequest( - int? identifier, - _i3.NSUrlRequestData? request, - ) => - super.noSuchMethod( - Invocation.method( - #loadRequest, - [ - identifier, - request, - ], - ), - returnValueForMissingStub: null, - ); - - @override - void loadHtmlString( - int? identifier, - String? string, - String? baseUrl, - ) => - super.noSuchMethod( - Invocation.method( - #loadHtmlString, - [ - identifier, - string, - baseUrl, - ], - ), - returnValueForMissingStub: null, - ); - - @override - void loadFileUrl( - int? identifier, - String? url, - String? readAccessUrl, - ) => - super.noSuchMethod( - Invocation.method( - #loadFileUrl, - [ - identifier, - url, - readAccessUrl, - ], - ), - returnValueForMissingStub: null, - ); - - @override - void loadFlutterAsset( - int? identifier, - String? key, - ) => - super.noSuchMethod( - Invocation.method( - #loadFlutterAsset, - [ - identifier, - key, - ], - ), - returnValueForMissingStub: null, - ); - - @override - bool canGoBack(int? identifier) => (super.noSuchMethod( - Invocation.method( - #canGoBack, - [identifier], - ), - returnValue: false, - ) as bool); - - @override - bool canGoForward(int? identifier) => (super.noSuchMethod( - Invocation.method( - #canGoForward, - [identifier], - ), - returnValue: false, - ) as bool); - - @override - void goBack(int? identifier) => super.noSuchMethod( - Invocation.method( - #goBack, - [identifier], - ), - returnValueForMissingStub: null, - ); - - @override - void goForward(int? identifier) => super.noSuchMethod( - Invocation.method( - #goForward, - [identifier], - ), - returnValueForMissingStub: null, - ); - - @override - void reload(int? identifier) => super.noSuchMethod( - Invocation.method( - #reload, - [identifier], - ), - returnValueForMissingStub: null, - ); - - @override - String? getTitle(int? identifier) => (super.noSuchMethod(Invocation.method( - #getTitle, - [identifier], - )) as String?); - - @override - void setAllowsBackForwardNavigationGestures( - int? identifier, - bool? allow, - ) => - super.noSuchMethod( - Invocation.method( - #setAllowsBackForwardNavigationGestures, - [ - identifier, - allow, - ], - ), - returnValueForMissingStub: null, - ); - - @override - void setCustomUserAgent( - int? identifier, - String? userAgent, - ) => - super.noSuchMethod( - Invocation.method( - #setCustomUserAgent, - [ - identifier, - userAgent, - ], - ), - returnValueForMissingStub: null, - ); - - @override - _i4.Future evaluateJavaScript( - int? identifier, - String? javaScriptString, - ) => - (super.noSuchMethod( - Invocation.method( - #evaluateJavaScript, - [ - identifier, - javaScriptString, - ], - ), - returnValue: _i4.Future.value(), - ) as _i4.Future); - - @override - void setInspectable( - int? identifier, - bool? inspectable, - ) => - super.noSuchMethod( - Invocation.method( - #setInspectable, - [ - identifier, - inspectable, - ], - ), - returnValueForMissingStub: null, - ); - - @override - String? getCustomUserAgent(int? identifier) => - (super.noSuchMethod(Invocation.method( - #getCustomUserAgent, - [identifier], - )) as String?); -} - -/// A class which mocks [TestUIScrollViewHostApi]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockTestUIScrollViewHostApi extends _i1.Mock - implements _i2.TestUIScrollViewHostApi { - MockTestUIScrollViewHostApi() { - _i1.throwOnMissingStub(this); - } - - @override - void createFromWebView( - int? identifier, - int? webViewIdentifier, - ) => - super.noSuchMethod( - Invocation.method( - #createFromWebView, - [ - identifier, - webViewIdentifier, - ], - ), - returnValueForMissingStub: null, - ); - - @override - List getContentOffset(int? identifier) => (super.noSuchMethod( - Invocation.method( - #getContentOffset, - [identifier], - ), - returnValue: [], - ) as List); - - @override - void scrollBy( - int? identifier, - double? x, - double? y, - ) => - super.noSuchMethod( - Invocation.method( - #scrollBy, - [ - identifier, - x, - y, - ], - ), - returnValueForMissingStub: null, - ); - - @override - void setContentOffset( - int? identifier, - double? x, - double? y, - ) => - super.noSuchMethod( - Invocation.method( - #setContentOffset, - [ - identifier, - x, - y, - ], - ), - returnValueForMissingStub: null, - ); - - @override - void setDelegate( - int? identifier, - int? uiScrollViewDelegateIdentifier, - ) => - super.noSuchMethod( - Invocation.method( - #setDelegate, - [ - identifier, - uiScrollViewDelegateIdentifier, - ], - ), - returnValueForMissingStub: null, - ); -} - -/// A class which mocks [TestUIScrollViewDelegateHostApi]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockTestUIScrollViewDelegateHostApi extends _i1.Mock - implements _i2.TestUIScrollViewDelegateHostApi { - MockTestUIScrollViewDelegateHostApi() { - _i1.throwOnMissingStub(this); - } - - @override - void create(int? identifier) => super.noSuchMethod( - Invocation.method( - #create, - [identifier], - ), - returnValueForMissingStub: null, - ); -} - -/// A class which mocks [TestUIViewHostApi]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockTestUIViewHostApi extends _i1.Mock implements _i2.TestUIViewHostApi { - MockTestUIViewHostApi() { - _i1.throwOnMissingStub(this); - } - - @override - void setBackgroundColor( - int? identifier, - int? value, - ) => - super.noSuchMethod( - Invocation.method( - #setBackgroundColor, - [ - identifier, - value, - ], - ), - returnValueForMissingStub: null, - ); - - @override - void setOpaque( - int? identifier, - bool? opaque, - ) => - super.noSuchMethod( - Invocation.method( - #setOpaque, - [ - identifier, - opaque, - ], - ), - returnValueForMissingStub: null, - ); -} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/test/src/web_kit/web_kit_test.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/src/web_kit/web_kit_test.dart deleted file mode 100644 index 2f89e32e181..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/src/web_kit/web_kit_test.dart +++ /dev/null @@ -1,1133 +0,0 @@ -// 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 'dart:async'; - -import 'package:flutter/services.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:mockito/annotations.dart'; -import 'package:mockito/mockito.dart'; -import 'package:webview_flutter_wkwebview/src/common/instance_manager.dart'; -import 'package:webview_flutter_wkwebview/src/common/web_kit.g.dart'; -import 'package:webview_flutter_wkwebview/src/foundation/foundation.dart'; -import 'package:webview_flutter_wkwebview/src/web_kit/web_kit.dart'; -import 'package:webview_flutter_wkwebview/src/web_kit/web_kit_api_impls.dart'; - -import '../common/test_web_kit.g.dart'; -import 'web_kit_test.mocks.dart'; - -@GenerateMocks([ - TestWKHttpCookieStoreHostApi, - TestWKNavigationDelegateHostApi, - TestWKPreferencesHostApi, - TestWKScriptMessageHandlerHostApi, - TestWKUIDelegateHostApi, - TestWKUserContentControllerHostApi, - TestWKWebViewConfigurationHostApi, - TestWKWebViewHostApi, - TestWKWebsiteDataStoreHostApi, -]) -void main() { - TestWidgetsFlutterBinding.ensureInitialized(); - - group('WebKit', () { - late InstanceManager instanceManager; - late WebKitFlutterApis flutterApis; - - setUp(() { - instanceManager = InstanceManager(onWeakReferenceRemoved: (_) {}); - flutterApis = WebKitFlutterApis(instanceManager: instanceManager); - WebKitFlutterApis.instance = flutterApis; - }); - - group('WKWebsiteDataStore', () { - late MockTestWKWebsiteDataStoreHostApi mockPlatformHostApi; - - late WKWebsiteDataStore websiteDataStore; - - late WKWebViewConfiguration webViewConfiguration; - - setUp(() { - mockPlatformHostApi = MockTestWKWebsiteDataStoreHostApi(); - TestWKWebsiteDataStoreHostApi.setUp(mockPlatformHostApi); - - TestWKWebViewConfigurationHostApi.setUp( - MockTestWKWebViewConfigurationHostApi(), - ); - webViewConfiguration = WKWebViewConfiguration( - instanceManager: instanceManager, - ); - - websiteDataStore = WKWebsiteDataStore.fromWebViewConfiguration( - webViewConfiguration, - instanceManager: instanceManager, - ); - }); - - tearDown(() { - TestWKWebsiteDataStoreHostApi.setUp(null); - TestWKWebViewConfigurationHostApi.setUp(null); - }); - - test('WKWebViewConfigurationFlutterApi.create', () { - final WebKitFlutterApis flutterApis = WebKitFlutterApis( - instanceManager: instanceManager, - ); - - flutterApis.webViewConfiguration.create(2); - - expect(instanceManager.containsIdentifier(2), isTrue); - expect( - instanceManager.getInstanceWithWeakReference(2), - isA(), - ); - }); - - test('createFromWebViewConfiguration', () { - verify(mockPlatformHostApi.createFromWebViewConfiguration( - instanceManager.getIdentifier(websiteDataStore), - instanceManager.getIdentifier(webViewConfiguration), - )); - }); - - test('createDefaultDataStore', () { - final WKWebsiteDataStore defaultDataStore = - WKWebsiteDataStore.defaultDataStore; - verify( - mockPlatformHostApi.createDefaultDataStore( - NSObject.globalInstanceManager.getIdentifier(defaultDataStore), - ), - ); - }); - - test('removeDataOfTypes', () { - when(mockPlatformHostApi.removeDataOfTypes( - any, - any, - any, - )).thenAnswer((_) => Future.value(true)); - - expect( - websiteDataStore.removeDataOfTypes( - {WKWebsiteDataType.cookies}, - DateTime.fromMillisecondsSinceEpoch(5000), - ), - completion(true), - ); - - final List capturedArgs = - verify(mockPlatformHostApi.removeDataOfTypes( - instanceManager.getIdentifier(websiteDataStore), - captureAny, - 5.0, - )).captured; - final List typeData = - (capturedArgs.single as List) - .cast(); - - expect(typeData.single.value, WKWebsiteDataTypeEnum.cookies); - }); - }); - - group('WKHttpCookieStore', () { - late MockTestWKHttpCookieStoreHostApi mockPlatformHostApi; - - late WKHttpCookieStore httpCookieStore; - - late WKWebsiteDataStore websiteDataStore; - - setUp(() { - mockPlatformHostApi = MockTestWKHttpCookieStoreHostApi(); - TestWKHttpCookieStoreHostApi.setUp(mockPlatformHostApi); - - TestWKWebViewConfigurationHostApi.setUp( - MockTestWKWebViewConfigurationHostApi(), - ); - TestWKWebsiteDataStoreHostApi.setUp( - MockTestWKWebsiteDataStoreHostApi(), - ); - - websiteDataStore = WKWebsiteDataStore.fromWebViewConfiguration( - WKWebViewConfiguration(instanceManager: instanceManager), - instanceManager: instanceManager, - ); - - httpCookieStore = WKHttpCookieStore.fromWebsiteDataStore( - websiteDataStore, - instanceManager: instanceManager, - ); - }); - - tearDown(() { - TestWKHttpCookieStoreHostApi.setUp(null); - TestWKWebsiteDataStoreHostApi.setUp(null); - TestWKWebViewConfigurationHostApi.setUp(null); - }); - - test('createFromWebsiteDataStore', () { - verify(mockPlatformHostApi.createFromWebsiteDataStore( - instanceManager.getIdentifier(httpCookieStore), - instanceManager.getIdentifier(websiteDataStore), - )); - }); - - test('setCookie', () async { - await httpCookieStore.setCookie( - const NSHttpCookie.withProperties({ - NSHttpCookiePropertyKey.comment: 'aComment', - })); - - final NSHttpCookieData cookie = verify( - mockPlatformHostApi.setCookie( - instanceManager.getIdentifier(httpCookieStore), - captureAny, - ), - ).captured.single as NSHttpCookieData; - - expect( - cookie.propertyKeys.single!.value, - NSHttpCookiePropertyKeyEnum.comment, - ); - expect(cookie.propertyValues.single, 'aComment'); - }); - }); - - group('WKScriptMessageHandler', () { - late MockTestWKScriptMessageHandlerHostApi mockPlatformHostApi; - - late WKScriptMessageHandler scriptMessageHandler; - - setUp(() async { - mockPlatformHostApi = MockTestWKScriptMessageHandlerHostApi(); - TestWKScriptMessageHandlerHostApi.setUp(mockPlatformHostApi); - - scriptMessageHandler = WKScriptMessageHandler( - didReceiveScriptMessage: (_, __) {}, - instanceManager: instanceManager, - ); - }); - - tearDown(() { - TestWKScriptMessageHandlerHostApi.setUp(null); - }); - - test('create', () async { - verify(mockPlatformHostApi.create( - instanceManager.getIdentifier(scriptMessageHandler), - )); - }); - - test('didReceiveScriptMessage', () async { - final Completer> argsCompleter = - Completer>(); - - WebKitFlutterApis.instance = WebKitFlutterApis( - instanceManager: instanceManager, - ); - - scriptMessageHandler = WKScriptMessageHandler( - instanceManager: instanceManager, - didReceiveScriptMessage: ( - WKUserContentController userContentController, - WKScriptMessage message, - ) { - argsCompleter.complete([userContentController, message]); - }, - ); - - final WKUserContentController userContentController = - WKUserContentController.detached( - instanceManager: instanceManager, - ); - instanceManager.addHostCreatedInstance(userContentController, 2); - - WebKitFlutterApis.instance.scriptMessageHandler.didReceiveScriptMessage( - instanceManager.getIdentifier(scriptMessageHandler)!, - 2, - WKScriptMessageData(name: 'name'), - ); - - expect( - argsCompleter.future, - completion([userContentController, isA()]), - ); - }); - }); - - group('WKPreferences', () { - late MockTestWKPreferencesHostApi mockPlatformHostApi; - - late WKPreferences preferences; - - late WKWebViewConfiguration webViewConfiguration; - - setUp(() { - mockPlatformHostApi = MockTestWKPreferencesHostApi(); - TestWKPreferencesHostApi.setUp(mockPlatformHostApi); - - TestWKWebViewConfigurationHostApi.setUp( - MockTestWKWebViewConfigurationHostApi(), - ); - webViewConfiguration = WKWebViewConfiguration( - instanceManager: instanceManager, - ); - - preferences = WKPreferences.fromWebViewConfiguration( - webViewConfiguration, - instanceManager: instanceManager, - ); - }); - - tearDown(() { - TestWKPreferencesHostApi.setUp(null); - TestWKWebViewConfigurationHostApi.setUp(null); - }); - - test('createFromWebViewConfiguration', () async { - verify(mockPlatformHostApi.createFromWebViewConfiguration( - instanceManager.getIdentifier(preferences), - instanceManager.getIdentifier(webViewConfiguration), - )); - }); - - test('setJavaScriptEnabled', () async { - await preferences.setJavaScriptEnabled(true); - verify(mockPlatformHostApi.setJavaScriptEnabled( - instanceManager.getIdentifier(preferences), - true, - )); - }); - }); - - group('WKUserContentController', () { - late MockTestWKUserContentControllerHostApi mockPlatformHostApi; - - late WKUserContentController userContentController; - - late WKWebViewConfiguration webViewConfiguration; - - setUp(() { - mockPlatformHostApi = MockTestWKUserContentControllerHostApi(); - TestWKUserContentControllerHostApi.setUp(mockPlatformHostApi); - - TestWKWebViewConfigurationHostApi.setUp( - MockTestWKWebViewConfigurationHostApi(), - ); - webViewConfiguration = WKWebViewConfiguration( - instanceManager: instanceManager, - ); - - userContentController = - WKUserContentController.fromWebViewConfiguration( - webViewConfiguration, - instanceManager: instanceManager, - ); - }); - - tearDown(() { - TestWKUserContentControllerHostApi.setUp(null); - TestWKWebViewConfigurationHostApi.setUp(null); - }); - - test('createFromWebViewConfiguration', () async { - verify(mockPlatformHostApi.createFromWebViewConfiguration( - instanceManager.getIdentifier(userContentController), - instanceManager.getIdentifier(webViewConfiguration), - )); - }); - - test('addScriptMessageHandler', () async { - TestWKScriptMessageHandlerHostApi.setUp( - MockTestWKScriptMessageHandlerHostApi(), - ); - final WKScriptMessageHandler handler = WKScriptMessageHandler( - didReceiveScriptMessage: (_, __) {}, - instanceManager: instanceManager, - ); - - await userContentController.addScriptMessageHandler( - handler, 'handlerName'); - verify(mockPlatformHostApi.addScriptMessageHandler( - instanceManager.getIdentifier(userContentController), - instanceManager.getIdentifier(handler), - 'handlerName', - )); - }); - - test('removeScriptMessageHandler', () async { - await userContentController.removeScriptMessageHandler('handlerName'); - verify(mockPlatformHostApi.removeScriptMessageHandler( - instanceManager.getIdentifier(userContentController), - 'handlerName', - )); - }); - - test('removeAllScriptMessageHandlers', () async { - await userContentController.removeAllScriptMessageHandlers(); - verify(mockPlatformHostApi.removeAllScriptMessageHandlers( - instanceManager.getIdentifier(userContentController), - )); - }); - - test('addUserScript', () { - userContentController.addUserScript(const WKUserScript( - 'aScript', - WKUserScriptInjectionTime.atDocumentEnd, - isMainFrameOnly: false, - )); - verify(mockPlatformHostApi.addUserScript( - instanceManager.getIdentifier(userContentController), - argThat(isA()), - )); - }); - - test('removeAllUserScripts', () { - userContentController.removeAllUserScripts(); - verify(mockPlatformHostApi.removeAllUserScripts( - instanceManager.getIdentifier(userContentController), - )); - }); - }); - - group('WKWebViewConfiguration', () { - late MockTestWKWebViewConfigurationHostApi mockPlatformHostApi; - - late WKWebViewConfiguration webViewConfiguration; - - setUp(() async { - mockPlatformHostApi = MockTestWKWebViewConfigurationHostApi(); - TestWKWebViewConfigurationHostApi.setUp(mockPlatformHostApi); - - webViewConfiguration = WKWebViewConfiguration( - instanceManager: instanceManager, - ); - }); - - tearDown(() { - TestWKWebViewConfigurationHostApi.setUp(null); - }); - - test('create', () async { - verify( - mockPlatformHostApi.create(instanceManager.getIdentifier( - webViewConfiguration, - )), - ); - }); - - test('createFromWebView', () async { - TestWKWebViewHostApi.setUp(MockTestWKWebViewHostApi()); - final WKWebView webView = WKWebViewIOS( - webViewConfiguration, - instanceManager: instanceManager, - ); - - final WKWebViewConfiguration configurationFromWebView = - WKWebViewConfiguration.fromWebView( - webView, - instanceManager: instanceManager, - ); - verify(mockPlatformHostApi.createFromWebView( - instanceManager.getIdentifier(configurationFromWebView), - instanceManager.getIdentifier(webView), - )); - }); - - test('allowsInlineMediaPlayback', () { - webViewConfiguration.setAllowsInlineMediaPlayback(true); - verify(mockPlatformHostApi.setAllowsInlineMediaPlayback( - instanceManager.getIdentifier(webViewConfiguration), - true, - )); - }); - - test('limitsNavigationsToAppBoundDomains', () { - webViewConfiguration.setLimitsNavigationsToAppBoundDomains(true); - verify(mockPlatformHostApi.setLimitsNavigationsToAppBoundDomains( - instanceManager.getIdentifier(webViewConfiguration), - true, - )); - }); - - test('mediaTypesRequiringUserActionForPlayback', () { - webViewConfiguration.setMediaTypesRequiringUserActionForPlayback( - { - WKAudiovisualMediaType.audio, - WKAudiovisualMediaType.video, - }, - ); - - final List typeData = verify( - mockPlatformHostApi.setMediaTypesRequiringUserActionForPlayback( - instanceManager.getIdentifier(webViewConfiguration), - captureAny, - )).captured.single as List; - - expect(typeData, hasLength(2)); - expect(typeData[0]!.value, WKAudiovisualMediaTypeEnum.audio); - expect(typeData[1]!.value, WKAudiovisualMediaTypeEnum.video); - }); - }); - - group('WKNavigationDelegate', () { - late MockTestWKNavigationDelegateHostApi mockPlatformHostApi; - - late WKWebView webView; - - late WKNavigationDelegate navigationDelegate; - - setUp(() async { - mockPlatformHostApi = MockTestWKNavigationDelegateHostApi(); - TestWKNavigationDelegateHostApi.setUp(mockPlatformHostApi); - - TestWKWebViewConfigurationHostApi.setUp( - MockTestWKWebViewConfigurationHostApi(), - ); - TestWKWebViewHostApi.setUp(MockTestWKWebViewHostApi()); - webView = WKWebViewIOS( - WKWebViewConfiguration(instanceManager: instanceManager), - instanceManager: instanceManager, - ); - - navigationDelegate = WKNavigationDelegate( - instanceManager: instanceManager, - ); - }); - - tearDown(() { - TestWKNavigationDelegateHostApi.setUp(null); - TestWKWebViewConfigurationHostApi.setUp(null); - TestWKWebViewHostApi.setUp(null); - }); - - test('create', () async { - navigationDelegate = WKNavigationDelegate( - instanceManager: instanceManager, - ); - - verify(mockPlatformHostApi.create( - instanceManager.getIdentifier(navigationDelegate), - )); - }); - - test('didFinishNavigation', () async { - final Completer> argsCompleter = - Completer>(); - - WebKitFlutterApis.instance = WebKitFlutterApis( - instanceManager: instanceManager, - ); - - navigationDelegate = WKNavigationDelegate( - instanceManager: instanceManager, - didFinishNavigation: (WKWebView webView, String? url) { - argsCompleter.complete([webView, url]); - }, - ); - - WebKitFlutterApis.instance.navigationDelegate.didFinishNavigation( - instanceManager.getIdentifier(navigationDelegate)!, - instanceManager.getIdentifier(webView)!, - 'url', - ); - - expect(argsCompleter.future, completion([webView, 'url'])); - }); - - test('didStartProvisionalNavigation', () async { - final Completer> argsCompleter = - Completer>(); - - WebKitFlutterApis.instance = WebKitFlutterApis( - instanceManager: instanceManager, - ); - - navigationDelegate = WKNavigationDelegate( - instanceManager: instanceManager, - didStartProvisionalNavigation: (WKWebView webView, String? url) { - argsCompleter.complete([webView, url]); - }, - ); - - WebKitFlutterApis.instance.navigationDelegate - .didStartProvisionalNavigation( - instanceManager.getIdentifier(navigationDelegate)!, - instanceManager.getIdentifier(webView)!, - 'url', - ); - - expect(argsCompleter.future, completion([webView, 'url'])); - }); - - test('decidePolicyForNavigationAction', () async { - WebKitFlutterApis.instance = WebKitFlutterApis( - instanceManager: instanceManager, - ); - - navigationDelegate = WKNavigationDelegate( - instanceManager: instanceManager, - decidePolicyForNavigationAction: ( - WKWebView webView, - WKNavigationAction navigationAction, - ) async { - return WKNavigationActionPolicy.cancel; - }, - ); - - final WKNavigationActionPolicyEnumData policyData = - await WebKitFlutterApis.instance.navigationDelegate - .decidePolicyForNavigationAction( - instanceManager.getIdentifier(navigationDelegate)!, - instanceManager.getIdentifier(webView)!, - WKNavigationActionData( - request: NSUrlRequestData( - url: 'url', - allHttpHeaderFields: {}, - ), - targetFrame: WKFrameInfoData( - isMainFrame: false, - request: NSUrlRequestData( - url: 'url', - allHttpHeaderFields: {}, - )), - navigationType: WKNavigationType.linkActivated, - ), - ); - - expect(policyData.value, WKNavigationActionPolicyEnum.cancel); - }); - - test('decidePolicyForNavigationResponse', () async { - WebKitFlutterApis.instance = WebKitFlutterApis( - instanceManager: instanceManager, - ); - - navigationDelegate = WKNavigationDelegate( - instanceManager: instanceManager, - decidePolicyForNavigationResponse: ( - WKWebView webView, - WKNavigationResponse navigationAction, - ) async { - return WKNavigationResponsePolicy.cancel; - }, - ); - - final WKNavigationResponsePolicyEnum policy = await WebKitFlutterApis - .instance.navigationDelegate - .decidePolicyForNavigationResponse( - instanceManager.getIdentifier(navigationDelegate)!, - instanceManager.getIdentifier(webView)!, - WKNavigationResponseData( - response: NSHttpUrlResponseData(statusCode: 401), - forMainFrame: true), - ); - - expect(policy, WKNavigationResponsePolicyEnum.cancel); - }); - - test('didFailNavigation', () async { - final Completer> argsCompleter = - Completer>(); - - WebKitFlutterApis.instance = WebKitFlutterApis( - instanceManager: instanceManager, - ); - - navigationDelegate = WKNavigationDelegate( - instanceManager: instanceManager, - didFailNavigation: (WKWebView webView, NSError error) { - argsCompleter.complete([webView, error]); - }, - ); - - WebKitFlutterApis.instance.navigationDelegate.didFailNavigation( - instanceManager.getIdentifier(navigationDelegate)!, - instanceManager.getIdentifier(webView)!, - NSErrorData( - code: 23, - domain: 'Hello', - userInfo: { - NSErrorUserInfoKey.NSLocalizedDescription: 'my desc', - }, - ), - ); - - expect( - argsCompleter.future, - completion([webView, isA()]), - ); - }); - - test('didFailProvisionalNavigation', () async { - final Completer> argsCompleter = - Completer>(); - - WebKitFlutterApis.instance = WebKitFlutterApis( - instanceManager: instanceManager, - ); - - navigationDelegate = WKNavigationDelegate( - instanceManager: instanceManager, - didFailProvisionalNavigation: (WKWebView webView, NSError error) { - argsCompleter.complete([webView, error]); - }, - ); - - WebKitFlutterApis.instance.navigationDelegate - .didFailProvisionalNavigation( - instanceManager.getIdentifier(navigationDelegate)!, - instanceManager.getIdentifier(webView)!, - NSErrorData( - code: 23, - domain: 'Hello', - userInfo: { - NSErrorUserInfoKey.NSLocalizedDescription: 'my desc', - }, - ), - ); - - expect( - argsCompleter.future, - completion([webView, isA()]), - ); - }); - - test('webViewWebContentProcessDidTerminate', () async { - final Completer> argsCompleter = - Completer>(); - - WebKitFlutterApis.instance = WebKitFlutterApis( - instanceManager: instanceManager, - ); - - navigationDelegate = WKNavigationDelegate( - instanceManager: instanceManager, - webViewWebContentProcessDidTerminate: (WKWebView webView) { - argsCompleter.complete([webView]); - }, - ); - - WebKitFlutterApis.instance.navigationDelegate - .webViewWebContentProcessDidTerminate( - instanceManager.getIdentifier(navigationDelegate)!, - instanceManager.getIdentifier(webView)!, - ); - - expect(argsCompleter.future, completion([webView])); - }); - - test('didReceiveAuthenticationChallenge', () async { - WebKitFlutterApis.instance = WebKitFlutterApis( - instanceManager: instanceManager, - ); - - const int credentialIdentifier = 3; - final NSUrlCredential credential = NSUrlCredential.detached( - instanceManager: instanceManager, - ); - instanceManager.addHostCreatedInstance( - credential, - credentialIdentifier, - ); - - navigationDelegate = WKNavigationDelegate( - instanceManager: instanceManager, - didReceiveAuthenticationChallenge: ( - WKWebView webView, - NSUrlAuthenticationChallenge challenge, - void Function( - NSUrlSessionAuthChallengeDisposition disposition, - NSUrlCredential? credential, - ) completionHandler, - ) { - completionHandler( - NSUrlSessionAuthChallengeDisposition.useCredential, - credential, - ); - }, - ); - - const int challengeIdentifier = 27; - instanceManager.addHostCreatedInstance( - NSUrlAuthenticationChallenge.detached( - protectionSpace: NSUrlProtectionSpace.detached( - host: null, - realm: null, - authenticationMethod: null, - ), - instanceManager: instanceManager, - ), - challengeIdentifier, - ); - - final AuthenticationChallengeResponse response = await WebKitFlutterApis - .instance.navigationDelegate - .didReceiveAuthenticationChallenge( - instanceManager.getIdentifier(navigationDelegate)!, - instanceManager.getIdentifier(webView)!, - challengeIdentifier, - ); - - expect(response.disposition, - NSUrlSessionAuthChallengeDisposition.useCredential); - expect(response.credentialIdentifier, credentialIdentifier); - }); - }); - - group('WKWebView', () { - late MockTestWKWebViewHostApi mockPlatformHostApi; - - late WKWebViewConfiguration webViewConfiguration; - - late WKWebView webView; - late int webViewInstanceId; - - setUp(() { - mockPlatformHostApi = MockTestWKWebViewHostApi(); - TestWKWebViewHostApi.setUp(mockPlatformHostApi); - - TestWKWebViewConfigurationHostApi.setUp( - MockTestWKWebViewConfigurationHostApi()); - webViewConfiguration = WKWebViewConfiguration( - instanceManager: instanceManager, - ); - - webView = WKWebViewIOS( - webViewConfiguration, - instanceManager: instanceManager, - ); - webViewInstanceId = instanceManager.getIdentifier(webView)!; - }); - - tearDown(() { - TestWKWebViewHostApi.setUp(null); - TestWKWebViewConfigurationHostApi.setUp(null); - }); - - test('create', () async { - verify(mockPlatformHostApi.create( - instanceManager.getIdentifier(webView), - instanceManager.getIdentifier( - webViewConfiguration, - ), - )); - }); - - test('setUIDelegate', () async { - TestWKUIDelegateHostApi.setUp(MockTestWKUIDelegateHostApi()); - final WKUIDelegate uiDelegate = WKUIDelegate( - instanceManager: instanceManager, - ); - - await webView.setUIDelegate(uiDelegate); - verify(mockPlatformHostApi.setUIDelegate( - webViewInstanceId, - instanceManager.getIdentifier(uiDelegate), - )); - - TestWKUIDelegateHostApi.setUp(null); - }); - - test('setNavigationDelegate', () async { - TestWKNavigationDelegateHostApi.setUp( - MockTestWKNavigationDelegateHostApi(), - ); - final WKNavigationDelegate navigationDelegate = WKNavigationDelegate( - instanceManager: instanceManager, - ); - - await webView.setNavigationDelegate(navigationDelegate); - verify(mockPlatformHostApi.setNavigationDelegate( - webViewInstanceId, - instanceManager.getIdentifier(navigationDelegate), - )); - - TestWKNavigationDelegateHostApi.setUp(null); - }); - - test('getUrl', () { - when( - mockPlatformHostApi.getUrl(webViewInstanceId), - ).thenReturn('www.flutter.dev'); - expect(webView.getUrl(), completion('www.flutter.dev')); - }); - - test('getEstimatedProgress', () { - when( - mockPlatformHostApi.getEstimatedProgress(webViewInstanceId), - ).thenReturn(54.5); - expect(webView.getEstimatedProgress(), completion(54.5)); - }); - - test('loadRequest', () { - webView.loadRequest(const NSUrlRequest(url: 'www.flutter.dev')); - verify(mockPlatformHostApi.loadRequest( - webViewInstanceId, - argThat(isA()), - )); - }); - - test('loadHtmlString', () { - webView.loadHtmlString('a', baseUrl: 'b'); - verify(mockPlatformHostApi.loadHtmlString(webViewInstanceId, 'a', 'b')); - }); - - test('loadFileUrl', () { - webView.loadFileUrl('a', readAccessUrl: 'b'); - verify(mockPlatformHostApi.loadFileUrl(webViewInstanceId, 'a', 'b')); - }); - - test('loadFlutterAsset', () { - webView.loadFlutterAsset('a'); - verify(mockPlatformHostApi.loadFlutterAsset(webViewInstanceId, 'a')); - }); - - test('canGoBack', () { - when(mockPlatformHostApi.canGoBack(webViewInstanceId)).thenReturn(true); - expect(webView.canGoBack(), completion(isTrue)); - }); - - test('canGoForward', () { - when(mockPlatformHostApi.canGoForward(webViewInstanceId)) - .thenReturn(false); - expect(webView.canGoForward(), completion(isFalse)); - }); - - test('goBack', () { - webView.goBack(); - verify(mockPlatformHostApi.goBack(webViewInstanceId)); - }); - - test('goForward', () { - webView.goForward(); - verify(mockPlatformHostApi.goForward(webViewInstanceId)); - }); - - test('reload', () { - webView.reload(); - verify(mockPlatformHostApi.reload(webViewInstanceId)); - }); - - test('getTitle', () { - when(mockPlatformHostApi.getTitle(webViewInstanceId)) - .thenReturn('MyTitle'); - expect(webView.getTitle(), completion('MyTitle')); - }); - - test('setAllowsBackForwardNavigationGestures', () { - webView.setAllowsBackForwardNavigationGestures(false); - verify(mockPlatformHostApi.setAllowsBackForwardNavigationGestures( - webViewInstanceId, - false, - )); - }); - - test('setCustomUserAgent', () { - webView.setCustomUserAgent('hello'); - verify(mockPlatformHostApi.setCustomUserAgent( - webViewInstanceId, - 'hello', - )); - }); - - test('getCustomUserAgent', () { - const String userAgent = 'str'; - when( - mockPlatformHostApi.getCustomUserAgent(webViewInstanceId), - ).thenReturn(userAgent); - expect(webView.getCustomUserAgent(), completion(userAgent)); - }); - - test('evaluateJavaScript', () { - when(mockPlatformHostApi.evaluateJavaScript(webViewInstanceId, 'gogo')) - .thenAnswer((_) => Future.value('stopstop')); - expect(webView.evaluateJavaScript('gogo'), completion('stopstop')); - }); - - test('evaluateJavaScript returns NSError', () { - when(mockPlatformHostApi.evaluateJavaScript(webViewInstanceId, 'gogo')) - .thenThrow( - PlatformException( - code: '', - details: NSErrorData( - code: 0, - domain: 'domain', - userInfo: { - NSErrorUserInfoKey.NSLocalizedDescription: 'desc', - }, - ), - ), - ); - expect( - webView.evaluateJavaScript('gogo'), - throwsA( - isA().having( - (PlatformException exception) => exception.details, - 'details', - isA(), - ), - ), - ); - }); - }); - - group('WKUIDelegate', () { - late MockTestWKUIDelegateHostApi mockPlatformHostApi; - - late WKUIDelegate uiDelegate; - - setUp(() async { - mockPlatformHostApi = MockTestWKUIDelegateHostApi(); - TestWKUIDelegateHostApi.setUp(mockPlatformHostApi); - - uiDelegate = WKUIDelegate(instanceManager: instanceManager); - }); - - tearDown(() { - TestWKUIDelegateHostApi.setUp(null); - }); - - test('create', () async { - verify(mockPlatformHostApi.create( - instanceManager.getIdentifier(uiDelegate), - )); - }); - - test('onCreateWebView', () async { - final Completer> argsCompleter = - Completer>(); - - WebKitFlutterApis.instance = WebKitFlutterApis( - instanceManager: instanceManager, - ); - - uiDelegate = WKUIDelegate( - instanceManager: instanceManager, - onCreateWebView: ( - WKWebView webView, - WKWebViewConfiguration configuration, - WKNavigationAction navigationAction, - ) { - argsCompleter.complete([ - webView, - configuration, - navigationAction, - ]); - }, - ); - - final WKWebView webView = WKWebViewIOS.detached( - instanceManager: instanceManager, - ); - instanceManager.addHostCreatedInstance(webView, 2); - - final WKWebViewConfiguration configuration = - WKWebViewConfiguration.detached( - instanceManager: instanceManager, - ); - instanceManager.addHostCreatedInstance(configuration, 3); - - WebKitFlutterApis.instance.uiDelegate.onCreateWebView( - instanceManager.getIdentifier(uiDelegate)!, - 2, - 3, - WKNavigationActionData( - request: NSUrlRequestData( - url: 'url', - allHttpHeaderFields: {}, - ), - targetFrame: WKFrameInfoData( - isMainFrame: false, - request: NSUrlRequestData( - url: 'url', - allHttpHeaderFields: {}, - )), - navigationType: WKNavigationType.linkActivated, - ), - ); - - expect( - argsCompleter.future, - completion([ - webView, - configuration, - isA(), - ]), - ); - }); - - test('requestMediaCapturePermission', () { - final InstanceManager instanceManager = InstanceManager( - onWeakReferenceRemoved: (_) {}, - ); - - const int instanceIdentifier = 0; - late final List callbackParameters; - final WKUIDelegate instance = WKUIDelegate.detached( - requestMediaCapturePermission: ( - WKUIDelegate instance, - WKWebView webView, - WKSecurityOrigin origin, - WKFrameInfo frame, - WKMediaCaptureType type, - ) async { - callbackParameters = [ - instance, - webView, - origin, - frame, - type, - ]; - return WKPermissionDecision.grant; - }, - instanceManager: instanceManager, - ); - instanceManager.addHostCreatedInstance(instance, instanceIdentifier); - - final WKUIDelegateFlutterApiImpl flutterApi = - WKUIDelegateFlutterApiImpl( - instanceManager: instanceManager, - ); - - final WKWebView webView = WKWebViewIOS.detached( - instanceManager: instanceManager, - ); - const int webViewIdentifier = 42; - instanceManager.addHostCreatedInstance( - webView, - webViewIdentifier, - ); - - const WKSecurityOrigin origin = - WKSecurityOrigin(host: 'host', port: 12, protocol: 'protocol'); - const WKFrameInfo frame = - WKFrameInfo(isMainFrame: false, request: NSUrlRequest(url: 'url')); - const WKMediaCaptureType type = WKMediaCaptureType.microphone; - - flutterApi.requestMediaCapturePermission( - instanceIdentifier, - webViewIdentifier, - WKSecurityOriginData( - host: origin.host, - port: origin.port, - protocol: origin.protocol, - ), - WKFrameInfoData( - isMainFrame: frame.isMainFrame, - request: NSUrlRequestData( - url: 'url', allHttpHeaderFields: {})), - WKMediaCaptureTypeData(value: type), - ); - - expect(callbackParameters, [ - instance, - webView, - isA(), - isA(), - type, - ]); - }); - }); - }); -} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/test/src/web_kit/web_kit_test.mocks.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/src/web_kit/web_kit_test.mocks.dart deleted file mode 100644 index d9a0ed01d50..00000000000 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/src/web_kit/web_kit_test.mocks.dart +++ /dev/null @@ -1,659 +0,0 @@ -// Mocks generated by Mockito 5.4.4 from annotations -// in webview_flutter_wkwebview/test/src/web_kit/web_kit_test.dart. -// Do not manually edit this file. - -// ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i3; - -import 'package:mockito/mockito.dart' as _i1; -import 'package:webview_flutter_wkwebview/src/common/web_kit.g.dart' as _i4; - -import '../common/test_web_kit.g.dart' as _i2; - -// ignore_for_file: type=lint -// ignore_for_file: avoid_redundant_argument_values -// ignore_for_file: avoid_setters_without_getters -// ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// 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: prefer_const_constructors -// ignore_for_file: unnecessary_parenthesis -// ignore_for_file: camel_case_types -// ignore_for_file: subtype_of_sealed_class - -/// A class which mocks [TestWKHttpCookieStoreHostApi]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockTestWKHttpCookieStoreHostApi extends _i1.Mock - implements _i2.TestWKHttpCookieStoreHostApi { - MockTestWKHttpCookieStoreHostApi() { - _i1.throwOnMissingStub(this); - } - - @override - void createFromWebsiteDataStore( - int? identifier, - int? websiteDataStoreIdentifier, - ) => - super.noSuchMethod( - Invocation.method( - #createFromWebsiteDataStore, - [ - identifier, - websiteDataStoreIdentifier, - ], - ), - returnValueForMissingStub: null, - ); - - @override - _i3.Future setCookie( - int? identifier, - _i4.NSHttpCookieData? cookie, - ) => - (super.noSuchMethod( - Invocation.method( - #setCookie, - [ - identifier, - cookie, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); -} - -/// A class which mocks [TestWKNavigationDelegateHostApi]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockTestWKNavigationDelegateHostApi extends _i1.Mock - implements _i2.TestWKNavigationDelegateHostApi { - MockTestWKNavigationDelegateHostApi() { - _i1.throwOnMissingStub(this); - } - - @override - void create(int? identifier) => super.noSuchMethod( - Invocation.method( - #create, - [identifier], - ), - returnValueForMissingStub: null, - ); -} - -/// A class which mocks [TestWKPreferencesHostApi]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockTestWKPreferencesHostApi extends _i1.Mock - implements _i2.TestWKPreferencesHostApi { - MockTestWKPreferencesHostApi() { - _i1.throwOnMissingStub(this); - } - - @override - void createFromWebViewConfiguration( - int? identifier, - int? configurationIdentifier, - ) => - super.noSuchMethod( - Invocation.method( - #createFromWebViewConfiguration, - [ - identifier, - configurationIdentifier, - ], - ), - returnValueForMissingStub: null, - ); - - @override - void setJavaScriptEnabled( - int? identifier, - bool? enabled, - ) => - super.noSuchMethod( - Invocation.method( - #setJavaScriptEnabled, - [ - identifier, - enabled, - ], - ), - returnValueForMissingStub: null, - ); -} - -/// A class which mocks [TestWKScriptMessageHandlerHostApi]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockTestWKScriptMessageHandlerHostApi extends _i1.Mock - implements _i2.TestWKScriptMessageHandlerHostApi { - MockTestWKScriptMessageHandlerHostApi() { - _i1.throwOnMissingStub(this); - } - - @override - void create(int? identifier) => super.noSuchMethod( - Invocation.method( - #create, - [identifier], - ), - returnValueForMissingStub: null, - ); -} - -/// A class which mocks [TestWKUIDelegateHostApi]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockTestWKUIDelegateHostApi extends _i1.Mock - implements _i2.TestWKUIDelegateHostApi { - MockTestWKUIDelegateHostApi() { - _i1.throwOnMissingStub(this); - } - - @override - void create(int? identifier) => super.noSuchMethod( - Invocation.method( - #create, - [identifier], - ), - returnValueForMissingStub: null, - ); -} - -/// A class which mocks [TestWKUserContentControllerHostApi]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockTestWKUserContentControllerHostApi extends _i1.Mock - implements _i2.TestWKUserContentControllerHostApi { - MockTestWKUserContentControllerHostApi() { - _i1.throwOnMissingStub(this); - } - - @override - void createFromWebViewConfiguration( - int? identifier, - int? configurationIdentifier, - ) => - super.noSuchMethod( - Invocation.method( - #createFromWebViewConfiguration, - [ - identifier, - configurationIdentifier, - ], - ), - returnValueForMissingStub: null, - ); - - @override - void addScriptMessageHandler( - int? identifier, - int? handlerIdentifier, - String? name, - ) => - super.noSuchMethod( - Invocation.method( - #addScriptMessageHandler, - [ - identifier, - handlerIdentifier, - name, - ], - ), - returnValueForMissingStub: null, - ); - - @override - void removeScriptMessageHandler( - int? identifier, - String? name, - ) => - super.noSuchMethod( - Invocation.method( - #removeScriptMessageHandler, - [ - identifier, - name, - ], - ), - returnValueForMissingStub: null, - ); - - @override - void removeAllScriptMessageHandlers(int? identifier) => super.noSuchMethod( - Invocation.method( - #removeAllScriptMessageHandlers, - [identifier], - ), - returnValueForMissingStub: null, - ); - - @override - void addUserScript( - int? identifier, - _i4.WKUserScriptData? userScript, - ) => - super.noSuchMethod( - Invocation.method( - #addUserScript, - [ - identifier, - userScript, - ], - ), - returnValueForMissingStub: null, - ); - - @override - void removeAllUserScripts(int? identifier) => super.noSuchMethod( - Invocation.method( - #removeAllUserScripts, - [identifier], - ), - returnValueForMissingStub: null, - ); -} - -/// A class which mocks [TestWKWebViewConfigurationHostApi]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockTestWKWebViewConfigurationHostApi extends _i1.Mock - implements _i2.TestWKWebViewConfigurationHostApi { - MockTestWKWebViewConfigurationHostApi() { - _i1.throwOnMissingStub(this); - } - - @override - void create(int? identifier) => super.noSuchMethod( - Invocation.method( - #create, - [identifier], - ), - returnValueForMissingStub: null, - ); - - @override - void createFromWebView( - int? identifier, - int? webViewIdentifier, - ) => - super.noSuchMethod( - Invocation.method( - #createFromWebView, - [ - identifier, - webViewIdentifier, - ], - ), - returnValueForMissingStub: null, - ); - - @override - void setAllowsInlineMediaPlayback( - int? identifier, - bool? allow, - ) => - super.noSuchMethod( - Invocation.method( - #setAllowsInlineMediaPlayback, - [ - identifier, - allow, - ], - ), - returnValueForMissingStub: null, - ); - - @override - void setLimitsNavigationsToAppBoundDomains( - int? identifier, - bool? limit, - ) => - super.noSuchMethod( - Invocation.method( - #setLimitsNavigationsToAppBoundDomains, - [ - identifier, - limit, - ], - ), - returnValueForMissingStub: null, - ); - - @override - void setMediaTypesRequiringUserActionForPlayback( - int? identifier, - List<_i4.WKAudiovisualMediaTypeEnumData?>? types, - ) => - super.noSuchMethod( - Invocation.method( - #setMediaTypesRequiringUserActionForPlayback, - [ - identifier, - types, - ], - ), - returnValueForMissingStub: null, - ); -} - -/// A class which mocks [TestWKWebViewHostApi]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockTestWKWebViewHostApi extends _i1.Mock - implements _i2.TestWKWebViewHostApi { - MockTestWKWebViewHostApi() { - _i1.throwOnMissingStub(this); - } - - @override - void create( - int? identifier, - int? configurationIdentifier, - ) => - super.noSuchMethod( - Invocation.method( - #create, - [ - identifier, - configurationIdentifier, - ], - ), - returnValueForMissingStub: null, - ); - - @override - void setUIDelegate( - int? identifier, - int? uiDelegateIdentifier, - ) => - super.noSuchMethod( - Invocation.method( - #setUIDelegate, - [ - identifier, - uiDelegateIdentifier, - ], - ), - returnValueForMissingStub: null, - ); - - @override - void setNavigationDelegate( - int? identifier, - int? navigationDelegateIdentifier, - ) => - super.noSuchMethod( - Invocation.method( - #setNavigationDelegate, - [ - identifier, - navigationDelegateIdentifier, - ], - ), - returnValueForMissingStub: null, - ); - - @override - String? getUrl(int? identifier) => (super.noSuchMethod(Invocation.method( - #getUrl, - [identifier], - )) as String?); - - @override - double getEstimatedProgress(int? identifier) => (super.noSuchMethod( - Invocation.method( - #getEstimatedProgress, - [identifier], - ), - returnValue: 0.0, - ) as double); - - @override - void loadRequest( - int? identifier, - _i4.NSUrlRequestData? request, - ) => - super.noSuchMethod( - Invocation.method( - #loadRequest, - [ - identifier, - request, - ], - ), - returnValueForMissingStub: null, - ); - - @override - void loadHtmlString( - int? identifier, - String? string, - String? baseUrl, - ) => - super.noSuchMethod( - Invocation.method( - #loadHtmlString, - [ - identifier, - string, - baseUrl, - ], - ), - returnValueForMissingStub: null, - ); - - @override - void loadFileUrl( - int? identifier, - String? url, - String? readAccessUrl, - ) => - super.noSuchMethod( - Invocation.method( - #loadFileUrl, - [ - identifier, - url, - readAccessUrl, - ], - ), - returnValueForMissingStub: null, - ); - - @override - void loadFlutterAsset( - int? identifier, - String? key, - ) => - super.noSuchMethod( - Invocation.method( - #loadFlutterAsset, - [ - identifier, - key, - ], - ), - returnValueForMissingStub: null, - ); - - @override - bool canGoBack(int? identifier) => (super.noSuchMethod( - Invocation.method( - #canGoBack, - [identifier], - ), - returnValue: false, - ) as bool); - - @override - bool canGoForward(int? identifier) => (super.noSuchMethod( - Invocation.method( - #canGoForward, - [identifier], - ), - returnValue: false, - ) as bool); - - @override - void goBack(int? identifier) => super.noSuchMethod( - Invocation.method( - #goBack, - [identifier], - ), - returnValueForMissingStub: null, - ); - - @override - void goForward(int? identifier) => super.noSuchMethod( - Invocation.method( - #goForward, - [identifier], - ), - returnValueForMissingStub: null, - ); - - @override - void reload(int? identifier) => super.noSuchMethod( - Invocation.method( - #reload, - [identifier], - ), - returnValueForMissingStub: null, - ); - - @override - String? getTitle(int? identifier) => (super.noSuchMethod(Invocation.method( - #getTitle, - [identifier], - )) as String?); - - @override - void setAllowsBackForwardNavigationGestures( - int? identifier, - bool? allow, - ) => - super.noSuchMethod( - Invocation.method( - #setAllowsBackForwardNavigationGestures, - [ - identifier, - allow, - ], - ), - returnValueForMissingStub: null, - ); - - @override - void setCustomUserAgent( - int? identifier, - String? userAgent, - ) => - super.noSuchMethod( - Invocation.method( - #setCustomUserAgent, - [ - identifier, - userAgent, - ], - ), - returnValueForMissingStub: null, - ); - - @override - _i3.Future evaluateJavaScript( - int? identifier, - String? javaScriptString, - ) => - (super.noSuchMethod( - Invocation.method( - #evaluateJavaScript, - [ - identifier, - javaScriptString, - ], - ), - returnValue: _i3.Future.value(), - ) as _i3.Future); - - @override - void setInspectable( - int? identifier, - bool? inspectable, - ) => - super.noSuchMethod( - Invocation.method( - #setInspectable, - [ - identifier, - inspectable, - ], - ), - returnValueForMissingStub: null, - ); - - @override - String? getCustomUserAgent(int? identifier) => - (super.noSuchMethod(Invocation.method( - #getCustomUserAgent, - [identifier], - )) as String?); -} - -/// A class which mocks [TestWKWebsiteDataStoreHostApi]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockTestWKWebsiteDataStoreHostApi extends _i1.Mock - implements _i2.TestWKWebsiteDataStoreHostApi { - MockTestWKWebsiteDataStoreHostApi() { - _i1.throwOnMissingStub(this); - } - - @override - void createFromWebViewConfiguration( - int? identifier, - int? configurationIdentifier, - ) => - super.noSuchMethod( - Invocation.method( - #createFromWebViewConfiguration, - [ - identifier, - configurationIdentifier, - ], - ), - returnValueForMissingStub: null, - ); - - @override - void createDefaultDataStore(int? identifier) => super.noSuchMethod( - Invocation.method( - #createDefaultDataStore, - [identifier], - ), - returnValueForMissingStub: null, - ); - - @override - _i3.Future removeDataOfTypes( - int? identifier, - List<_i4.WKWebsiteDataTypeEnumData?>? dataTypes, - double? modificationTimeInSecondsSinceEpoch, - ) => - (super.noSuchMethod( - Invocation.method( - #removeDataOfTypes, - [ - identifier, - dataTypes, - modificationTimeInSecondsSinceEpoch, - ], - ), - returnValue: _i3.Future.value(false), - ) as _i3.Future); -} 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 8a1ba88ee26..d7f7b589879 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 @@ -6,13 +6,17 @@ import 'dart:async'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:mockito/annotations.dart'; +import 'package:mockito/mockito.dart'; import 'package:webview_flutter_platform_interface/webview_flutter_platform_interface.dart'; import 'package:webview_flutter_wkwebview/src/common/web_kit.g.dart'; -import 'package:webview_flutter_wkwebview/src/foundation/foundation.dart'; -import 'package:webview_flutter_wkwebview/src/web_kit/web_kit.dart'; +import 'package:webview_flutter_wkwebview/src/common/webkit_constants.dart'; import 'package:webview_flutter_wkwebview/src/webkit_proxy.dart'; import 'package:webview_flutter_wkwebview/webview_flutter_wkwebview.dart'; +import 'webkit_navigation_delegate_test.mocks.dart'; + +@GenerateMocks([URLAuthenticationChallenge, URLRequest, URL]) void main() { WidgetsFlutterBinding.ensureInitialized(); @@ -28,55 +32,86 @@ void main() { ); }); - test('setOnPageFinished', () { + test('setOnPageFinished', () async { final WebKitNavigationDelegate webKitDelegate = WebKitNavigationDelegate( const WebKitNavigationDelegateCreationParams( webKitProxy: WebKitProxy( - createNavigationDelegate: CapturingNavigationDelegate.new, - createUIDelegate: CapturingUIDelegate.new, + newWKNavigationDelegate: CapturingNavigationDelegate.new, ), ), ); late final String callbackUrl; - webKitDelegate.setOnPageFinished((String url) => callbackUrl = url); + await webKitDelegate.setOnPageFinished((String url) => callbackUrl = url); CapturingNavigationDelegate.lastCreatedDelegate.didFinishNavigation!( - WKWebViewIOS.detached(), + WKNavigationDelegate.pigeon_detached( + pigeon_instanceManager: TestInstanceManager(), + decidePolicyForNavigationAction: (_, __, ___) async { + return NavigationActionPolicy.cancel; + }, + decidePolicyForNavigationResponse: (_, __, ___) async { + return NavigationResponsePolicy.cancel; + }, + didReceiveAuthenticationChallenge: (_, __, ___) async { + return [ + UrlSessionAuthChallengeDisposition.performDefaultHandling, + null, + ]; + }, + ), + WKWebView.pigeon_detached( + pigeon_instanceManager: TestInstanceManager(), + ), 'https://www.google.com', ); expect(callbackUrl, 'https://www.google.com'); }); - test('setOnPageStarted', () { + test('setOnPageStarted', () async { final WebKitNavigationDelegate webKitDelegate = WebKitNavigationDelegate( const WebKitNavigationDelegateCreationParams( webKitProxy: WebKitProxy( - createNavigationDelegate: CapturingNavigationDelegate.new, - createUIDelegate: CapturingUIDelegate.new, + newWKNavigationDelegate: CapturingNavigationDelegate.new, ), ), ); late final String callbackUrl; - webKitDelegate.setOnPageStarted((String url) => callbackUrl = url); + await webKitDelegate.setOnPageStarted((String url) => callbackUrl = url); CapturingNavigationDelegate .lastCreatedDelegate.didStartProvisionalNavigation!( - WKWebViewIOS.detached(), + WKNavigationDelegate.pigeon_detached( + pigeon_instanceManager: TestInstanceManager(), + decidePolicyForNavigationAction: (_, __, ___) async { + return NavigationActionPolicy.cancel; + }, + decidePolicyForNavigationResponse: (_, __, ___) async { + return NavigationResponsePolicy.cancel; + }, + didReceiveAuthenticationChallenge: (_, __, ___) async { + return [ + UrlSessionAuthChallengeDisposition.performDefaultHandling, + null, + ]; + }, + ), + WKWebView.pigeon_detached( + pigeon_instanceManager: TestInstanceManager(), + ), 'https://www.google.com', ); expect(callbackUrl, 'https://www.google.com'); }); - test('setOnHttpError from decidePolicyForNavigationResponse', () { + test('setOnHttpError from decidePolicyForNavigationResponse', () async { final WebKitNavigationDelegate webKitDelegate = WebKitNavigationDelegate( const WebKitNavigationDelegateCreationParams( webKitProxy: WebKitProxy( - createNavigationDelegate: CapturingNavigationDelegate.new, - createUIDelegate: CapturingUIDelegate.new, + newWKNavigationDelegate: CapturingNavigationDelegate.new, ), ), ); @@ -86,24 +121,46 @@ void main() { callbackError = error; } - webKitDelegate.setOnHttpError(onHttpError); + await webKitDelegate.setOnHttpError(onHttpError); - CapturingNavigationDelegate - .lastCreatedDelegate.decidePolicyForNavigationResponse!( - WKWebViewIOS.detached(), - const WKNavigationResponse( - response: NSHttpUrlResponse(statusCode: 401), forMainFrame: true), + await CapturingNavigationDelegate.lastCreatedDelegate + .decidePolicyForNavigationResponse( + WKNavigationDelegate.pigeon_detached( + pigeon_instanceManager: TestInstanceManager(), + decidePolicyForNavigationAction: (_, __, ___) async { + return NavigationActionPolicy.cancel; + }, + decidePolicyForNavigationResponse: (_, __, ___) async { + return NavigationResponsePolicy.cancel; + }, + didReceiveAuthenticationChallenge: (_, __, ___) async { + return [ + UrlSessionAuthChallengeDisposition.performDefaultHandling, + null, + ]; + }, + ), + WKWebView.pigeon_detached( + pigeon_instanceManager: TestInstanceManager(), + ), + WKNavigationResponse.pigeon_detached( + response: HTTPURLResponse.pigeon_detached( + statusCode: 401, + pigeon_instanceManager: TestInstanceManager(), + ), + isForMainFrame: true, + pigeon_instanceManager: TestInstanceManager(), + ), ); expect(callbackError.response?.statusCode, 401); }); - test('setOnHttpError is not called for error codes < 400', () { + test('setOnHttpError is not called for error codes < 400', () async { final WebKitNavigationDelegate webKitDelegate = WebKitNavigationDelegate( const WebKitNavigationDelegateCreationParams( webKitProxy: WebKitProxy( - createNavigationDelegate: CapturingNavigationDelegate.new, - createUIDelegate: CapturingUIDelegate.new, + newWKNavigationDelegate: CapturingNavigationDelegate.new, ), ), ); @@ -113,24 +170,46 @@ void main() { callbackError = error; } - webKitDelegate.setOnHttpError(onHttpError); + await webKitDelegate.setOnHttpError(onHttpError); - CapturingNavigationDelegate - .lastCreatedDelegate.decidePolicyForNavigationResponse!( - WKWebViewIOS.detached(), - const WKNavigationResponse( - response: NSHttpUrlResponse(statusCode: 399), forMainFrame: true), + await CapturingNavigationDelegate.lastCreatedDelegate + .decidePolicyForNavigationResponse( + WKNavigationDelegate.pigeon_detached( + pigeon_instanceManager: TestInstanceManager(), + decidePolicyForNavigationAction: (_, __, ___) async { + return NavigationActionPolicy.cancel; + }, + decidePolicyForNavigationResponse: (_, __, ___) async { + return NavigationResponsePolicy.cancel; + }, + didReceiveAuthenticationChallenge: (_, __, ___) async { + return [ + UrlSessionAuthChallengeDisposition.performDefaultHandling, + null, + ]; + }, + ), + WKWebView.pigeon_detached( + pigeon_instanceManager: TestInstanceManager(), + ), + WKNavigationResponse.pigeon_detached( + response: HTTPURLResponse.pigeon_detached( + statusCode: 399, + pigeon_instanceManager: TestInstanceManager(), + ), + isForMainFrame: true, + pigeon_instanceManager: TestInstanceManager(), + ), ); expect(callbackError, isNull); }); - test('onWebResourceError from didFailNavigation', () { + test('onWebResourceError from didFailNavigation', () async { final WebKitNavigationDelegate webKitDelegate = WebKitNavigationDelegate( const WebKitNavigationDelegateCreationParams( webKitProxy: WebKitProxy( - createNavigationDelegate: CapturingNavigationDelegate.new, - createUIDelegate: CapturingUIDelegate.new, + newWKNavigationDelegate: CapturingNavigationDelegate.new, ), ), ); @@ -140,14 +219,31 @@ void main() { callbackError = error as WebKitWebResourceError; } - webKitDelegate.setOnWebResourceError(onWebResourceError); + await webKitDelegate.setOnWebResourceError(onWebResourceError); CapturingNavigationDelegate.lastCreatedDelegate.didFailNavigation!( - WKWebViewIOS.detached(), - const NSError( + WKNavigationDelegate.pigeon_detached( + pigeon_instanceManager: TestInstanceManager(), + decidePolicyForNavigationAction: (_, __, ___) async { + return NavigationActionPolicy.cancel; + }, + decidePolicyForNavigationResponse: (_, __, ___) async { + return NavigationResponsePolicy.cancel; + }, + didReceiveAuthenticationChallenge: (_, __, ___) async { + return [ + UrlSessionAuthChallengeDisposition.performDefaultHandling, + null, + ]; + }, + ), + WKWebView.pigeon_detached( + pigeon_instanceManager: TestInstanceManager(), + ), + NSError.pigeon_detached( code: WKErrorCode.webViewInvalidated, domain: 'domain', - userInfo: { + userInfo: const { NSErrorUserInfoKey.NSURLErrorFailingURLStringError: 'www.flutter.dev', NSErrorUserInfoKey.NSLocalizedDescription: 'my desc', @@ -163,12 +259,11 @@ void main() { expect(callbackError.isForMainFrame, true); }); - test('onWebResourceError from didFailProvisionalNavigation', () { + test('onWebResourceError from didFailProvisionalNavigation', () async { final WebKitNavigationDelegate webKitDelegate = WebKitNavigationDelegate( const WebKitNavigationDelegateCreationParams( webKitProxy: WebKitProxy( - createNavigationDelegate: CapturingNavigationDelegate.new, - createUIDelegate: CapturingUIDelegate.new, + newWKNavigationDelegate: CapturingNavigationDelegate.new, ), ), ); @@ -178,15 +273,32 @@ void main() { callbackError = error as WebKitWebResourceError; } - webKitDelegate.setOnWebResourceError(onWebResourceError); + await webKitDelegate.setOnWebResourceError(onWebResourceError); CapturingNavigationDelegate .lastCreatedDelegate.didFailProvisionalNavigation!( - WKWebViewIOS.detached(), - const NSError( + WKNavigationDelegate.pigeon_detached( + pigeon_instanceManager: TestInstanceManager(), + decidePolicyForNavigationAction: (_, __, ___) async { + return NavigationActionPolicy.cancel; + }, + decidePolicyForNavigationResponse: (_, __, ___) async { + return NavigationResponsePolicy.cancel; + }, + didReceiveAuthenticationChallenge: (_, __, ___) async { + return [ + UrlSessionAuthChallengeDisposition.performDefaultHandling, + null, + ]; + }, + ), + WKWebView.pigeon_detached( + pigeon_instanceManager: TestInstanceManager(), + ), + NSError.pigeon_detached( code: WKErrorCode.webViewInvalidated, domain: 'domain', - userInfo: { + userInfo: const { NSErrorUserInfoKey.NSURLErrorFailingURLStringError: 'www.flutter.dev', NSErrorUserInfoKey.NSLocalizedDescription: 'my desc', @@ -202,12 +314,12 @@ void main() { expect(callbackError.isForMainFrame, true); }); - test('onWebResourceError from webViewWebContentProcessDidTerminate', () { + test('onWebResourceError from webViewWebContentProcessDidTerminate', + () async { final WebKitNavigationDelegate webKitDelegate = WebKitNavigationDelegate( const WebKitNavigationDelegateCreationParams( webKitProxy: WebKitProxy( - createNavigationDelegate: CapturingNavigationDelegate.new, - createUIDelegate: CapturingUIDelegate.new, + newWKNavigationDelegate: CapturingNavigationDelegate.new, ), ), ); @@ -217,11 +329,28 @@ void main() { callbackError = error as WebKitWebResourceError; } - webKitDelegate.setOnWebResourceError(onWebResourceError); + await webKitDelegate.setOnWebResourceError(onWebResourceError); CapturingNavigationDelegate .lastCreatedDelegate.webViewWebContentProcessDidTerminate!( - WKWebViewIOS.detached(), + WKNavigationDelegate.pigeon_detached( + pigeon_instanceManager: TestInstanceManager(), + decidePolicyForNavigationAction: (_, __, ___) async { + return NavigationActionPolicy.cancel; + }, + decidePolicyForNavigationResponse: (_, __, ___) async { + return NavigationResponsePolicy.cancel; + }, + didReceiveAuthenticationChallenge: (_, __, ___) async { + return [ + UrlSessionAuthChallengeDisposition.performDefaultHandling, + null, + ]; + }, + ), + WKWebView.pigeon_detached( + pigeon_instanceManager: TestInstanceManager(), + ), ); expect(callbackError.description, ''); @@ -234,50 +363,86 @@ void main() { expect(callbackError.isForMainFrame, true); }); - test('onNavigationRequest from decidePolicyForNavigationAction', () { + test('onNavigationRequest from decidePolicyForNavigationAction', () async { final WebKitNavigationDelegate webKitDelegate = WebKitNavigationDelegate( const WebKitNavigationDelegateCreationParams( webKitProxy: WebKitProxy( - createNavigationDelegate: CapturingNavigationDelegate.new, - createUIDelegate: CapturingUIDelegate.new, + newWKNavigationDelegate: CapturingNavigationDelegate.new, ), ), ); late final NavigationRequest callbackRequest; FutureOr onNavigationRequest( - NavigationRequest request) { + NavigationRequest request, + ) { callbackRequest = request; return NavigationDecision.navigate; } - webKitDelegate.setOnNavigationRequest(onNavigationRequest); + await webKitDelegate.setOnNavigationRequest(onNavigationRequest); + + final MockURLRequest mockRequest = MockURLRequest(); + when(mockRequest.getUrl()).thenAnswer( + (_) => Future.value('https://www.google.com'), + ); expect( - CapturingNavigationDelegate - .lastCreatedDelegate.decidePolicyForNavigationAction!( - WKWebViewIOS.detached(), - const WKNavigationAction( - request: NSUrlRequest(url: 'https://www.google.com'), - targetFrame: WKFrameInfo( - isMainFrame: false, - request: NSUrlRequest(url: 'https://google.com')), - navigationType: WKNavigationType.linkActivated, + await CapturingNavigationDelegate.lastCreatedDelegate + .decidePolicyForNavigationAction( + WKNavigationDelegate.pigeon_detached( + pigeon_instanceManager: TestInstanceManager(), + decidePolicyForNavigationAction: (_, __, ___) async { + return NavigationActionPolicy.cancel; + }, + decidePolicyForNavigationResponse: (_, __, ___) async { + return NavigationResponsePolicy.cancel; + }, + didReceiveAuthenticationChallenge: (_, __, ___) async { + return [ + UrlSessionAuthChallengeDisposition.performDefaultHandling, + null, + ]; + }, + ), + WKWebView.pigeon_detached( + pigeon_instanceManager: TestInstanceManager(), + ), + WKNavigationAction.pigeon_detached( + request: mockRequest, + targetFrame: WKFrameInfo.pigeon_detached( + isMainFrame: false, + request: URLRequest.pigeon_detached( + pigeon_instanceManager: TestInstanceManager(), + ), + ), + navigationType: NavigationType.linkActivated, + pigeon_instanceManager: TestInstanceManager(), ), ), - completion(WKNavigationActionPolicy.allow), + NavigationActionPolicy.allow, ); expect(callbackRequest.url, 'https://www.google.com'); expect(callbackRequest.isMainFrame, isFalse); }); - test('onHttpBasicAuthRequest emits host and realm', () { + test('onHttpBasicAuthRequest emits host and realm', () async { final WebKitNavigationDelegate iosNavigationDelegate = WebKitNavigationDelegate( - const WebKitNavigationDelegateCreationParams( + WebKitNavigationDelegateCreationParams( webKitProxy: WebKitProxy( - createNavigationDelegate: CapturingNavigationDelegate.new, + newWKNavigationDelegate: CapturingNavigationDelegate.new, + newAuthenticationChallengeResponse: ({ + required UrlSessionAuthChallengeDisposition disposition, + URLCredential? credential, + }) { + return AuthenticationChallengeResponse.pigeon_detached( + disposition: UrlSessionAuthChallengeDisposition + .cancelAuthenticationChallenge, + pigeon_instanceManager: TestInstanceManager(), + ); + }, ), ), ); @@ -285,37 +450,76 @@ void main() { String? callbackHost; String? callbackRealm; - iosNavigationDelegate.setOnHttpAuthRequest((HttpAuthRequest request) { - callbackHost = request.host; - callbackRealm = request.realm; - }); + await iosNavigationDelegate.setOnHttpAuthRequest( + (HttpAuthRequest request) { + callbackHost = request.host; + callbackRealm = request.realm; + request.onCancel(); + }, + ); const String expectedHost = 'expectedHost'; const String expectedRealm = 'expectedRealm'; - CapturingNavigationDelegate - .lastCreatedDelegate.didReceiveAuthenticationChallenge!( - WKWebViewIOS.detached(), - NSUrlAuthenticationChallenge.detached( - protectionSpace: NSUrlProtectionSpace.detached( + final MockURLAuthenticationChallenge mockChallenge = + MockURLAuthenticationChallenge(); + when(mockChallenge.getProtectionSpace()).thenAnswer( + (_) { + return Future.value( + URLProtectionSpace.pigeon_detached( + port: 0, host: expectedHost, realm: expectedRealm, authenticationMethod: NSUrlAuthenticationMethod.httpBasic, + pigeon_instanceManager: TestInstanceManager(), ), - ), - (NSUrlSessionAuthChallengeDisposition disposition, - NSUrlCredential? credential) {}); + ); + }, + ); + + await CapturingNavigationDelegate.lastCreatedDelegate + .didReceiveAuthenticationChallenge( + WKNavigationDelegate.pigeon_detached( + pigeon_instanceManager: TestInstanceManager(), + decidePolicyForNavigationAction: (_, __, ___) async { + return NavigationActionPolicy.cancel; + }, + decidePolicyForNavigationResponse: (_, __, ___) async { + return NavigationResponsePolicy.cancel; + }, + didReceiveAuthenticationChallenge: (_, __, ___) async { + return [ + UrlSessionAuthChallengeDisposition.performDefaultHandling, + null, + ]; + }, + ), + WKWebView.pigeon_detached( + pigeon_instanceManager: TestInstanceManager(), + ), + mockChallenge, + ); expect(callbackHost, expectedHost); expect(callbackRealm, expectedRealm); }); - test('onHttpNtlmAuthRequest emits host and realm', () { + test('onHttpNtlmAuthRequest emits host and realm', () async { final WebKitNavigationDelegate iosNavigationDelegate = WebKitNavigationDelegate( - const WebKitNavigationDelegateCreationParams( + WebKitNavigationDelegateCreationParams( webKitProxy: WebKitProxy( - createNavigationDelegate: CapturingNavigationDelegate.new, + newWKNavigationDelegate: CapturingNavigationDelegate.new, + newAuthenticationChallengeResponse: ({ + required UrlSessionAuthChallengeDisposition disposition, + URLCredential? credential, + }) { + return AuthenticationChallengeResponse.pigeon_detached( + disposition: UrlSessionAuthChallengeDisposition + .cancelAuthenticationChallenge, + pigeon_instanceManager: TestInstanceManager(), + ); + }, ), ), ); @@ -323,26 +527,68 @@ void main() { String? callbackHost; String? callbackRealm; - iosNavigationDelegate.setOnHttpAuthRequest((HttpAuthRequest request) { - callbackHost = request.host; - callbackRealm = request.realm; - }); + const String user = 'user'; + const String password = 'password'; + await iosNavigationDelegate.setOnHttpAuthRequest( + (HttpAuthRequest request) { + callbackHost = request.host; + callbackRealm = request.realm; + request.onProceed( + const WebViewCredential(user: user, password: password), + ); + }, + ); const String expectedHost = 'expectedHost'; const String expectedRealm = 'expectedRealm'; - CapturingNavigationDelegate - .lastCreatedDelegate.didReceiveAuthenticationChallenge!( - WKWebViewIOS.detached(), - NSUrlAuthenticationChallenge.detached( - protectionSpace: NSUrlProtectionSpace.detached( + final MockURLAuthenticationChallenge mockChallenge = + MockURLAuthenticationChallenge(); + when(mockChallenge.getProtectionSpace()).thenAnswer( + (_) { + return Future.value( + URLProtectionSpace.pigeon_detached( + port: 0, host: expectedHost, realm: expectedRealm, authenticationMethod: NSUrlAuthenticationMethod.httpNtlm, + pigeon_instanceManager: TestInstanceManager(), ), - ), - (NSUrlSessionAuthChallengeDisposition disposition, - NSUrlCredential? credential) {}); + ); + }, + ); + + final List result = await CapturingNavigationDelegate + .lastCreatedDelegate + .didReceiveAuthenticationChallenge( + WKNavigationDelegate.pigeon_detached( + pigeon_instanceManager: TestInstanceManager(), + decidePolicyForNavigationAction: (_, __, ___) async { + return NavigationActionPolicy.cancel; + }, + decidePolicyForNavigationResponse: (_, __, ___) async { + return NavigationResponsePolicy.cancel; + }, + didReceiveAuthenticationChallenge: (_, __, ___) async { + return [ + UrlSessionAuthChallengeDisposition.performDefaultHandling, + null, + ]; + }, + ), + WKWebView.pigeon_detached( + pigeon_instanceManager: TestInstanceManager(), + ), + mockChallenge, + ); + + expect(result[0], UrlSessionAuthChallengeDisposition.useCredential); + expect(result[1], containsPair('user', user)); + expect(result[1], containsPair('password', password)); + expect( + result[1], + containsPair('persistence', UrlCredentialPersistence.forSession), + ); expect(callbackHost, expectedHost); expect(callbackRealm, expectedRealm); @@ -355,30 +601,33 @@ 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, - }) : super.detached() { + 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 [ + UrlSessionAuthChallengeDisposition.performDefaultHandling, + null, + ]; + }, + ); } -// Records the last created instance of itself. -class CapturingUIDelegate extends WKUIDelegate { - CapturingUIDelegate({ - super.onCreateWebView, - super.requestMediaCapturePermission, - super.runJavaScriptAlertDialog, - super.runJavaScriptConfirmDialog, - super.runJavaScriptTextInputDialog, - super.instanceManager, - }) : super.detached() { - lastCreatedDelegate = this; - } - static CapturingUIDelegate lastCreatedDelegate = CapturingUIDelegate(); +// Test InstanceManager that sets `onWeakReferenceRemoved` as a noop. +class TestInstanceManager extends PigeonInstanceManager { + TestInstanceManager() : super(onWeakReferenceRemoved: (_) {}); } 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 new file mode 100644 index 00000000000..503c38a6dc5 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_navigation_delegate_test.mocks.dart @@ -0,0 +1,262 @@ +// 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. + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:async' as _i3; +import 'dart:typed_data' as _i4; + +import 'package:mockito/mockito.dart' as _i1; +import 'package:mockito/src/dummies.dart' as _i5; +import 'package:webview_flutter_wkwebview/src/common/web_kit.g.dart' as _i2; + +// ignore_for_file: type=lint +// ignore_for_file: avoid_redundant_argument_values +// ignore_for_file: avoid_setters_without_getters +// ignore_for_file: comment_references +// ignore_for_file: deprecated_member_use +// 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 +// ignore_for_file: subtype_of_sealed_class + +class _FakePigeonInstanceManager_0 extends _i1.SmartFake + implements _i2.PigeonInstanceManager { + _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); +} + +class _FakeURLAuthenticationChallenge_2 extends _i1.SmartFake + implements _i2.URLAuthenticationChallenge { + _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); +} + +class _FakeURL_4 extends _i1.SmartFake implements _i2.URL { + _FakeURL_4(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); +} + +/// A class which mocks [URLAuthenticationChallenge]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockURLAuthenticationChallenge extends _i1.Mock + implements _i2.URLAuthenticationChallenge { + MockURLAuthenticationChallenge() { + _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 + _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>); + + @override + _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( + _i2.NSObject? observer, + String? keyPath, + List<_i2.KeyValueObservingOptions>? options, + ) => + (super.noSuchMethod( + 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 [URLRequest]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockURLRequest extends _i1.Mock implements _i2.URLRequest { + MockURLRequest() { + _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 + _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); + + @override + _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); + + @override + _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); + + @override + _i3.Future?> getAllHttpHeaderFields() => + (super.noSuchMethod( + 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); + + @override + _i3.Future addObserver( + _i2.NSObject? observer, + String? keyPath, + List<_i2.KeyValueObservingOptions>? options, + ) => + (super.noSuchMethod( + 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 [URL]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockURL extends _i1.Mock implements _i2.URL { + MockURL() { + _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 + _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); + + @override + _i3.Future addObserver( + _i2.NSObject? observer, + String? keyPath, + List<_i2.KeyValueObservingOptions>? options, + ) => + (super.noSuchMethod( + 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); +} 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 235932953f1..e6a350de4e6 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 @@ -3,33 +3,36 @@ // found in the LICENSE file. import 'dart:async'; -import 'dart:math'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; import 'package:webview_flutter_platform_interface/webview_flutter_platform_interface.dart'; -import 'package:webview_flutter_wkwebview/src/common/instance_manager.dart'; -import 'package:webview_flutter_wkwebview/src/foundation/foundation.dart'; -import 'package:webview_flutter_wkwebview/src/ui_kit/ui_kit.dart'; -import 'package:webview_flutter_wkwebview/src/web_kit/web_kit.dart'; +import 'package:webview_flutter_wkwebview/src/common/platform_webview.dart'; +import 'package:webview_flutter_wkwebview/src/common/web_kit.g.dart'; +import 'package:webview_flutter_wkwebview/src/common/webkit_constants.dart'; import 'package:webview_flutter_wkwebview/src/webkit_proxy.dart'; import 'package:webview_flutter_wkwebview/webview_flutter_wkwebview.dart'; import 'webkit_webview_controller_test.mocks.dart'; -@GenerateMocks([ - NSUrl, - UIScrollView, - UIScrollViewDelegate, - WKPreferences, - WKUserContentController, - WKWebsiteDataStore, - WKWebViewIOS, - WKWebViewConfiguration, - WKScriptMessageHandler, +@GenerateNiceMocks(>[ + MockSpec(), + MockSpec(), + MockSpec(), + MockSpec(), + MockSpec(), + MockSpec(), + MockSpec(), + MockSpec(), + MockSpec(), + MockSpec(), + MockSpec(), + MockSpec(), + MockSpec(), ]) void main() { WidgetsFlutterBinding.ensureInitialized(); @@ -42,92 +45,132 @@ void main() { WKUIDelegate? uiDelegate, MockWKUserContentController? mockUserContentController, MockWKWebsiteDataStore? mockWebsiteDataStore, - MockWKWebViewIOS Function( + MockUIViewWKWebView Function( WKWebViewConfiguration configuration, { void Function( - String keyPath, - NSObject object, - Map change, + NSObject, + String? keyPath, + NSObject? object, + Map? change, )? observeValue, })? createMockWebView, MockWKWebViewConfiguration? mockWebViewConfiguration, - InstanceManager? instanceManager, + MockURLRequest Function({required String url})? createURLRequest, + PigeonInstanceManager? instanceManager, + MockWKWebpagePreferences? mockWebpagePreferences, }) { final MockWKWebViewConfiguration nonNullMockWebViewConfiguration = mockWebViewConfiguration ?? MockWKWebViewConfiguration(); - late final MockWKWebViewIOS nonNullMockWebView; + late final MockUIViewWKWebView nonNullMockWebView; final PlatformWebViewControllerCreationParams controllerCreationParams = WebKitWebViewControllerCreationParams( webKitProxy: WebKitProxy( - createWebViewConfiguration: ({InstanceManager? instanceManager}) { + newWKWebViewConfiguration: ( + {PigeonInstanceManager? instanceManager}) { return nonNullMockWebViewConfiguration; }, - createWebView: ( - _, { + newPlatformWebView: ({ + required WKWebViewConfiguration initialConfiguration, void Function( - String keyPath, - NSObject object, - Map change, + NSObject, + String?, + NSObject?, + Map?, )? observeValue, - InstanceManager? instanceManager, }) { nonNullMockWebView = createMockWebView == null - ? MockWKWebViewIOS() + ? MockUIViewWKWebView() : createMockWebView( nonNullMockWebViewConfiguration, observeValue: observeValue, ); - return nonNullMockWebView; + return PlatformWebView.fromNativeWebView(nonNullMockWebView); }, - createUIDelegate: ({ + newWKUIDelegate: ({ void Function( - WKWebView webView, - WKWebViewConfiguration configuration, - WKNavigationAction navigationAction, + WKUIDelegate, + WKWebView, + WKWebViewConfiguration, + WKNavigationAction, )? onCreateWebView, - Future Function( - WKUIDelegate instance, - WKWebView webView, - WKSecurityOrigin origin, - WKFrameInfo frame, - WKMediaCaptureType type, - )? requestMediaCapturePermission, + required Future Function( + WKUIDelegate, + WKWebView, + WKSecurityOrigin, + WKFrameInfo, + MediaCaptureType, + ) requestMediaCapturePermission, Future Function( - String message, - WKFrameInfo frame, - )? runJavaScriptAlertDialog, - Future Function( - String message, - WKFrameInfo frame, - )? runJavaScriptConfirmDialog, - Future Function( - String prompt, - String defaultText, - WKFrameInfo frame, - )? runJavaScriptTextInputDialog, - InstanceManager? instanceManager, + WKUIDelegate, + WKWebView, + String, + WKFrameInfo, + )? runJavaScriptAlertPanel, + required Future Function( + WKUIDelegate, + WKWebView, + String, + WKFrameInfo, + ) runJavaScriptConfirmPanel, + Future Function( + WKUIDelegate, + WKWebView, + String, + String?, + WKFrameInfo, + )? runJavaScriptTextInputPanel, }) { return uiDelegate ?? CapturingUIDelegate( onCreateWebView: onCreateWebView, requestMediaCapturePermission: requestMediaCapturePermission, - runJavaScriptAlertDialog: runJavaScriptAlertDialog, - runJavaScriptConfirmDialog: runJavaScriptConfirmDialog, - runJavaScriptTextInputDialog: runJavaScriptTextInputDialog); + runJavaScriptAlertPanel: runJavaScriptAlertPanel, + runJavaScriptConfirmPanel: runJavaScriptConfirmPanel, + runJavaScriptTextInputPanel: runJavaScriptTextInputPanel); }, - createScriptMessageHandler: WKScriptMessageHandler.detached, - createUIScrollViewDelegate: ({ - void Function(UIScrollView, double, double)? scrollViewDidScroll, + newWKScriptMessageHandler: ({ + required void Function( + WKScriptMessageHandler, + WKUserContentController, + WKScriptMessage, + ) didReceiveScriptMessage, + }) { + return WKScriptMessageHandler.pigeon_detached( + didReceiveScriptMessage: didReceiveScriptMessage, + pigeon_instanceManager: TestInstanceManager(), + ); + }, + newUIScrollViewDelegate: ({ + void Function( + UIScrollViewDelegate, + UIScrollView, + double, + double, + )? scrollViewDidScroll, }) { return scrollViewDelegate ?? CapturingUIScrollViewDelegate( scrollViewDidScroll: scrollViewDidScroll, ); }, + newURLRequest: + createURLRequest ?? ({required String url}) => MockURLRequest(), + newWKUserScript: ({ + required String source, + required UserScriptInjectionTime injectionTime, + required bool isForMainFrameOnly, + }) { + return WKUserScript.pigeon_detached( + source: source, + injectionTime: injectionTime, + isForMainFrameOnly: isForMainFrameOnly, + pigeon_instanceManager: TestInstanceManager(), + ); + }, ), - instanceManager: instanceManager, + instanceManager: instanceManager ?? TestInstanceManager(), ); final WebKitWebViewController controller = WebKitWebViewController( @@ -139,12 +182,26 @@ void main() { when(nonNullMockWebView.configuration) .thenReturn(nonNullMockWebViewConfiguration); - when(nonNullMockWebViewConfiguration.preferences) - .thenReturn(mockPreferences ?? MockWKPreferences()); - when(nonNullMockWebViewConfiguration.userContentController).thenReturn( - mockUserContentController ?? MockWKUserContentController()); - when(nonNullMockWebViewConfiguration.websiteDataStore) - .thenReturn(mockWebsiteDataStore ?? MockWKWebsiteDataStore()); + when(nonNullMockWebViewConfiguration.getPreferences()).thenAnswer( + (_) => Future.value( + mockPreferences ?? MockWKPreferences(), + ), + ); + when(nonNullMockWebViewConfiguration.getDefaultWebpagePreferences()) + .thenAnswer( + (_) async => mockWebpagePreferences ?? MockWKWebpagePreferences(), + ); + when(nonNullMockWebViewConfiguration.getUserContentController()) + .thenAnswer( + (_) => Future.value( + mockUserContentController ?? MockWKUserContentController(), + ), + ); + when(nonNullMockWebViewConfiguration.getWebsiteDataStore()).thenAnswer( + (_) => Future.value( + mockWebsiteDataStore ?? MockWKWebsiteDataStore(), + ), + ); return controller; } @@ -156,10 +213,9 @@ void main() { WebKitWebViewControllerCreationParams( webKitProxy: WebKitProxy( - createWebViewConfiguration: ({InstanceManager? instanceManager}) { - return mockConfiguration; - }, + newWKWebViewConfiguration: () => mockConfiguration, ), + instanceManager: TestInstanceManager(), allowsInlineMediaPlayback: true, ); @@ -174,10 +230,11 @@ void main() { WebKitWebViewControllerCreationParams( webKitProxy: WebKitProxy( - createWebViewConfiguration: ({InstanceManager? instanceManager}) { + newWKWebViewConfiguration: () { return mockConfiguration; }, ), + instanceManager: TestInstanceManager(), limitsNavigationsToAppBoundDomains: true, ); @@ -194,10 +251,11 @@ void main() { WebKitWebViewControllerCreationParams( webKitProxy: WebKitProxy( - createWebViewConfiguration: ({InstanceManager? instanceManager}) { + newWKWebViewConfiguration: () { return mockConfiguration; }, ), + instanceManager: TestInstanceManager(), ); verifyNever( @@ -211,10 +269,11 @@ void main() { WebKitWebViewControllerCreationParams( webKitProxy: WebKitProxy( - createWebViewConfiguration: ({InstanceManager? instanceManager}) { + newWKWebViewConfiguration: () { return mockConfiguration; }, ), + instanceManager: TestInstanceManager(), mediaTypesRequiringUserAction: const { PlaybackMediaTypes.video, }, @@ -222,9 +281,7 @@ void main() { verify( mockConfiguration.setMediaTypesRequiringUserActionForPlayback( - { - WKAudiovisualMediaType.video, - }, + AudiovisualMediaType.video, ), ); }); @@ -236,18 +293,16 @@ void main() { WebKitWebViewControllerCreationParams( webKitProxy: WebKitProxy( - createWebViewConfiguration: ({InstanceManager? instanceManager}) { + newWKWebViewConfiguration: () { return mockConfiguration; }, ), + instanceManager: TestInstanceManager(), ); verify( mockConfiguration.setMediaTypesRequiringUserActionForPlayback( - { - WKAudiovisualMediaType.audio, - WKAudiovisualMediaType.video, - }, + AudiovisualMediaType.all, ), ); }); @@ -259,37 +314,35 @@ void main() { WebKitWebViewControllerCreationParams( webKitProxy: WebKitProxy( - createWebViewConfiguration: ({InstanceManager? instanceManager}) { + newWKWebViewConfiguration: () { return mockConfiguration; }, ), + instanceManager: TestInstanceManager(), mediaTypesRequiringUserAction: const {}, ); verify( mockConfiguration.setMediaTypesRequiringUserActionForPlayback( - {WKAudiovisualMediaType.none}, + AudiovisualMediaType.none, ), ); }); }); test('loadFile', () async { - final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); + final MockUIViewWKWebView mockWebView = MockUIViewWKWebView(); final WebKitWebViewController controller = createControllerWithMocks( createMockWebView: (_, {dynamic observeValue}) => mockWebView, ); await controller.loadFile('/path/to/file.html'); - verify(mockWebView.loadFileUrl( - '/path/to/file.html', - readAccessUrl: '/path/to', - )); + verify(mockWebView.loadFileUrl('/path/to/file.html', '/path/to')); }); test('loadFlutterAsset', () async { - final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); + final MockUIViewWKWebView mockWebView = MockUIViewWKWebView(); final WebKitWebViewController controller = createControllerWithMocks( createMockWebView: (_, {dynamic observeValue}) => mockWebView, @@ -300,24 +353,24 @@ void main() { }); test('loadHtmlString', () async { - final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); + final MockUIViewWKWebView mockWebView = MockUIViewWKWebView(); final WebKitWebViewController controller = createControllerWithMocks( createMockWebView: (_, {dynamic observeValue}) => mockWebView, ); - const String htmlString = 'Test data.'; + const String htmlString = 'Test data.'; await controller.loadHtmlString(htmlString, baseUrl: 'baseUrl'); verify(mockWebView.loadHtmlString( - 'Test data.', - baseUrl: 'baseUrl', + 'Test data.', + 'baseUrl', )); }); group('loadRequest', () { test('Throws ArgumentError for empty scheme', () async { - final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); + final MockUIViewWKWebView mockWebView = MockUIViewWKWebView(); final WebKitWebViewController controller = createControllerWithMocks( createMockWebView: (_, {dynamic observeValue}) => mockWebView, @@ -332,26 +385,28 @@ void main() { }); test('GET without headers', () async { - final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); + final MockUIViewWKWebView mockWebView = MockUIViewWKWebView(); + final MockURLRequest mockRequest = MockURLRequest(); final WebKitWebViewController controller = createControllerWithMocks( - createMockWebView: (_, {dynamic observeValue}) => mockWebView, - ); + createMockWebView: (_, {dynamic observeValue}) => mockWebView, + createURLRequest: ({required String url}) { + expect(url, 'https://www.google.com'); + return mockRequest; + }); await controller.loadRequest( LoadRequestParams(uri: Uri.parse('https://www.google.com')), ); - final NSUrlRequest request = verify(mockWebView.loadRequest(captureAny)) - .captured - .single as NSUrlRequest; - expect(request.url, 'https://www.google.com'); - expect(request.allHttpHeaderFields, {}); - expect(request.httpMethod, 'get'); + final URLRequest request = + verify(mockWebView.load(captureAny)).captured.single as URLRequest; + verify(request.setAllHttpHeaderFields({})); + verify(request.setHttpMethod('get')); }); test('GET with headers', () async { - final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); + final MockUIViewWKWebView mockWebView = MockUIViewWKWebView(); final WebKitWebViewController controller = createControllerWithMocks( createMockWebView: (_, {dynamic observeValue}) => mockWebView, @@ -364,16 +419,14 @@ void main() { ), ); - final NSUrlRequest request = verify(mockWebView.loadRequest(captureAny)) - .captured - .single as NSUrlRequest; - expect(request.url, 'https://www.google.com'); - expect(request.allHttpHeaderFields, {'a': 'header'}); - expect(request.httpMethod, 'get'); + final URLRequest request = + verify(mockWebView.load(captureAny)).captured.single as URLRequest; + verify(request.setAllHttpHeaderFields({'a': 'header'})); + verify(request.setHttpMethod('get')); }); test('POST without body', () async { - final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); + final MockUIViewWKWebView mockWebView = MockUIViewWKWebView(); final WebKitWebViewController controller = createControllerWithMocks( createMockWebView: (_, {dynamic observeValue}) => mockWebView, @@ -384,15 +437,13 @@ void main() { method: LoadRequestMethod.post, )); - final NSUrlRequest request = verify(mockWebView.loadRequest(captureAny)) - .captured - .single as NSUrlRequest; - expect(request.url, 'https://www.google.com'); - expect(request.httpMethod, 'post'); + final URLRequest request = + verify(mockWebView.load(captureAny)).captured.single as URLRequest; + verify(request.setHttpMethod('post')); }); test('POST with body', () async { - final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); + final MockUIViewWKWebView mockWebView = MockUIViewWKWebView(); final WebKitWebViewController controller = createControllerWithMocks( createMockWebView: (_, {dynamic observeValue}) => mockWebView, @@ -404,20 +455,15 @@ void main() { body: Uint8List.fromList('Test Body'.codeUnits), )); - final NSUrlRequest request = verify(mockWebView.loadRequest(captureAny)) - .captured - .single as NSUrlRequest; - expect(request.url, 'https://www.google.com'); - expect(request.httpMethod, 'post'); - expect( - request.httpBody, - Uint8List.fromList('Test Body'.codeUnits), - ); + final URLRequest request = + verify(mockWebView.load(captureAny)).captured.single as URLRequest; + verify(request.setHttpMethod('post')); + verify(request.setHttpBody(Uint8List.fromList('Test Body'.codeUnits))); }); }); test('canGoBack', () { - final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); + final MockUIViewWKWebView mockWebView = MockUIViewWKWebView(); final WebKitWebViewController controller = createControllerWithMocks( createMockWebView: (_, {dynamic observeValue}) => mockWebView, @@ -430,7 +476,7 @@ void main() { }); test('canGoForward', () { - final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); + final MockUIViewWKWebView mockWebView = MockUIViewWKWebView(); final WebKitWebViewController controller = createControllerWithMocks( createMockWebView: (_, {dynamic observeValue}) => mockWebView, @@ -443,7 +489,7 @@ void main() { }); test('goBack', () async { - final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); + final MockUIViewWKWebView mockWebView = MockUIViewWKWebView(); final WebKitWebViewController controller = createControllerWithMocks( createMockWebView: (_, {dynamic observeValue}) => mockWebView, @@ -454,7 +500,7 @@ void main() { }); test('goForward', () async { - final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); + final MockUIViewWKWebView mockWebView = MockUIViewWKWebView(); final WebKitWebViewController controller = createControllerWithMocks( createMockWebView: (_, {dynamic observeValue}) => mockWebView, @@ -465,7 +511,7 @@ void main() { }); test('reload', () async { - final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); + final MockUIViewWKWebView mockWebView = MockUIViewWKWebView(); final WebKitWebViewController controller = createControllerWithMocks( createMockWebView: (_, {dynamic observeValue}) => mockWebView, @@ -476,7 +522,7 @@ void main() { }); test('setAllowsBackForwardNavigationGestures', () async { - final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); + final MockUIViewWKWebView mockWebView = MockUIViewWKWebView(); final WebKitWebViewController controller = createControllerWithMocks( createMockWebView: (_, {dynamic observeValue}) => mockWebView, @@ -487,7 +533,7 @@ void main() { }); test('runJavaScriptReturningResult', () { - final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); + final MockUIViewWKWebView mockWebView = MockUIViewWKWebView(); final WebKitWebViewController controller = createControllerWithMocks( createMockWebView: (_, {dynamic observeValue}) => mockWebView, @@ -504,7 +550,7 @@ void main() { }); test('runJavaScriptReturningResult throws error on null return value', () { - final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); + final MockUIViewWKWebView mockWebView = MockUIViewWKWebView(); final WebKitWebViewController controller = createControllerWithMocks( createMockWebView: (_, {dynamic observeValue}) => mockWebView, @@ -520,7 +566,7 @@ void main() { }); test('runJavaScript', () { - final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); + final MockUIViewWKWebView mockWebView = MockUIViewWKWebView(); final WebKitWebViewController controller = createControllerWithMocks( createMockWebView: (_, {dynamic observeValue}) => mockWebView, @@ -537,7 +583,7 @@ void main() { test('runJavaScript ignores exception with unsupported javaScript type', () { - final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); + final MockUIViewWKWebView mockWebView = MockUIViewWKWebView(); final WebKitWebViewController controller = createControllerWithMocks( createMockWebView: (_, {dynamic observeValue}) => mockWebView, @@ -546,9 +592,11 @@ void main() { when(mockWebView.evaluateJavaScript('runJavaScript')) .thenThrow(PlatformException( code: '', - details: const NSError( + details: NSError.pigeon_detached( code: WKErrorCode.javaScriptResultTypeIsUnsupported, domain: '', + userInfo: const {}, + pigeon_instanceManager: TestInstanceManager(), ), )); expect( @@ -558,7 +606,7 @@ void main() { }); test('getTitle', () async { - final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); + final MockUIViewWKWebView mockWebView = MockUIViewWKWebView(); final WebKitWebViewController controller = createControllerWithMocks( createMockWebView: (_, {dynamic observeValue}) => mockWebView, @@ -570,7 +618,7 @@ void main() { }); test('currentUrl', () { - final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); + final MockUIViewWKWebView mockWebView = MockUIViewWKWebView(); final WebKitWebViewController controller = createControllerWithMocks( createMockWebView: (_, {dynamic observeValue}) => mockWebView, @@ -588,41 +636,27 @@ void main() { mockScrollView: mockScrollView, ); - await controller.scrollTo(2, 4); - verify(mockScrollView.setContentOffset(const Point(2.0, 4.0))); - }); + debugDefaultTargetPlatformOverride = TargetPlatform.iOS; - test('scrollBy', () async { - final MockUIScrollView mockScrollView = MockUIScrollView(); - - final WebKitWebViewController controller = createControllerWithMocks( - mockScrollView: mockScrollView, - ); + await controller.scrollTo(2, 4); + verify(mockScrollView.setContentOffset(2.0, 4.0)); - await controller.scrollBy(2, 4); - verify(mockScrollView.scrollBy(const Point(2.0, 4.0))); + debugDefaultTargetPlatformOverride = null; }); - test('verticalScrollBarEnabled', () async { + test('scrollBy', () async { final MockUIScrollView mockScrollView = MockUIScrollView(); final WebKitWebViewController controller = createControllerWithMocks( mockScrollView: mockScrollView, ); - await controller.verticalScrollBarEnabled(false); - verify(mockScrollView.verticalScrollBarEnabled(false)); - }); - - test('horizontalScrollBarEnabled', () async { - final MockUIScrollView mockScrollView = MockUIScrollView(); + debugDefaultTargetPlatformOverride = TargetPlatform.iOS; - final WebKitWebViewController controller = createControllerWithMocks( - mockScrollView: mockScrollView, - ); + await controller.scrollBy(2, 4); + verify(mockScrollView.scrollBy(2.0, 4.0)); - await controller.horizontalScrollBarEnabled(false); - verify(mockScrollView.horizontalScrollBarEnabled(false); + debugDefaultTargetPlatformOverride = null; }); test('getScrollPosition', () { @@ -632,13 +666,17 @@ void main() { mockScrollView: mockScrollView, ); + debugDefaultTargetPlatformOverride = TargetPlatform.iOS; + when(mockScrollView.getContentOffset()).thenAnswer( - (_) => Future>.value(const Point(8.0, 16.0)), + (_) => Future>.value([8.0, 16.0]), ); expect( controller.getScrollPosition(), completion(const Offset(8.0, 16.0)), ); + + debugDefaultTargetPlatformOverride = null; }); test('disable zoom', () async { @@ -655,8 +693,8 @@ void main() { verify(mockUserContentController.addUserScript(captureAny)) .captured .first as WKUserScript; - expect(zoomScript.isMainFrameOnly, isTrue); - expect(zoomScript.injectionTime, WKUserScriptInjectionTime.atDocumentEnd); + expect(zoomScript.isForMainFrameOnly, isTrue); + expect(zoomScript.injectionTime, UserScriptInjectionTime.atDocumentEnd); expect( zoomScript.source, "var meta = document.createElement('meta');\n" @@ -668,7 +706,8 @@ void main() { }); test('setBackgroundColor', () async { - final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); + final MockUIViewWKWebView mockWebView = MockUIViewWKWebView(); + //when(mockWebView) final MockUIScrollView mockScrollView = MockUIScrollView(); final WebKitWebViewController controller = createControllerWithMocks( @@ -676,18 +715,22 @@ void main() { mockScrollView: mockScrollView, ); + debugDefaultTargetPlatformOverride = TargetPlatform.iOS; + await controller.setBackgroundColor(Colors.red); // UIScrollView.setBackgroundColor must be called last. verifyInOrder([ mockWebView.setOpaque(false), - mockWebView.setBackgroundColor(Colors.transparent), - mockScrollView.setBackgroundColor(Colors.red), + mockWebView.setBackgroundColor(Colors.transparent.value), + mockScrollView.setBackgroundColor(Colors.red.value), ]); + + debugDefaultTargetPlatformOverride = null; }); test('userAgent', () async { - final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); + final MockUIViewWKWebView mockWebView = MockUIViewWKWebView(); final WebKitWebViewController controller = createControllerWithMocks( createMockWebView: (_, {dynamic observeValue}) => mockWebView, @@ -698,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', () { @@ -730,12 +795,12 @@ void main() { ); when( mockWebsiteDataStore.removeDataOfTypes( - { - WKWebsiteDataType.memoryCache, - WKWebsiteDataType.diskCache, - WKWebsiteDataType.offlineWebApplicationCache, - }, - DateTime.fromMillisecondsSinceEpoch(0), + [ + WebsiteDataType.memoryCache, + WebsiteDataType.diskCache, + WebsiteDataType.offlineWebApplicationCache, + ], + 0, ), ).thenAnswer((_) => Future.value(false)); @@ -751,8 +816,8 @@ void main() { ); when( mockWebsiteDataStore.removeDataOfTypes( - {WKWebsiteDataType.localStorage}, - DateTime.fromMillisecondsSinceEpoch(0), + [WebsiteDataType.localStorage], + 0, ), ).thenAnswer((_) => Future.value(false)); @@ -761,14 +826,16 @@ void main() { test('addJavaScriptChannel', () async { final WebKitProxy webKitProxy = WebKitProxy( - createScriptMessageHandler: ({ + newWKScriptMessageHandler: ({ required void Function( - WKUserContentController userContentController, - WKScriptMessage message, + WKScriptMessageHandler, + WKUserContentController, + WKScriptMessage, ) didReceiveScriptMessage, }) { - return WKScriptMessageHandler.detached( + return WKScriptMessageHandler.pigeon_detached( didReceiveScriptMessage: didReceiveScriptMessage, + pigeon_instanceManager: TestInstanceManager(), ); }, ); @@ -800,20 +867,22 @@ void main() { expect(userScript.source, 'window.name = webkit.messageHandlers.name;'); expect( userScript.injectionTime, - WKUserScriptInjectionTime.atDocumentStart, + UserScriptInjectionTime.atDocumentStart, ); }); test('addJavaScriptChannel requires channel with a unique name', () async { final WebKitProxy webKitProxy = WebKitProxy( - createScriptMessageHandler: ({ + newWKScriptMessageHandler: ({ required void Function( - WKUserContentController userContentController, - WKScriptMessage message, + WKScriptMessageHandler, + WKUserContentController, + WKScriptMessage, ) didReceiveScriptMessage, }) { - return WKScriptMessageHandler.detached( + return WKScriptMessageHandler.pigeon_detached( didReceiveScriptMessage: didReceiveScriptMessage, + pigeon_instanceManager: TestInstanceManager(), ); }, ); @@ -845,14 +914,16 @@ void main() { test('removeJavaScriptChannel', () async { final WebKitProxy webKitProxy = WebKitProxy( - createScriptMessageHandler: ({ + newWKScriptMessageHandler: ({ required void Function( - WKUserContentController userContentController, - WKScriptMessage message, + WKScriptMessageHandler, + WKUserContentController, + WKScriptMessage, ) didReceiveScriptMessage, }) { - return WKScriptMessageHandler.detached( + return WKScriptMessageHandler.pigeon_detached( didReceiveScriptMessage: didReceiveScriptMessage, + pigeon_instanceManager: TestInstanceManager(), ); }, ); @@ -884,14 +955,16 @@ void main() { test('removeJavaScriptChannel multiple times', () async { final WebKitProxy webKitProxy = WebKitProxy( - createScriptMessageHandler: ({ + newWKScriptMessageHandler: ({ required void Function( - WKUserContentController userContentController, - WKScriptMessage message, + WKScriptMessageHandler, + WKUserContentController, + WKScriptMessage, ) didReceiveScriptMessage, }) { - return WKScriptMessageHandler.detached( + return WKScriptMessageHandler.pigeon_detached( didReceiveScriptMessage: didReceiveScriptMessage, + pigeon_instanceManager: TestInstanceManager(), ); }, ); @@ -939,7 +1012,7 @@ void main() { expect(userScript.source, 'window.name2 = webkit.messageHandlers.name2;'); expect( userScript.injectionTime, - WKUserScriptInjectionTime.atDocumentStart, + UserScriptInjectionTime.atDocumentStart, ); await controller.removeJavaScriptChannel('name2'); @@ -950,14 +1023,16 @@ void main() { test('removeJavaScriptChannel with zoom disabled', () async { final WebKitProxy webKitProxy = WebKitProxy( - createScriptMessageHandler: ({ + newWKScriptMessageHandler: ({ required void Function( - WKUserContentController userContentController, - WKScriptMessage message, + WKScriptMessageHandler, + WKUserContentController, + WKScriptMessage, ) didReceiveScriptMessage, }) { - return WKScriptMessageHandler.detached( + return WKScriptMessageHandler.pigeon_detached( didReceiveScriptMessage: didReceiveScriptMessage, + pigeon_instanceManager: TestInstanceManager(), ); }, ); @@ -985,8 +1060,8 @@ void main() { verify(mockUserContentController.addUserScript(captureAny)) .captured .first as WKUserScript; - expect(zoomScript.isMainFrameOnly, isTrue); - expect(zoomScript.injectionTime, WKUserScriptInjectionTime.atDocumentEnd); + expect(zoomScript.isForMainFrameOnly, isTrue); + expect(zoomScript.injectionTime, UserScriptInjectionTime.atDocumentEnd); expect( zoomScript.source, "var meta = document.createElement('meta');\n" @@ -998,7 +1073,7 @@ void main() { }); test('getUserAgent', () { - final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); + final MockUIViewWKWebView mockWebView = MockUIViewWKWebView(); final WebKitWebViewController controller = createControllerWithMocks( createMockWebView: (_, {dynamic observeValue}) => mockWebView, @@ -1013,7 +1088,7 @@ void main() { }); test('setPlatformNavigationDelegate', () { - final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); + final MockUIViewWKWebView mockWebView = MockUIViewWKWebView(); final WebKitWebViewController controller = createControllerWithMocks( createMockWebView: (_, {dynamic observeValue}) => mockWebView, @@ -1023,8 +1098,8 @@ void main() { WebKitNavigationDelegate( const WebKitNavigationDelegateCreationParams( webKitProxy: WebKitProxy( - createNavigationDelegate: CapturingNavigationDelegate.new, - createUIDelegate: CapturingUIDelegate.new, + newWKNavigationDelegate: CapturingNavigationDelegate.new, + newWKUIDelegate: CapturingUIDelegate.new, ), ), ); @@ -1039,21 +1114,23 @@ void main() { }); test('setPlatformNavigationDelegate onProgress', () async { - final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); + final MockUIViewWKWebView mockWebView = MockUIViewWKWebView(); late final void Function( - String keyPath, - NSObject object, - Map change, + NSObject, + String? keyPath, + NSObject? object, + Map? change, ) webViewObserveValue; final WebKitWebViewController controller = createControllerWithMocks( createMockWebView: ( - _, { + WKWebViewConfiguration configuration, { void Function( - String keyPath, - NSObject object, - Map change, + NSObject, + String? keyPath, + NSObject? object, + Map? change, )? observeValue, }) { webViewObserveValue = observeValue!; @@ -1064,10 +1141,8 @@ void main() { verify( mockWebView.addObserver( mockWebView, - keyPath: 'estimatedProgress', - options: { - NSKeyValueObservingOptions.newValue, - }, + 'estimatedProgress', + [KeyValueObservingOptions.newValue], ), ); @@ -1075,8 +1150,7 @@ void main() { WebKitNavigationDelegate( const WebKitNavigationDelegateCreationParams( webKitProxy: WebKitProxy( - createNavigationDelegate: CapturingNavigationDelegate.new, - createUIDelegate: WKUIDelegate.detached, + newWKNavigationDelegate: CapturingNavigationDelegate.new, ), ), ); @@ -1089,9 +1163,10 @@ void main() { await controller.setPlatformNavigationDelegate(navigationDelegate); webViewObserveValue( + mockWebView, 'estimatedProgress', mockWebView, - {NSKeyValueChangeKey.newValue: 0.0}, + {KeyValueChangeKey.newValue: 0.0}, ); expect(callbackProgress, 0); @@ -1099,48 +1174,61 @@ 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. createControllerWithMocks(); - final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); - const NSUrlRequest request = NSUrlRequest(url: 'https://www.google.com'); + final MockUIViewWKWebView mockWebView = MockUIViewWKWebView(); + final MockURLRequest mockRequest = MockURLRequest(); CapturingUIDelegate.lastCreatedDelegate.onCreateWebView!( + CapturingUIDelegate.lastCreatedDelegate, mockWebView, - WKWebViewConfiguration.detached(), - const WKNavigationAction( - request: request, - targetFrame: WKFrameInfo( - isMainFrame: false, - request: NSUrlRequest(url: 'https://google.com')), - navigationType: WKNavigationType.linkActivated, + MockWKWebViewConfiguration(), + WKNavigationAction.pigeon_detached( + request: mockRequest, + targetFrame: WKFrameInfo.pigeon_detached( + isMainFrame: false, + request: MockURLRequest(), + pigeon_instanceManager: TestInstanceManager(), + ), + navigationType: NavigationType.linkActivated, + pigeon_instanceManager: TestInstanceManager(), ), ); - verify(mockWebView.loadRequest(request)); + verify(mockWebView.load(mockRequest)); }); test( 'setPlatformNavigationDelegate onProgress can be changed by the WebKitNavigationDelegate', () async { - final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); + final MockUIViewWKWebView mockWebView = MockUIViewWKWebView(); late final void Function( - String keyPath, - NSObject object, - Map change, + NSObject, + String? keyPath, + NSObject? object, + Map? change, ) webViewObserveValue; final WebKitWebViewController controller = createControllerWithMocks( createMockWebView: ( - _, { + WKWebViewConfiguration configuration, { void Function( - String keyPath, - NSObject object, - Map change, + NSObject, + String? keyPath, + NSObject? object, + Map? change, )? observeValue, }) { webViewObserveValue = observeValue!; @@ -1152,8 +1240,7 @@ void main() { WebKitNavigationDelegate( const WebKitNavigationDelegateCreationParams( webKitProxy: WebKitProxy( - createNavigationDelegate: CapturingNavigationDelegate.new, - createUIDelegate: WKUIDelegate.detached, + newWKNavigationDelegate: CapturingNavigationDelegate.new, ), ), ); @@ -1169,30 +1256,33 @@ void main() { ); webViewObserveValue( + mockWebView, 'estimatedProgress', mockWebView, - {NSKeyValueChangeKey.newValue: 0.0}, + {KeyValueChangeKey.newValue: 0.0}, ); expect(callbackProgress, 0); }); test('setPlatformNavigationDelegate onUrlChange', () async { - final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); + final MockUIViewWKWebView mockWebView = MockUIViewWKWebView(); late final void Function( - String keyPath, - NSObject object, - Map change, + NSObject, + String? keyPath, + NSObject? object, + Map? change, ) webViewObserveValue; final WebKitWebViewController controller = createControllerWithMocks( createMockWebView: ( - _, { + WKWebViewConfiguration configuration, { void Function( - String keyPath, - NSObject object, - Map change, + NSObject, + String? keyPath, + NSObject? object, + Map? change, )? observeValue, }) { webViewObserveValue = observeValue!; @@ -1203,10 +1293,10 @@ void main() { verify( mockWebView.addObserver( mockWebView, - keyPath: 'URL', - options: { - NSKeyValueObservingOptions.newValue, - }, + 'URL', + [ + KeyValueObservingOptions.newValue, + ], ), ); @@ -1214,8 +1304,7 @@ void main() { WebKitNavigationDelegate( const WebKitNavigationDelegateCreationParams( webKitProxy: WebKitProxy( - createNavigationDelegate: CapturingNavigationDelegate.new, - createUIDelegate: WKUIDelegate.detached, + newWKNavigationDelegate: CapturingNavigationDelegate.new, ), ), ); @@ -1227,14 +1316,15 @@ void main() { await controller.setPlatformNavigationDelegate(navigationDelegate); - final MockNSUrl mockNSUrl = MockNSUrl(); - when(mockNSUrl.getAbsoluteString()).thenAnswer((_) { + final MockURL mockUrl = MockURL(); + when(mockUrl.getAbsoluteString()).thenAnswer((_) { return Future.value('https://www.google.com'); }); webViewObserveValue( + mockWebView, 'URL', mockWebView, - {NSKeyValueChangeKey.newValue: mockNSUrl}, + {KeyValueChangeKey.newValue: mockUrl}, ); final UrlChange urlChange = await urlChangeCompleter.future; @@ -1242,21 +1332,23 @@ void main() { }); test('setPlatformNavigationDelegate onUrlChange to null NSUrl', () async { - final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); + final MockUIViewWKWebView mockWebView = MockUIViewWKWebView(); late final void Function( - String keyPath, - NSObject object, - Map change, + NSObject, + String? keyPath, + NSObject? object, + Map? change, ) webViewObserveValue; final WebKitWebViewController controller = createControllerWithMocks( createMockWebView: ( - _, { + WKWebViewConfiguration configuration, { void Function( - String keyPath, - NSObject object, - Map change, + NSObject, + String? keyPath, + NSObject? object, + Map? change, )? observeValue, }) { webViewObserveValue = observeValue!; @@ -1268,8 +1360,7 @@ void main() { WebKitNavigationDelegate( const WebKitNavigationDelegateCreationParams( webKitProxy: WebKitProxy( - createNavigationDelegate: CapturingNavigationDelegate.new, - createUIDelegate: WKUIDelegate.detached, + newWKNavigationDelegate: CapturingNavigationDelegate.new, ), ), ); @@ -1282,21 +1373,21 @@ void main() { await controller.setPlatformNavigationDelegate(navigationDelegate); webViewObserveValue( + mockWebView, 'URL', mockWebView, - {NSKeyValueChangeKey.newValue: null}, + {KeyValueChangeKey.newValue: null}, ); final UrlChange urlChange = await urlChangeCompleter.future; - expect(urlChange.url, isNull); + expect(urlChange.url, null); }); test('webViewIdentifier', () { - final InstanceManager instanceManager = InstanceManager( - onWeakReferenceRemoved: (_) {}, - ); - final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); - when(mockWebView.copy()).thenReturn(MockWKWebViewIOS()); + final PigeonInstanceManager instanceManager = TestInstanceManager(); + + final MockUIViewWKWebView mockWebView = MockUIViewWKWebView(); + when(mockWebView.pigeon_copy()).thenReturn(MockUIViewWKWebView()); instanceManager.addHostCreatedInstance(mockWebView, 0); final WebKitWebViewController controller = createControllerWithMocks( @@ -1321,33 +1412,40 @@ void main() { }, ); - final Future Function( + final Future Function( WKUIDelegate instance, WKWebView webView, WKSecurityOrigin origin, WKFrameInfo frame, - WKMediaCaptureType type, - ) onPermissionRequestCallback = CapturingUIDelegate - .lastCreatedDelegate.requestMediaCapturePermission!; + MediaCaptureType type, + ) onPermissionRequestCallback = + CapturingUIDelegate.lastCreatedDelegate.requestMediaCapturePermission; - final WKPermissionDecision decision = await onPermissionRequestCallback( + final PermissionDecision decision = await onPermissionRequestCallback( CapturingUIDelegate.lastCreatedDelegate, - WKWebViewIOS.detached(), - const WKSecurityOrigin(host: '', port: 0, protocol: ''), - const WKFrameInfo( - isMainFrame: false, - request: NSUrlRequest(url: 'https://google.com')), - WKMediaCaptureType.microphone, + MockWKWebView(), + WKSecurityOrigin.pigeon_detached( + host: '', + port: 0, + securityProtocol: '', + pigeon_instanceManager: TestInstanceManager(), + ), + WKFrameInfo.pigeon_detached( + isMainFrame: false, + request: MockURLRequest(), + pigeon_instanceManager: TestInstanceManager(), + ), + MediaCaptureType.microphone, ); expect(permissionRequest.types, [ WebViewPermissionResourceType.microphone, ]); - expect(decision, WKPermissionDecision.grant); + expect(decision, PermissionDecision.grant); }); group('JavaScript Dialog', () { - test('setOnJavaScriptAlertDialog', () async { + test('setOnJavaScriptAlertPanel', () async { final WebKitWebViewController controller = createControllerWithMocks(); late final String message; await controller.setOnJavaScriptAlertDialog( @@ -1357,19 +1455,34 @@ void main() { }); const String callbackMessage = 'Message'; - final Future Function(String message, WKFrameInfo frame) - onJavaScriptAlertDialog = - CapturingUIDelegate.lastCreatedDelegate.runJavaScriptAlertDialog!; - await onJavaScriptAlertDialog( - callbackMessage, - const WKFrameInfo( - isMainFrame: false, - request: NSUrlRequest(url: 'https://google.com'))); + final Future Function( + WKUIDelegate, + WKWebView, + String message, + WKFrameInfo frame, + ) onJavaScriptAlertPanel = + CapturingUIDelegate.lastCreatedDelegate.runJavaScriptAlertPanel!; + + final MockURLRequest mockRequest = MockURLRequest(); + when(mockRequest.getUrl()).thenAnswer( + (_) => Future.value('https://google.com'), + ); + + await onJavaScriptAlertPanel( + CapturingUIDelegate.lastCreatedDelegate, + MockWKWebView(), + callbackMessage, + WKFrameInfo.pigeon_detached( + isMainFrame: false, + request: mockRequest, + pigeon_instanceManager: TestInstanceManager(), + ), + ); expect(message, callbackMessage); }); - test('setOnJavaScriptConfirmDialog', () async { + test('setOnJavaScriptConfirmPanel', () async { final WebKitWebViewController controller = createControllerWithMocks(); late final String message; const bool callbackReturnValue = true; @@ -1380,20 +1493,35 @@ void main() { }); const String callbackMessage = 'Message'; - final Future Function(String message, WKFrameInfo frame) - onJavaScriptConfirmDialog = - CapturingUIDelegate.lastCreatedDelegate.runJavaScriptConfirmDialog!; - final bool returnValue = await onJavaScriptConfirmDialog( - callbackMessage, - const WKFrameInfo( - isMainFrame: false, - request: NSUrlRequest(url: 'https://google.com'))); + final Future Function( + WKUIDelegate, + WKWebView, + String message, + WKFrameInfo frame, + ) onJavaScriptConfirmPanel = + CapturingUIDelegate.lastCreatedDelegate.runJavaScriptConfirmPanel; + + final MockURLRequest mockRequest = MockURLRequest(); + when(mockRequest.getUrl()).thenAnswer( + (_) => Future.value('https://google.com'), + ); + + final bool returnValue = await onJavaScriptConfirmPanel( + CapturingUIDelegate.lastCreatedDelegate, + MockWKWebView(), + callbackMessage, + WKFrameInfo.pigeon_detached( + isMainFrame: false, + request: mockRequest, + pigeon_instanceManager: TestInstanceManager(), + ), + ); expect(message, callbackMessage); expect(returnValue, callbackReturnValue); }); - test('setOnJavaScriptTextInputDialog', () async { + test('setOnJavaScriptTextInputPanel', () async { final WebKitWebViewController controller = createControllerWithMocks(); late final String message; late final String? defaultText; @@ -1407,16 +1535,31 @@ void main() { const String callbackMessage = 'Message'; const String callbackDefaultText = 'Default Text'; - final Future Function( - String prompt, String defaultText, WKFrameInfo frame) - onJavaScriptTextInputDialog = CapturingUIDelegate - .lastCreatedDelegate.runJavaScriptTextInputDialog!; - final String returnValue = await onJavaScriptTextInputDialog( - callbackMessage, - callbackDefaultText, - const WKFrameInfo( - isMainFrame: false, - request: NSUrlRequest(url: 'https://google.com'))); + final Future Function( + WKUIDelegate, + WKWebView, + String prompt, + String? defaultText, + WKFrameInfo frame, + ) onJavaScriptTextInputPanel = CapturingUIDelegate + .lastCreatedDelegate.runJavaScriptTextInputPanel!; + + final MockURLRequest mockRequest = MockURLRequest(); + when(mockRequest.getUrl()).thenAnswer( + (_) => Future.value('https://google.com'), + ); + + final String? returnValue = await onJavaScriptTextInputPanel( + CapturingUIDelegate.lastCreatedDelegate, + MockWKWebView(), + callbackMessage, + callbackDefaultText, + WKFrameInfo.pigeon_detached( + isMainFrame: false, + request: mockRequest, + pigeon_instanceManager: TestInstanceManager(), + ), + ); expect(message, callbackMessage); expect(defaultText, callbackDefaultText); @@ -1425,7 +1568,7 @@ void main() { }); test('inspectable', () async { - final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); + final MockUIViewWKWebView mockWebView = MockUIViewWKWebView(); final WebKitWebViewController controller = createControllerWithMocks( createMockWebView: (_, {dynamic observeValue}) => mockWebView, @@ -1456,15 +1599,15 @@ void main() { final WKUserScript overrideConsoleScript = capturedScripts[1] as WKUserScript; - expect(messageHandlerScript.isMainFrameOnly, isFalse); + expect(messageHandlerScript.isForMainFrameOnly, isFalse); expect(messageHandlerScript.injectionTime, - WKUserScriptInjectionTime.atDocumentStart); + UserScriptInjectionTime.atDocumentStart); expect(messageHandlerScript.source, 'window.fltConsoleMessage = webkit.messageHandlers.fltConsoleMessage;'); - expect(overrideConsoleScript.isMainFrameOnly, isTrue); + expect(overrideConsoleScript.isForMainFrameOnly, isTrue); expect(overrideConsoleScript.injectionTime, - WKUserScriptInjectionTime.atDocumentStart); + UserScriptInjectionTime.atDocumentStart); expect(overrideConsoleScript.source, ''' var _flutter_webview_plugin_overrides = _flutter_webview_plugin_overrides || { removeCyclicObject: function() { @@ -1538,30 +1681,50 @@ window.addEventListener("error", function(e) { capturedParameters[0] as WKScriptMessageHandler; scriptMessageHandler.didReceiveScriptMessage( - mockUserContentController, - const WKScriptMessage( - name: 'test', - body: '{"level": "debug", "message": "Debug message"}')); + scriptMessageHandler, + mockUserContentController, + WKScriptMessage.pigeon_detached( + name: 'test', + body: '{"level": "debug", "message": "Debug message"}', + pigeon_instanceManager: TestInstanceManager(), + ), + ); scriptMessageHandler.didReceiveScriptMessage( - mockUserContentController, - const WKScriptMessage( - name: 'test', - body: '{"level": "error", "message": "Error message"}')); + scriptMessageHandler, + mockUserContentController, + WKScriptMessage.pigeon_detached( + name: 'test', + body: '{"level": "error", "message": "Error message"}', + pigeon_instanceManager: TestInstanceManager(), + ), + ); scriptMessageHandler.didReceiveScriptMessage( - mockUserContentController, - const WKScriptMessage( - name: 'test', - body: '{"level": "info", "message": "Info message"}')); + scriptMessageHandler, + mockUserContentController, + WKScriptMessage.pigeon_detached( + name: 'test', + body: '{"level": "info", "message": "Info message"}', + pigeon_instanceManager: TestInstanceManager(), + ), + ); scriptMessageHandler.didReceiveScriptMessage( - mockUserContentController, - const WKScriptMessage( - name: 'test', - body: '{"level": "log", "message": "Log message"}')); + scriptMessageHandler, + mockUserContentController, + WKScriptMessage.pigeon_detached( + name: 'test', + body: '{"level": "log", "message": "Log message"}', + pigeon_instanceManager: TestInstanceManager(), + ), + ); scriptMessageHandler.didReceiveScriptMessage( - mockUserContentController, - const WKScriptMessage( - name: 'test', - body: '{"level": "warning", "message": "Warning message"}')); + scriptMessageHandler, + mockUserContentController, + WKScriptMessage.pigeon_detached( + name: 'test', + body: '{"level": "warning", "message": "Warning message"}', + pigeon_instanceManager: TestInstanceManager(), + ), + ); expect(logs.length, 5); expect(logs[JavaScriptLogLevel.debug], 'Debug message'); @@ -1572,9 +1735,60 @@ window.addEventListener("error", function(e) { }); }); + test('setOnCanGoBackChange', () async { + final MockUIViewWKWebView mockWebView = MockUIViewWKWebView(); + + late final void Function( + NSObject, + String? keyPath, + NSObject? object, + Map? change, + ) webViewObserveValue; + + final WebKitWebViewController controller = createControllerWithMocks( + createMockWebView: ( + WKWebViewConfiguration configuration, { + void Function( + NSObject, + String? keyPath, + NSObject? object, + Map? change, + )? observeValue, + }) { + webViewObserveValue = observeValue!; + return mockWebView; + }, + ); + + verify( + mockWebView.addObserver( + mockWebView, + 'canGoBack', + [KeyValueObservingOptions.newValue], + ), + ); + + late final bool callbackCanGoBack; + + await controller.setOnCanGoBackChange( + (bool canGoBack) => callbackCanGoBack = canGoBack, + ); + + webViewObserveValue( + mockWebView, + 'canGoBack', + mockWebView, + {KeyValueChangeKey.newValue: true}, + ); + + expect(callbackCanGoBack, true); + }); + test('setOnScrollPositionChange', () async { final WebKitWebViewController controller = createControllerWithMocks(); + debugDefaultTargetPlatformOverride = TargetPlatform.iOS; + final Completer changeCompleter = Completer(); await controller.setOnScrollPositionChange( @@ -1584,6 +1798,7 @@ window.addEventListener("error", function(e) { ); final void Function( + UIScrollViewDelegate, UIScrollView scrollView, double, double, @@ -1591,11 +1806,18 @@ window.addEventListener("error", function(e) { .lastCreatedDelegate.scrollViewDidScroll!; final MockUIScrollView mockUIScrollView = MockUIScrollView(); - onScrollViewDidScroll(mockUIScrollView, 1.0, 2.0); + onScrollViewDidScroll( + CapturingUIScrollViewDelegate.lastCreatedDelegate, + mockUIScrollView, + 1.0, + 2.0, + ); final ScrollPositionChange change = await changeCompleter.future; expect(change.x, 1.0); expect(change.y, 2.0); + + debugDefaultTargetPlatformOverride = null; }); }); @@ -1604,14 +1826,16 @@ window.addEventListener("error", function(e) { late final WKScriptMessageHandler messageHandler; final WebKitProxy webKitProxy = WebKitProxy( - createScriptMessageHandler: ({ + newWKScriptMessageHandler: ({ required void Function( + WKScriptMessageHandler, WKUserContentController userContentController, WKScriptMessage message, ) didReceiveScriptMessage, }) { - messageHandler = WKScriptMessageHandler.detached( + messageHandler = WKScriptMessageHandler.pigeon_detached( didReceiveScriptMessage: didReceiveScriptMessage, + pigeon_instanceManager: TestInstanceManager(), ); return messageHandler; }, @@ -1627,8 +1851,13 @@ window.addEventListener("error", function(e) { ); messageHandler.didReceiveScriptMessage( + messageHandler, MockWKUserContentController(), - const WKScriptMessage(name: 'name', body: 'myMessage'), + WKScriptMessage.pigeon_detached( + name: 'name', + body: 'myMessage', + pigeon_instanceManager: TestInstanceManager(), + ), ); expect(callbackMessage, 'myMessage'); @@ -1641,44 +1870,65 @@ class CapturingNavigationDelegate extends WKNavigationDelegate { CapturingNavigationDelegate({ super.didFinishNavigation, super.didStartProvisionalNavigation, + required super.decidePolicyForNavigationResponse, super.didFailNavigation, super.didFailProvisionalNavigation, - super.decidePolicyForNavigationAction, - super.decidePolicyForNavigationResponse, + required super.decidePolicyForNavigationAction, super.webViewWebContentProcessDidTerminate, - super.didReceiveAuthenticationChallenge, - }) : super.detached() { + 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 [ + UrlSessionAuthChallengeDisposition.performDefaultHandling, + null, + ]; + }, + ); } // Records the last created instance of itself. class CapturingUIDelegate extends WKUIDelegate { CapturingUIDelegate({ super.onCreateWebView, - super.requestMediaCapturePermission, - super.runJavaScriptAlertDialog, - super.runJavaScriptConfirmDialog, - super.runJavaScriptTextInputDialog, - super.instanceManager, - }) : super.detached() { + required super.requestMediaCapturePermission, + super.runJavaScriptAlertPanel, + 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 { CapturingUIScrollViewDelegate({ super.scrollViewDidScroll, - super.instanceManager, - }) : super.detached() { + }) : super.pigeon_detached(pigeon_instanceManager: TestInstanceManager()) { lastCreatedDelegate = this; } static CapturingUIScrollViewDelegate lastCreatedDelegate = CapturingUIScrollViewDelegate(); } + +// Test InstanceManager that sets `onWeakReferenceRemoved` as a noop. +class TestInstanceManager extends PigeonInstanceManager { + TestInstanceManager() : super(onWeakReferenceRemoved: (_) {}); +} 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 b2abb40db13..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 @@ -1,17 +1,14 @@ -// 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. // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i6; -import 'dart:math' as _i3; -import 'dart:ui' as _i7; +import 'dart:async' as _i3; +import 'dart:typed_data' as _i5; import 'package:mockito/mockito.dart' as _i1; -import 'package:webview_flutter_wkwebview/src/foundation/foundation.dart' - as _i2; -import 'package:webview_flutter_wkwebview/src/ui_kit/ui_kit.dart' as _i4; -import 'package:webview_flutter_wkwebview/src/web_kit/web_kit.dart' as _i5; +import 'package:mockito/src/dummies.dart' as _i4; +import 'package:webview_flutter_wkwebview/src/common/web_kit.g.dart' as _i2; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -21,1162 +18,1385 @@ import 'package:webview_flutter_wkwebview/src/web_kit/web_kit.dart' as _i5; // 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 // ignore_for_file: subtype_of_sealed_class -class _FakeNSObject_0 extends _i1.SmartFake implements _i2.NSObject { - _FakeNSObject_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); +class _FakePigeonInstanceManager_0 extends _i1.SmartFake + implements _i2.PigeonInstanceManager { + _FakePigeonInstanceManager_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakePoint_1 extends _i1.SmartFake - implements _i3.Point { - _FakePoint_1( - 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); } -class _FakeUIScrollView_2 extends _i1.SmartFake implements _i4.UIScrollView { - _FakeUIScrollView_2( - 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); } -class _FakeUIScrollViewDelegate_3 extends _i1.SmartFake - implements _i4.UIScrollViewDelegate { - _FakeUIScrollViewDelegate_3( - 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); } -class _FakeWKPreferences_4 extends _i1.SmartFake implements _i5.WKPreferences { - _FakeWKPreferences_4( - 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); } -class _FakeWKUserContentController_5 extends _i1.SmartFake - implements _i5.WKUserContentController { - _FakeWKUserContentController_5( - 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 _FakeWKHttpCookieStore_6 extends _i1.SmartFake - implements _i5.WKHttpCookieStore { - _FakeWKHttpCookieStore_6( - 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); } -class _FakeWKWebsiteDataStore_7 extends _i1.SmartFake - implements _i5.WKWebsiteDataStore { - _FakeWKWebsiteDataStore_7( - 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); } -class _FakeWKWebViewConfiguration_8 extends _i1.SmartFake - implements _i5.WKWebViewConfiguration { - _FakeWKWebViewConfiguration_8( - 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); } -class _FakeWKWebView_9 extends _i1.SmartFake implements _i5.WKWebView { - _FakeWKWebView_9( - 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); } -class _FakeWKScriptMessageHandler_10 extends _i1.SmartFake - implements _i5.WKScriptMessageHandler { - _FakeWKScriptMessageHandler_10( - 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); } -/// A class which mocks [NSUrl]. +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_12(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); +} + +class _FakeUIViewWKWebView_13 extends _i1.SmartFake + implements _i2.UIViewWKWebView { + _FakeUIViewWKWebView_13(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); +} + +class _FakeWKHTTPCookieStore_14 extends _i1.SmartFake + implements _i2.WKHTTPCookieStore { + _FakeWKHTTPCookieStore_14(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); +} + +/// A class which mocks [UIScrollView]. /// /// See the documentation for Mockito's code generation for more information. -class MockNSUrl extends _i1.Mock implements _i2.NSUrl { - MockNSUrl() { - _i1.throwOnMissingStub(this); - } +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 - _i6.Future getAbsoluteString() => (super.noSuchMethod( - Invocation.method( - #getAbsoluteString, - [], + _i3.Future> getContentOffset() => (super.noSuchMethod( + Invocation.method(#getContentOffset, []), + returnValue: _i3.Future>.value([]), + returnValueForMissingStub: _i3.Future>.value( + [], ), - returnValue: _i6.Future.value(), - ) as _i6.Future); + ) 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); + + @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.NSObject copy() => (super.noSuchMethod( - Invocation.method( - #copy, - [], + _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, []), ), - returnValue: _FakeNSObject_0( + returnValueForMissingStub: _FakeUIScrollView_1( this, - Invocation.method( - #copy, - [], - ), + Invocation.method(#pigeon_copy, []), ), - ) as _i2.NSObject); + ) 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 - _i6.Future addObserver( - _i2.NSObject? observer, { - required String? keyPath, - required Set<_i2.NSKeyValueObservingOptions>? options, - }) => + _i3.Future addObserver( + _i2.NSObject? observer, + String? keyPath, + List<_i2.KeyValueObservingOptions>? options, + ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [observer], - { - #keyPath: keyPath, - #options: options, - }, - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); - - @override - _i6.Future removeObserver( - _i2.NSObject? observer, { - required String? keyPath, - }) => + 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: keyPath}, - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); } -/// A class which mocks [UIScrollView]. +/// A class which mocks [UIScrollViewDelegate]. /// /// See the documentation for Mockito's code generation for more information. -// ignore: must_be_immutable -class MockUIScrollView extends _i1.Mock implements _i4.UIScrollView { - MockUIScrollView() { - _i1.throwOnMissingStub(this); - } - +class MockUIScrollViewDelegate extends _i1.Mock + implements _i2.UIScrollViewDelegate { @override - _i6.Future<_i3.Point> getContentOffset() => (super.noSuchMethod( - Invocation.method( - #getContentOffset, - [], + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), ), - returnValue: _i6.Future<_i3.Point>.value(_FakePoint_1( + returnValueForMissingStub: _FakePigeonInstanceManager_0( this, - Invocation.method( - #getContentOffset, - [], - ), - )), - ) as _i6.Future<_i3.Point>); + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); @override - _i6.Future scrollBy(_i3.Point? offset) => (super.noSuchMethod( - Invocation.method( - #scrollBy, - [offset], + _i2.UIScrollViewDelegate pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeUIScrollViewDelegate_2( + this, + Invocation.method(#pigeon_copy, []), ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValueForMissingStub: _FakeUIScrollViewDelegate_2( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.UIScrollViewDelegate); @override - _i6.Future verticalScrollBarEnabled(bool? enabled) => + _i3.Future addObserver( + _i2.NSObject? observer, + String? keyPath, + List<_i2.KeyValueObservingOptions>? options, + ) => (super.noSuchMethod( - Invocation.method( - #verticalScrollBarEnabled, - [enabled], - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override - _i6.Future horizontalScrollBarEnabled(bool? enabled) => + _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method( - #horizontalScrollBarEnabled, - [enabled], + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); +} + +/// A class which mocks [URL]. +/// +/// 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), ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValueForMissingStub: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); @override - _i6.Future setContentOffset(_i3.Point? offset) => - (super.noSuchMethod( - Invocation.method( - #setContentOffset, - [offset], + _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, []), + ), ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + ) as _i3.Future); @override - _i6.Future setDelegate(_i4.UIScrollViewDelegate? delegate) => - (super.noSuchMethod( - Invocation.method( - #setDelegate, - [delegate], + _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, []), ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + ) as _i2.URL); + + @override + _i3.Future addObserver( + _i2.NSObject? observer, + String? keyPath, + List<_i2.KeyValueObservingOptions>? options, + ) => + (super.noSuchMethod( + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override - _i4.UIScrollView copy() => (super.noSuchMethod( - Invocation.method( - #copy, - [], + _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 [URLRequest]. +/// +/// 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), ), - returnValue: _FakeUIScrollView_2( + returnValueForMissingStub: _FakePigeonInstanceManager_0( this, - Invocation.method( - #copy, - [], - ), + Invocation.getter(#pigeon_instanceManager), ), - ) as _i4.UIScrollView); + ) as _i2.PigeonInstanceManager); @override - _i6.Future setBackgroundColor(_i7.Color? color) => (super.noSuchMethod( - Invocation.method( - #setBackgroundColor, - [color], - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + _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); @override - _i6.Future setOpaque(bool? opaque) => (super.noSuchMethod( - Invocation.method( - #setOpaque, - [opaque], + _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, []), ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValueForMissingStub: _FakeURLRequest_4( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.URLRequest); @override - _i6.Future addObserver( - _i2.NSObject? observer, { - required String? keyPath, - required Set<_i2.NSKeyValueObservingOptions>? options, - }) => + _i3.Future addObserver( + _i2.NSObject? observer, + String? keyPath, + List<_i2.KeyValueObservingOptions>? options, + ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [observer], - { - #keyPath: keyPath, - #options: options, - }, - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); - - @override - _i6.Future removeObserver( - _i2.NSObject? observer, { - required String? keyPath, - }) => + 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: keyPath}, - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); } -/// A class which mocks [UIScrollViewDelegate]. +/// A class which mocks [WKPreferences]. /// /// See the documentation for Mockito's code generation for more information. -// ignore: must_be_immutable -class MockUIScrollViewDelegate extends _i1.Mock - implements _i4.UIScrollViewDelegate { - MockUIScrollViewDelegate() { - _i1.throwOnMissingStub(this); - } +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 - _i4.UIScrollViewDelegate copy() => (super.noSuchMethod( - Invocation.method( - #copy, - [], + _i2.WKPreferences pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKPreferences_5( + this, + Invocation.method(#pigeon_copy, []), ), - returnValue: _FakeUIScrollViewDelegate_3( + returnValueForMissingStub: _FakeWKPreferences_5( this, - Invocation.method( - #copy, - [], - ), + Invocation.method(#pigeon_copy, []), ), - ) as _i4.UIScrollViewDelegate); + ) as _i2.WKPreferences); @override - _i6.Future addObserver( - _i2.NSObject? observer, { - required String? keyPath, - required Set<_i2.NSKeyValueObservingOptions>? options, - }) => + _i3.Future addObserver( + _i2.NSObject? observer, + String? keyPath, + List<_i2.KeyValueObservingOptions>? options, + ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [observer], - { - #keyPath: keyPath, - #options: options, - }, - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); - - @override - _i6.Future removeObserver( - _i2.NSObject? observer, { - required String? keyPath, - }) => + 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: keyPath}, - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); } -/// A class which mocks [WKPreferences]. +/// A class which mocks [WKScriptMessageHandler]. /// /// See the documentation for Mockito's code generation for more information. -// ignore: must_be_immutable -class MockWKPreferences extends _i1.Mock implements _i5.WKPreferences { - MockWKPreferences() { - _i1.throwOnMissingStub(this); - } +class MockWKScriptMessageHandler extends _i1.Mock + implements _i2.WKScriptMessageHandler { + @override + void Function( + _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 - _i6.Future setJavaScriptEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method( - #setJavaScriptEnabled, - [enabled], + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValueForMissingStub: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); @override - _i5.WKPreferences copy() => (super.noSuchMethod( - Invocation.method( - #copy, - [], + _i2.WKScriptMessageHandler pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKScriptMessageHandler_6( + this, + Invocation.method(#pigeon_copy, []), ), - returnValue: _FakeWKPreferences_4( + returnValueForMissingStub: _FakeWKScriptMessageHandler_6( this, - Invocation.method( - #copy, - [], - ), + Invocation.method(#pigeon_copy, []), ), - ) as _i5.WKPreferences); + ) as _i2.WKScriptMessageHandler); @override - _i6.Future addObserver( - _i2.NSObject? observer, { - required String? keyPath, - required Set<_i2.NSKeyValueObservingOptions>? options, - }) => + _i3.Future addObserver( + _i2.NSObject? observer, + String? keyPath, + List<_i2.KeyValueObservingOptions>? options, + ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [observer], - { - #keyPath: keyPath, - #options: options, - }, - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); - - @override - _i6.Future removeObserver( - _i2.NSObject? observer, { - required String? keyPath, - }) => + 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: keyPath}, - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); } /// A class which mocks [WKUserContentController]. /// /// See the documentation for Mockito's code generation for more information. -// ignore: must_be_immutable class MockWKUserContentController extends _i1.Mock - implements _i5.WKUserContentController { - MockWKUserContentController() { - _i1.throwOnMissingStub(this); - } + 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); @override - _i6.Future addScriptMessageHandler( - _i5.WKScriptMessageHandler? handler, + _i3.Future addScriptMessageHandler( + _i2.WKScriptMessageHandler? handler, String? name, ) => (super.noSuchMethod( - Invocation.method( - #addScriptMessageHandler, - [ - handler, - name, - ], - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + Invocation.method(#addScriptMessageHandler, [handler, name]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override - _i6.Future removeScriptMessageHandler(String? name) => + _i3.Future removeScriptMessageHandler(String? name) => (super.noSuchMethod( - Invocation.method( - #removeScriptMessageHandler, - [name], - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + Invocation.method(#removeScriptMessageHandler, [name]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override - _i6.Future removeAllScriptMessageHandlers() => (super.noSuchMethod( - Invocation.method( - #removeAllScriptMessageHandlers, - [], - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + _i3.Future removeAllScriptMessageHandlers() => (super.noSuchMethod( + Invocation.method(#removeAllScriptMessageHandlers, []), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override - _i6.Future addUserScript(_i5.WKUserScript? userScript) => + _i3.Future addUserScript(_i2.WKUserScript? userScript) => (super.noSuchMethod( - Invocation.method( - #addUserScript, - [userScript], - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + Invocation.method(#addUserScript, [userScript]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override - _i6.Future removeAllUserScripts() => (super.noSuchMethod( - Invocation.method( - #removeAllUserScripts, - [], - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + _i3.Future removeAllUserScripts() => (super.noSuchMethod( + Invocation.method(#removeAllUserScripts, []), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override - _i5.WKUserContentController copy() => (super.noSuchMethod( - Invocation.method( - #copy, - [], + _i2.WKUserContentController pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKUserContentController_7( + this, + Invocation.method(#pigeon_copy, []), ), - returnValue: _FakeWKUserContentController_5( + returnValueForMissingStub: _FakeWKUserContentController_7( this, - Invocation.method( - #copy, - [], - ), + Invocation.method(#pigeon_copy, []), ), - ) as _i5.WKUserContentController); + ) as _i2.WKUserContentController); @override - _i6.Future addObserver( - _i2.NSObject? observer, { - required String? keyPath, - required Set<_i2.NSKeyValueObservingOptions>? options, - }) => + _i3.Future addObserver( + _i2.NSObject? observer, + String? keyPath, + List<_i2.KeyValueObservingOptions>? options, + ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [observer], - { - #keyPath: keyPath, - #options: options, - }, - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); - - @override - _i6.Future removeObserver( - _i2.NSObject? observer, { - required String? keyPath, - }) => + 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: keyPath}, - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); } -/// A class which mocks [WKWebsiteDataStore]. +/// A class which mocks [WKUserScript]. /// /// See the documentation for Mockito's code generation for more information. -// ignore: must_be_immutable -class MockWKWebsiteDataStore extends _i1.Mock - implements _i5.WKWebsiteDataStore { - MockWKWebsiteDataStore() { - _i1.throwOnMissingStub(this); - } - +class MockWKUserScript extends _i1.Mock implements _i2.WKUserScript { @override - _i5.WKHttpCookieStore get httpCookieStore => (super.noSuchMethod( - Invocation.getter(#httpCookieStore), - returnValue: _FakeWKHttpCookieStore_6( + String get source => (super.noSuchMethod( + Invocation.getter(#source), + returnValue: _i4.dummyValue( this, - Invocation.getter(#httpCookieStore), + Invocation.getter(#source), + ), + returnValueForMissingStub: _i4.dummyValue( + this, + Invocation.getter(#source), ), - ) as _i5.WKHttpCookieStore); + ) as String); @override - _i6.Future removeDataOfTypes( - Set<_i5.WKWebsiteDataType>? dataTypes, - DateTime? since, - ) => - (super.noSuchMethod( - Invocation.method( - #removeDataOfTypes, - [ - dataTypes, - since, - ], + _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), ), - returnValue: _i6.Future.value(false), - ) as _i6.Future); + returnValueForMissingStub: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); @override - _i5.WKWebsiteDataStore copy() => (super.noSuchMethod( - Invocation.method( - #copy, - [], + _i2.WKUserScript pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKUserScript_8( + this, + Invocation.method(#pigeon_copy, []), ), - returnValue: _FakeWKWebsiteDataStore_7( + returnValueForMissingStub: _FakeWKUserScript_8( this, - Invocation.method( - #copy, - [], - ), + Invocation.method(#pigeon_copy, []), ), - ) as _i5.WKWebsiteDataStore); + ) as _i2.WKUserScript); @override - _i6.Future addObserver( - _i2.NSObject? observer, { - required String? keyPath, - required Set<_i2.NSKeyValueObservingOptions>? options, - }) => + _i3.Future addObserver( + _i2.NSObject? observer, + String? keyPath, + List<_i2.KeyValueObservingOptions>? options, + ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [observer], - { - #keyPath: keyPath, - #options: options, - }, - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); - - @override - _i6.Future removeObserver( - _i2.NSObject? observer, { - required String? keyPath, - }) => + 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: keyPath}, - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); } -/// A class which mocks [WKWebViewIOS]. +/// A class which mocks [WKWebView]. /// /// See the documentation for Mockito's code generation for more information. -class MockWKWebViewIOS extends _i1.Mock implements _i5.WKWebViewIOS { - MockWKWebViewIOS() { - _i1.throwOnMissingStub(this); - } - +class MockWKWebView extends _i1.Mock implements _i2.WKWebView { @override - _i4.UIScrollView get scrollView => (super.noSuchMethod( - Invocation.getter(#scrollView), - returnValue: _FakeUIScrollView_2( + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( this, - Invocation.getter(#scrollView), + Invocation.getter(#pigeon_instanceManager), ), - ) as _i4.UIScrollView); - - @override - _i5.WKWebViewConfiguration get configuration => (super.noSuchMethod( - Invocation.getter(#configuration), - returnValue: _FakeWKWebViewConfiguration_8( + returnValueForMissingStub: _FakePigeonInstanceManager_0( this, - Invocation.getter(#configuration), + Invocation.getter(#pigeon_instanceManager), ), - ) as _i5.WKWebViewConfiguration); + ) as _i2.PigeonInstanceManager); @override - _i5.WKWebView copy() => (super.noSuchMethod( - Invocation.method( - #copy, - [], - ), + _i2.WKWebView pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), returnValue: _FakeWKWebView_9( this, - Invocation.method( - #copy, - [], - ), + Invocation.method(#pigeon_copy, []), ), - ) as _i5.WKWebView); - - @override - _i6.Future setBackgroundColor(_i7.Color? color) => (super.noSuchMethod( - Invocation.method( - #setBackgroundColor, - [color], - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); - - @override - _i6.Future setOpaque(bool? opaque) => (super.noSuchMethod( - Invocation.method( - #setOpaque, - [opaque], + returnValueForMissingStub: _FakeWKWebView_9( + this, + Invocation.method(#pigeon_copy, []), ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + ) as _i2.WKWebView); @override - _i6.Future setUIDelegate(_i5.WKUIDelegate? delegate) => + _i3.Future addObserver( + _i2.NSObject? observer, + String? keyPath, + List<_i2.KeyValueObservingOptions>? options, + ) => (super.noSuchMethod( - Invocation.method( - #setUIDelegate, - [delegate], - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override - _i6.Future setNavigationDelegate(_i5.WKNavigationDelegate? delegate) => + _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method( - #setNavigationDelegate, - [delegate], - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); +} +/// A class which mocks [WKWebViewConfiguration]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockWKWebViewConfiguration extends _i1.Mock + implements _i2.WKWebViewConfiguration { @override - _i6.Future getUrl() => (super.noSuchMethod( - Invocation.method( - #getUrl, - [], + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), ), - returnValue: _i6.Future.value(), - ) as _i6.Future); - - @override - _i6.Future getEstimatedProgress() => (super.noSuchMethod( - Invocation.method( - #getEstimatedProgress, - [], + returnValueForMissingStub: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), ), - returnValue: _i6.Future.value(0.0), - ) as _i6.Future); + ) as _i2.PigeonInstanceManager); @override - _i6.Future loadRequest(_i2.NSUrlRequest? request) => + _i3.Future setUserContentController( + _i2.WKUserContentController? controller, + ) => (super.noSuchMethod( - Invocation.method( - #loadRequest, - [request], - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + Invocation.method(#setUserContentController, [controller]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override - _i6.Future loadHtmlString( - String? string, { - String? baseUrl, - }) => + _i3.Future<_i2.WKUserContentController> getUserContentController() => (super.noSuchMethod( - Invocation.method( - #loadHtmlString, - [string], - {#baseUrl: baseUrl}, + 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, []), + ), ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + ) as _i3.Future<_i2.WKUserContentController>); @override - _i6.Future loadFileUrl( - String? url, { - required String? readAccessUrl, - }) => + _i3.Future setWebsiteDataStore(_i2.WKWebsiteDataStore? dataStore) => (super.noSuchMethod( - Invocation.method( - #loadFileUrl, - [url], - {#readAccessUrl: readAccessUrl}, - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + Invocation.method(#setWebsiteDataStore, [dataStore]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override - _i6.Future loadFlutterAsset(String? key) => (super.noSuchMethod( - Invocation.method( - #loadFlutterAsset, - [key], + _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: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + ) as _i3.Future<_i2.WKWebsiteDataStore>); @override - _i6.Future canGoBack() => (super.noSuchMethod( - Invocation.method( - #canGoBack, - [], + _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, []), + ), ), - returnValue: _i6.Future.value(false), - ) as _i6.Future); + ) as _i3.Future<_i2.WKPreferences>); @override - _i6.Future canGoForward() => (super.noSuchMethod( - Invocation.method( - #canGoForward, - [], - ), - returnValue: _i6.Future.value(false), - ) as _i6.Future); + _i3.Future setAllowsInlineMediaPlayback(bool? allow) => + (super.noSuchMethod( + Invocation.method(#setAllowsInlineMediaPlayback, [allow]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override - _i6.Future goBack() => (super.noSuchMethod( - Invocation.method( - #goBack, - [], - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + _i3.Future setLimitsNavigationsToAppBoundDomains(bool? limit) => + (super.noSuchMethod( + Invocation.method(#setLimitsNavigationsToAppBoundDomains, [limit]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override - _i6.Future goForward() => (super.noSuchMethod( - Invocation.method( - #goForward, - [], - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + _i3.Future setMediaTypesRequiringUserActionForPlayback( + _i2.AudiovisualMediaType? type, + ) => + (super.noSuchMethod( + Invocation.method(#setMediaTypesRequiringUserActionForPlayback, [ + type, + ]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override - _i6.Future reload() => (super.noSuchMethod( - Invocation.method( - #reload, - [], + _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, []), + ), ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + ) as _i3.Future<_i2.WKWebpagePreferences>); @override - _i6.Future getTitle() => (super.noSuchMethod( - Invocation.method( - #getTitle, - [], + _i2.WKWebViewConfiguration pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKWebViewConfiguration_12( + this, + Invocation.method(#pigeon_copy, []), ), - returnValue: _i6.Future.value(), - ) as _i6.Future); + returnValueForMissingStub: _FakeWKWebViewConfiguration_12( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WKWebViewConfiguration); @override - _i6.Future getCustomUserAgent() => (super.noSuchMethod( - Invocation.method( - #getCustomUserAgent, - [], - ), - returnValue: _i6.Future.value(), - ) as _i6.Future); + _i3.Future addObserver( + _i2.NSObject? observer, + String? keyPath, + List<_i2.KeyValueObservingOptions>? options, + ) => + (super.noSuchMethod( + Invocation.method(#addObserver, [observer, keyPath, options]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override - _i6.Future setAllowsBackForwardNavigationGestures(bool? allow) => + _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method( - #setAllowsBackForwardNavigationGestures, - [allow], - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + 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 - _i6.Future setCustomUserAgent(String? userAgent) => (super.noSuchMethod( - Invocation.method( - #setCustomUserAgent, - [userAgent], + _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), ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + ) as _i2.PigeonInstanceManager); @override - _i6.Future evaluateJavaScript(String? javaScriptString) => + _i3.Future setAllowsContentJavaScript(bool? allow) => (super.noSuchMethod( - Invocation.method( - #evaluateJavaScript, - [javaScriptString], - ), - returnValue: _i6.Future.value(), - ) as _i6.Future); + Invocation.method(#setAllowsContentJavaScript, [allow]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override - _i6.Future setInspectable(bool? inspectable) => (super.noSuchMethod( - Invocation.method( - #setInspectable, - [inspectable], + _i2.WKWebpagePreferences pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKWebpagePreferences_11( + this, + Invocation.method(#pigeon_copy, []), ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValueForMissingStub: _FakeWKWebpagePreferences_11( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WKWebpagePreferences); @override - _i6.Future addObserver( - _i2.NSObject? observer, { - required String? keyPath, - required Set<_i2.NSKeyValueObservingOptions>? options, - }) => + _i3.Future addObserver( + _i2.NSObject? observer, + String? keyPath, + List<_i2.KeyValueObservingOptions>? options, + ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [observer], - { - #keyPath: keyPath, - #options: options, - }, - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); - - @override - _i6.Future removeObserver( - _i2.NSObject? observer, { - required String? keyPath, - }) => + 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: keyPath}, - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); } -/// A class which mocks [WKWebViewConfiguration]. +/// A class which mocks [UIViewWKWebView]. /// /// See the documentation for Mockito's code generation for more information. -// ignore: must_be_immutable -class MockWKWebViewConfiguration extends _i1.Mock - implements _i5.WKWebViewConfiguration { - MockWKWebViewConfiguration() { - _i1.throwOnMissingStub(this); - } +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 - _i5.WKUserContentController get userContentController => (super.noSuchMethod( - Invocation.getter(#userContentController), - returnValue: _FakeWKUserContentController_5( + _i2.UIScrollView get scrollView => (super.noSuchMethod( + Invocation.getter(#scrollView), + returnValue: _FakeUIScrollView_1( + this, + Invocation.getter(#scrollView), + ), + returnValueForMissingStub: _FakeUIScrollView_1( this, - Invocation.getter(#userContentController), + Invocation.getter(#scrollView), ), - ) as _i5.WKUserContentController); + ) as _i2.UIScrollView); @override - _i5.WKPreferences get preferences => (super.noSuchMethod( - Invocation.getter(#preferences), - returnValue: _FakeWKPreferences_4( + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( this, - Invocation.getter(#preferences), + Invocation.getter(#pigeon_instanceManager), ), - ) as _i5.WKPreferences); + returnValueForMissingStub: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); @override - _i5.WKWebsiteDataStore get websiteDataStore => (super.noSuchMethod( - Invocation.getter(#websiteDataStore), - returnValue: _FakeWKWebsiteDataStore_7( + _i2.WKWebViewConfiguration pigeonVar_configuration() => (super.noSuchMethod( + Invocation.method(#pigeonVar_configuration, []), + returnValue: _FakeWKWebViewConfiguration_12( this, - Invocation.getter(#websiteDataStore), + Invocation.method(#pigeonVar_configuration, []), ), - ) as _i5.WKWebsiteDataStore); + returnValueForMissingStub: _FakeWKWebViewConfiguration_12( + this, + Invocation.method(#pigeonVar_configuration, []), + ), + ) as _i2.WKWebViewConfiguration); @override - _i6.Future setAllowsInlineMediaPlayback(bool? allow) => - (super.noSuchMethod( - Invocation.method( - #setAllowsInlineMediaPlayback, - [allow], + _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, []), ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + ) as _i2.UIScrollView); @override - _i6.Future setLimitsNavigationsToAppBoundDomains(bool? limit) => + _i3.Future setUIDelegate(_i2.WKUIDelegate? delegate) => (super.noSuchMethod( - Invocation.method( - #setLimitsNavigationsToAppBoundDomains, - [limit], - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + Invocation.method(#setUIDelegate, [delegate]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override - _i6.Future setMediaTypesRequiringUserActionForPlayback( - Set<_i5.WKAudiovisualMediaType>? types) => + _i3.Future setNavigationDelegate(_i2.WKNavigationDelegate? delegate) => (super.noSuchMethod( - Invocation.method( - #setMediaTypesRequiringUserActionForPlayback, - [types], - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.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); + + @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(#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); + + @override + _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 - _i5.WKWebViewConfiguration copy() => (super.noSuchMethod( - Invocation.method( - #copy, - [], + _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, []), ), - returnValue: _FakeWKWebViewConfiguration_8( + returnValueForMissingStub: _FakeUIViewWKWebView_13( this, - Invocation.method( - #copy, - [], - ), + Invocation.method(#pigeon_copy, []), ), - ) as _i5.WKWebViewConfiguration); + ) 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 - _i6.Future addObserver( - _i2.NSObject? observer, { - required String? keyPath, - required Set<_i2.NSKeyValueObservingOptions>? options, - }) => + _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( + _i2.NSObject? observer, + String? keyPath, + List<_i2.KeyValueObservingOptions>? options, + ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [observer], - { - #keyPath: keyPath, - #options: options, - }, - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); - - @override - _i6.Future removeObserver( - _i2.NSObject? observer, { - required String? keyPath, - }) => + 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: keyPath}, - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); } -/// A class which mocks [WKScriptMessageHandler]. +/// A class which mocks [WKWebsiteDataStore]. /// /// See the documentation for Mockito's code generation for more information. -// ignore: must_be_immutable -class MockWKScriptMessageHandler extends _i1.Mock - implements _i5.WKScriptMessageHandler { - MockWKScriptMessageHandler() { - _i1.throwOnMissingStub(this); - } +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 - void Function( - _i5.WKUserContentController, - _i5.WKScriptMessage, - ) get didReceiveScriptMessage => (super.noSuchMethod( - Invocation.getter(#didReceiveScriptMessage), - returnValue: ( - _i5.WKUserContentController userContentController, - _i5.WKScriptMessage message, - ) {}, - ) as void Function( - _i5.WKUserContentController, - _i5.WKScriptMessage, - )); + _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 - _i5.WKScriptMessageHandler copy() => (super.noSuchMethod( - Invocation.method( - #copy, - [], + _i2.WKHTTPCookieStore pigeonVar_httpCookieStore() => (super.noSuchMethod( + Invocation.method(#pigeonVar_httpCookieStore, []), + returnValue: _FakeWKHTTPCookieStore_14( + this, + Invocation.method(#pigeonVar_httpCookieStore, []), ), - returnValue: _FakeWKScriptMessageHandler_10( + returnValueForMissingStub: _FakeWKHTTPCookieStore_14( this, - Invocation.method( - #copy, - [], - ), + Invocation.method(#pigeonVar_httpCookieStore, []), ), - ) as _i5.WKScriptMessageHandler); + ) as _i2.WKHTTPCookieStore); @override - _i6.Future addObserver( - _i2.NSObject? observer, { - required String? keyPath, - required Set<_i2.NSKeyValueObservingOptions>? options, - }) => + _i3.Future removeDataOfTypes( + List<_i2.WebsiteDataType>? dataTypes, + double? modificationTimeInSecondsSinceEpoch, + ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [observer], - { - #keyPath: keyPath, - #options: options, - }, - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); - - @override - _i6.Future removeObserver( - _i2.NSObject? observer, { - required String? keyPath, - }) => + 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( + _i2.NSObject? observer, + String? keyPath, + List<_i2.KeyValueObservingOptions>? options, + ) => + (super.noSuchMethod( + 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: keyPath}, - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.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.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_cookie_manager_test.dart index a9dd742bd67..429ac198882 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_cookie_manager_test.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_cookie_manager_test.dart @@ -7,14 +7,13 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; import 'package:webview_flutter_platform_interface/webview_flutter_platform_interface.dart'; -import 'package:webview_flutter_wkwebview/src/foundation/foundation.dart'; -import 'package:webview_flutter_wkwebview/src/web_kit/web_kit.dart'; +import 'package:webview_flutter_wkwebview/src/common/web_kit.g.dart'; import 'package:webview_flutter_wkwebview/src/webkit_proxy.dart'; import 'package:webview_flutter_wkwebview/webview_flutter_wkwebview.dart'; import 'webkit_webview_cookie_manager_test.mocks.dart'; -@GenerateMocks([WKWebsiteDataStore, WKHttpCookieStore]) +@GenerateMocks([WKWebsiteDataStore, WKHTTPCookieStore]) void main() { WidgetsFlutterBinding.ensureInitialized(); @@ -26,23 +25,23 @@ void main() { final WebKitWebViewCookieManager manager = WebKitWebViewCookieManager( WebKitWebViewCookieManagerCreationParams( webKitProxy: WebKitProxy( - defaultWebsiteDataStore: () => mockWKWebsiteDataStore, + defaultDataStoreWKWebsiteDataStore: () => mockWKWebsiteDataStore, ), ), ); when( mockWKWebsiteDataStore.removeDataOfTypes( - {WKWebsiteDataType.cookies}, - any, + [WebsiteDataType.cookies], + 0.0, ), ).thenAnswer((_) => Future.value(true)); expect(manager.clearCookies(), completion(true)); when( mockWKWebsiteDataStore.removeDataOfTypes( - {WKWebsiteDataType.cookies}, - any, + [WebsiteDataType.cookies], + 0.0, ), ).thenAnswer((_) => Future.value(false)); expect(manager.clearCookies(), completion(false)); @@ -52,13 +51,23 @@ void main() { final MockWKWebsiteDataStore mockWKWebsiteDataStore = MockWKWebsiteDataStore(); - final MockWKHttpCookieStore mockCookieStore = MockWKHttpCookieStore(); + final MockWKHTTPCookieStore mockCookieStore = MockWKHTTPCookieStore(); when(mockWKWebsiteDataStore.httpCookieStore).thenReturn(mockCookieStore); + Map? cookieProperties; + final HTTPCookie cookie = HTTPCookie.pigeon_detached( + pigeon_instanceManager: TestInstanceManager(), + ); final WebKitWebViewCookieManager manager = WebKitWebViewCookieManager( WebKitWebViewCookieManagerCreationParams( webKitProxy: WebKitProxy( - defaultWebsiteDataStore: () => mockWKWebsiteDataStore, + defaultDataStoreWKWebsiteDataStore: () => mockWKWebsiteDataStore, + newHTTPCookie: ({ + required Map properties, + }) { + cookieProperties = properties; + return cookie; + }, ), ), ); @@ -67,16 +76,14 @@ void main() { const WebViewCookie(name: 'a', value: 'b', domain: 'c', path: 'd'), ); - final NSHttpCookie cookie = verify(mockCookieStore.setCookie(captureAny)) - .captured - .single as NSHttpCookie; + verify(mockCookieStore.setCookie(cookie)); expect( - cookie.properties, - { - NSHttpCookiePropertyKey.name: 'a', - NSHttpCookiePropertyKey.value: 'b', - NSHttpCookiePropertyKey.domain: 'c', - NSHttpCookiePropertyKey.path: 'd', + cookieProperties, + { + HttpCookiePropertyKey.name: 'a', + HttpCookiePropertyKey.value: 'b', + HttpCookiePropertyKey.domain: 'c', + HttpCookiePropertyKey.path: 'd', }, ); }); @@ -85,13 +92,13 @@ void main() { final MockWKWebsiteDataStore mockWKWebsiteDataStore = MockWKWebsiteDataStore(); - final MockWKHttpCookieStore mockCookieStore = MockWKHttpCookieStore(); + final MockWKHTTPCookieStore mockCookieStore = MockWKHTTPCookieStore(); when(mockWKWebsiteDataStore.httpCookieStore).thenReturn(mockCookieStore); final WebKitWebViewCookieManager manager = WebKitWebViewCookieManager( WebKitWebViewCookieManagerCreationParams( webKitProxy: WebKitProxy( - defaultWebsiteDataStore: () => mockWKWebsiteDataStore, + defaultDataStoreWKWebsiteDataStore: () => mockWKWebsiteDataStore, ), ), ); @@ -110,3 +117,8 @@ void main() { }); }); } + +// Test InstanceManager that sets `onWeakReferenceRemoved` as a noop. +class TestInstanceManager extends PigeonInstanceManager { + TestInstanceManager() : super(onWeakReferenceRemoved: (_) {}); +} 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 bda15f7cec7..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 @@ -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. @@ -6,9 +6,7 @@ import 'dart:async' as _i3; import 'package:mockito/mockito.dart' as _i1; -import 'package:webview_flutter_wkwebview/src/foundation/foundation.dart' - as _i4; -import 'package:webview_flutter_wkwebview/src/web_kit/web_kit.dart' as _i2; +import 'package:webview_flutter_wkwebview/src/common/web_kit.g.dart' as _i2; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -18,37 +16,33 @@ import 'package:webview_flutter_wkwebview/src/web_kit/web_kit.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 // ignore_for_file: subtype_of_sealed_class -class _FakeWKHttpCookieStore_0 extends _i1.SmartFake - implements _i2.WKHttpCookieStore { - _FakeWKHttpCookieStore_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); +class _FakeWKHTTPCookieStore_0 extends _i1.SmartFake + implements _i2.WKHTTPCookieStore { + _FakeWKHTTPCookieStore_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeWKWebsiteDataStore_1 extends _i1.SmartFake +class _FakePigeonInstanceManager_1 extends _i1.SmartFake + implements _i2.PigeonInstanceManager { + _FakePigeonInstanceManager_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); +} + +class _FakeWKWebsiteDataStore_2 extends _i1.SmartFake implements _i2.WKWebsiteDataStore { - _FakeWKWebsiteDataStore_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWKWebsiteDataStore_2(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [WKWebsiteDataStore]. /// /// See the documentation for Mockito's code generation for more information. -// ignore: must_be_immutable class MockWKWebsiteDataStore extends _i1.Mock implements _i2.WKWebsiteDataStore { MockWKWebsiteDataStore() { @@ -56,144 +50,124 @@ class MockWKWebsiteDataStore extends _i1.Mock } @override - _i2.WKHttpCookieStore get httpCookieStore => (super.noSuchMethod( + _i2.WKHTTPCookieStore get httpCookieStore => (super.noSuchMethod( Invocation.getter(#httpCookieStore), - returnValue: _FakeWKHttpCookieStore_0( + returnValue: _FakeWKHTTPCookieStore_0( this, Invocation.getter(#httpCookieStore), ), - ) as _i2.WKHttpCookieStore); + ) 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); + + @override + _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( - Set<_i2.WKWebsiteDataType>? dataTypes, - DateTime? since, + List<_i2.WebsiteDataType>? dataTypes, + double? modificationTimeInSecondsSinceEpoch, ) => (super.noSuchMethod( - Invocation.method( - #removeDataOfTypes, - [ - dataTypes, - since, - ], - ), + Invocation.method(#removeDataOfTypes, [ + dataTypes, + modificationTimeInSecondsSinceEpoch, + ]), returnValue: _i3.Future.value(false), ) as _i3.Future); @override - _i2.WKWebsiteDataStore copy() => (super.noSuchMethod( - Invocation.method( - #copy, - [], - ), - returnValue: _FakeWKWebsiteDataStore_1( + _i2.WKWebsiteDataStore pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKWebsiteDataStore_2( this, - Invocation.method( - #copy, - [], - ), + Invocation.method(#pigeon_copy, []), ), ) as _i2.WKWebsiteDataStore); @override _i3.Future addObserver( - _i4.NSObject? observer, { - required String? keyPath, - required Set<_i4.NSKeyValueObservingOptions>? options, - }) => + _i2.NSObject? observer, + String? keyPath, + List<_i2.KeyValueObservingOptions>? options, + ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [observer], - { - #keyPath: keyPath, - #options: options, - }, - ), + Invocation.method(#addObserver, [observer, keyPath, options]), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override - _i3.Future removeObserver( - _i4.NSObject? observer, { - required String? keyPath, - }) => + _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method( - #removeObserver, - [observer], - {#keyPath: keyPath}, - ), + Invocation.method(#removeObserver, [observer, keyPath]), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); } -/// A class which mocks [WKHttpCookieStore]. +/// A class which mocks [WKHTTPCookieStore]. /// /// See the documentation for Mockito's code generation for more information. -// ignore: must_be_immutable -class MockWKHttpCookieStore extends _i1.Mock implements _i2.WKHttpCookieStore { - MockWKHttpCookieStore() { +class MockWKHTTPCookieStore extends _i1.Mock implements _i2.WKHTTPCookieStore { + MockWKHTTPCookieStore() { _i1.throwOnMissingStub(this); } @override - _i3.Future setCookie(_i4.NSHttpCookie? cookie) => (super.noSuchMethod( - Invocation.method( - #setCookie, - [cookie], + _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); @override - _i2.WKHttpCookieStore copy() => (super.noSuchMethod( - Invocation.method( - #copy, - [], - ), - returnValue: _FakeWKHttpCookieStore_0( + _i2.WKHTTPCookieStore pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKHTTPCookieStore_0( this, - Invocation.method( - #copy, - [], - ), + Invocation.method(#pigeon_copy, []), ), - ) as _i2.WKHttpCookieStore); + ) as _i2.WKHTTPCookieStore); @override _i3.Future addObserver( - _i4.NSObject? observer, { - required String? keyPath, - required Set<_i4.NSKeyValueObservingOptions>? options, - }) => + _i2.NSObject? observer, + String? keyPath, + List<_i2.KeyValueObservingOptions>? options, + ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [observer], - { - #keyPath: keyPath, - #options: options, - }, - ), + Invocation.method(#addObserver, [observer, keyPath, options]), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override - _i3.Future removeObserver( - _i4.NSObject? observer, { - required String? keyPath, - }) => + _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method( - #removeObserver, - [observer], - {#keyPath: keyPath}, - ), + 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.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_widget_test.dart index 3a17047c3ed..3ddfa7dd098 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_widget_test.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_widget_test.dart @@ -2,31 +2,29 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'dart:io'; - +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; -import 'package:webview_flutter_wkwebview/src/common/instance_manager.dart'; -import 'package:webview_flutter_wkwebview/src/foundation/foundation.dart'; -import 'package:webview_flutter_wkwebview/src/ui_kit/ui_kit.dart'; -import 'package:webview_flutter_wkwebview/src/web_kit/web_kit.dart'; +import 'package:webview_flutter_wkwebview/src/common/platform_webview.dart'; +import 'package:webview_flutter_wkwebview/src/common/web_kit.g.dart'; import 'package:webview_flutter_wkwebview/src/webkit_proxy.dart'; import 'package:webview_flutter_wkwebview/webview_flutter_wkwebview.dart'; -import 'webkit_webview_controller_test.mocks.dart' - show MockUIScrollViewDelegate; + import 'webkit_webview_widget_test.mocks.dart'; -@GenerateMocks([WKUIDelegate, WKWebViewConfiguration]) +@GenerateMocks([ + WKUIDelegate, + WKWebViewConfiguration, + UIScrollViewDelegate, +]) void main() { TestWidgetsFlutterBinding.ensureInitialized(); group('WebKitWebViewWidget', () { testWidgets('build', (WidgetTester tester) async { - final InstanceManager testInstanceManager = InstanceManager( - onWeakReferenceRemoved: (_) {}, - ); + final PigeonInstanceManager testInstanceManager = TestInstanceManager(); final WebKitWebViewController controller = createTestWebViewController(testInstanceManager); @@ -43,16 +41,20 @@ void main() { Builder(builder: (BuildContext context) => widget.build(context)), ); - expect(find.byType(Platform.isMacOS ? AppKitView : UiKitView), - findsOneWidget); + expect( + find.byType( + defaultTargetPlatform == TargetPlatform.macOS + ? AppKitView + : UiKitView, + ), + findsOneWidget, + ); expect(find.byKey(const Key('keyValue')), findsOneWidget); }); testWidgets('Key of the PlatformView changes when the controller changes', (WidgetTester tester) async { - final InstanceManager testInstanceManager = InstanceManager( - onWeakReferenceRemoved: (_) {}, - ); + final PigeonInstanceManager testInstanceManager = TestInstanceManager(); // Pump WebViewWidget with first controller. final WebKitWebViewController controller1 = @@ -119,9 +121,7 @@ void main() { testWidgets( 'Key of the PlatformView is the same when the creation params are equal', (WidgetTester tester) async { - final InstanceManager testInstanceManager = InstanceManager( - onWeakReferenceRemoved: (_) {}, - ); + final PigeonInstanceManager testInstanceManager = TestInstanceManager(); final WebKitWebViewController controller = createTestWebViewController(testInstanceManager); @@ -177,50 +177,59 @@ void main() { } WebKitWebViewController createTestWebViewController( - InstanceManager testInstanceManager, + PigeonInstanceManager testInstanceManager, ) { return WebKitWebViewController( WebKitWebViewControllerCreationParams( - webKitProxy: WebKitProxy(createWebView: ( - WKWebViewConfiguration configuration, { - void Function( - String keyPath, - NSObject object, - Map change, - )? observeValue, - InstanceManager? instanceManager, - }) { - final WKWebView webView = WKWebViewIOS.detached( - instanceManager: testInstanceManager, - ); - testInstanceManager.addDartCreatedInstance(webView); - return webView; - }, createWebViewConfiguration: ({InstanceManager? instanceManager}) { - return MockWKWebViewConfiguration(); - }, createUIDelegate: ({ - dynamic onCreateWebView, - dynamic requestMediaCapturePermission, - dynamic runJavaScriptAlertDialog, - dynamic runJavaScriptConfirmDialog, - dynamic runJavaScriptTextInputDialog, - InstanceManager? instanceManager, - }) { - final MockWKUIDelegate mockWKUIDelegate = MockWKUIDelegate(); - when(mockWKUIDelegate.copy()).thenReturn(MockWKUIDelegate()); - - testInstanceManager.addDartCreatedInstance(mockWKUIDelegate); - return mockWKUIDelegate; - }, createUIScrollViewDelegate: ({ - void Function(UIScrollView, double, double)? scrollViewDidScroll, - }) { - final MockUIScrollViewDelegate mockScrollViewDelegate = - MockUIScrollViewDelegate(); - when(mockScrollViewDelegate.copy()) - .thenReturn(MockUIScrollViewDelegate()); - - testInstanceManager.addDartCreatedInstance(mockScrollViewDelegate); - return mockScrollViewDelegate; - }), + webKitProxy: WebKitProxy( + newPlatformWebView: ({ + required WKWebViewConfiguration initialConfiguration, + void Function( + NSObject, + String?, + NSObject?, + Map?, + )? observeValue, + }) { + final UIViewWKWebView webView = UIViewWKWebView.pigeon_detached( + pigeon_instanceManager: testInstanceManager, + ); + testInstanceManager.addDartCreatedInstance(webView); + return PlatformWebView.fromNativeWebView(webView); + }, + newWKWebViewConfiguration: () { + return MockWKWebViewConfiguration(); + }, + newWKUIDelegate: ({ + dynamic onCreateWebView, + dynamic requestMediaCapturePermission, + dynamic runJavaScriptAlertPanel, + dynamic runJavaScriptConfirmPanel, + dynamic runJavaScriptTextInputPanel, + }) { + final MockWKUIDelegate mockWKUIDelegate = MockWKUIDelegate(); + when(mockWKUIDelegate.pigeon_copy()).thenReturn(MockWKUIDelegate()); + + testInstanceManager.addDartCreatedInstance(mockWKUIDelegate); + return mockWKUIDelegate; + }, + newUIScrollViewDelegate: ({ + dynamic scrollViewDidScroll, + }) { + final MockUIScrollViewDelegate mockScrollViewDelegate = + MockUIScrollViewDelegate(); + when(mockScrollViewDelegate.pigeon_copy()) + .thenReturn(MockUIScrollViewDelegate()); + + testInstanceManager.addDartCreatedInstance(mockScrollViewDelegate); + return mockScrollViewDelegate; + }, + ), ), ); } + +// Test InstanceManager that sets `onWeakReferenceRemoved` as a noop. +class TestInstanceManager extends PigeonInstanceManager { + TestInstanceManager() : super(onWeakReferenceRemoved: (_) {}); +} 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 2aff8e964b6..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 @@ -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. @@ -6,9 +6,7 @@ import 'dart:async' as _i3; import 'package:mockito/mockito.dart' as _i1; -import 'package:webview_flutter_wkwebview/src/foundation/foundation.dart' - as _i4; -import 'package:webview_flutter_wkwebview/src/web_kit/web_kit.dart' as _i2; +import 'package:webview_flutter_wkwebview/src/common/web_kit.g.dart' as _i2; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -18,118 +16,149 @@ import 'package:webview_flutter_wkwebview/src/web_kit/web_kit.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 // ignore_for_file: subtype_of_sealed_class -class _FakeWKUIDelegate_0 extends _i1.SmartFake implements _i2.WKUIDelegate { - _FakeWKUIDelegate_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); +class _FakePigeonInstanceManager_0 extends _i1.SmartFake + implements _i2.PigeonInstanceManager { + _FakePigeonInstanceManager_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeWKUserContentController_1 extends _i1.SmartFake - implements _i2.WKUserContentController { - _FakeWKUserContentController_1( - 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); } -class _FakeWKPreferences_2 extends _i1.SmartFake implements _i2.WKPreferences { - _FakeWKPreferences_2( - 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); } 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); +} + +class _FakeWKWebpagePreferences_5 extends _i1.SmartFake + implements _i2.WKWebpagePreferences { + _FakeWKWebpagePreferences_5(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } -class _FakeWKWebViewConfiguration_4 extends _i1.SmartFake +class _FakeWKWebViewConfiguration_6 extends _i1.SmartFake implements _i2.WKWebViewConfiguration { - _FakeWKWebViewConfiguration_4( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWKWebViewConfiguration_6(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); +} + +class _FakeUIScrollViewDelegate_7 extends _i1.SmartFake + implements _i2.UIScrollViewDelegate { + _FakeUIScrollViewDelegate_7(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [WKUIDelegate]. /// /// See the documentation for Mockito's code generation for more information. -// ignore: must_be_immutable class MockWKUIDelegate extends _i1.Mock implements _i2.WKUIDelegate { MockWKUIDelegate() { _i1.throwOnMissingStub(this); } @override - _i2.WKUIDelegate copy() => (super.noSuchMethod( - Invocation.method( - #copy, - [], + _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, ), - returnValue: _FakeWKUIDelegate_0( + ) 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.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( this, - Invocation.method( - #copy, - [], - ), + 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( - _i4.NSObject? observer, { - required String? keyPath, - required Set<_i4.NSKeyValueObservingOptions>? options, - }) => + _i2.NSObject? observer, + String? keyPath, + List<_i2.KeyValueObservingOptions>? options, + ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [observer], - { - #keyPath: keyPath, - #options: options, - }, - ), + Invocation.method(#addObserver, [observer, keyPath, options]), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override - _i3.Future removeObserver( - _i4.NSObject? observer, { - required String? keyPath, - }) => + _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method( - #removeObserver, - [observer], - {#keyPath: keyPath}, - ), + Invocation.method(#removeObserver, [observer, keyPath]), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @@ -138,7 +167,6 @@ class MockWKUIDelegate extends _i1.Mock implements _i2.WKUIDelegate { /// A class which mocks [WKWebViewConfiguration]. /// /// See the documentation for Mockito's code generation for more information. -// ignore: must_be_immutable class MockWKWebViewConfiguration extends _i1.Mock implements _i2.WKWebViewConfiguration { MockWKWebViewConfiguration() { @@ -146,39 +174,79 @@ class MockWKWebViewConfiguration extends _i1.Mock } @override - _i2.WKUserContentController get userContentController => (super.noSuchMethod( - Invocation.getter(#userContentController), - returnValue: _FakeWKUserContentController_1( + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( this, - Invocation.getter(#userContentController), + Invocation.getter(#pigeon_instanceManager), ), - ) as _i2.WKUserContentController); + ) as _i2.PigeonInstanceManager); @override - _i2.WKPreferences get preferences => (super.noSuchMethod( - Invocation.getter(#preferences), - returnValue: _FakeWKPreferences_2( - this, - Invocation.getter(#preferences), + _i3.Future setUserContentController( + _i2.WKUserContentController? controller, + ) => + (super.noSuchMethod( + 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 _i2.WKPreferences); + ) as _i3.Future<_i2.WKUserContentController>); @override - _i2.WKWebsiteDataStore get websiteDataStore => (super.noSuchMethod( - Invocation.getter(#websiteDataStore), - returnValue: _FakeWKWebsiteDataStore_3( - this, - Invocation.getter(#websiteDataStore), + _i3.Future setWebsiteDataStore(_i2.WKWebsiteDataStore? dataStore) => + (super.noSuchMethod( + 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 _i2.WKWebsiteDataStore); + ) as _i3.Future<_i2.WKWebsiteDataStore>); @override - _i3.Future setAllowsInlineMediaPlayback(bool? allow) => + _i3.Future setPreferences(_i2.WKPreferences? preferences) => (super.noSuchMethod( - Invocation.method( - #setAllowsInlineMediaPlayback, - [allow], + 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>); + + @override + _i3.Future setAllowsInlineMediaPlayback(bool? allow) => + (super.noSuchMethod( + Invocation.method(#setAllowsInlineMediaPlayback, [allow]), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @@ -186,71 +254,108 @@ class MockWKWebViewConfiguration extends _i1.Mock @override _i3.Future setLimitsNavigationsToAppBoundDomains(bool? limit) => (super.noSuchMethod( - Invocation.method( - #setLimitsNavigationsToAppBoundDomains, - [limit], - ), + Invocation.method(#setLimitsNavigationsToAppBoundDomains, [limit]), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override _i3.Future setMediaTypesRequiringUserActionForPlayback( - Set<_i2.WKAudiovisualMediaType>? types) => + _i2.AudiovisualMediaType? type, + ) => (super.noSuchMethod( - Invocation.method( - #setMediaTypesRequiringUserActionForPlayback, - [types], - ), + Invocation.method(#setMediaTypesRequiringUserActionForPlayback, [ + type, + ]), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override - _i2.WKWebViewConfiguration copy() => (super.noSuchMethod( - Invocation.method( - #copy, - [], + _i3.Future<_i2.WKWebpagePreferences> getDefaultWebpagePreferences() => + (super.noSuchMethod( + Invocation.method(#getDefaultWebpagePreferences, []), + returnValue: _i3.Future<_i2.WKWebpagePreferences>.value( + _FakeWKWebpagePreferences_5( + this, + Invocation.method(#getDefaultWebpagePreferences, []), + ), ), - returnValue: _FakeWKWebViewConfiguration_4( + ) as _i3.Future<_i2.WKWebpagePreferences>); + + @override + _i2.WKWebViewConfiguration pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKWebViewConfiguration_6( this, - Invocation.method( - #copy, - [], - ), + Invocation.method(#pigeon_copy, []), ), ) as _i2.WKWebViewConfiguration); @override _i3.Future addObserver( - _i4.NSObject? observer, { - required String? keyPath, - required Set<_i4.NSKeyValueObservingOptions>? options, - }) => + _i2.NSObject? observer, + String? keyPath, + List<_i2.KeyValueObservingOptions>? options, + ) => (super.noSuchMethod( - Invocation.method( - #addObserver, - [observer], - { - #keyPath: keyPath, - #options: options, - }, - ), + Invocation.method(#addObserver, [observer, keyPath, options]), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override - _i3.Future removeObserver( - _i4.NSObject? observer, { - required String? keyPath, - }) => + _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => (super.noSuchMethod( - Invocation.method( - #removeObserver, - [observer], - {#keyPath: keyPath}, + Invocation.method(#removeObserver, [observer, keyPath]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); +} + +/// A class which mocks [UIScrollViewDelegate]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockUIScrollViewDelegate extends _i1.Mock + implements _i2.UIScrollViewDelegate { + MockUIScrollViewDelegate() { + _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 + _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( + _i2.NSObject? observer, + String? keyPath, + List<_i2.KeyValueObservingOptions>? options, + ) => + (super.noSuchMethod( + 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); From d214e1a2fe10d5d60b3048c39307b67598563b7b Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Mon, 7 Apr 2025 22:22:30 -0400 Subject: [PATCH 05/29] undo pubspec changes --- packages/webview_flutter/webview_flutter/pubspec.yaml | 9 +++------ .../webview_flutter/webview_flutter_android/pubspec.yaml | 3 +-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/packages/webview_flutter/webview_flutter/pubspec.yaml b/packages/webview_flutter/webview_flutter/pubspec.yaml index 1e90c37be23..837800d7fee 100644 --- a/packages/webview_flutter/webview_flutter/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter/pubspec.yaml @@ -21,12 +21,9 @@ flutter: dependencies: flutter: sdk: flutter - webview_flutter_android: - path: ../webview_flutter_android - webview_flutter_platform_interface: - path: ../webview_flutter_platform_interface - webview_flutter_wkwebview: - path: ../webview_flutter_wkwebview + webview_flutter_android: ^4.0.0 + webview_flutter_platform_interface: ^2.10.0 + webview_flutter_wkwebview: ^3.15.0 dev_dependencies: build_runner: ^2.1.5 diff --git a/packages/webview_flutter/webview_flutter_android/pubspec.yaml b/packages/webview_flutter/webview_flutter_android/pubspec.yaml index 2a238860f1b..f9b5eae6e96 100644 --- a/packages/webview_flutter/webview_flutter_android/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter_android/pubspec.yaml @@ -20,8 +20,7 @@ flutter: dependencies: flutter: sdk: flutter - webview_flutter_platform_interface: - path: ../webview_flutter_platform_interface + webview_flutter_platform_interface: ^2.10.0 dev_dependencies: build_runner: ^2.1.4 From 13421caea5d0133ff9fc4cfc1be9f6d0308d1fe9 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Mon, 7 Apr 2025 22:25:15 -0400 Subject: [PATCH 06/29] proper dependency overrides --- .../webview_flutter/webview_flutter/example/pubspec.yaml | 6 ++++++ packages/webview_flutter/webview_flutter/pubspec.yaml | 6 ++++++ .../webview_flutter_android/example/pubspec.yaml | 4 ++++ .../webview_flutter/webview_flutter_android/pubspec.yaml | 4 ++++ .../webview_flutter_wkwebview/example/pubspec.yaml | 4 ++++ .../webview_flutter/webview_flutter_wkwebview/pubspec.yaml | 4 ++++ 6 files changed, 28 insertions(+) diff --git a/packages/webview_flutter/webview_flutter/example/pubspec.yaml b/packages/webview_flutter/webview_flutter/example/pubspec.yaml index e6152419a9a..d964e3ab605 100644 --- a/packages/webview_flutter/webview_flutter/example/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter/example/pubspec.yaml @@ -36,3 +36,9 @@ flutter: - assets/sample_video.mp4 - assets/www/index.html - assets/www/styles/style.css +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-federated-plugins +dependency_overrides: + webview_flutter_android: {path: ../../../../packages/webview_flutter/webview_flutter_android} + webview_flutter_platform_interface: {path: ../../../../packages/webview_flutter/webview_flutter_platform_interface} + webview_flutter_wkwebview: {path: ../../../../packages/webview_flutter/webview_flutter_wkwebview} diff --git a/packages/webview_flutter/webview_flutter/pubspec.yaml b/packages/webview_flutter/webview_flutter/pubspec.yaml index 837800d7fee..323cb0e1022 100644 --- a/packages/webview_flutter/webview_flutter/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter/pubspec.yaml @@ -36,3 +36,9 @@ topics: - html - webview - webview-flutter +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-federated-plugins +dependency_overrides: + webview_flutter_android: {path: ../../../packages/webview_flutter/webview_flutter_android} + webview_flutter_platform_interface: {path: ../../../packages/webview_flutter/webview_flutter_platform_interface} + webview_flutter_wkwebview: {path: ../../../packages/webview_flutter/webview_flutter_wkwebview} diff --git a/packages/webview_flutter/webview_flutter_android/example/pubspec.yaml b/packages/webview_flutter/webview_flutter_android/example/pubspec.yaml index c22d7dc7022..bce58acf18b 100644 --- a/packages/webview_flutter/webview_flutter_android/example/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter_android/example/pubspec.yaml @@ -33,3 +33,7 @@ flutter: - assets/sample_video.mp4 - assets/www/index.html - assets/www/styles/style.css +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-federated-plugins +dependency_overrides: + webview_flutter_platform_interface: {path: ../../../../packages/webview_flutter/webview_flutter_platform_interface} diff --git a/packages/webview_flutter/webview_flutter_android/pubspec.yaml b/packages/webview_flutter/webview_flutter_android/pubspec.yaml index f9b5eae6e96..4be34d75e8a 100644 --- a/packages/webview_flutter/webview_flutter_android/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter_android/pubspec.yaml @@ -33,3 +33,7 @@ topics: - html - webview - webview-flutter +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-federated-plugins +dependency_overrides: + webview_flutter_platform_interface: {path: ../../../packages/webview_flutter/webview_flutter_platform_interface} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/pubspec.yaml b/packages/webview_flutter/webview_flutter_wkwebview/example/pubspec.yaml index 051e60afa66..13f7918b267 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/example/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter_wkwebview/example/pubspec.yaml @@ -32,3 +32,7 @@ flutter: - assets/sample_video.mp4 - assets/www/index.html - assets/www/styles/style.css +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-federated-plugins +dependency_overrides: + webview_flutter_platform_interface: {path: ../../../../packages/webview_flutter/webview_flutter_platform_interface} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml b/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml index 67f2f644cd6..f96e9e1a986 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml @@ -38,3 +38,7 @@ topics: - html - webview - webview-flutter +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-federated-plugins +dependency_overrides: + webview_flutter_platform_interface: {path: ../../../packages/webview_flutter/webview_flutter_platform_interface} From 05ab7106e1fe347e00aafebfe39f88322a2aad29 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Mon, 7 Apr 2025 22:28:42 -0400 Subject: [PATCH 07/29] update platform interface --- .../lib/src/platform_webview_controller.dart | 12 ++++++------ .../test/platform_webview_controller_test.dart | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/webview_flutter/webview_flutter_platform_interface/lib/src/platform_webview_controller.dart b/packages/webview_flutter/webview_flutter_platform_interface/lib/src/platform_webview_controller.dart index 6a04c8607f8..d84cbf03533 100644 --- a/packages/webview_flutter/webview_flutter_platform_interface/lib/src/platform_webview_controller.dart +++ b/packages/webview_flutter/webview_flutter_platform_interface/lib/src/platform_webview_controller.dart @@ -229,16 +229,16 @@ abstract class PlatformWebViewController extends PlatformInterface { 'scrollBy is not implemented on the current platform'); } - /// Define whether the vertical scrollbar should be drawn or not. The default value is true. - Future verticalScrollBarEnabled(bool enabled) { + /// Whether the vertical scrollbar should be drawn or not. + Future setVerticalScrollBarEnabled(bool enabled) { throw UnimplementedError( - 'verticalScrollBarEnabled is not implemented on the current platform'); + 'setVerticalScrollBarEnabled is not implemented on the current platform'); } - /// Define whether the horizontal scrollbar should be drawn or not. The default value is true. - Future horizontalScrollBarEnabled(bool enabled) { + /// Whether the horizontal scrollbar should be drawn or not. + Future setHorizontalScrollBarEnabled(bool enabled) { throw UnimplementedError( - 'horizontalScrollBarEnabled is not implemented on the current platform'); + 'setHorizontalScrollBarEnabled is not implemented on the current platform'); } /// Return the current scroll position of this view. diff --git a/packages/webview_flutter/webview_flutter_platform_interface/test/platform_webview_controller_test.dart b/packages/webview_flutter/webview_flutter_platform_interface/test/platform_webview_controller_test.dart index ae458d7b994..56643d8601b 100644 --- a/packages/webview_flutter/webview_flutter_platform_interface/test/platform_webview_controller_test.dart +++ b/packages/webview_flutter/webview_flutter_platform_interface/test/platform_webview_controller_test.dart @@ -311,26 +311,26 @@ void main() { ); }); - test('Default implementation of verticalScrollBarEnabled should throw unimplemented error', + test('Default implementation of setVerticalScrollBarEnabled should throw unimplemented error', () { final PlatformWebViewController controller = ExtendsPlatformWebViewController( const PlatformWebViewControllerCreationParams()); expect( - () => controller.verticalScrollBarEnabled(false), + () => controller.setVerticalScrollBarEnabled(false), throwsUnimplementedError, ); }); - test('Default implementation of horizontalScrollBarEnabled should throw unimplemented error', + test('Default implementation of setHorizontalScrollBarEnabled should throw unimplemented error', () { final PlatformWebViewController controller = ExtendsPlatformWebViewController( const PlatformWebViewControllerCreationParams()); expect( - () => controller.horizontalScrollBarEnabled(false), + () => controller.setHorizontalScrollBarEnabled(false), throwsUnimplementedError, ); }); From c8387feabe16f1810d17cc431f1f9c06890d9749 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Mon, 7 Apr 2025 23:02:55 -0400 Subject: [PATCH 08/29] dart side of impl --- .../webviewflutter/AndroidWebkitLibrary.g.kt | 3083 ++++------- .../lib/src/android_webkit.g.dart | 286 +- .../lib/src/android_webview_controller.dart | 8 +- .../pigeons/android_webkit.dart | 10 + ...ndroid_navigation_delegate_test.mocks.dart | 201 +- .../test/android_webview_controller_test.dart | 8 +- ...android_webview_controller_test.mocks.dart | 4782 ++++++++--------- ...oid_webview_cookie_manager_test.mocks.dart | 891 ++- ...iew_android_cookie_manager_test.mocks.dart | 107 +- .../webview_android_widget_test.mocks.dart | 1745 +++--- 10 files changed, 4737 insertions(+), 6384 deletions(-) diff --git a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/AndroidWebkitLibrary.g.kt b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/AndroidWebkitLibrary.g.kt index a3b98702778..2e3845b3805 100644 --- a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/AndroidWebkitLibrary.g.kt +++ b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/AndroidWebkitLibrary.g.kt @@ -1,16 +1,18 @@ // 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.5.0), do not edit directly. +// Autogenerated from Pigeon (v22.7.4), do not edit directly. // See also: https://pub.dev/packages/pigeon -@file:Suppress("UNCHECKED_CAST", "ArrayInDataClass", "SyntheticAccessor") +@file:Suppress("UNCHECKED_CAST", "ArrayInDataClass") package io.flutter.plugins.webviewflutter import android.util.Log import io.flutter.plugin.common.BasicMessageChannel import io.flutter.plugin.common.BinaryMessenger +import io.flutter.plugin.common.EventChannel import io.flutter.plugin.common.MessageCodec +import io.flutter.plugin.common.StandardMethodCodec import io.flutter.plugin.common.StandardMessageCodec import java.io.ByteArrayOutputStream import java.nio.ByteBuffer @@ -21,52 +23,52 @@ private fun wrapResult(result: Any?): List { private fun wrapError(exception: Throwable): List { return if (exception is AndroidWebKitError) { - listOf(exception.code, exception.message, exception.details) + listOf( + exception.code, + exception.message, + exception.details + ) } else { listOf( - exception.javaClass.simpleName, - exception.toString(), - "Cause: " + exception.cause + ", Stacktrace: " + Log.getStackTraceString(exception)) + exception.javaClass.simpleName, + exception.toString(), + "Cause: " + exception.cause + ", Stacktrace: " + Log.getStackTraceString(exception) + ) } } private fun createConnectionError(channelName: String): AndroidWebKitError { - return AndroidWebKitError( - "channel-error", "Unable to establish connection on channel: '$channelName'.", "") -} + return AndroidWebKitError("channel-error", "Unable to establish connection on channel: '$channelName'.", "")} /** * Error class for passing custom error details to Flutter via a thrown PlatformException. - * * @property code The error code. * @property message The error message. * @property details The error details. Must be a datatype supported by the api codec. */ -class AndroidWebKitError( - val code: String, - override val message: String? = null, - val details: Any? = null +class AndroidWebKitError ( + val code: String, + override val message: String? = null, + val details: Any? = null ) : Throwable() /** * Maintains instances used to communicate with the corresponding objects in Dart. * - * Objects stored in this container are represented by an object in Dart that is also stored in an - * InstanceManager with the same identifier. + * Objects stored in this container are represented by an object in Dart that is also stored in + * an InstanceManager with the same identifier. * * When an instance is added with an identifier, either can be used to retrieve the other. * - * Added instances are added as a weak reference and a strong reference. When the strong reference - * is removed with [remove] and the weak reference is deallocated, the - * `finalizationListener.onFinalize` is called with the instance's identifier. However, if the - * strong reference is removed and then the identifier is retrieved with the intention to pass the - * identifier to Dart (e.g. calling [getIdentifierForStrongReference]), the strong reference to the - * instance is recreated. The strong reference will then need to be removed manually again. + * Added instances are added as a weak reference and a strong reference. When the strong + * reference is removed with [remove] and the weak reference is deallocated, the + * `finalizationListener.onFinalize` is called with the instance's identifier. However, if the strong + * reference is removed and then the identifier is retrieved with the intention to pass the identifier + * to Dart (e.g. calling [getIdentifierForStrongReference]), the strong reference to the instance + * is recreated. The strong reference will then need to be removed manually again. */ @Suppress("UNCHECKED_CAST", "MemberVisibilityCanBePrivate") -class AndroidWebkitLibraryPigeonInstanceManager( - private val finalizationListener: PigeonFinalizationListener -) { - /** Interface for listening when a weak reference of an instance is removed from the manager. */ +class AndroidWebkitLibraryPigeonInstanceManager(private val finalizationListener: PigeonFinalizationListener) { + /** Interface for listening when a weak reference of an instance is removed from the manager. */ interface PigeonFinalizationListener { fun onFinalize(identifier: Long) } @@ -92,7 +94,10 @@ class AndroidWebkitLibraryPigeonInstanceManager( } init { - handler.postDelayed({ releaseAllFinalizedInstances() }, clearFinalizedWeakReferencesInterval) + handler.postDelayed( + { releaseAllFinalizedInstances() }, + clearFinalizedWeakReferencesInterval + ) } companion object { @@ -104,40 +109,37 @@ class AndroidWebkitLibraryPigeonInstanceManager( private const val tag = "PigeonInstanceManager" /** - * Instantiate a new manager with a listener for garbage collected weak references. + * Instantiate a new manager with a listener for garbage collected weak + * references. * * When the manager is no longer needed, [stopFinalizationListener] must be called. */ - fun create( - finalizationListener: PigeonFinalizationListener - ): AndroidWebkitLibraryPigeonInstanceManager { + fun create(finalizationListener: PigeonFinalizationListener): AndroidWebkitLibraryPigeonInstanceManager { return AndroidWebkitLibraryPigeonInstanceManager(finalizationListener) } } /** - * Removes `identifier` and return its associated strongly referenced instance, if present, from - * the manager. + * Removes `identifier` and return its associated strongly referenced instance, if present, + * from the manager. */ fun remove(identifier: Long): T? { logWarningIfFinalizationListenerHasStopped() - val instance: Any? = getInstance(identifier) - if (instance is WebViewProxyApi.WebViewPlatformView) { - instance.destroy() - } return strongInstances.remove(identifier) as T? } /** * Retrieves the identifier paired with an instance, if present, otherwise `null`. * + * * If the manager contains a strong reference to `instance`, it will return the identifier * associated with `instance`. If the manager contains only a weak reference to `instance`, a new * strong reference to `instance` will be added and will need to be removed again with [remove]. * + * * If this method returns a nonnull identifier, this method also expects the Dart - * `AndroidWebkitLibraryPigeonInstanceManager` to have, or recreate, a weak reference to the Dart - * instance the identifier is associated with. + * `AndroidWebkitLibraryPigeonInstanceManager` to have, or recreate, a weak reference to the Dart instance the + * identifier is associated with. */ fun getIdentifierForStrongReference(instance: Any?): Long? { logWarningIfFinalizationListenerHasStopped() @@ -151,9 +153,9 @@ class AndroidWebkitLibraryPigeonInstanceManager( /** * Adds a new instance that was instantiated from Dart. * - * The same instance can be added multiple times, but each identifier must be unique. This allows - * two objects that are equivalent (e.g. the `equals` method returns true and their hashcodes are - * equal) to both be added. + * The same instance can be added multiple times, but each identifier must be unique. This + * allows two objects that are equivalent (e.g. the `equals` method returns true and their + * hashcodes are equal) to both be added. * * [identifier] must be >= 0 and unique. */ @@ -169,9 +171,7 @@ class AndroidWebkitLibraryPigeonInstanceManager( */ fun addHostCreatedInstance(instance: Any): Long { logWarningIfFinalizationListenerHasStopped() - require(!containsInstance(instance)) { - "Instance of ${instance.javaClass} has already been added." - } + require(!containsInstance(instance)) { "Instance of ${instance.javaClass} has already been added." } val identifier = nextIdentifier++ addInstance(instance, identifier) return identifier @@ -229,8 +229,7 @@ class AndroidWebkitLibraryPigeonInstanceManager( return } var reference: java.lang.ref.WeakReference? - while ((referenceQueue.poll() as java.lang.ref.WeakReference?).also { reference = it } != - null) { + while ((referenceQueue.poll() as java.lang.ref.WeakReference?).also { reference = it } != null) { val identifier = weakReferencesToIdentifiers.remove(reference) if (identifier != null) { weakInstances.remove(identifier) @@ -238,7 +237,10 @@ class AndroidWebkitLibraryPigeonInstanceManager( finalizationListener.onFinalize(identifier) } } - handler.postDelayed({ releaseAllFinalizedInstances() }, clearFinalizedWeakReferencesInterval) + handler.postDelayed( + { releaseAllFinalizedInstances() }, + clearFinalizedWeakReferencesInterval + ) } private fun addInstance(instance: Any, identifier: Long) { @@ -256,43 +258,39 @@ class AndroidWebkitLibraryPigeonInstanceManager( private fun logWarningIfFinalizationListenerHasStopped() { if (hasFinalizationListenerStopped()) { Log.w( - tag, - "The manager was used after calls to the PigeonFinalizationListener has been stopped.") + tag, + "The manager was used after calls to the PigeonFinalizationListener has been stopped." + ) } } } + /** Generated API for managing the Dart and native `InstanceManager`s. */ private class AndroidWebkitLibraryPigeonInstanceManagerApi(val binaryMessenger: BinaryMessenger) { companion object { /** The codec used by AndroidWebkitLibraryPigeonInstanceManagerApi. */ - val codec: MessageCodec by lazy { AndroidWebkitLibraryPigeonCodec() } + val codec: MessageCodec by lazy { + AndroidWebkitLibraryPigeonCodec() + } /** - * Sets up an instance of `AndroidWebkitLibraryPigeonInstanceManagerApi` to handle messages from - * the `binaryMessenger`. + * Sets up an instance of `AndroidWebkitLibraryPigeonInstanceManagerApi` to handle messages from the + * `binaryMessenger`. */ - fun setUpMessageHandlers( - binaryMessenger: BinaryMessenger, - instanceManager: AndroidWebkitLibraryPigeonInstanceManager? - ) { + fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, instanceManager: AndroidWebkitLibraryPigeonInstanceManager?) { run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.PigeonInternalInstanceManager.removeStrongReference", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.PigeonInternalInstanceManager.removeStrongReference", codec) if (instanceManager != null) { channel.setMessageHandler { message, reply -> val args = message as List val identifierArg = args[0] as Long - val wrapped: List = - try { - instanceManager.remove(identifierArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + instanceManager.remove(identifierArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -300,20 +298,15 @@ private class AndroidWebkitLibraryPigeonInstanceManagerApi(val binaryMessenger: } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.PigeonInternalInstanceManager.clear", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.PigeonInternalInstanceManager.clear", codec) if (instanceManager != null) { channel.setMessageHandler { _, reply -> - val wrapped: List = - try { - instanceManager.clear() - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + instanceManager.clear() + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -323,28 +316,26 @@ private class AndroidWebkitLibraryPigeonInstanceManagerApi(val binaryMessenger: } } - fun removeStrongReference(identifierArg: Long, callback: (Result) -> Unit) { - val channelName = - "dev.flutter.pigeon.webview_flutter_android.PigeonInternalInstanceManager.removeStrongReference" + fun removeStrongReference(identifierArg: Long, callback: (Result) -> Unit) +{ + val channelName = "dev.flutter.pigeon.webview_flutter_android.PigeonInternalInstanceManager.removeStrongReference" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } } /** - * Provides implementations for each ProxyApi implementation and provides access to resources needed - * by any implementation. + * Provides implementations for each ProxyApi implementation and provides access to resources + * needed by any implementation. */ abstract class AndroidWebkitLibraryPigeonProxyApiRegistrar(val binaryMessenger: BinaryMessenger) { /** Whether APIs should ignore calling to Dart. */ @@ -361,19 +352,20 @@ abstract class AndroidWebkitLibraryPigeonProxyApiRegistrar(val binaryMessenger: init { val api = AndroidWebkitLibraryPigeonInstanceManagerApi(binaryMessenger) - instanceManager = - AndroidWebkitLibraryPigeonInstanceManager.create( - object : AndroidWebkitLibraryPigeonInstanceManager.PigeonFinalizationListener { - override fun onFinalize(identifier: Long) { - api.removeStrongReference(identifier) { - if (it.isFailure) { - Log.e( - "PigeonProxyApiRegistrar", - "Failed to remove Dart strong reference with identifier: $identifier") - } - } - } - }) + instanceManager = AndroidWebkitLibraryPigeonInstanceManager.create( + object : AndroidWebkitLibraryPigeonInstanceManager.PigeonFinalizationListener { + override fun onFinalize(identifier: Long) { + api.removeStrongReference(identifier) { + if (it.isFailure) { + Log.e( + "PigeonProxyApiRegistrar", + "Failed to remove Dart strong reference with identifier: $identifier" + ) + } + } + } + } + ) } /** * An implementation of [PigeonApiWebResourceRequest] used to add a new Dart instance of @@ -400,8 +392,8 @@ abstract class AndroidWebkitLibraryPigeonProxyApiRegistrar(val binaryMessenger: abstract fun getPigeonApiWebResourceErrorCompat(): PigeonApiWebResourceErrorCompat /** - * An implementation of [PigeonApiWebViewPoint] used to add a new Dart instance of `WebViewPoint` - * to the Dart `InstanceManager`. + * An implementation of [PigeonApiWebViewPoint] used to add a new Dart instance of + * `WebViewPoint` to the Dart `InstanceManager`. */ abstract fun getPigeonApiWebViewPoint(): PigeonApiWebViewPoint @@ -418,14 +410,14 @@ abstract class AndroidWebkitLibraryPigeonProxyApiRegistrar(val binaryMessenger: abstract fun getPigeonApiCookieManager(): PigeonApiCookieManager /** - * An implementation of [PigeonApiWebView] used to add a new Dart instance of `WebView` to the - * Dart `InstanceManager`. + * An implementation of [PigeonApiWebView] used to add a new Dart instance of + * `WebView` to the Dart `InstanceManager`. */ abstract fun getPigeonApiWebView(): PigeonApiWebView /** - * An implementation of [PigeonApiWebSettings] used to add a new Dart instance of `WebSettings` to - * the Dart `InstanceManager`. + * An implementation of [PigeonApiWebSettings] used to add a new Dart instance of + * `WebSettings` to the Dart `InstanceManager`. */ abstract fun getPigeonApiWebSettings(): PigeonApiWebSettings @@ -460,8 +452,8 @@ abstract class AndroidWebkitLibraryPigeonProxyApiRegistrar(val binaryMessenger: abstract fun getPigeonApiFlutterAssetManager(): PigeonApiFlutterAssetManager /** - * An implementation of [PigeonApiWebStorage] used to add a new Dart instance of `WebStorage` to - * the Dart `InstanceManager`. + * An implementation of [PigeonApiWebStorage] used to add a new Dart instance of + * `WebStorage` to the Dart `InstanceManager`. */ abstract fun getPigeonApiWebStorage(): PigeonApiWebStorage @@ -484,14 +476,14 @@ abstract class AndroidWebkitLibraryPigeonProxyApiRegistrar(val binaryMessenger: abstract fun getPigeonApiCustomViewCallback(): PigeonApiCustomViewCallback /** - * An implementation of [PigeonApiView] used to add a new Dart instance of `View` to the Dart - * `InstanceManager`. + * An implementation of [PigeonApiView] used to add a new Dart instance of + * `View` to the Dart `InstanceManager`. */ abstract fun getPigeonApiView(): PigeonApiView /** - * An implementation of [PigeonApiGeolocationPermissionsCallback] used to add a new Dart instance - * of `GeolocationPermissionsCallback` to the Dart `InstanceManager`. + * An implementation of [PigeonApiGeolocationPermissionsCallback] used to add a new Dart instance of + * `GeolocationPermissionsCallback` to the Dart `InstanceManager`. */ abstract fun getPigeonApiGeolocationPermissionsCallback(): PigeonApiGeolocationPermissionsCallback @@ -502,29 +494,22 @@ abstract class AndroidWebkitLibraryPigeonProxyApiRegistrar(val binaryMessenger: abstract fun getPigeonApiHttpAuthHandler(): PigeonApiHttpAuthHandler fun setUp() { - AndroidWebkitLibraryPigeonInstanceManagerApi.setUpMessageHandlers( - binaryMessenger, instanceManager) + AndroidWebkitLibraryPigeonInstanceManagerApi.setUpMessageHandlers(binaryMessenger, instanceManager) PigeonApiCookieManager.setUpMessageHandlers(binaryMessenger, getPigeonApiCookieManager()) PigeonApiWebView.setUpMessageHandlers(binaryMessenger, getPigeonApiWebView()) PigeonApiWebSettings.setUpMessageHandlers(binaryMessenger, getPigeonApiWebSettings()) - PigeonApiJavaScriptChannel.setUpMessageHandlers( - binaryMessenger, getPigeonApiJavaScriptChannel()) + PigeonApiJavaScriptChannel.setUpMessageHandlers(binaryMessenger, getPigeonApiJavaScriptChannel()) PigeonApiWebViewClient.setUpMessageHandlers(binaryMessenger, getPigeonApiWebViewClient()) PigeonApiDownloadListener.setUpMessageHandlers(binaryMessenger, getPigeonApiDownloadListener()) PigeonApiWebChromeClient.setUpMessageHandlers(binaryMessenger, getPigeonApiWebChromeClient()) - PigeonApiFlutterAssetManager.setUpMessageHandlers( - binaryMessenger, getPigeonApiFlutterAssetManager()) + PigeonApiFlutterAssetManager.setUpMessageHandlers(binaryMessenger, getPigeonApiFlutterAssetManager()) PigeonApiWebStorage.setUpMessageHandlers(binaryMessenger, getPigeonApiWebStorage()) - PigeonApiPermissionRequest.setUpMessageHandlers( - binaryMessenger, getPigeonApiPermissionRequest()) - PigeonApiCustomViewCallback.setUpMessageHandlers( - binaryMessenger, getPigeonApiCustomViewCallback()) + PigeonApiPermissionRequest.setUpMessageHandlers(binaryMessenger, getPigeonApiPermissionRequest()) + PigeonApiCustomViewCallback.setUpMessageHandlers(binaryMessenger, getPigeonApiCustomViewCallback()) PigeonApiView.setUpMessageHandlers(binaryMessenger, getPigeonApiView()) - PigeonApiGeolocationPermissionsCallback.setUpMessageHandlers( - binaryMessenger, getPigeonApiGeolocationPermissionsCallback()) + PigeonApiGeolocationPermissionsCallback.setUpMessageHandlers(binaryMessenger, getPigeonApiGeolocationPermissionsCallback()) PigeonApiHttpAuthHandler.setUpMessageHandlers(binaryMessenger, getPigeonApiHttpAuthHandler()) } - fun tearDown() { AndroidWebkitLibraryPigeonInstanceManagerApi.setUpMessageHandlers(binaryMessenger, null) PigeonApiCookieManager.setUpMessageHandlers(binaryMessenger, null) @@ -543,10 +528,7 @@ abstract class AndroidWebkitLibraryPigeonProxyApiRegistrar(val binaryMessenger: PigeonApiHttpAuthHandler.setUpMessageHandlers(binaryMessenger, null) } } - -private class AndroidWebkitLibraryPigeonProxyApiBaseCodec( - val registrar: AndroidWebkitLibraryPigeonProxyApiRegistrar -) : AndroidWebkitLibraryPigeonCodec() { +private class AndroidWebkitLibraryPigeonProxyApiBaseCodec(val registrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) : AndroidWebkitLibraryPigeonCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { 128.toByte() -> { @@ -557,68 +539,73 @@ private class AndroidWebkitLibraryPigeonProxyApiBaseCodec( } override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { - if (value is Boolean || - value is ByteArray || - value is Double || - value is DoubleArray || - value is FloatArray || - value is Int || - value is IntArray || - value is List<*> || - value is Long || - value is LongArray || - value is Map<*, *> || - value is String || - value is FileChooserMode || - value is ConsoleMessageLevel || - value == null) { + if (value is Boolean || value is ByteArray || value is Double || value is DoubleArray || value is FloatArray || value is Int || value is IntArray || value is List<*> || value is Long || value is LongArray || value is Map<*, *> || value is String || value is FileChooserMode || value is ConsoleMessageLevel || value == null) { super.writeValue(stream, value) return } if (value is android.webkit.WebResourceRequest) { - registrar.getPigeonApiWebResourceRequest().pigeon_newInstance(value) {} - } else if (value is android.webkit.WebResourceResponse) { - registrar.getPigeonApiWebResourceResponse().pigeon_newInstance(value) {} - } else if (android.os.Build.VERSION.SDK_INT >= 23 && value is android.webkit.WebResourceError) { - registrar.getPigeonApiWebResourceError().pigeon_newInstance(value) {} - } else if (value is androidx.webkit.WebResourceErrorCompat) { - registrar.getPigeonApiWebResourceErrorCompat().pigeon_newInstance(value) {} - } else if (value is WebViewPoint) { - registrar.getPigeonApiWebViewPoint().pigeon_newInstance(value) {} - } else if (value is android.webkit.ConsoleMessage) { - registrar.getPigeonApiConsoleMessage().pigeon_newInstance(value) {} - } else if (value is android.webkit.CookieManager) { - registrar.getPigeonApiCookieManager().pigeon_newInstance(value) {} - } else if (value is android.webkit.WebView) { - registrar.getPigeonApiWebView().pigeon_newInstance(value) {} - } else if (value is android.webkit.WebSettings) { - registrar.getPigeonApiWebSettings().pigeon_newInstance(value) {} - } else if (value is JavaScriptChannel) { - registrar.getPigeonApiJavaScriptChannel().pigeon_newInstance(value) {} - } else if (value is android.webkit.WebViewClient) { - registrar.getPigeonApiWebViewClient().pigeon_newInstance(value) {} - } else if (value is android.webkit.DownloadListener) { - registrar.getPigeonApiDownloadListener().pigeon_newInstance(value) {} - } else if (value - is io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl) { - registrar.getPigeonApiWebChromeClient().pigeon_newInstance(value) {} - } else if (value is io.flutter.plugins.webviewflutter.FlutterAssetManager) { - registrar.getPigeonApiFlutterAssetManager().pigeon_newInstance(value) {} - } else if (value is android.webkit.WebStorage) { - registrar.getPigeonApiWebStorage().pigeon_newInstance(value) {} - } else if (value is android.webkit.WebChromeClient.FileChooserParams) { - registrar.getPigeonApiFileChooserParams().pigeon_newInstance(value) {} - } else if (value is android.webkit.PermissionRequest) { - registrar.getPigeonApiPermissionRequest().pigeon_newInstance(value) {} - } else if (value is android.webkit.WebChromeClient.CustomViewCallback) { - registrar.getPigeonApiCustomViewCallback().pigeon_newInstance(value) {} - } else if (value is android.view.View) { - registrar.getPigeonApiView().pigeon_newInstance(value) {} - } else if (value is android.webkit.GeolocationPermissions.Callback) { - registrar.getPigeonApiGeolocationPermissionsCallback().pigeon_newInstance(value) {} - } else if (value is android.webkit.HttpAuthHandler) { - registrar.getPigeonApiHttpAuthHandler().pigeon_newInstance(value) {} + registrar.getPigeonApiWebResourceRequest().pigeon_newInstance(value) { } + } + else if (value is android.webkit.WebResourceResponse) { + registrar.getPigeonApiWebResourceResponse().pigeon_newInstance(value) { } + } + else if (android.os.Build.VERSION.SDK_INT >= 23 && value is android.webkit.WebResourceError) { + registrar.getPigeonApiWebResourceError().pigeon_newInstance(value) { } + } + else if (value is androidx.webkit.WebResourceErrorCompat) { + registrar.getPigeonApiWebResourceErrorCompat().pigeon_newInstance(value) { } + } + else if (value is WebViewPoint) { + registrar.getPigeonApiWebViewPoint().pigeon_newInstance(value) { } + } + else if (value is android.webkit.ConsoleMessage) { + registrar.getPigeonApiConsoleMessage().pigeon_newInstance(value) { } + } + else if (value is android.webkit.CookieManager) { + registrar.getPigeonApiCookieManager().pigeon_newInstance(value) { } + } + else if (value is android.webkit.WebView) { + registrar.getPigeonApiWebView().pigeon_newInstance(value) { } + } + else if (value is android.webkit.WebSettings) { + registrar.getPigeonApiWebSettings().pigeon_newInstance(value) { } + } + else if (value is JavaScriptChannel) { + registrar.getPigeonApiJavaScriptChannel().pigeon_newInstance(value) { } + } + else if (value is android.webkit.WebViewClient) { + registrar.getPigeonApiWebViewClient().pigeon_newInstance(value) { } + } + else if (value is android.webkit.DownloadListener) { + registrar.getPigeonApiDownloadListener().pigeon_newInstance(value) { } + } + else if (value is io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl) { + registrar.getPigeonApiWebChromeClient().pigeon_newInstance(value) { } + } + else if (value is io.flutter.plugins.webviewflutter.FlutterAssetManager) { + registrar.getPigeonApiFlutterAssetManager().pigeon_newInstance(value) { } + } + else if (value is android.webkit.WebStorage) { + registrar.getPigeonApiWebStorage().pigeon_newInstance(value) { } + } + else if (value is android.webkit.WebChromeClient.FileChooserParams) { + registrar.getPigeonApiFileChooserParams().pigeon_newInstance(value) { } + } + else if (value is android.webkit.PermissionRequest) { + registrar.getPigeonApiPermissionRequest().pigeon_newInstance(value) { } + } + else if (value is android.webkit.WebChromeClient.CustomViewCallback) { + registrar.getPigeonApiCustomViewCallback().pigeon_newInstance(value) { } + } + else if (value is android.view.View) { + registrar.getPigeonApiView().pigeon_newInstance(value) { } + } + else if (value is android.webkit.GeolocationPermissions.Callback) { + registrar.getPigeonApiGeolocationPermissionsCallback().pigeon_newInstance(value) { } + } + else if (value is android.webkit.HttpAuthHandler) { + registrar.getPigeonApiHttpAuthHandler().pigeon_newInstance(value) { } } when { @@ -626,9 +613,7 @@ private class AndroidWebkitLibraryPigeonProxyApiBaseCodec( stream.write(128) writeValue(stream, registrar.instanceManager.getIdentifierForStrongReference(value)) } - else -> - throw IllegalArgumentException( - "Unsupported value: '$value' of type '${value.javaClass.name}'") + else -> throw IllegalArgumentException("Unsupported value: '$value' of type '${value.javaClass.name}'") } } } @@ -640,31 +625,29 @@ private class AndroidWebkitLibraryPigeonProxyApiBaseCodec( */ enum class FileChooserMode(val raw: Int) { /** - * Open single file and requires that the file exists before allowing the user to pick it. + * Open single file and requires that the file exists before allowing the + * user to pick it. * - * See - * https://developer.android.com/reference/android/webkit/WebChromeClient.FileChooserParams#MODE_OPEN. + * See https://developer.android.com/reference/android/webkit/WebChromeClient.FileChooserParams#MODE_OPEN. */ OPEN(0), /** * Similar to [open] but allows multiple files to be selected. * - * See - * https://developer.android.com/reference/android/webkit/WebChromeClient.FileChooserParams#MODE_OPEN_MULTIPLE. + * See https://developer.android.com/reference/android/webkit/WebChromeClient.FileChooserParams#MODE_OPEN_MULTIPLE. */ OPEN_MULTIPLE(1), /** * Allows picking a nonexistent file and saving it. * - * See - * https://developer.android.com/reference/android/webkit/WebChromeClient.FileChooserParams#MODE_SAVE. + * See https://developer.android.com/reference/android/webkit/WebChromeClient.FileChooserParams#MODE_SAVE. */ SAVE(2), /** * Indicates a `FileChooserMode` with an unknown mode. * - * This does not represent an actual value provided by the platform and only indicates a value was - * provided that isn't currently supported. + * This does not represent an actual value provided by the platform and only + * indicates a value was provided that isn't currently supported. */ UNKNOWN(3); @@ -714,8 +697,8 @@ enum class ConsoleMessageLevel(val raw: Int) { /** * Indicates a message with an unknown level. * - * This does not represent an actual value provided by the platform and only indicates a value was - * provided that isn't currently supported. + * This does not represent an actual value provided by the platform and only + * indicates a value was provided that isn't currently supported. */ UNKNOWN(5); @@ -725,21 +708,23 @@ enum class ConsoleMessageLevel(val raw: Int) { } } } - private open class AndroidWebkitLibraryPigeonCodec : StandardMessageCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { 129.toByte() -> { - return (readValue(buffer) as Long?)?.let { FileChooserMode.ofRaw(it.toInt()) } + return (readValue(buffer) as Long?)?.let { + FileChooserMode.ofRaw(it.toInt()) + } } 130.toByte() -> { - return (readValue(buffer) as Long?)?.let { ConsoleMessageLevel.ofRaw(it.toInt()) } + return (readValue(buffer) as Long?)?.let { + ConsoleMessageLevel.ofRaw(it.toInt()) + } } else -> super.readValueOfType(type, buffer) } } - - override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { + override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { when (value) { is FileChooserMode -> { stream.write(129) @@ -760,9 +745,7 @@ private open class AndroidWebkitLibraryPigeonCodec : StandardMessageCodec() { * See https://developer.android.com/reference/android/webkit/WebResourceRequest. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiWebResourceRequest( - open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar -) { +abstract class PigeonApiWebResourceRequest(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { /** The URL for which the resource request was made. */ abstract fun url(pigeon_instance: android.webkit.WebResourceRequest): String @@ -779,16 +762,12 @@ abstract class PigeonApiWebResourceRequest( abstract fun method(pigeon_instance: android.webkit.WebResourceRequest): String /** The headers associated with the request. */ - abstract fun requestHeaders( - pigeon_instance: android.webkit.WebResourceRequest - ): Map? + abstract fun requestHeaders(pigeon_instance: android.webkit.WebResourceRequest): Map? @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of WebResourceRequest and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance( - pigeon_instanceArg: android.webkit.WebResourceRequest, - callback: (Result) -> Unit - ) { + fun pigeon_newInstance(pigeon_instanceArg: android.webkit.WebResourceRequest, callback: (Result) -> Unit) +{ if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -799,8 +778,7 @@ abstract class PigeonApiWebResourceRequest( Result.success(Unit) return } - val pigeon_identifierArg = - pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val urlArg = url(pigeon_instanceArg) val isForMainFrameArg = isForMainFrame(pigeon_instanceArg) val isRedirectArg = isRedirect(pigeon_instanceArg) @@ -809,31 +787,21 @@ abstract class PigeonApiWebResourceRequest( val requestHeadersArg = requestHeaders(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.webview_flutter_android.WebResourceRequest.pigeon_newInstance" + val channelName = "dev.flutter.pigeon.webview_flutter_android.WebResourceRequest.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send( - listOf( - pigeon_identifierArg, - urlArg, - isForMainFrameArg, - isRedirectArg, - hasGestureArg, - methodArg, - requestHeadersArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) - } else { - callback(Result.success(Unit)) - } - } else { - callback(Result.failure(createConnectionError(channelName))) - } + channel.send(listOf(pigeon_identifierArg, urlArg, isForMainFrameArg, isRedirectArg, hasGestureArg, methodArg, requestHeadersArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } } + } /** * Encapsulates a resource response. @@ -841,18 +809,14 @@ abstract class PigeonApiWebResourceRequest( * See https://developer.android.com/reference/android/webkit/WebResourceResponse. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiWebResourceResponse( - open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar -) { +abstract class PigeonApiWebResourceResponse(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { /** The resource response's status code. */ abstract fun statusCode(pigeon_instance: android.webkit.WebResourceResponse): Long @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of WebResourceResponse and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance( - pigeon_instanceArg: android.webkit.WebResourceResponse, - callback: (Result) -> Unit - ) { + fun pigeon_newInstance(pigeon_instanceArg: android.webkit.WebResourceResponse, callback: (Result) -> Unit) +{ if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -863,38 +827,34 @@ abstract class PigeonApiWebResourceResponse( Result.success(Unit) return } - val pigeon_identifierArg = - pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val statusCodeArg = statusCode(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.webview_flutter_android.WebResourceResponse.pigeon_newInstance" + val channelName = "dev.flutter.pigeon.webview_flutter_android.WebResourceResponse.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg, statusCodeArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } + } /** - * Encapsulates information about errors that occurred during loading of web resources. + * Encapsulates information about errors that occurred during loading of web + * resources. * * See https://developer.android.com/reference/android/webkit/WebResourceError. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiWebResourceError( - open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar -) { +abstract class PigeonApiWebResourceError(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { /** The error code of the error. */ @androidx.annotation.RequiresApi(api = 23) abstract fun errorCode(pigeon_instance: android.webkit.WebResourceError): Long @@ -906,10 +866,8 @@ abstract class PigeonApiWebResourceError( @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of WebResourceError and attaches it to [pigeon_instanceArg]. */ @androidx.annotation.RequiresApi(api = 23) - fun pigeon_newInstance( - pigeon_instanceArg: android.webkit.WebResourceError, - callback: (Result) -> Unit - ) { + fun pigeon_newInstance(pigeon_instanceArg: android.webkit.WebResourceError, callback: (Result) -> Unit) +{ if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -920,39 +878,35 @@ abstract class PigeonApiWebResourceError( Result.success(Unit) return } - val pigeon_identifierArg = - pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val errorCodeArg = errorCode(pigeon_instanceArg) val descriptionArg = description(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.webview_flutter_android.WebResourceError.pigeon_newInstance" + val channelName = "dev.flutter.pigeon.webview_flutter_android.WebResourceError.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg, errorCodeArg, descriptionArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } + } /** - * Encapsulates information about errors that occurred during loading of web resources. + * Encapsulates information about errors that occurred during loading of web + * resources. * * See https://developer.android.com/reference/androidx/webkit/WebResourceErrorCompat. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiWebResourceErrorCompat( - open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar -) { +abstract class PigeonApiWebResourceErrorCompat(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { /** The error code of the error. */ abstract fun errorCode(pigeon_instance: androidx.webkit.WebResourceErrorCompat): Long @@ -961,10 +915,8 @@ abstract class PigeonApiWebResourceErrorCompat( @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of WebResourceErrorCompat and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance( - pigeon_instanceArg: androidx.webkit.WebResourceErrorCompat, - callback: (Result) -> Unit - ) { + fun pigeon_newInstance(pigeon_instanceArg: androidx.webkit.WebResourceErrorCompat, callback: (Result) -> Unit) +{ if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -975,29 +927,26 @@ abstract class PigeonApiWebResourceErrorCompat( Result.success(Unit) return } - val pigeon_identifierArg = - pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val errorCodeArg = errorCode(pigeon_instanceArg) val descriptionArg = description(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.webview_flutter_android.WebResourceErrorCompat.pigeon_newInstance" + val channelName = "dev.flutter.pigeon.webview_flutter_android.WebResourceErrorCompat.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg, errorCodeArg, descriptionArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } + } /** * Represents a position on a web page. @@ -1005,16 +954,15 @@ abstract class PigeonApiWebResourceErrorCompat( * This is a custom class created for convenience of the wrapper. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiWebViewPoint( - open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar -) { +abstract class PigeonApiWebViewPoint(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { abstract fun x(pigeon_instance: WebViewPoint): Long abstract fun y(pigeon_instance: WebViewPoint): Long @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of WebViewPoint and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: WebViewPoint, callback: (Result) -> Unit) { + fun pigeon_newInstance(pigeon_instanceArg: WebViewPoint, callback: (Result) -> Unit) +{ if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -1025,8 +973,7 @@ abstract class PigeonApiWebViewPoint( Result.success(Unit) return } - val pigeon_identifierArg = - pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val xArg = x(pigeon_instanceArg) val yArg = y(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger @@ -1036,17 +983,16 @@ abstract class PigeonApiWebViewPoint( channel.send(listOf(pigeon_identifierArg, xArg, yArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } + } /** * Represents a JavaScript console message from WebCore. @@ -1054,9 +1000,7 @@ abstract class PigeonApiWebViewPoint( * See https://developer.android.com/reference/android/webkit/ConsoleMessage */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiConsoleMessage( - open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar -) { +abstract class PigeonApiConsoleMessage(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { abstract fun lineNumber(pigeon_instance: android.webkit.ConsoleMessage): Long abstract fun message(pigeon_instance: android.webkit.ConsoleMessage): String @@ -1067,10 +1011,8 @@ abstract class PigeonApiConsoleMessage( @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of ConsoleMessage and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance( - pigeon_instanceArg: android.webkit.ConsoleMessage, - callback: (Result) -> Unit - ) { + fun pigeon_newInstance(pigeon_instanceArg: android.webkit.ConsoleMessage, callback: (Result) -> Unit) +{ if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -1081,8 +1023,7 @@ abstract class PigeonApiConsoleMessage( Result.success(Unit) return } - val pigeon_identifierArg = - pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val lineNumberArg = lineNumber(pigeon_instanceArg) val messageArg = message(pigeon_instanceArg) val levelArg = level(pigeon_instanceArg) @@ -1094,17 +1035,16 @@ abstract class PigeonApiConsoleMessage( channel.send(listOf(pigeon_identifierArg, lineNumberArg, messageArg, levelArg, sourceIdArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } + } /** * Manages the cookies used by an application's `WebView` instances. @@ -1112,49 +1052,34 @@ abstract class PigeonApiConsoleMessage( * See https://developer.android.com/reference/android/webkit/CookieManager. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiCookieManager( - open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar -) { +abstract class PigeonApiCookieManager(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { abstract fun instance(): android.webkit.CookieManager /** Sets a single cookie (key-value pair) for the given URL. */ abstract fun setCookie(pigeon_instance: android.webkit.CookieManager, url: String, value: String) /** Removes all cookies. */ - abstract fun removeAllCookies( - pigeon_instance: android.webkit.CookieManager, - callback: (Result) -> Unit - ) + abstract fun removeAllCookies(pigeon_instance: android.webkit.CookieManager, callback: (Result) -> Unit) /** Sets whether the `WebView` should allow third party cookies to be set. */ - abstract fun setAcceptThirdPartyCookies( - pigeon_instance: android.webkit.CookieManager, - webView: android.webkit.WebView, - accept: Boolean - ) + abstract fun setAcceptThirdPartyCookies(pigeon_instance: android.webkit.CookieManager, webView: android.webkit.WebView, accept: Boolean) companion object { @Suppress("LocalVariableName") fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiCookieManager?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.CookieManager.instance", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.CookieManager.instance", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_identifierArg = args[0] as Long - val wrapped: List = - try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - api.instance(), pigeon_identifierArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.instance(), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1162,24 +1087,19 @@ abstract class PigeonApiCookieManager( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.CookieManager.setCookie", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.CookieManager.setCookie", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.CookieManager val urlArg = args[1] as String val valueArg = args[2] as String - val wrapped: List = - try { - api.setCookie(pigeon_instanceArg, urlArg, valueArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.setCookie(pigeon_instanceArg, urlArg, valueArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1187,11 +1107,7 @@ abstract class PigeonApiCookieManager( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.CookieManager.removeAllCookies", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.CookieManager.removeAllCookies", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1211,24 +1127,19 @@ abstract class PigeonApiCookieManager( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.CookieManager.setAcceptThirdPartyCookies", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.CookieManager.setAcceptThirdPartyCookies", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.CookieManager val webViewArg = args[1] as android.webkit.WebView val acceptArg = args[2] as Boolean - val wrapped: List = - try { - api.setAcceptThirdPartyCookies(pigeon_instanceArg, webViewArg, acceptArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.setAcceptThirdPartyCookies(pigeon_instanceArg, webViewArg, acceptArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1240,10 +1151,8 @@ abstract class PigeonApiCookieManager( @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of CookieManager and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance( - pigeon_instanceArg: android.webkit.CookieManager, - callback: (Result) -> Unit - ) { + fun pigeon_newInstance(pigeon_instanceArg: android.webkit.CookieManager, callback: (Result) -> Unit) +{ if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -1254,8 +1163,7 @@ abstract class PigeonApiCookieManager( Result.success(Unit) return } - val pigeon_identifierArg = - pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.webview_flutter_android.CookieManager.pigeon_newInstance" @@ -1263,17 +1171,16 @@ abstract class PigeonApiCookieManager( channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } + } /** * A View that displays web pages. @@ -1281,38 +1188,23 @@ abstract class PigeonApiCookieManager( * See https://developer.android.com/reference/android/webkit/WebView. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiWebView( - open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar -) { +abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { abstract fun pigeon_defaultConstructor(): android.webkit.WebView /** The WebSettings object used to control the settings for this WebView. */ abstract fun settings(pigeon_instance: android.webkit.WebView): android.webkit.WebSettings /** Loads the given data into this WebView using a 'data' scheme URL. */ - abstract fun loadData( - pigeon_instance: android.webkit.WebView, - data: String, - mimeType: String?, - encoding: String? - ) - - /** Loads the given data into this WebView, using baseUrl as the base URL for the content. */ - abstract fun loadDataWithBaseUrl( - pigeon_instance: android.webkit.WebView, - baseUrl: String?, - data: String, - mimeType: String?, - encoding: String?, - historyUrl: String? - ) + abstract fun loadData(pigeon_instance: android.webkit.WebView, data: String, mimeType: String?, encoding: String?) + + /** + * Loads the given data into this WebView, using baseUrl as the base URL for + * the content. + */ + abstract fun loadDataWithBaseUrl(pigeon_instance: android.webkit.WebView, baseUrl: String?, data: String, mimeType: String?, encoding: String?, historyUrl: String?) /** Loads the given URL. */ - abstract fun loadUrl( - pigeon_instance: android.webkit.WebView, - url: String, - headers: Map - ) + abstract fun loadUrl(pigeon_instance: android.webkit.WebView, url: String, headers: Map) /** Loads the URL with postData using "POST" method into this WebView. */ abstract fun postUrl(pigeon_instance: android.webkit.WebView, url: String, data: ByteArray) @@ -1338,61 +1230,45 @@ abstract class PigeonApiWebView( /** Clears the resource cache. */ abstract fun clearCache(pigeon_instance: android.webkit.WebView, includeDiskFiles: Boolean) - /** Asynchronously evaluates JavaScript in the context of the currently displayed page. */ - abstract fun evaluateJavascript( - pigeon_instance: android.webkit.WebView, - javascriptString: String, - callback: (Result) -> Unit - ) + /** + * Asynchronously evaluates JavaScript in the context of the currently + * displayed page. + */ + abstract fun evaluateJavascript(pigeon_instance: android.webkit.WebView, javascriptString: String, callback: (Result) -> Unit) /** Gets the title for the current page. */ abstract fun getTitle(pigeon_instance: android.webkit.WebView): String? /** - * Enables debugging of web contents (HTML / CSS / JavaScript) loaded into any WebViews of this - * application. + * Enables debugging of web contents (HTML / CSS / JavaScript) loaded into + * any WebViews of this application. */ abstract fun setWebContentsDebuggingEnabled(enabled: Boolean) - /** Sets the WebViewClient that will receive various notifications and requests. */ - abstract fun setWebViewClient( - pigeon_instance: android.webkit.WebView, - client: android.webkit.WebViewClient? - ) + /** + * Sets the WebViewClient that will receive various notifications and + * requests. + */ + abstract fun setWebViewClient(pigeon_instance: android.webkit.WebView, client: android.webkit.WebViewClient?) /** Injects the supplied Java object into this WebView. */ - abstract fun addJavaScriptChannel( - pigeon_instance: android.webkit.WebView, - channel: JavaScriptChannel - ) + abstract fun addJavaScriptChannel(pigeon_instance: android.webkit.WebView, channel: JavaScriptChannel) /** Removes a previously injected Java object from this WebView. */ abstract fun removeJavaScriptChannel(pigeon_instance: android.webkit.WebView, name: String) /** - * Registers the interface to be used when content can not be handled by the rendering engine, and - * should be downloaded instead. + * Registers the interface to be used when content can not be handled by the + * rendering engine, and should be downloaded instead. */ - abstract fun setDownloadListener( - pigeon_instance: android.webkit.WebView, - listener: android.webkit.DownloadListener? - ) + abstract fun setDownloadListener(pigeon_instance: android.webkit.WebView, listener: android.webkit.DownloadListener?) /** Sets the chrome handler. */ - abstract fun setWebChromeClient( - pigeon_instance: android.webkit.WebView, - client: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl? - ) + abstract fun setWebChromeClient(pigeon_instance: android.webkit.WebView, client: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl?) /** Sets the background color for this view. */ abstract fun setBackgroundColor(pigeon_instance: android.webkit.WebView, color: Long) - /** Define whether the vertical scrollbar should be drawn or not. The default value is true. */ - abstract fun verticalScrollBarEnabled(pigeon_instance: android.webkit.WebView, enabled: Boolean) - - /** Define whether the horizontal scrollbar should be drawn or not. The default value is true. */ - abstract fun horizontalScrollBarEnabled(pigeon_instance: android.webkit.WebView, enabled: Boolean) - /** Destroys the internal state of this WebView. */ abstract fun destroy(pigeon_instance: android.webkit.WebView) @@ -1401,23 +1277,17 @@ abstract class PigeonApiWebView( fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiWebView?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.WebView.pigeon_defaultConstructor", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.pigeon_defaultConstructor", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_identifierArg = args[0] as Long - val wrapped: List = - try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - api.pigeon_defaultConstructor(), pigeon_identifierArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.pigeon_defaultConstructor(), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1425,24 +1295,18 @@ abstract class PigeonApiWebView( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.WebView.settings", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.settings", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView val pigeon_identifierArg = args[1] as Long - val wrapped: List = - try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - api.settings(pigeon_instanceArg), pigeon_identifierArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.settings(pigeon_instanceArg), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1450,11 +1314,7 @@ abstract class PigeonApiWebView( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.WebView.loadData", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.loadData", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1462,13 +1322,12 @@ abstract class PigeonApiWebView( val dataArg = args[1] as String val mimeTypeArg = args[2] as String? val encodingArg = args[3] as String? - val wrapped: List = - try { - api.loadData(pigeon_instanceArg, dataArg, mimeTypeArg, encodingArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.loadData(pigeon_instanceArg, dataArg, mimeTypeArg, encodingArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1476,11 +1335,7 @@ abstract class PigeonApiWebView( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.WebView.loadDataWithBaseUrl", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.loadDataWithBaseUrl", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1490,19 +1345,12 @@ abstract class PigeonApiWebView( val mimeTypeArg = args[3] as String? val encodingArg = args[4] as String? val historyUrlArg = args[5] as String? - val wrapped: List = - try { - api.loadDataWithBaseUrl( - pigeon_instanceArg, - baseUrlArg, - dataArg, - mimeTypeArg, - encodingArg, - historyUrlArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.loadDataWithBaseUrl(pigeon_instanceArg, baseUrlArg, dataArg, mimeTypeArg, encodingArg, historyUrlArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1510,24 +1358,19 @@ abstract class PigeonApiWebView( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.WebView.loadUrl", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.loadUrl", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView val urlArg = args[1] as String val headersArg = args[2] as Map - val wrapped: List = - try { - api.loadUrl(pigeon_instanceArg, urlArg, headersArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.loadUrl(pigeon_instanceArg, urlArg, headersArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1535,24 +1378,19 @@ abstract class PigeonApiWebView( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.WebView.postUrl", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.postUrl", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView val urlArg = args[1] as String val dataArg = args[2] as ByteArray - val wrapped: List = - try { - api.postUrl(pigeon_instanceArg, urlArg, dataArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.postUrl(pigeon_instanceArg, urlArg, dataArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1560,19 +1398,16 @@ abstract class PigeonApiWebView( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.getUrl", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.getUrl", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView - val wrapped: List = - try { - listOf(api.getUrl(pigeon_instanceArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.getUrl(pigeon_instanceArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1580,21 +1415,16 @@ abstract class PigeonApiWebView( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.WebView.canGoBack", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.canGoBack", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView - val wrapped: List = - try { - listOf(api.canGoBack(pigeon_instanceArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.canGoBack(pigeon_instanceArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1602,21 +1432,16 @@ abstract class PigeonApiWebView( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.WebView.canGoForward", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.canGoForward", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView - val wrapped: List = - try { - listOf(api.canGoForward(pigeon_instanceArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.canGoForward(pigeon_instanceArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1624,20 +1449,17 @@ abstract class PigeonApiWebView( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.goBack", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.goBack", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView - val wrapped: List = - try { - api.goBack(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.goBack(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1645,22 +1467,17 @@ abstract class PigeonApiWebView( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.WebView.goForward", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.goForward", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView - val wrapped: List = - try { - api.goForward(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.goForward(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1668,20 +1485,17 @@ abstract class PigeonApiWebView( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.reload", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.reload", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView - val wrapped: List = - try { - api.reload(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.reload(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1689,23 +1503,18 @@ abstract class PigeonApiWebView( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.WebView.clearCache", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.clearCache", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView val includeDiskFilesArg = args[1] as Boolean - val wrapped: List = - try { - api.clearCache(pigeon_instanceArg, includeDiskFilesArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.clearCache(pigeon_instanceArg, includeDiskFilesArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1713,18 +1522,13 @@ abstract class PigeonApiWebView( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.WebView.evaluateJavascript", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.evaluateJavascript", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView val javascriptStringArg = args[1] as String - api.evaluateJavascript(pigeon_instanceArg, javascriptStringArg) { - result: Result -> + api.evaluateJavascript(pigeon_instanceArg, javascriptStringArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -1739,21 +1543,16 @@ abstract class PigeonApiWebView( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.WebView.getTitle", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.getTitle", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView - val wrapped: List = - try { - listOf(api.getTitle(pigeon_instanceArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.getTitle(pigeon_instanceArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1761,22 +1560,17 @@ abstract class PigeonApiWebView( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.WebView.setWebContentsDebuggingEnabled", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.setWebContentsDebuggingEnabled", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val enabledArg = args[0] as Boolean - val wrapped: List = - try { - api.setWebContentsDebuggingEnabled(enabledArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.setWebContentsDebuggingEnabled(enabledArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1784,23 +1578,18 @@ abstract class PigeonApiWebView( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.WebView.setWebViewClient", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.setWebViewClient", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView val clientArg = args[1] as android.webkit.WebViewClient? - val wrapped: List = - try { - api.setWebViewClient(pigeon_instanceArg, clientArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.setWebViewClient(pigeon_instanceArg, clientArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1808,23 +1597,18 @@ abstract class PigeonApiWebView( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.WebView.addJavaScriptChannel", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.addJavaScriptChannel", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView val channelArg = args[1] as JavaScriptChannel - val wrapped: List = - try { - api.addJavaScriptChannel(pigeon_instanceArg, channelArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.addJavaScriptChannel(pigeon_instanceArg, channelArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1832,23 +1616,18 @@ abstract class PigeonApiWebView( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.WebView.removeJavaScriptChannel", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.removeJavaScriptChannel", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView val nameArg = args[1] as String - val wrapped: List = - try { - api.removeJavaScriptChannel(pigeon_instanceArg, nameArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.removeJavaScriptChannel(pigeon_instanceArg, nameArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1856,23 +1635,18 @@ abstract class PigeonApiWebView( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.WebView.setDownloadListener", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.setDownloadListener", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView val listenerArg = args[1] as android.webkit.DownloadListener? - val wrapped: List = - try { - api.setDownloadListener(pigeon_instanceArg, listenerArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.setDownloadListener(pigeon_instanceArg, listenerArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1880,26 +1654,18 @@ abstract class PigeonApiWebView( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.WebView.setWebChromeClient", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.setWebChromeClient", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView - val clientArg = - args[1] - as - io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl? - val wrapped: List = - try { - api.setWebChromeClient(pigeon_instanceArg, clientArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val clientArg = args[1] as io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl? + val wrapped: List = try { + api.setWebChromeClient(pigeon_instanceArg, clientArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1907,71 +1673,18 @@ abstract class PigeonApiWebView( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.WebView.setBackgroundColor", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.setBackgroundColor", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView val colorArg = args[1] as Long - val wrapped: List = - try { - api.setBackgroundColor(pigeon_instanceArg, colorArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } - reply.reply(wrapped) - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.WebView.verticalScrollBarEnabled", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as android.webkit.WebView - val enabledArg = args[1] as Boolean - val wrapped: List = - try { - api.verticalScrollBarEnabled(pigeon_instanceArg, enabledArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } - reply.reply(wrapped) - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.WebView.horizontalScrollBarEnabled", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as android.webkit.WebView - val enabledArg = args[1] as Boolean - val wrapped: List = - try { - api.horizontalScrollBarEnabled(pigeon_instanceArg, enabledArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.setBackgroundColor(pigeon_instanceArg, colorArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1979,22 +1692,17 @@ abstract class PigeonApiWebView( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.WebView.destroy", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.destroy", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView - val wrapped: List = - try { - api.destroy(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.destroy(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2006,10 +1714,8 @@ abstract class PigeonApiWebView( @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of WebView and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance( - pigeon_instanceArg: android.webkit.WebView, - callback: (Result) -> Unit - ) { + fun pigeon_newInstance(pigeon_instanceArg: android.webkit.WebView, callback: (Result) -> Unit) +{ if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2020,8 +1726,7 @@ abstract class PigeonApiWebView( Result.success(Unit) return } - val pigeon_identifierArg = - pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.webview_flutter_android.WebView.pigeon_newInstance" @@ -2029,30 +1734,22 @@ abstract class PigeonApiWebView( channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** - * This is called in response to an internal scroll in this view (i.e., the view scrolled its own - * contents). + * This is called in response to an internal scroll in this view (i.e., the + * view scrolled its own contents). */ - fun onScrollChanged( - pigeon_instanceArg: android.webkit.WebView, - leftArg: Long, - topArg: Long, - oldLeftArg: Long, - oldTopArg: Long, - callback: (Result) -> Unit - ) { + fun onScrollChanged(pigeon_instanceArg: android.webkit.WebView, leftArg: Long, topArg: Long, oldLeftArg: Long, oldTopArg: Long, callback: (Result) -> Unit) +{ if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2066,23 +1763,23 @@ abstract class PigeonApiWebView( channel.send(listOf(pigeon_instanceArg, leftArg, topArg, oldLeftArg, oldTopArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } @Suppress("FunctionName") /** An implementation of [PigeonApiView] used to access callback methods */ - fun pigeon_getPigeonApiView(): PigeonApiView { + fun pigeon_getPigeonApiView(): PigeonApiView + { return pigeonRegistrar.getPigeonApiView() } + } /** * Manages settings state for a `WebView`. @@ -2090,68 +1787,52 @@ abstract class PigeonApiWebView( * See https://developer.android.com/reference/android/webkit/WebSettings. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiWebSettings( - open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar -) { +abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { /** Sets whether the DOM storage API is enabled. */ abstract fun setDomStorageEnabled(pigeon_instance: android.webkit.WebSettings, flag: Boolean) /** Tells JavaScript to open windows automatically. */ - abstract fun setJavaScriptCanOpenWindowsAutomatically( - pigeon_instance: android.webkit.WebSettings, - flag: Boolean - ) + abstract fun setJavaScriptCanOpenWindowsAutomatically(pigeon_instance: android.webkit.WebSettings, flag: Boolean) /** Sets whether the WebView whether supports multiple windows. */ - abstract fun setSupportMultipleWindows( - pigeon_instance: android.webkit.WebSettings, - support: Boolean - ) + abstract fun setSupportMultipleWindows(pigeon_instance: android.webkit.WebSettings, support: Boolean) /** Tells the WebView to enable JavaScript execution. */ abstract fun setJavaScriptEnabled(pigeon_instance: android.webkit.WebSettings, flag: Boolean) /** Sets the WebView's user-agent string. */ - abstract fun setUserAgentString( - pigeon_instance: android.webkit.WebSettings, - userAgentString: String? - ) + abstract fun setUserAgentString(pigeon_instance: android.webkit.WebSettings, userAgentString: String?) /** Sets whether the WebView requires a user gesture to play media. */ - abstract fun setMediaPlaybackRequiresUserGesture( - pigeon_instance: android.webkit.WebSettings, - require: Boolean - ) + abstract fun setMediaPlaybackRequiresUserGesture(pigeon_instance: android.webkit.WebSettings, require: Boolean) /** - * Sets whether the WebView should support zooming using its on-screen zoom controls and gestures. + * Sets whether the WebView should support zooming using its on-screen zoom + * controls and gestures. */ abstract fun setSupportZoom(pigeon_instance: android.webkit.WebSettings, support: Boolean) /** - * Sets whether the WebView loads pages in overview mode, that is, zooms out the content to fit on - * screen by width. + * Sets whether the WebView loads pages in overview mode, that is, zooms out + * the content to fit on screen by width. */ - abstract fun setLoadWithOverviewMode( - pigeon_instance: android.webkit.WebSettings, - overview: Boolean - ) + abstract fun setLoadWithOverviewMode(pigeon_instance: android.webkit.WebSettings, overview: Boolean) /** - * Sets whether the WebView should enable support for the "viewport" HTML meta tag or should use a - * wide viewport. + * Sets whether the WebView should enable support for the "viewport" HTML + * meta tag or should use a wide viewport. */ abstract fun setUseWideViewPort(pigeon_instance: android.webkit.WebSettings, use: Boolean) /** - * Sets whether the WebView should display on-screen zoom controls when using the built-in zoom - * mechanisms. + * Sets whether the WebView should display on-screen zoom controls when using + * the built-in zoom mechanisms. */ abstract fun setDisplayZoomControls(pigeon_instance: android.webkit.WebSettings, enabled: Boolean) /** - * Sets whether the WebView should display on-screen zoom controls when using the built-in zoom - * mechanisms. + * Sets whether the WebView should display on-screen zoom controls when using + * the built-in zoom mechanisms. */ abstract fun setBuiltInZoomControls(pigeon_instance: android.webkit.WebSettings, enabled: Boolean) @@ -2175,23 +1856,18 @@ abstract class PigeonApiWebSettings( fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiWebSettings?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.WebSettings.setDomStorageEnabled", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setDomStorageEnabled", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val flagArg = args[1] as Boolean - val wrapped: List = - try { - api.setDomStorageEnabled(pigeon_instanceArg, flagArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.setDomStorageEnabled(pigeon_instanceArg, flagArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2199,23 +1875,18 @@ abstract class PigeonApiWebSettings( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.WebSettings.setJavaScriptCanOpenWindowsAutomatically", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setJavaScriptCanOpenWindowsAutomatically", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val flagArg = args[1] as Boolean - val wrapped: List = - try { - api.setJavaScriptCanOpenWindowsAutomatically(pigeon_instanceArg, flagArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.setJavaScriptCanOpenWindowsAutomatically(pigeon_instanceArg, flagArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2223,23 +1894,18 @@ abstract class PigeonApiWebSettings( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.WebSettings.setSupportMultipleWindows", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setSupportMultipleWindows", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val supportArg = args[1] as Boolean - val wrapped: List = - try { - api.setSupportMultipleWindows(pigeon_instanceArg, supportArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.setSupportMultipleWindows(pigeon_instanceArg, supportArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2247,23 +1913,18 @@ abstract class PigeonApiWebSettings( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.WebSettings.setJavaScriptEnabled", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setJavaScriptEnabled", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val flagArg = args[1] as Boolean - val wrapped: List = - try { - api.setJavaScriptEnabled(pigeon_instanceArg, flagArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.setJavaScriptEnabled(pigeon_instanceArg, flagArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2271,23 +1932,18 @@ abstract class PigeonApiWebSettings( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.WebSettings.setUserAgentString", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setUserAgentString", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val userAgentStringArg = args[1] as String? - val wrapped: List = - try { - api.setUserAgentString(pigeon_instanceArg, userAgentStringArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.setUserAgentString(pigeon_instanceArg, userAgentStringArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2295,23 +1951,18 @@ abstract class PigeonApiWebSettings( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.WebSettings.setMediaPlaybackRequiresUserGesture", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setMediaPlaybackRequiresUserGesture", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val requireArg = args[1] as Boolean - val wrapped: List = - try { - api.setMediaPlaybackRequiresUserGesture(pigeon_instanceArg, requireArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.setMediaPlaybackRequiresUserGesture(pigeon_instanceArg, requireArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2319,23 +1970,18 @@ abstract class PigeonApiWebSettings( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.WebSettings.setSupportZoom", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setSupportZoom", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val supportArg = args[1] as Boolean - val wrapped: List = - try { - api.setSupportZoom(pigeon_instanceArg, supportArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.setSupportZoom(pigeon_instanceArg, supportArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2343,23 +1989,18 @@ abstract class PigeonApiWebSettings( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.WebSettings.setLoadWithOverviewMode", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setLoadWithOverviewMode", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val overviewArg = args[1] as Boolean - val wrapped: List = - try { - api.setLoadWithOverviewMode(pigeon_instanceArg, overviewArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.setLoadWithOverviewMode(pigeon_instanceArg, overviewArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2367,23 +2008,18 @@ abstract class PigeonApiWebSettings( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.WebSettings.setUseWideViewPort", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setUseWideViewPort", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val useArg = args[1] as Boolean - val wrapped: List = - try { - api.setUseWideViewPort(pigeon_instanceArg, useArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.setUseWideViewPort(pigeon_instanceArg, useArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2391,23 +2027,18 @@ abstract class PigeonApiWebSettings( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.WebSettings.setDisplayZoomControls", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setDisplayZoomControls", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val enabledArg = args[1] as Boolean - val wrapped: List = - try { - api.setDisplayZoomControls(pigeon_instanceArg, enabledArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.setDisplayZoomControls(pigeon_instanceArg, enabledArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2415,23 +2046,18 @@ abstract class PigeonApiWebSettings( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.WebSettings.setBuiltInZoomControls", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setBuiltInZoomControls", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val enabledArg = args[1] as Boolean - val wrapped: List = - try { - api.setBuiltInZoomControls(pigeon_instanceArg, enabledArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.setBuiltInZoomControls(pigeon_instanceArg, enabledArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2439,23 +2065,18 @@ abstract class PigeonApiWebSettings( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.WebSettings.setAllowFileAccess", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setAllowFileAccess", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val enabledArg = args[1] as Boolean - val wrapped: List = - try { - api.setAllowFileAccess(pigeon_instanceArg, enabledArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.setAllowFileAccess(pigeon_instanceArg, enabledArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2463,23 +2084,18 @@ abstract class PigeonApiWebSettings( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.WebSettings.setAllowContentAccess", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setAllowContentAccess", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val enabledArg = args[1] as Boolean - val wrapped: List = - try { - api.setAllowContentAccess(pigeon_instanceArg, enabledArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.setAllowContentAccess(pigeon_instanceArg, enabledArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2487,23 +2103,18 @@ abstract class PigeonApiWebSettings( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.WebSettings.setGeolocationEnabled", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setGeolocationEnabled", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val enabledArg = args[1] as Boolean - val wrapped: List = - try { - api.setGeolocationEnabled(pigeon_instanceArg, enabledArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.setGeolocationEnabled(pigeon_instanceArg, enabledArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2511,23 +2122,18 @@ abstract class PigeonApiWebSettings( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.WebSettings.setTextZoom", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setTextZoom", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val textZoomArg = args[1] as Long - val wrapped: List = - try { - api.setTextZoom(pigeon_instanceArg, textZoomArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.setTextZoom(pigeon_instanceArg, textZoomArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2535,21 +2141,16 @@ abstract class PigeonApiWebSettings( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.WebSettings.getUserAgentString", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.getUserAgentString", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings - val wrapped: List = - try { - listOf(api.getUserAgentString(pigeon_instanceArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.getUserAgentString(pigeon_instanceArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2561,10 +2162,8 @@ abstract class PigeonApiWebSettings( @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of WebSettings and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance( - pigeon_instanceArg: android.webkit.WebSettings, - callback: (Result) -> Unit - ) { + fun pigeon_newInstance(pigeon_instanceArg: android.webkit.WebSettings, callback: (Result) -> Unit) +{ if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2575,8 +2174,7 @@ abstract class PigeonApiWebSettings( Result.success(Unit) return } - val pigeon_identifierArg = - pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.webview_flutter_android.WebSettings.pigeon_newInstance" @@ -2584,17 +2182,16 @@ abstract class PigeonApiWebSettings( channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } + } /** * A JavaScript interface for exposing Javascript callbacks to Dart. @@ -2603,9 +2200,7 @@ abstract class PigeonApiWebSettings( * [JavascriptInterface](https://developer.android.com/reference/android/webkit/JavascriptInterface). */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiJavaScriptChannel( - open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar -) { +abstract class PigeonApiJavaScriptChannel(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { abstract fun pigeon_defaultConstructor(channelName: String): JavaScriptChannel companion object { @@ -2613,24 +2208,18 @@ abstract class PigeonApiJavaScriptChannel( fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiJavaScriptChannel?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.JavaScriptChannel.pigeon_defaultConstructor", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.JavaScriptChannel.pigeon_defaultConstructor", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_identifierArg = args[0] as Long val channelNameArg = args[1] as String - val wrapped: List = - try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - api.pigeon_defaultConstructor(channelNameArg), pigeon_identifierArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.pigeon_defaultConstructor(channelNameArg), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2642,7 +2231,8 @@ abstract class PigeonApiJavaScriptChannel( @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of JavaScriptChannel and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: JavaScriptChannel, callback: (Result) -> Unit) { + fun pigeon_newInstance(pigeon_instanceArg: JavaScriptChannel, callback: (Result) -> Unit) +{ if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2653,16 +2243,12 @@ abstract class PigeonApiJavaScriptChannel( Result.success(Unit) return } - throw IllegalStateException( - "Attempting to create a new Dart instance of JavaScriptChannel, but the class has a nonnull callback method.") + throw IllegalStateException("Attempting to create a new Dart instance of JavaScriptChannel, but the class has a nonnull callback method.") } /** Handles callbacks messages from JavaScript. */ - fun postMessage( - pigeon_instanceArg: JavaScriptChannel, - messageArg: String, - callback: (Result) -> Unit - ) { + fun postMessage(pigeon_instanceArg: JavaScriptChannel, messageArg: String, callback: (Result) -> Unit) +{ if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2676,17 +2262,16 @@ abstract class PigeonApiJavaScriptChannel( channel.send(listOf(pigeon_instanceArg, messageArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } + } /** * Receives various notifications and requests from a `WebView`. @@ -2694,51 +2279,41 @@ abstract class PigeonApiJavaScriptChannel( * See https://developer.android.com/reference/android/webkit/WebViewClient. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiWebViewClient( - open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar -) { +abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { abstract fun pigeon_defaultConstructor(): android.webkit.WebViewClient /** * Sets the required synchronous return value for the Java method, * `WebViewClient.shouldOverrideUrlLoading(...)`. * - * The Java method, `WebViewClient.shouldOverrideUrlLoading(...)`, requires a boolean to be - * returned and this method sets the returned value for all calls to the Java method. + * The Java method, `WebViewClient.shouldOverrideUrlLoading(...)`, requires + * a boolean to be returned and this method sets the returned value for all + * calls to the Java method. * - * Setting this to true causes the current [WebView] to abort loading any URL received by - * [requestLoading] or [urlLoading], while setting this to false causes the [WebView] to continue - * loading a URL as usual. + * Setting this to true causes the current [WebView] to abort loading any URL + * received by [requestLoading] or [urlLoading], while setting this to false + * causes the [WebView] to continue loading a URL as usual. * * Defaults to false. */ - abstract fun setSynchronousReturnValueForShouldOverrideUrlLoading( - pigeon_instance: android.webkit.WebViewClient, - value: Boolean - ) + abstract fun setSynchronousReturnValueForShouldOverrideUrlLoading(pigeon_instance: android.webkit.WebViewClient, value: Boolean) companion object { @Suppress("LocalVariableName") fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiWebViewClient?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.WebViewClient.pigeon_defaultConstructor", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebViewClient.pigeon_defaultConstructor", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_identifierArg = args[0] as Long - val wrapped: List = - try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - api.pigeon_defaultConstructor(), pigeon_identifierArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.pigeon_defaultConstructor(), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2746,24 +2321,18 @@ abstract class PigeonApiWebViewClient( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.WebViewClient.setSynchronousReturnValueForShouldOverrideUrlLoading", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebViewClient.setSynchronousReturnValueForShouldOverrideUrlLoading", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebViewClient val valueArg = args[1] as Boolean - val wrapped: List = - try { - api.setSynchronousReturnValueForShouldOverrideUrlLoading( - pigeon_instanceArg, valueArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.setSynchronousReturnValueForShouldOverrideUrlLoading(pigeon_instanceArg, valueArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2775,10 +2344,8 @@ abstract class PigeonApiWebViewClient( @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of WebViewClient and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance( - pigeon_instanceArg: android.webkit.WebViewClient, - callback: (Result) -> Unit - ) { + fun pigeon_newInstance(pigeon_instanceArg: android.webkit.WebViewClient, callback: (Result) -> Unit) +{ if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2789,8 +2356,7 @@ abstract class PigeonApiWebViewClient( Result.success(Unit) return } - val pigeon_identifierArg = - pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.webview_flutter_android.WebViewClient.pigeon_newInstance" @@ -2798,25 +2364,19 @@ abstract class PigeonApiWebViewClient( channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Notify the host application that a page has started loading. */ - fun onPageStarted( - pigeon_instanceArg: android.webkit.WebViewClient, - webViewArg: android.webkit.WebView, - urlArg: String, - callback: (Result) -> Unit - ) { + fun onPageStarted(pigeon_instanceArg: android.webkit.WebViewClient, webViewArg: android.webkit.WebView, urlArg: String, callback: (Result) -> Unit) +{ if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2830,25 +2390,19 @@ abstract class PigeonApiWebViewClient( channel.send(listOf(pigeon_instanceArg, webViewArg, urlArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Notify the host application that a page has finished loading. */ - fun onPageFinished( - pigeon_instanceArg: android.webkit.WebViewClient, - webViewArg: android.webkit.WebView, - urlArg: String, - callback: (Result) -> Unit - ) { + fun onPageFinished(pigeon_instanceArg: android.webkit.WebViewClient, webViewArg: android.webkit.WebView, urlArg: String, callback: (Result) -> Unit) +{ if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2862,29 +2416,22 @@ abstract class PigeonApiWebViewClient( channel.send(listOf(pigeon_instanceArg, webViewArg, urlArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** - * Notify the host application that an HTTP error has been received from the server while loading - * a resource. + * Notify the host application that an HTTP error has been received from the + * server while loading a resource. */ - fun onReceivedHttpError( - pigeon_instanceArg: android.webkit.WebViewClient, - webViewArg: android.webkit.WebView, - requestArg: android.webkit.WebResourceRequest, - responseArg: android.webkit.WebResourceResponse, - callback: (Result) -> Unit - ) { + fun onReceivedHttpError(pigeon_instanceArg: android.webkit.WebViewClient, webViewArg: android.webkit.WebView, requestArg: android.webkit.WebResourceRequest, responseArg: android.webkit.WebResourceResponse, callback: (Result) -> Unit) +{ if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2898,27 +2445,20 @@ abstract class PigeonApiWebViewClient( channel.send(listOf(pigeon_instanceArg, webViewArg, requestArg, responseArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Report web resource loading error to the host application. */ @androidx.annotation.RequiresApi(api = 23) - fun onReceivedRequestError( - pigeon_instanceArg: android.webkit.WebViewClient, - webViewArg: android.webkit.WebView, - requestArg: android.webkit.WebResourceRequest, - errorArg: android.webkit.WebResourceError, - callback: (Result) -> Unit - ) { + fun onReceivedRequestError(pigeon_instanceArg: android.webkit.WebViewClient, webViewArg: android.webkit.WebView, requestArg: android.webkit.WebResourceRequest, errorArg: android.webkit.WebResourceError, callback: (Result) -> Unit) +{ if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2927,32 +2467,24 @@ abstract class PigeonApiWebViewClient( } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedRequestError" + val channelName = "dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedRequestError" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, webViewArg, requestArg, errorArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Report web resource loading error to the host application. */ - fun onReceivedRequestErrorCompat( - pigeon_instanceArg: android.webkit.WebViewClient, - webViewArg: android.webkit.WebView, - requestArg: android.webkit.WebResourceRequest, - errorArg: androidx.webkit.WebResourceErrorCompat, - callback: (Result) -> Unit - ) { + fun onReceivedRequestErrorCompat(pigeon_instanceArg: android.webkit.WebViewClient, webViewArg: android.webkit.WebView, requestArg: android.webkit.WebResourceRequest, errorArg: androidx.webkit.WebResourceErrorCompat, callback: (Result) -> Unit) +{ if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2961,33 +2493,24 @@ abstract class PigeonApiWebViewClient( } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedRequestErrorCompat" + val channelName = "dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedRequestErrorCompat" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, webViewArg, requestArg, errorArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Report an error to the host application. */ - fun onReceivedError( - pigeon_instanceArg: android.webkit.WebViewClient, - webViewArg: android.webkit.WebView, - errorCodeArg: Long, - descriptionArg: String, - failingUrlArg: String, - callback: (Result) -> Unit - ) { + fun onReceivedError(pigeon_instanceArg: android.webkit.WebViewClient, webViewArg: android.webkit.WebView, errorCodeArg: Long, descriptionArg: String, failingUrlArg: String, callback: (Result) -> Unit) +{ if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2998,32 +2521,25 @@ abstract class PigeonApiWebViewClient( val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedError" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send( - listOf(pigeon_instanceArg, webViewArg, errorCodeArg, descriptionArg, failingUrlArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) - } else { - callback(Result.success(Unit)) - } - } else { - callback(Result.failure(createConnectionError(channelName))) - } + channel.send(listOf(pigeon_instanceArg, webViewArg, errorCodeArg, descriptionArg, failingUrlArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } } /** - * Give the host application a chance to take control when a URL is about to be loaded in the - * current WebView. + * Give the host application a chance to take control when a URL is about to + * be loaded in the current WebView. */ - fun requestLoading( - pigeon_instanceArg: android.webkit.WebViewClient, - webViewArg: android.webkit.WebView, - requestArg: android.webkit.WebResourceRequest, - callback: (Result) -> Unit - ) { + fun requestLoading(pigeon_instanceArg: android.webkit.WebViewClient, webViewArg: android.webkit.WebView, requestArg: android.webkit.WebResourceRequest, callback: (Result) -> Unit) +{ if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3037,28 +2553,22 @@ abstract class PigeonApiWebViewClient( channel.send(listOf(pigeon_instanceArg, webViewArg, requestArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** - * Give the host application a chance to take control when a URL is about to be loaded in the - * current WebView. + * Give the host application a chance to take control when a URL is about to + * be loaded in the current WebView. */ - fun urlLoading( - pigeon_instanceArg: android.webkit.WebViewClient, - webViewArg: android.webkit.WebView, - urlArg: String, - callback: (Result) -> Unit - ) { + fun urlLoading(pigeon_instanceArg: android.webkit.WebViewClient, webViewArg: android.webkit.WebView, urlArg: String, callback: (Result) -> Unit) +{ if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3072,26 +2582,19 @@ abstract class PigeonApiWebViewClient( channel.send(listOf(pigeon_instanceArg, webViewArg, urlArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Notify the host application to update its visited links database. */ - fun doUpdateVisitedHistory( - pigeon_instanceArg: android.webkit.WebViewClient, - webViewArg: android.webkit.WebView, - urlArg: String, - isReloadArg: Boolean, - callback: (Result) -> Unit - ) { + fun doUpdateVisitedHistory(pigeon_instanceArg: android.webkit.WebViewClient, webViewArg: android.webkit.WebView, urlArg: String, isReloadArg: Boolean, callback: (Result) -> Unit) +{ if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3100,33 +2603,27 @@ abstract class PigeonApiWebViewClient( } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.webview_flutter_android.WebViewClient.doUpdateVisitedHistory" + val channelName = "dev.flutter.pigeon.webview_flutter_android.WebViewClient.doUpdateVisitedHistory" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, webViewArg, urlArg, isReloadArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - /** Notifies the host application that the WebView received an HTTP authentication request. */ - fun onReceivedHttpAuthRequest( - pigeon_instanceArg: android.webkit.WebViewClient, - webViewArg: android.webkit.WebView, - handlerArg: android.webkit.HttpAuthHandler, - hostArg: String, - realmArg: String, - callback: (Result) -> Unit - ) { + /** + * Notifies the host application that the WebView received an HTTP + * authentication request. + */ + fun onReceivedHttpAuthRequest(pigeon_instanceArg: android.webkit.WebViewClient, webViewArg: android.webkit.WebView, handlerArg: android.webkit.HttpAuthHandler, hostArg: String, realmArg: String, callback: (Result) -> Unit) +{ if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3135,23 +2632,21 @@ abstract class PigeonApiWebViewClient( } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedHttpAuthRequest" + val channelName = "dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedHttpAuthRequest" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, webViewArg, handlerArg, hostArg, realmArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } + } /** * Handles notifications that a file should be downloaded. @@ -3159,9 +2654,7 @@ abstract class PigeonApiWebViewClient( * See https://developer.android.com/reference/android/webkit/DownloadListener. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiDownloadListener( - open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar -) { +abstract class PigeonApiDownloadListener(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { abstract fun pigeon_defaultConstructor(): android.webkit.DownloadListener companion object { @@ -3169,23 +2662,17 @@ abstract class PigeonApiDownloadListener( fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiDownloadListener?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.DownloadListener.pigeon_defaultConstructor", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.DownloadListener.pigeon_defaultConstructor", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_identifierArg = args[0] as Long - val wrapped: List = - try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - api.pigeon_defaultConstructor(), pigeon_identifierArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.pigeon_defaultConstructor(), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3197,10 +2684,8 @@ abstract class PigeonApiDownloadListener( @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of DownloadListener and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance( - pigeon_instanceArg: android.webkit.DownloadListener, - callback: (Result) -> Unit - ) { + fun pigeon_newInstance(pigeon_instanceArg: android.webkit.DownloadListener, callback: (Result) -> Unit) +{ if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3211,20 +2696,12 @@ abstract class PigeonApiDownloadListener( Result.success(Unit) return } - throw IllegalStateException( - "Attempting to create a new Dart instance of DownloadListener, but the class has a nonnull callback method.") + throw IllegalStateException("Attempting to create a new Dart instance of DownloadListener, but the class has a nonnull callback method.") } /** Notify the host application that a file should be downloaded. */ - fun onDownloadStart( - pigeon_instanceArg: android.webkit.DownloadListener, - urlArg: String, - userAgentArg: String, - contentDispositionArg: String, - mimetypeArg: String, - contentLengthArg: Long, - callback: (Result) -> Unit - ) { + fun onDownloadStart(pigeon_instanceArg: android.webkit.DownloadListener, urlArg: String, userAgentArg: String, contentDispositionArg: String, mimetypeArg: String, contentLengthArg: Long, callback: (Result) -> Unit) +{ if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3235,160 +2712,133 @@ abstract class PigeonApiDownloadListener( val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.webview_flutter_android.DownloadListener.onDownloadStart" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send( - listOf( - pigeon_instanceArg, - urlArg, - userAgentArg, - contentDispositionArg, - mimetypeArg, - contentLengthArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) - } else { - callback(Result.success(Unit)) - } - } else { - callback(Result.failure(createConnectionError(channelName))) - } + channel.send(listOf(pigeon_instanceArg, urlArg, userAgentArg, contentDispositionArg, mimetypeArg, contentLengthArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } } + } /** - * Handles notification of JavaScript dialogs, favicons, titles, and the progress. + * Handles notification of JavaScript dialogs, favicons, titles, and the + * progress. * * See https://developer.android.com/reference/android/webkit/WebChromeClient. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiWebChromeClient( - open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar -) { - abstract fun pigeon_defaultConstructor(): - io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl +abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { + abstract fun pigeon_defaultConstructor(): io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl /** * Sets the required synchronous return value for the Java method, * `WebChromeClient.onShowFileChooser(...)`. * - * The Java method, `WebChromeClient.onShowFileChooser(...)`, requires a boolean to be returned - * and this method sets the returned value for all calls to the Java method. + * The Java method, `WebChromeClient.onShowFileChooser(...)`, requires + * a boolean to be returned and this method sets the returned value for all + * calls to the Java method. * - * Setting this to true indicates that all file chooser requests should be handled by - * `onShowFileChooser` and the returned list of Strings will be returned to the WebView. - * Otherwise, the client will use the default handling and the returned value in - * `onShowFileChooser` will be ignored. + * Setting this to true indicates that all file chooser requests should be + * handled by `onShowFileChooser` and the returned list of Strings will be + * returned to the WebView. Otherwise, the client will use the default + * handling and the returned value in `onShowFileChooser` will be ignored. * * Requires `onShowFileChooser` to be nonnull. * * Defaults to false. */ - abstract fun setSynchronousReturnValueForOnShowFileChooser( - pigeon_instance: - io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, - value: Boolean - ) + abstract fun setSynchronousReturnValueForOnShowFileChooser(pigeon_instance: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, value: Boolean) /** * Sets the required synchronous return value for the Java method, * `WebChromeClient.onConsoleMessage(...)`. * - * The Java method, `WebChromeClient.onConsoleMessage(...)`, requires a boolean to be returned and - * this method sets the returned value for all calls to the Java method. + * The Java method, `WebChromeClient.onConsoleMessage(...)`, requires + * a boolean to be returned and this method sets the returned value for all + * calls to the Java method. * - * Setting this to true indicates that the client is handling all console messages. + * Setting this to true indicates that the client is handling all console + * messages. * * Requires `onConsoleMessage` to be nonnull. * * Defaults to false. */ - abstract fun setSynchronousReturnValueForOnConsoleMessage( - pigeon_instance: - io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, - value: Boolean - ) + abstract fun setSynchronousReturnValueForOnConsoleMessage(pigeon_instance: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, value: Boolean) /** * Sets the required synchronous return value for the Java method, * `WebChromeClient.onJsAlert(...)`. * - * The Java method, `WebChromeClient.onJsAlert(...)`, requires a boolean to be returned and this - * method sets the returned value for all calls to the Java method. + * The Java method, `WebChromeClient.onJsAlert(...)`, requires a boolean to + * be returned and this method sets the returned value for all calls to the + * Java method. * - * Setting this to true indicates that the client is handling all console messages. + * Setting this to true indicates that the client is handling all console + * messages. * * Requires `onJsAlert` to be nonnull. * * Defaults to false. */ - abstract fun setSynchronousReturnValueForOnJsAlert( - pigeon_instance: - io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, - value: Boolean - ) + abstract fun setSynchronousReturnValueForOnJsAlert(pigeon_instance: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, value: Boolean) /** * Sets the required synchronous return value for the Java method, * `WebChromeClient.onJsConfirm(...)`. * - * The Java method, `WebChromeClient.onJsConfirm(...)`, requires a boolean to be returned and this - * method sets the returned value for all calls to the Java method. + * The Java method, `WebChromeClient.onJsConfirm(...)`, requires a boolean to + * be returned and this method sets the returned value for all calls to the + * Java method. * - * Setting this to true indicates that the client is handling all console messages. + * Setting this to true indicates that the client is handling all console + * messages. * * Requires `onJsConfirm` to be nonnull. * * Defaults to false. */ - abstract fun setSynchronousReturnValueForOnJsConfirm( - pigeon_instance: - io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, - value: Boolean - ) + abstract fun setSynchronousReturnValueForOnJsConfirm(pigeon_instance: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, value: Boolean) /** * Sets the required synchronous return value for the Java method, * `WebChromeClient.onJsPrompt(...)`. * - * The Java method, `WebChromeClient.onJsPrompt(...)`, requires a boolean to be returned and this - * method sets the returned value for all calls to the Java method. + * The Java method, `WebChromeClient.onJsPrompt(...)`, requires a boolean to + * be returned and this method sets the returned value for all calls to the + * Java method. * - * Setting this to true indicates that the client is handling all console messages. + * Setting this to true indicates that the client is handling all console + * messages. * * Requires `onJsPrompt` to be nonnull. * * Defaults to false. */ - abstract fun setSynchronousReturnValueForOnJsPrompt( - pigeon_instance: - io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, - value: Boolean - ) + abstract fun setSynchronousReturnValueForOnJsPrompt(pigeon_instance: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, value: Boolean) companion object { @Suppress("LocalVariableName") fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiWebChromeClient?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.pigeon_defaultConstructor", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.pigeon_defaultConstructor", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_identifierArg = args[0] as Long - val wrapped: List = - try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - api.pigeon_defaultConstructor(), pigeon_identifierArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.pigeon_defaultConstructor(), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3396,25 +2846,18 @@ abstract class PigeonApiWebChromeClient( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.setSynchronousReturnValueForOnShowFileChooser", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.setSynchronousReturnValueForOnShowFileChooser", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_instanceArg = - args[0] - as io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl + val pigeon_instanceArg = args[0] as io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl val valueArg = args[1] as Boolean - val wrapped: List = - try { - api.setSynchronousReturnValueForOnShowFileChooser(pigeon_instanceArg, valueArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.setSynchronousReturnValueForOnShowFileChooser(pigeon_instanceArg, valueArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3422,25 +2865,18 @@ abstract class PigeonApiWebChromeClient( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.setSynchronousReturnValueForOnConsoleMessage", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.setSynchronousReturnValueForOnConsoleMessage", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_instanceArg = - args[0] - as io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl + val pigeon_instanceArg = args[0] as io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl val valueArg = args[1] as Boolean - val wrapped: List = - try { - api.setSynchronousReturnValueForOnConsoleMessage(pigeon_instanceArg, valueArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.setSynchronousReturnValueForOnConsoleMessage(pigeon_instanceArg, valueArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3448,25 +2884,18 @@ abstract class PigeonApiWebChromeClient( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.setSynchronousReturnValueForOnJsAlert", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.setSynchronousReturnValueForOnJsAlert", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_instanceArg = - args[0] - as io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl + val pigeon_instanceArg = args[0] as io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl val valueArg = args[1] as Boolean - val wrapped: List = - try { - api.setSynchronousReturnValueForOnJsAlert(pigeon_instanceArg, valueArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.setSynchronousReturnValueForOnJsAlert(pigeon_instanceArg, valueArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3474,25 +2903,18 @@ abstract class PigeonApiWebChromeClient( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.setSynchronousReturnValueForOnJsConfirm", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.setSynchronousReturnValueForOnJsConfirm", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_instanceArg = - args[0] - as io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl + val pigeon_instanceArg = args[0] as io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl val valueArg = args[1] as Boolean - val wrapped: List = - try { - api.setSynchronousReturnValueForOnJsConfirm(pigeon_instanceArg, valueArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.setSynchronousReturnValueForOnJsConfirm(pigeon_instanceArg, valueArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3500,25 +2922,18 @@ abstract class PigeonApiWebChromeClient( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.setSynchronousReturnValueForOnJsPrompt", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.setSynchronousReturnValueForOnJsPrompt", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_instanceArg = - args[0] - as io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl + val pigeon_instanceArg = args[0] as io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl val valueArg = args[1] as Boolean - val wrapped: List = - try { - api.setSynchronousReturnValueForOnJsPrompt(pigeon_instanceArg, valueArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.setSynchronousReturnValueForOnJsPrompt(pigeon_instanceArg, valueArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3530,11 +2945,8 @@ abstract class PigeonApiWebChromeClient( @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of WebChromeClient and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance( - pigeon_instanceArg: - io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, - callback: (Result) -> Unit - ) { + fun pigeon_newInstance(pigeon_instanceArg: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, callback: (Result) -> Unit) +{ if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3545,36 +2957,27 @@ abstract class PigeonApiWebChromeClient( Result.success(Unit) return } - val pigeon_identifierArg = - pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.pigeon_newInstance" + val channelName = "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Tell the host application the current progress of loading a page. */ - fun onProgressChanged( - pigeon_instanceArg: - io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, - webViewArg: android.webkit.WebView, - progressArg: Long, - callback: (Result) -> Unit - ) { + fun onProgressChanged(pigeon_instanceArg: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, webViewArg: android.webkit.WebView, progressArg: Long, callback: (Result) -> Unit) +{ if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3588,26 +2991,19 @@ abstract class PigeonApiWebChromeClient( channel.send(listOf(pigeon_instanceArg, webViewArg, progressArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Tell the client to show a file chooser. */ - fun onShowFileChooser( - pigeon_instanceArg: - io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, - webViewArg: android.webkit.WebView, - paramsArg: android.webkit.WebChromeClient.FileChooserParams, - callback: (Result>) -> Unit - ) { + fun onShowFileChooser(pigeon_instanceArg: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, webViewArg: android.webkit.WebView, paramsArg: android.webkit.WebChromeClient.FileChooserParams, callback: (Result>) -> Unit) +{ if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3621,36 +3017,26 @@ abstract class PigeonApiWebChromeClient( channel.send(listOf(pigeon_instanceArg, webViewArg, paramsArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback( - Result.failure( - AndroidWebKitError( - "null-error", - "Flutter api returned null value for non-null return value.", - ""))) + callback(Result.failure(AndroidWebKitError("null-error", "Flutter api returned null value for non-null return value.", ""))) } else { val output = it[0] as List callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** - * Notify the host application that web content is requesting permission to access the specified - * resources and the permission currently isn't granted or denied. + * Notify the host application that web content is requesting permission to + * access the specified resources and the permission currently isn't granted + * or denied. */ - fun onPermissionRequest( - pigeon_instanceArg: - io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, - requestArg: android.webkit.PermissionRequest, - callback: (Result) -> Unit - ) { + fun onPermissionRequest(pigeon_instanceArg: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, requestArg: android.webkit.PermissionRequest, callback: (Result) -> Unit) +{ if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3659,32 +3045,24 @@ abstract class PigeonApiWebChromeClient( } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.onPermissionRequest" + val channelName = "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.onPermissionRequest" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, requestArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Callback to Dart function `WebChromeClient.onShowCustomView`. */ - fun onShowCustomView( - pigeon_instanceArg: - io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, - viewArg: android.view.View, - callbackArg: android.webkit.WebChromeClient.CustomViewCallback, - callback: (Result) -> Unit - ) { + fun onShowCustomView(pigeon_instanceArg: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, viewArg: android.view.View, callbackArg: android.webkit.WebChromeClient.CustomViewCallback, callback: (Result) -> Unit) +{ if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3698,24 +3076,22 @@ abstract class PigeonApiWebChromeClient( channel.send(listOf(pigeon_instanceArg, viewArg, callbackArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - /** Notify the host application that the current page has entered full screen mode. */ - fun onHideCustomView( - pigeon_instanceArg: - io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, - callback: (Result) -> Unit - ) { + /** + * Notify the host application that the current page has entered full screen + * mode. + */ + fun onHideCustomView(pigeon_instanceArg: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, callback: (Result) -> Unit) +{ if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3729,29 +3105,23 @@ abstract class PigeonApiWebChromeClient( channel.send(listOf(pigeon_instanceArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** - * Notify the host application that web content from the specified origin is attempting to use the - * Geolocation API, but no permission state is currently set for that origin. + * Notify the host application that web content from the specified origin is + * attempting to use the Geolocation API, but no permission state is + * currently set for that origin. */ - fun onGeolocationPermissionsShowPrompt( - pigeon_instanceArg: - io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, - originArg: String, - callbackArg: android.webkit.GeolocationPermissions.Callback, - callback: (Result) -> Unit - ) { + fun onGeolocationPermissionsShowPrompt(pigeon_instanceArg: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, originArg: String, callbackArg: android.webkit.GeolocationPermissions.Callback, callback: (Result) -> Unit) +{ if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3760,33 +3130,28 @@ abstract class PigeonApiWebChromeClient( } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.onGeolocationPermissionsShowPrompt" + val channelName = "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.onGeolocationPermissionsShowPrompt" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, originArg, callbackArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** - * Notify the host application that a request for Geolocation permissions, made with a previous - * call to `onGeolocationPermissionsShowPrompt` has been canceled. + * Notify the host application that a request for Geolocation permissions, + * made with a previous call to `onGeolocationPermissionsShowPrompt` has been + * canceled. */ - fun onGeolocationPermissionsHidePrompt( - pigeon_instanceArg: - io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, - callback: (Result) -> Unit - ) { + fun onGeolocationPermissionsHidePrompt(pigeon_instanceArg: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, callback: (Result) -> Unit) +{ if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3795,31 +3160,24 @@ abstract class PigeonApiWebChromeClient( } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.onGeolocationPermissionsHidePrompt" + val channelName = "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.onGeolocationPermissionsHidePrompt" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Report a JavaScript console message to the host application. */ - fun onConsoleMessage( - pigeon_instanceArg: - io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, - messageArg: android.webkit.ConsoleMessage, - callback: (Result) -> Unit - ) { + fun onConsoleMessage(pigeon_instanceArg: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, messageArg: android.webkit.ConsoleMessage, callback: (Result) -> Unit) +{ if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3833,29 +3191,22 @@ abstract class PigeonApiWebChromeClient( channel.send(listOf(pigeon_instanceArg, messageArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** - * Notify the host application that the web page wants to display a JavaScript `alert()` dialog. + * Notify the host application that the web page wants to display a + * JavaScript `alert()` dialog. */ - fun onJsAlert( - pigeon_instanceArg: - io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, - webViewArg: android.webkit.WebView, - urlArg: String, - messageArg: String, - callback: (Result) -> Unit - ) { + fun onJsAlert(pigeon_instanceArg: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, webViewArg: android.webkit.WebView, urlArg: String, messageArg: String, callback: (Result) -> Unit) +{ if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3869,29 +3220,22 @@ abstract class PigeonApiWebChromeClient( channel.send(listOf(pigeon_instanceArg, webViewArg, urlArg, messageArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** - * Notify the host application that the web page wants to display a JavaScript `confirm()` dialog. + * Notify the host application that the web page wants to display a + * JavaScript `confirm()` dialog. */ - fun onJsConfirm( - pigeon_instanceArg: - io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, - webViewArg: android.webkit.WebView, - urlArg: String, - messageArg: String, - callback: (Result) -> Unit - ) { + fun onJsConfirm(pigeon_instanceArg: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, webViewArg: android.webkit.WebView, urlArg: String, messageArg: String, callback: (Result) -> Unit) +{ if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3905,38 +3249,25 @@ abstract class PigeonApiWebChromeClient( channel.send(listOf(pigeon_instanceArg, webViewArg, urlArg, messageArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback( - Result.failure( - AndroidWebKitError( - "null-error", - "Flutter api returned null value for non-null return value.", - ""))) + callback(Result.failure(AndroidWebKitError("null-error", "Flutter api returned null value for non-null return value.", ""))) } else { val output = it[0] as Boolean callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** - * Notify the host application that the web page wants to display a JavaScript `prompt()` dialog. + * Notify the host application that the web page wants to display a + * JavaScript `prompt()` dialog. */ - fun onJsPrompt( - pigeon_instanceArg: - io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, - webViewArg: android.webkit.WebView, - urlArg: String, - messageArg: String, - defaultValueArg: String, - callback: (Result) -> Unit - ) { + fun onJsPrompt(pigeon_instanceArg: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, webViewArg: android.webkit.WebView, urlArg: String, messageArg: String, defaultValueArg: String, callback: (Result) -> Unit) +{ if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3950,18 +3281,17 @@ abstract class PigeonApiWebChromeClient( channel.send(listOf(pigeon_instanceArg, webViewArg, urlArg, messageArg, defaultValueArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { val output = it[0] as String? callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } + } /** * Provides access to the assets registered as part of the App bundle. @@ -3969,9 +3299,7 @@ abstract class PigeonApiWebChromeClient( * Convenience class for accessing Flutter asset resources. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiFlutterAssetManager( - open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar -) { +abstract class PigeonApiFlutterAssetManager(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { /** The global instance of the `FlutterAssetManager`. */ abstract fun instance(): io.flutter.plugins.webviewflutter.FlutterAssetManager @@ -3980,46 +3308,35 @@ abstract class PigeonApiFlutterAssetManager( * * Throws an IOException in case I/O operations were interrupted. */ - abstract fun list( - pigeon_instance: io.flutter.plugins.webviewflutter.FlutterAssetManager, - path: String - ): List + abstract fun list(pigeon_instance: io.flutter.plugins.webviewflutter.FlutterAssetManager, path: String): List /** * Gets the relative file path to the Flutter asset with the given name, including the file's * extension, e.g., "myImage.jpg". * - * The returned file path is relative to the Android app's standard asset's directory. Therefore, - * the returned path is appropriate to pass to Android's AssetManager, but the path is not - * appropriate to load as an absolute path. + * The returned file path is relative to the Android app's standard asset's + * directory. Therefore, the returned path is appropriate to pass to + * Android's AssetManager, but the path is not appropriate to load as an + * absolute path. */ - abstract fun getAssetFilePathByName( - pigeon_instance: io.flutter.plugins.webviewflutter.FlutterAssetManager, - name: String - ): String + abstract fun getAssetFilePathByName(pigeon_instance: io.flutter.plugins.webviewflutter.FlutterAssetManager, name: String): String companion object { @Suppress("LocalVariableName") fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiFlutterAssetManager?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.FlutterAssetManager.instance", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.FlutterAssetManager.instance", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_identifierArg = args[0] as Long - val wrapped: List = - try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - api.instance(), pigeon_identifierArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.instance(), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4027,23 +3344,17 @@ abstract class PigeonApiFlutterAssetManager( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.FlutterAssetManager.list", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.FlutterAssetManager.list", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_instanceArg = - args[0] as io.flutter.plugins.webviewflutter.FlutterAssetManager + val pigeon_instanceArg = args[0] as io.flutter.plugins.webviewflutter.FlutterAssetManager val pathArg = args[1] as String - val wrapped: List = - try { - listOf(api.list(pigeon_instanceArg, pathArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.list(pigeon_instanceArg, pathArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4051,23 +3362,17 @@ abstract class PigeonApiFlutterAssetManager( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.FlutterAssetManager.getAssetFilePathByName", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.FlutterAssetManager.getAssetFilePathByName", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_instanceArg = - args[0] as io.flutter.plugins.webviewflutter.FlutterAssetManager + val pigeon_instanceArg = args[0] as io.flutter.plugins.webviewflutter.FlutterAssetManager val nameArg = args[1] as String - val wrapped: List = - try { - listOf(api.getAssetFilePathByName(pigeon_instanceArg, nameArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.getAssetFilePathByName(pigeon_instanceArg, nameArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4079,10 +3384,8 @@ abstract class PigeonApiFlutterAssetManager( @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of FlutterAssetManager and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance( - pigeon_instanceArg: io.flutter.plugins.webviewflutter.FlutterAssetManager, - callback: (Result) -> Unit - ) { + fun pigeon_newInstance(pigeon_instanceArg: io.flutter.plugins.webviewflutter.FlutterAssetManager, callback: (Result) -> Unit) +{ if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -4093,37 +3396,33 @@ abstract class PigeonApiFlutterAssetManager( Result.success(Unit) return } - val pigeon_identifierArg = - pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.webview_flutter_android.FlutterAssetManager.pigeon_newInstance" + val channelName = "dev.flutter.pigeon.webview_flutter_android.FlutterAssetManager.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } + } /** - * This class is used to manage the JavaScript storage APIs provided by the WebView. + * This class is used to manage the JavaScript storage APIs provided by the + * WebView. * * See https://developer.android.com/reference/android/webkit/WebStorage. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiWebStorage( - open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar -) { +abstract class PigeonApiWebStorage(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { abstract fun instance(): android.webkit.WebStorage /** Clears all storage currently being used by the JavaScript storage APIs. */ @@ -4134,23 +3433,17 @@ abstract class PigeonApiWebStorage( fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiWebStorage?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.WebStorage.instance", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebStorage.instance", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_identifierArg = args[0] as Long - val wrapped: List = - try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - api.instance(), pigeon_identifierArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.instance(), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4158,22 +3451,17 @@ abstract class PigeonApiWebStorage( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.WebStorage.deleteAllData", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebStorage.deleteAllData", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebStorage - val wrapped: List = - try { - api.deleteAllData(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.deleteAllData(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4185,10 +3473,8 @@ abstract class PigeonApiWebStorage( @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of WebStorage and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance( - pigeon_instanceArg: android.webkit.WebStorage, - callback: (Result) -> Unit - ) { + fun pigeon_newInstance(pigeon_instanceArg: android.webkit.WebStorage, callback: (Result) -> Unit) +{ if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -4199,8 +3485,7 @@ abstract class PigeonApiWebStorage( Result.success(Unit) return } - val pigeon_identifierArg = - pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.webview_flutter_android.WebStorage.pigeon_newInstance" @@ -4208,17 +3493,16 @@ abstract class PigeonApiWebStorage( channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } + } /** * Parameters used in the `WebChromeClient.onShowFileChooser` method. @@ -4226,35 +3510,23 @@ abstract class PigeonApiWebStorage( * See https://developer.android.com/reference/android/webkit/WebChromeClient.FileChooserParams. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiFileChooserParams( - open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar -) { +abstract class PigeonApiFileChooserParams(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { /** Preference for a live media captured value (e.g. Camera, Microphone). */ - abstract fun isCaptureEnabled( - pigeon_instance: android.webkit.WebChromeClient.FileChooserParams - ): Boolean + abstract fun isCaptureEnabled(pigeon_instance: android.webkit.WebChromeClient.FileChooserParams): Boolean /** An array of acceptable MIME types. */ - abstract fun acceptTypes( - pigeon_instance: android.webkit.WebChromeClient.FileChooserParams - ): List + abstract fun acceptTypes(pigeon_instance: android.webkit.WebChromeClient.FileChooserParams): List /** File chooser mode. */ - abstract fun mode( - pigeon_instance: android.webkit.WebChromeClient.FileChooserParams - ): FileChooserMode + abstract fun mode(pigeon_instance: android.webkit.WebChromeClient.FileChooserParams): FileChooserMode /** File name of a default selection if specified, or null. */ - abstract fun filenameHint( - pigeon_instance: android.webkit.WebChromeClient.FileChooserParams - ): String? + abstract fun filenameHint(pigeon_instance: android.webkit.WebChromeClient.FileChooserParams): String? @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of FileChooserParams and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance( - pigeon_instanceArg: android.webkit.WebChromeClient.FileChooserParams, - callback: (Result) -> Unit - ) { + fun pigeon_newInstance(pigeon_instanceArg: android.webkit.WebChromeClient.FileChooserParams, callback: (Result) -> Unit) +{ if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -4265,47 +3537,43 @@ abstract class PigeonApiFileChooserParams( Result.success(Unit) return } - val pigeon_identifierArg = - pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val isCaptureEnabledArg = isCaptureEnabled(pigeon_instanceArg) val acceptTypesArg = acceptTypes(pigeon_instanceArg) val modeArg = mode(pigeon_instanceArg) val filenameHintArg = filenameHint(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.webview_flutter_android.FileChooserParams.pigeon_newInstance" + val channelName = "dev.flutter.pigeon.webview_flutter_android.FileChooserParams.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send( - listOf( - pigeon_identifierArg, isCaptureEnabledArg, acceptTypesArg, modeArg, filenameHintArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) - } else { - callback(Result.success(Unit)) - } - } else { - callback(Result.failure(createConnectionError(channelName))) - } + channel.send(listOf(pigeon_identifierArg, isCaptureEnabledArg, acceptTypesArg, modeArg, filenameHintArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } } + } /** - * This class defines a permission request and is used when web content requests access to protected - * resources. + * This class defines a permission request and is used when web content + * requests access to protected resources. * * See https://developer.android.com/reference/android/webkit/PermissionRequest. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiPermissionRequest( - open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar -) { +abstract class PigeonApiPermissionRequest(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { abstract fun resources(pigeon_instance: android.webkit.PermissionRequest): List - /** Call this method to grant origin the permission to access the given resources. */ + /** + * Call this method to grant origin the permission to access the given + * resources. + */ abstract fun grant(pigeon_instance: android.webkit.PermissionRequest, resources: List) /** Call this method to deny the request. */ @@ -4316,23 +3584,18 @@ abstract class PigeonApiPermissionRequest( fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiPermissionRequest?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.PermissionRequest.grant", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.PermissionRequest.grant", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.PermissionRequest val resourcesArg = args[1] as List - val wrapped: List = - try { - api.grant(pigeon_instanceArg, resourcesArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.grant(pigeon_instanceArg, resourcesArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4340,22 +3603,17 @@ abstract class PigeonApiPermissionRequest( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.PermissionRequest.deny", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.PermissionRequest.deny", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.PermissionRequest - val wrapped: List = - try { - api.deny(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.deny(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4367,10 +3625,8 @@ abstract class PigeonApiPermissionRequest( @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of PermissionRequest and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance( - pigeon_instanceArg: android.webkit.PermissionRequest, - callback: (Result) -> Unit - ) { + fun pigeon_newInstance(pigeon_instanceArg: android.webkit.PermissionRequest, callback: (Result) -> Unit) +{ if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -4381,65 +3637,53 @@ abstract class PigeonApiPermissionRequest( Result.success(Unit) return } - val pigeon_identifierArg = - pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val resourcesArg = resources(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.webview_flutter_android.PermissionRequest.pigeon_newInstance" + val channelName = "dev.flutter.pigeon.webview_flutter_android.PermissionRequest.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg, resourcesArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } + } /** - * A callback interface used by the host application to notify the current page that its custom view - * has been dismissed. + * A callback interface used by the host application to notify the current page + * that its custom view has been dismissed. * * See https://developer.android.com/reference/android/webkit/WebChromeClient.CustomViewCallback. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiCustomViewCallback( - open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar -) { +abstract class PigeonApiCustomViewCallback(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { /** Invoked when the host application dismisses the custom view. */ - abstract fun onCustomViewHidden( - pigeon_instance: android.webkit.WebChromeClient.CustomViewCallback - ) + abstract fun onCustomViewHidden(pigeon_instance: android.webkit.WebChromeClient.CustomViewCallback) companion object { @Suppress("LocalVariableName") fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiCustomViewCallback?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.CustomViewCallback.onCustomViewHidden", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.CustomViewCallback.onCustomViewHidden", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebChromeClient.CustomViewCallback - val wrapped: List = - try { - api.onCustomViewHidden(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.onCustomViewHidden(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4451,10 +3695,8 @@ abstract class PigeonApiCustomViewCallback( @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of CustomViewCallback and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance( - pigeon_instanceArg: android.webkit.WebChromeClient.CustomViewCallback, - callback: (Result) -> Unit - ) { + fun pigeon_newInstance(pigeon_instanceArg: android.webkit.WebChromeClient.CustomViewCallback, callback: (Result) -> Unit) +{ if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -4465,37 +3707,33 @@ abstract class PigeonApiCustomViewCallback( Result.success(Unit) return } - val pigeon_identifierArg = - pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.webview_flutter_android.CustomViewCallback.pigeon_newInstance" + val channelName = "dev.flutter.pigeon.webview_flutter_android.CustomViewCallback.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } + } /** - * This class represents the basic building block for user interface components. + * This class represents the basic building block for user interface + * components. * * See https://developer.android.com/reference/android/view/View. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiView( - open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar -) { +abstract class PigeonApiView(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { /** Set the scrolled position of your view. */ abstract fun scrollTo(pigeon_instance: android.view.View, x: Long, y: Long) @@ -4505,27 +3743,38 @@ abstract class PigeonApiView( /** Return the scrolled position of this view. */ abstract fun getScrollPosition(pigeon_instance: android.view.View): WebViewPoint + /** + * Define whether the vertical scrollbar should be drawn or not. + * + * The scrollbar is not drawn by default. + */ + abstract fun setVerticalScrollBarEnabled(pigeon_instance: android.view.View, enabled: Boolean) + + /** + * Define whether the horizontal scrollbar should be drawn or not. + * + * The scrollbar is not drawn by default. + */ + abstract fun setHorizontalScrollBarEnabled(pigeon_instance: android.view.View, enabled: Boolean) + companion object { @Suppress("LocalVariableName") fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiView?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = - BasicMessageChannel( - binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.View.scrollTo", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.View.scrollTo", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.view.View val xArg = args[1] as Long val yArg = args[2] as Long - val wrapped: List = - try { - api.scrollTo(pigeon_instanceArg, xArg, yArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.scrollTo(pigeon_instanceArg, xArg, yArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4533,22 +3782,55 @@ abstract class PigeonApiView( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.View.scrollBy", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.View.scrollBy", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.view.View val xArg = args[1] as Long val yArg = args[2] as Long - val wrapped: List = - try { - api.scrollBy(pigeon_instanceArg, xArg, yArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.scrollBy(pigeon_instanceArg, xArg, yArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.View.getScrollPosition", codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as android.view.View + val wrapped: List = try { + listOf(api.getScrollPosition(pigeon_instanceArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.View.setVerticalScrollBarEnabled", codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as android.view.View + val enabledArg = args[1] as Boolean + val wrapped: List = try { + api.setVerticalScrollBarEnabled(pigeon_instanceArg, enabledArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4556,21 +3838,18 @@ abstract class PigeonApiView( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.View.getScrollPosition", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.View.setHorizontalScrollBarEnabled", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.view.View - val wrapped: List = - try { - listOf(api.getScrollPosition(pigeon_instanceArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val enabledArg = args[1] as Boolean + val wrapped: List = try { + api.setHorizontalScrollBarEnabled(pigeon_instanceArg, enabledArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4582,7 +3861,8 @@ abstract class PigeonApiView( @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of View and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.view.View, callback: (Result) -> Unit) { + fun pigeon_newInstance(pigeon_instanceArg: android.view.View, callback: (Result) -> Unit) +{ if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -4593,8 +3873,7 @@ abstract class PigeonApiView( Result.success(Unit) return } - val pigeon_identifierArg = - pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.webview_flutter_android.View.pigeon_newInstance" @@ -4602,49 +3881,34 @@ abstract class PigeonApiView( channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } + } /** - * A callback interface used by the host application to set the Geolocation permission state for an - * origin. + * A callback interface used by the host application to set the Geolocation + * permission state for an origin. * * See https://developer.android.com/reference/android/webkit/GeolocationPermissions.Callback. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiGeolocationPermissionsCallback( - open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar -) { +abstract class PigeonApiGeolocationPermissionsCallback(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { /** Sets the Geolocation permission state for the supplied origin. */ - abstract fun invoke( - pigeon_instance: android.webkit.GeolocationPermissions.Callback, - origin: String, - allow: Boolean, - retain: Boolean - ) + abstract fun invoke(pigeon_instance: android.webkit.GeolocationPermissions.Callback, origin: String, allow: Boolean, retain: Boolean) companion object { @Suppress("LocalVariableName") - fun setUpMessageHandlers( - binaryMessenger: BinaryMessenger, - api: PigeonApiGeolocationPermissionsCallback? - ) { + fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiGeolocationPermissionsCallback?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.GeolocationPermissionsCallback.invoke", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.GeolocationPermissionsCallback.invoke", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -4652,13 +3916,12 @@ abstract class PigeonApiGeolocationPermissionsCallback( val originArg = args[1] as String val allowArg = args[2] as Boolean val retainArg = args[3] as Boolean - val wrapped: List = - try { - api.invoke(pigeon_instanceArg, originArg, allowArg, retainArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.invoke(pigeon_instanceArg, originArg, allowArg, retainArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4669,14 +3932,9 @@ abstract class PigeonApiGeolocationPermissionsCallback( } @Suppress("LocalVariableName", "FunctionName") - /** - * Creates a Dart instance of GeolocationPermissionsCallback and attaches it to - * [pigeon_instanceArg]. - */ - fun pigeon_newInstance( - pigeon_instanceArg: android.webkit.GeolocationPermissions.Callback, - callback: (Result) -> Unit - ) { + /** Creates a Dart instance of GeolocationPermissionsCallback and attaches it to [pigeon_instanceArg]. */ + fun pigeon_newInstance(pigeon_instanceArg: android.webkit.GeolocationPermissions.Callback, callback: (Result) -> Unit) +{ if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -4687,27 +3945,24 @@ abstract class PigeonApiGeolocationPermissionsCallback( Result.success(Unit) return } - val pigeon_identifierArg = - pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.webview_flutter_android.GeolocationPermissionsCallback.pigeon_newInstance" + val channelName = "dev.flutter.pigeon.webview_flutter_android.GeolocationPermissionsCallback.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } + } /** * Represents a request for HTTP authentication. @@ -4715,45 +3970,38 @@ abstract class PigeonApiGeolocationPermissionsCallback( * See https://developer.android.com/reference/android/webkit/HttpAuthHandler. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiHttpAuthHandler( - open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar -) { +abstract class PigeonApiHttpAuthHandler(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { /** - * Gets whether the credentials stored for the current host (i.e. the host for which - * `WebViewClient.onReceivedHttpAuthRequest` was called) are suitable for use. + * Gets whether the credentials stored for the current host (i.e. the host + * for which `WebViewClient.onReceivedHttpAuthRequest` was called) are + * suitable for use. */ abstract fun useHttpAuthUsernamePassword(pigeon_instance: android.webkit.HttpAuthHandler): Boolean /** Instructs the WebView to cancel the authentication request.. */ abstract fun cancel(pigeon_instance: android.webkit.HttpAuthHandler) - /** Instructs the WebView to proceed with the authentication with the given credentials. */ - abstract fun proceed( - pigeon_instance: android.webkit.HttpAuthHandler, - username: String, - password: String - ) + /** + * Instructs the WebView to proceed with the authentication with the given + * credentials. + */ + abstract fun proceed(pigeon_instance: android.webkit.HttpAuthHandler, username: String, password: String) companion object { @Suppress("LocalVariableName") fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiHttpAuthHandler?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.HttpAuthHandler.useHttpAuthUsernamePassword", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.HttpAuthHandler.useHttpAuthUsernamePassword", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.HttpAuthHandler - val wrapped: List = - try { - listOf(api.useHttpAuthUsernamePassword(pigeon_instanceArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.useHttpAuthUsernamePassword(pigeon_instanceArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4761,22 +4009,17 @@ abstract class PigeonApiHttpAuthHandler( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.HttpAuthHandler.cancel", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.HttpAuthHandler.cancel", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.HttpAuthHandler - val wrapped: List = - try { - api.cancel(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.cancel(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4784,24 +4027,19 @@ abstract class PigeonApiHttpAuthHandler( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.HttpAuthHandler.proceed", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.HttpAuthHandler.proceed", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.HttpAuthHandler val usernameArg = args[1] as String val passwordArg = args[2] as String - val wrapped: List = - try { - api.proceed(pigeon_instanceArg, usernameArg, passwordArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.proceed(pigeon_instanceArg, usernameArg, passwordArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4813,10 +4051,8 @@ abstract class PigeonApiHttpAuthHandler( @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of HttpAuthHandler and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance( - pigeon_instanceArg: android.webkit.HttpAuthHandler, - callback: (Result) -> Unit - ) { + fun pigeon_newInstance(pigeon_instanceArg: android.webkit.HttpAuthHandler, callback: (Result) -> Unit) +{ if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -4827,25 +4063,22 @@ abstract class PigeonApiHttpAuthHandler( Result.success(Unit) return } - val pigeon_identifierArg = - pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.webview_flutter_android.HttpAuthHandler.pigeon_newInstance" + val channelName = "dev.flutter.pigeon.webview_flutter_android.HttpAuthHandler.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } + } diff --git a/packages/webview_flutter/webview_flutter_android/lib/src/android_webkit.g.dart b/packages/webview_flutter/webview_flutter_android/lib/src/android_webkit.g.dart index c18ee4e0c24..f3c6db856ba 100644 --- a/packages/webview_flutter/webview_flutter_android/lib/src/android_webkit.g.dart +++ b/packages/webview_flutter/webview_flutter_android/lib/src/android_webkit.g.dart @@ -1,15 +1,14 @@ // 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.5.0), do not edit directly. +// Autogenerated from Pigeon (v22.7.4), 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 import 'dart:async'; import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; -import 'package:flutter/foundation.dart' - show ReadBuffer, WriteBuffer, immutable, protected; +import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer, immutable, protected; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart' show WidgetsFlutterBinding; @@ -20,8 +19,7 @@ PlatformException _createConnectionError(String channelName) { ); } -List wrapResponse( - {Object? result, PlatformException? error, bool empty = false}) { +List wrapResponse({Object? result, PlatformException? error, bool empty = false}) { if (empty) { return []; } @@ -30,7 +28,6 @@ List wrapResponse( } return [error.code, error.message, error.details]; } - /// An immutable object that serves as the base class for all ProxyApis and /// can provide functional copies of itself. /// @@ -53,7 +50,6 @@ abstract class PigeonInternalProxyApiBaseClass { final BinaryMessenger? pigeon_binaryMessenger; /// Maintains instances stored to communicate with native language objects. - @protected final PigeonInstanceManager pigeon_instanceManager; /// Instantiates and returns a functionally identical object to oneself. @@ -114,10 +110,9 @@ class PigeonInstanceManager { // by calling instanceManager.getIdentifier() inside of `==` while this was a // HashMap). final Expando _identifiers = Expando(); - final Map> - _weakInstances = >{}; - final Map _strongInstances = - {}; + final Map> _weakInstances = + >{}; + final Map _strongInstances = {}; late final Finalizer _finalizer; int _nextIdentifier = 0; @@ -127,8 +122,7 @@ class PigeonInstanceManager { static PigeonInstanceManager _initInstance() { WidgetsFlutterBinding.ensureInitialized(); - final _PigeonInternalInstanceManagerApi api = - _PigeonInternalInstanceManagerApi(); + final _PigeonInternalInstanceManagerApi api = _PigeonInternalInstanceManagerApi(); // Clears the native `PigeonInstanceManager` on the initial use of the Dart one. api.clear(); final PigeonInstanceManager instanceManager = PigeonInstanceManager( @@ -136,49 +130,28 @@ class PigeonInstanceManager { api.removeStrongReference(identifier); }, ); - _PigeonInternalInstanceManagerApi.setUpMessageHandlers( - instanceManager: instanceManager); - WebResourceRequest.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - WebResourceResponse.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - WebResourceError.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - WebResourceErrorCompat.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - WebViewPoint.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - ConsoleMessage.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - CookieManager.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - WebView.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - WebSettings.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - JavaScriptChannel.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - WebViewClient.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - DownloadListener.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - WebChromeClient.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - FlutterAssetManager.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - WebStorage.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - FileChooserParams.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - PermissionRequest.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - CustomViewCallback.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); + _PigeonInternalInstanceManagerApi.setUpMessageHandlers(instanceManager: instanceManager); + WebResourceRequest.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + WebResourceResponse.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + WebResourceError.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + WebResourceErrorCompat.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + WebViewPoint.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + ConsoleMessage.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + CookieManager.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + WebView.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + WebSettings.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + JavaScriptChannel.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + WebViewClient.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + DownloadListener.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + WebChromeClient.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + FlutterAssetManager.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + WebStorage.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + FileChooserParams.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + PermissionRequest.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + CustomViewCallback.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); View.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - GeolocationPermissionsCallback.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - HttpAuthHandler.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); + GeolocationPermissionsCallback.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + HttpAuthHandler.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); return instanceManager; } @@ -242,20 +215,15 @@ class PigeonInstanceManager { /// /// This method also expects the host `InstanceManager` to have a strong /// reference to the instance the identifier is associated with. - T? getInstanceWithWeakReference( - int identifier) { - final PigeonInternalProxyApiBaseClass? weakInstance = - _weakInstances[identifier]?.target; + T? getInstanceWithWeakReference(int identifier) { + final PigeonInternalProxyApiBaseClass? weakInstance = _weakInstances[identifier]?.target; if (weakInstance == null) { - final PigeonInternalProxyApiBaseClass? strongInstance = - _strongInstances[identifier]; + final PigeonInternalProxyApiBaseClass? strongInstance = _strongInstances[identifier]; if (strongInstance != null) { - final PigeonInternalProxyApiBaseClass copy = - strongInstance.pigeon_copy(); + final PigeonInternalProxyApiBaseClass copy = strongInstance.pigeon_copy(); _identifiers[copy] = identifier; - _weakInstances[identifier] = - WeakReference(copy); + _weakInstances[identifier] = WeakReference(copy); _finalizer.attach(copy, identifier, detach: copy); return copy as T; } @@ -279,20 +247,17 @@ class PigeonInstanceManager { /// added. /// /// Returns unique identifier of the [instance] added. - void addHostCreatedInstance( - PigeonInternalProxyApiBaseClass instance, int identifier) { + void addHostCreatedInstance(PigeonInternalProxyApiBaseClass instance, int identifier) { _addInstanceWithIdentifier(instance, identifier); } - void _addInstanceWithIdentifier( - PigeonInternalProxyApiBaseClass instance, int identifier) { + void _addInstanceWithIdentifier(PigeonInternalProxyApiBaseClass instance, int identifier) { assert(!containsIdentifier(identifier)); assert(getIdentifier(instance) == null); assert(identifier >= 0); _identifiers[instance] = identifier; - _weakInstances[identifier] = - WeakReference(instance); + _weakInstances[identifier] = WeakReference(instance); _finalizer.attach(instance, identifier, detach: instance); final PigeonInternalProxyApiBaseClass copy = instance.pigeon_copy(); @@ -416,30 +381,30 @@ class _PigeonInternalInstanceManagerApi { } class _PigeonInternalProxyApiBaseCodec extends _PigeonCodec { - const _PigeonInternalProxyApiBaseCodec(this.instanceManager); - final PigeonInstanceManager instanceManager; - @override - void writeValue(WriteBuffer buffer, Object? value) { - if (value is PigeonInternalProxyApiBaseClass) { - buffer.putUint8(128); - writeValue(buffer, instanceManager.getIdentifier(value)); - } else { - super.writeValue(buffer, value); - } - } - - @override - Object? readValueOfType(int type, ReadBuffer buffer) { - switch (type) { - case 128: - return instanceManager - .getInstanceWithWeakReference(readValue(buffer)! as int); - default: - return super.readValueOfType(type, buffer); - } - } + const _PigeonInternalProxyApiBaseCodec(this.instanceManager); + final PigeonInstanceManager instanceManager; + @override + void writeValue(WriteBuffer buffer, Object? value) { + if (value is PigeonInternalProxyApiBaseClass) { + buffer.putUint8(128); + writeValue(buffer, instanceManager.getIdentifier(value)); + } else { + super.writeValue(buffer, value); + } + } + @override + Object? readValueOfType(int type, ReadBuffer buffer) { + switch (type) { + case 128: + return instanceManager + .getInstanceWithWeakReference(readValue(buffer)! as int); + default: + return super.readValueOfType(type, buffer); + } + } } + /// Mode of how to select files for a file chooser. /// /// See https://developer.android.com/reference/android/webkit/WebChromeClient.FileChooserParams. @@ -449,17 +414,14 @@ enum FileChooserMode { /// /// See https://developer.android.com/reference/android/webkit/WebChromeClient.FileChooserParams#MODE_OPEN. open, - /// Similar to [open] but allows multiple files to be selected. /// /// See https://developer.android.com/reference/android/webkit/WebChromeClient.FileChooserParams#MODE_OPEN_MULTIPLE. openMultiple, - /// Allows picking a nonexistent file and saving it. /// /// See https://developer.android.com/reference/android/webkit/WebChromeClient.FileChooserParams#MODE_SAVE. save, - /// Indicates a `FileChooserMode` with an unknown mode. /// /// This does not represent an actual value provided by the platform and only @@ -475,27 +437,22 @@ enum ConsoleMessageLevel { /// /// See https://developer.android.com/reference/android/webkit/ConsoleMessage.MessageLevel#DEBUG. debug, - /// Indicates a message is provided as an error. /// /// See https://developer.android.com/reference/android/webkit/ConsoleMessage.MessageLevel#ERROR. error, - /// Indicates a message is provided as a basic log message. /// /// See https://developer.android.com/reference/android/webkit/ConsoleMessage.MessageLevel#LOG. log, - /// Indicates a message is provided as a tip. /// /// See https://developer.android.com/reference/android/webkit/ConsoleMessage.MessageLevel#TIP. tip, - /// Indicates a message is provided as a warning. /// /// See https://developer.android.com/reference/android/webkit/ConsoleMessage.MessageLevel#WARNING. warning, - /// Indicates a message with an unknown level. /// /// This does not represent an actual value provided by the platform and only @@ -503,6 +460,7 @@ enum ConsoleMessageLevel { unknown, } + class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override @@ -510,10 +468,10 @@ class _PigeonCodec extends StandardMessageCodec { if (value is int) { buffer.putUint8(4); buffer.putInt64(value); - } else if (value is FileChooserMode) { + } else if (value is FileChooserMode) { buffer.putUint8(129); writeValue(buffer, value.index); - } else if (value is ConsoleMessageLevel) { + } else if (value is ConsoleMessageLevel) { buffer.putUint8(130); writeValue(buffer, value.index); } else { @@ -524,10 +482,10 @@ class _PigeonCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 129: + case 129: final int? value = readValue(buffer) as int?; return value == null ? null : FileChooserMode.values[value]; - case 130: + case 130: final int? value = readValue(buffer) as int?; return value == null ? null : ConsoleMessageLevel.values[value]; default: @@ -535,7 +493,6 @@ class _PigeonCodec extends StandardMessageCodec { } } } - /// Encompasses parameters to the `WebViewClient.shouldInterceptRequest` method. /// /// See https://developer.android.com/reference/android/webkit/WebResourceRequest. @@ -2170,62 +2127,6 @@ class WebView extends View { } } - /// Define whether the vertical scrollbar should be drawn or not. The default value is true. - Future verticalScrollBarEnabled(bool enabled) async { - final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = - _pigeonVar_codecWebView; - final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; - const String pigeonVar_channelName = - 'dev.flutter.pigeon.webview_flutter_android.WebView.verticalScrollBarEnabled'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( - pigeonVar_channelName, - pigeonChannelCodec, - binaryMessenger: pigeonVar_binaryMessenger, - ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([this, enabled]) 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; - } - } - - /// Define whether the horizontal scrollbar should be drawn or not. The default value is true. - Future horizontalScrollBarEnabled(bool enabled) async { - final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = - _pigeonVar_codecWebView; - final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; - const String pigeonVar_channelName = - 'dev.flutter.pigeon.webview_flutter_android.WebView.horizontalScrollBarEnabled'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( - pigeonVar_channelName, - pigeonChannelCodec, - binaryMessenger: pigeonVar_binaryMessenger, - ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([this, enabled]) 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; - } - } - /// Destroys the internal state of this WebView. Future destroy() async { final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = @@ -5974,6 +5875,66 @@ class View extends PigeonInternalProxyApiBaseClass { } } + /// Define whether the vertical scrollbar should be drawn or not. + /// + /// The scrollbar is not drawn by default. + Future setVerticalScrollBarEnabled(bool enabled) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_android.View.setVerticalScrollBarEnabled'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = await pigeonVar_channel + .send([this, enabled]) 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; + } + } + + /// Define whether the horizontal scrollbar should be drawn or not. + /// + /// The scrollbar is not drawn by default. + Future setHorizontalScrollBarEnabled(bool enabled) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_android.View.setHorizontalScrollBarEnabled'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = await pigeonVar_channel + .send([this, enabled]) 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 View pigeon_copy() { return View.pigeon_detached( @@ -6261,3 +6222,4 @@ class HttpAuthHandler extends PigeonInternalProxyApiBaseClass { ); } } + diff --git a/packages/webview_flutter/webview_flutter_android/lib/src/android_webview_controller.dart b/packages/webview_flutter/webview_flutter_android/lib/src/android_webview_controller.dart index c70acd7e13a..a3971f9be51 100644 --- a/packages/webview_flutter/webview_flutter_android/lib/src/android_webview_controller.dart +++ b/packages/webview_flutter/webview_flutter_android/lib/src/android_webview_controller.dart @@ -733,12 +733,12 @@ class AndroidWebViewController extends PlatformWebViewController { } @override - Future verticalScrollBarEnabled(bool enabled) => - _webView.verticalScrollBarEnabled(enabled); + Future setVerticalScrollBarEnabled(bool enabled) => + _webView.setVerticalScrollBarEnabled(enabled); @override - Future horizontalScrollBarEnabled(bool enabled) => - _webView.horizontalScrollBarEnabled(enabled); + Future setHorizontalScrollBarEnabled(bool enabled) => + _webView.setHorizontalScrollBarEnabled(enabled); } /// Android implementation of [PlatformWebViewPermissionRequest]. diff --git a/packages/webview_flutter/webview_flutter_android/pigeons/android_webkit.dart b/packages/webview_flutter/webview_flutter_android/pigeons/android_webkit.dart index 8d3a4dbed5c..ef2d2b3a373 100644 --- a/packages/webview_flutter/webview_flutter_android/pigeons/android_webkit.dart +++ b/packages/webview_flutter/webview_flutter_android/pigeons/android_webkit.dart @@ -763,6 +763,16 @@ abstract class View { /// Return the scrolled position of this view. WebViewPoint getScrollPosition(); + + /// Define whether the vertical scrollbar should be drawn or not. + /// + /// The scrollbar is not drawn by default. + void setVerticalScrollBarEnabled(bool enabled); + + /// Define whether the horizontal scrollbar should be drawn or not. + /// + /// The scrollbar is not drawn by default. + void setHorizontalScrollBarEnabled(bool enabled); } /// A callback interface used by the host application to set the Geolocation diff --git a/packages/webview_flutter/webview_flutter_android/test/android_navigation_delegate_test.mocks.dart b/packages/webview_flutter/webview_flutter_android/test/android_navigation_delegate_test.mocks.dart index efe2191cc97..52363b1bd59 100644 --- a/packages/webview_flutter/webview_flutter_android/test/android_navigation_delegate_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_android/test/android_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_android/test/android_navigation_delegate_test.dart. // Do not manually edit this file. @@ -16,6 +16,7 @@ import 'package:webview_flutter_android/src/android_webkit.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_android/src/android_webkit.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 _FakeHttpAuthHandler_1 extends _i1.SmartFake implements _i2.HttpAuthHandler { - _FakeHttpAuthHandler_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeHttpAuthHandler_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeDownloadListener_2 extends _i1.SmartFake implements _i2.DownloadListener { - _FakeDownloadListener_2( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeDownloadListener_2(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [HttpAuthHandler]. @@ -63,64 +49,52 @@ class MockHttpAuthHandler extends _i1.Mock implements _i2.HttpAuthHandler { } @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 useHttpAuthUsernamePassword() => (super.noSuchMethod( - Invocation.method( - #useHttpAuthUsernamePassword, - [], - ), - returnValue: _i3.Future.value(false), - ) as _i3.Future); + _i3.Future useHttpAuthUsernamePassword() => + (super.noSuchMethod( + Invocation.method(#useHttpAuthUsernamePassword, []), + returnValue: _i3.Future.value(false), + ) + as _i3.Future); @override - _i3.Future cancel() => (super.noSuchMethod( - Invocation.method( - #cancel, - [], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + _i3.Future cancel() => + (super.noSuchMethod( + Invocation.method(#cancel, []), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override - _i3.Future proceed( - String? username, - String? password, - ) => + _i3.Future proceed(String? username, String? password) => (super.noSuchMethod( - Invocation.method( - #proceed, - [ - username, - password, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#proceed, [username, password]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override - _i2.HttpAuthHandler pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeHttpAuthHandler_1( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.HttpAuthHandler); + _i2.HttpAuthHandler pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeHttpAuthHandler_1( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.HttpAuthHandler); } /// A class which mocks [DownloadListener]. @@ -132,53 +106,48 @@ class MockDownloadListener extends _i1.Mock implements _i2.DownloadListener { } @override - void Function( - _i2.DownloadListener, - String, - String, - String, - String, - int, - ) get onDownloadStart => (super.noSuchMethod( - Invocation.getter(#onDownloadStart), - returnValue: ( - _i2.DownloadListener pigeon_instance, - String url, - String userAgent, - String contentDisposition, - String mimetype, - int contentLength, - ) {}, - ) as void Function( - _i2.DownloadListener, - String, - String, - String, - String, - int, - )); + void Function(_i2.DownloadListener, String, String, String, String, int) + get onDownloadStart => + (super.noSuchMethod( + Invocation.getter(#onDownloadStart), + returnValue: + ( + _i2.DownloadListener pigeon_instance, + String url, + String userAgent, + String contentDisposition, + String mimetype, + int contentLength, + ) {}, + ) + as void Function( + _i2.DownloadListener, + String, + String, + String, + String, + int, + )); @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.DownloadListener pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeDownloadListener_2( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.DownloadListener); + _i2.DownloadListener pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeDownloadListener_2( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.DownloadListener); } diff --git a/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.dart b/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.dart index 0a72369f56d..9a58ee00101 100644 --- a/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.dart +++ b/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.dart @@ -1407,9 +1407,9 @@ void main() { mockWebView: mockWebView, ); - await controller.verticalScrollBarEnabled(false); + await controller.setVerticalScrollBarEnabled(false); - verify(mockWebView.verticalScrollBarEnabled(false)).called(1); + verify(mockWebView.setVerticalScrollBarEnabled(false)).called(1); }); test('horizontalScrollBarEnabled', () async { @@ -1418,9 +1418,9 @@ void main() { mockWebView: mockWebView, ); - await controller.horizontalScrollBarEnabled(false); + await controller.setHorizontalScrollBarEnabled(false); - verify(mockWebView.horizontalScrollBarEnabled(false)).called(1); + verify(mockWebView.setHorizontalScrollBarEnabled(false)).called(1); }); test('getScrollPosition', () async { diff --git a/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.mocks.dart b/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.mocks.dart index e6994213f7e..e051b20ddc7 100644 --- a/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_android/test/android_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_android/test/android_webview_controller_test.dart. // Do not manually edit this file. @@ -29,6 +29,7 @@ import 'package:webview_flutter_platform_interface/webview_flutter_platform_inte // 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 @@ -36,34 +37,19 @@ import 'package:webview_flutter_platform_interface/webview_flutter_platform_inte class _FakeWebChromeClient_0 extends _i1.SmartFake implements _i2.WebChromeClient { - _FakeWebChromeClient_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWebChromeClient_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeWebViewClient_1 extends _i1.SmartFake implements _i2.WebViewClient { - _FakeWebViewClient_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWebViewClient_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeDownloadListener_2 extends _i1.SmartFake implements _i2.DownloadListener { - _FakeDownloadListener_2( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeDownloadListener_2(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakePlatformNavigationDelegateCreationParams_3 extends _i1.SmartFake @@ -71,10 +57,7 @@ class _FakePlatformNavigationDelegateCreationParams_3 extends _i1.SmartFake _FakePlatformNavigationDelegateCreationParams_3( Object parent, Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + ) : super(parent, parentInvocation); } class _FakePlatformWebViewControllerCreationParams_4 extends _i1.SmartFake @@ -82,125 +65,67 @@ class _FakePlatformWebViewControllerCreationParams_4 extends _i1.SmartFake _FakePlatformWebViewControllerCreationParams_4( Object parent, Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + ) : super(parent, parentInvocation); } class _FakeObject_5 extends _i1.SmartFake implements Object { - _FakeObject_5( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeObject_5(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeOffset_6 extends _i1.SmartFake implements _i4.Offset { - _FakeOffset_6( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeOffset_6(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeWebView_7 extends _i1.SmartFake implements _i2.WebView { - _FakeWebView_7( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWebView_7(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeJavaScriptChannel_8 extends _i1.SmartFake implements _i2.JavaScriptChannel { - _FakeJavaScriptChannel_8( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeJavaScriptChannel_8(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeCookieManager_9 extends _i1.SmartFake implements _i2.CookieManager { - _FakeCookieManager_9( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeCookieManager_9(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeFlutterAssetManager_10 extends _i1.SmartFake implements _i2.FlutterAssetManager { - _FakeFlutterAssetManager_10( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeFlutterAssetManager_10(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeWebStorage_11 extends _i1.SmartFake implements _i2.WebStorage { - _FakeWebStorage_11( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWebStorage_11(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakePigeonInstanceManager_12 extends _i1.SmartFake implements _i2.PigeonInstanceManager { - _FakePigeonInstanceManager_12( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakePigeonInstanceManager_12(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakePlatformViewsServiceProxy_13 extends _i1.SmartFake implements _i5.PlatformViewsServiceProxy { - _FakePlatformViewsServiceProxy_13( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakePlatformViewsServiceProxy_13(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakePlatformWebViewController_14 extends _i1.SmartFake implements _i3.PlatformWebViewController { - _FakePlatformWebViewController_14( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakePlatformWebViewController_14(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeSize_15 extends _i1.SmartFake implements _i4.Size { - _FakeSize_15( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeSize_15(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeGeolocationPermissionsCallback_16 extends _i1.SmartFake @@ -208,21 +133,13 @@ class _FakeGeolocationPermissionsCallback_16 extends _i1.SmartFake _FakeGeolocationPermissionsCallback_16( Object parent, Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + ) : super(parent, parentInvocation); } class _FakePermissionRequest_17 extends _i1.SmartFake implements _i2.PermissionRequest { - _FakePermissionRequest_17( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakePermissionRequest_17(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeExpensiveAndroidViewController_18 extends _i1.SmartFake @@ -230,10 +147,7 @@ class _FakeExpensiveAndroidViewController_18 extends _i1.SmartFake _FakeExpensiveAndroidViewController_18( Object parent, Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + ) : super(parent, parentInvocation); } class _FakeSurfaceAndroidViewController_19 extends _i1.SmartFake @@ -241,30 +155,17 @@ class _FakeSurfaceAndroidViewController_19 extends _i1.SmartFake _FakeSurfaceAndroidViewController_19( Object parent, Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + ) : super(parent, parentInvocation); } class _FakeWebSettings_20 extends _i1.SmartFake implements _i2.WebSettings { - _FakeWebSettings_20( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWebSettings_20(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeWebViewPoint_21 extends _i1.SmartFake implements _i2.WebViewPoint { - _FakeWebViewPoint_21( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWebViewPoint_21(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [AndroidNavigationDelegate]. @@ -273,160 +174,152 @@ class _FakeWebViewPoint_21 extends _i1.SmartFake implements _i2.WebViewPoint { class MockAndroidNavigationDelegate extends _i1.Mock implements _i7.AndroidNavigationDelegate { @override - _i2.WebChromeClient get androidWebChromeClient => (super.noSuchMethod( - Invocation.getter(#androidWebChromeClient), - returnValue: _FakeWebChromeClient_0( - this, - Invocation.getter(#androidWebChromeClient), - ), - returnValueForMissingStub: _FakeWebChromeClient_0( - this, - Invocation.getter(#androidWebChromeClient), - ), - ) as _i2.WebChromeClient); - - @override - _i2.WebViewClient get androidWebViewClient => (super.noSuchMethod( - Invocation.getter(#androidWebViewClient), - returnValue: _FakeWebViewClient_1( - this, - Invocation.getter(#androidWebViewClient), - ), - returnValueForMissingStub: _FakeWebViewClient_1( - this, - Invocation.getter(#androidWebViewClient), - ), - ) as _i2.WebViewClient); - - @override - _i2.DownloadListener get androidDownloadListener => (super.noSuchMethod( - Invocation.getter(#androidDownloadListener), - returnValue: _FakeDownloadListener_2( - this, - Invocation.getter(#androidDownloadListener), - ), - returnValueForMissingStub: _FakeDownloadListener_2( - this, - Invocation.getter(#androidDownloadListener), - ), - ) as _i2.DownloadListener); + _i2.WebChromeClient get androidWebChromeClient => + (super.noSuchMethod( + Invocation.getter(#androidWebChromeClient), + returnValue: _FakeWebChromeClient_0( + this, + Invocation.getter(#androidWebChromeClient), + ), + returnValueForMissingStub: _FakeWebChromeClient_0( + this, + Invocation.getter(#androidWebChromeClient), + ), + ) + as _i2.WebChromeClient); + + @override + _i2.WebViewClient get androidWebViewClient => + (super.noSuchMethod( + Invocation.getter(#androidWebViewClient), + returnValue: _FakeWebViewClient_1( + this, + Invocation.getter(#androidWebViewClient), + ), + returnValueForMissingStub: _FakeWebViewClient_1( + this, + Invocation.getter(#androidWebViewClient), + ), + ) + as _i2.WebViewClient); + + @override + _i2.DownloadListener get androidDownloadListener => + (super.noSuchMethod( + Invocation.getter(#androidDownloadListener), + returnValue: _FakeDownloadListener_2( + this, + Invocation.getter(#androidDownloadListener), + ), + returnValueForMissingStub: _FakeDownloadListener_2( + this, + Invocation.getter(#androidDownloadListener), + ), + ) + as _i2.DownloadListener); @override _i3.PlatformNavigationDelegateCreationParams get params => (super.noSuchMethod( - Invocation.getter(#params), - returnValue: _FakePlatformNavigationDelegateCreationParams_3( - this, - Invocation.getter(#params), - ), - returnValueForMissingStub: - _FakePlatformNavigationDelegateCreationParams_3( - this, - Invocation.getter(#params), - ), - ) as _i3.PlatformNavigationDelegateCreationParams); + Invocation.getter(#params), + returnValue: _FakePlatformNavigationDelegateCreationParams_3( + this, + Invocation.getter(#params), + ), + returnValueForMissingStub: + _FakePlatformNavigationDelegateCreationParams_3( + this, + Invocation.getter(#params), + ), + ) + as _i3.PlatformNavigationDelegateCreationParams); @override _i8.Future setOnLoadRequest(_i7.LoadRequestCallback? onLoadRequest) => (super.noSuchMethod( - Invocation.method( - #setOnLoadRequest, - [onLoadRequest], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setOnLoadRequest, [onLoadRequest]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setOnNavigationRequest( - _i3.NavigationRequestCallback? onNavigationRequest) => + _i3.NavigationRequestCallback? onNavigationRequest, + ) => (super.noSuchMethod( - Invocation.method( - #setOnNavigationRequest, - [onNavigationRequest], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setOnNavigationRequest, [onNavigationRequest]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setOnPageStarted(_i3.PageEventCallback? onPageStarted) => (super.noSuchMethod( - Invocation.method( - #setOnPageStarted, - [onPageStarted], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setOnPageStarted, [onPageStarted]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setOnPageFinished(_i3.PageEventCallback? onPageFinished) => (super.noSuchMethod( - Invocation.method( - #setOnPageFinished, - [onPageFinished], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setOnPageFinished, [onPageFinished]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setOnHttpError(_i3.HttpResponseErrorCallback? onHttpError) => (super.noSuchMethod( - Invocation.method( - #setOnHttpError, - [onHttpError], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setOnHttpError, [onHttpError]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setOnProgress(_i3.ProgressCallback? onProgress) => (super.noSuchMethod( - Invocation.method( - #setOnProgress, - [onProgress], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setOnProgress, [onProgress]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setOnWebResourceError( - _i3.WebResourceErrorCallback? onWebResourceError) => + _i3.WebResourceErrorCallback? onWebResourceError, + ) => (super.noSuchMethod( - Invocation.method( - #setOnWebResourceError, - [onWebResourceError], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setOnWebResourceError, [onWebResourceError]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setOnUrlChange(_i3.UrlChangeCallback? onUrlChange) => (super.noSuchMethod( - Invocation.method( - #setOnUrlChange, - [onUrlChange], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setOnUrlChange, [onUrlChange]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setOnHttpAuthRequest( - _i3.HttpAuthRequestCallback? onHttpAuthRequest) => - (super.noSuchMethod( - Invocation.method( - #setOnHttpAuthRequest, - [onHttpAuthRequest], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i3.HttpAuthRequestCallback? onHttpAuthRequest, + ) => + (super.noSuchMethod( + Invocation.method(#setOnHttpAuthRequest, [onHttpAuthRequest]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); } /// A class which mocks [AndroidWebViewController]. @@ -435,415 +328,357 @@ class MockAndroidNavigationDelegate extends _i1.Mock class MockAndroidWebViewController extends _i1.Mock implements _i7.AndroidWebViewController { @override - int get webViewIdentifier => (super.noSuchMethod( - Invocation.getter(#webViewIdentifier), - returnValue: 0, - returnValueForMissingStub: 0, - ) as int); - - @override - _i3.PlatformWebViewControllerCreationParams get params => (super.noSuchMethod( - Invocation.getter(#params), - returnValue: _FakePlatformWebViewControllerCreationParams_4( - this, - Invocation.getter(#params), - ), - returnValueForMissingStub: - _FakePlatformWebViewControllerCreationParams_4( - this, - Invocation.getter(#params), - ), - ) as _i3.PlatformWebViewControllerCreationParams); - - @override - _i8.Future setAllowFileAccess(bool? allow) => (super.noSuchMethod( - Invocation.method( - #setAllowFileAccess, - [allow], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i8.Future loadFile(String? absoluteFilePath) => (super.noSuchMethod( - Invocation.method( - #loadFile, - [absoluteFilePath], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i8.Future loadFlutterAsset(String? key) => (super.noSuchMethod( - Invocation.method( - #loadFlutterAsset, - [key], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i8.Future loadHtmlString( - String? html, { - String? baseUrl, - }) => + int get webViewIdentifier => (super.noSuchMethod( - Invocation.method( - #loadHtmlString, - [html], - {#baseUrl: baseUrl}, - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.getter(#webViewIdentifier), + returnValue: 0, + returnValueForMissingStub: 0, + ) + as int); + + @override + _i3.PlatformWebViewControllerCreationParams get params => + (super.noSuchMethod( + Invocation.getter(#params), + returnValue: _FakePlatformWebViewControllerCreationParams_4( + this, + Invocation.getter(#params), + ), + returnValueForMissingStub: + _FakePlatformWebViewControllerCreationParams_4( + this, + Invocation.getter(#params), + ), + ) + as _i3.PlatformWebViewControllerCreationParams); + + @override + _i8.Future setAllowFileAccess(bool? allow) => + (super.noSuchMethod( + Invocation.method(#setAllowFileAccess, [allow]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i8.Future loadFile(String? absoluteFilePath) => + (super.noSuchMethod( + Invocation.method(#loadFile, [absoluteFilePath]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i8.Future loadFlutterAsset(String? key) => + (super.noSuchMethod( + Invocation.method(#loadFlutterAsset, [key]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i8.Future loadHtmlString(String? html, {String? baseUrl}) => + (super.noSuchMethod( + Invocation.method(#loadHtmlString, [html], {#baseUrl: baseUrl}), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future loadRequest(_i3.LoadRequestParams? params) => (super.noSuchMethod( - Invocation.method( - #loadRequest, - [params], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i8.Future currentUrl() => (super.noSuchMethod( - Invocation.method( - #currentUrl, - [], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i8.Future canGoBack() => (super.noSuchMethod( - Invocation.method( - #canGoBack, - [], - ), - returnValue: _i8.Future.value(false), - returnValueForMissingStub: _i8.Future.value(false), - ) as _i8.Future); - - @override - _i8.Future canGoForward() => (super.noSuchMethod( - Invocation.method( - #canGoForward, - [], - ), - returnValue: _i8.Future.value(false), - returnValueForMissingStub: _i8.Future.value(false), - ) as _i8.Future); - - @override - _i8.Future goBack() => (super.noSuchMethod( - Invocation.method( - #goBack, - [], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i8.Future goForward() => (super.noSuchMethod( - Invocation.method( - #goForward, - [], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i8.Future reload() => (super.noSuchMethod( - Invocation.method( - #reload, - [], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i8.Future clearCache() => (super.noSuchMethod( - Invocation.method( - #clearCache, - [], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i8.Future clearLocalStorage() => (super.noSuchMethod( - Invocation.method( - #clearLocalStorage, - [], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#loadRequest, [params]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i8.Future currentUrl() => + (super.noSuchMethod( + Invocation.method(#currentUrl, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i8.Future canGoBack() => + (super.noSuchMethod( + Invocation.method(#canGoBack, []), + returnValue: _i8.Future.value(false), + returnValueForMissingStub: _i8.Future.value(false), + ) + as _i8.Future); + + @override + _i8.Future canGoForward() => + (super.noSuchMethod( + Invocation.method(#canGoForward, []), + returnValue: _i8.Future.value(false), + returnValueForMissingStub: _i8.Future.value(false), + ) + as _i8.Future); + + @override + _i8.Future goBack() => + (super.noSuchMethod( + Invocation.method(#goBack, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i8.Future goForward() => + (super.noSuchMethod( + Invocation.method(#goForward, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i8.Future reload() => + (super.noSuchMethod( + Invocation.method(#reload, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i8.Future clearCache() => + (super.noSuchMethod( + Invocation.method(#clearCache, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i8.Future clearLocalStorage() => + (super.noSuchMethod( + Invocation.method(#clearLocalStorage, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setPlatformNavigationDelegate( - _i3.PlatformNavigationDelegate? handler) => + _i3.PlatformNavigationDelegate? handler, + ) => (super.noSuchMethod( - Invocation.method( - #setPlatformNavigationDelegate, - [handler], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setPlatformNavigationDelegate, [handler]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future runJavaScript(String? javaScript) => (super.noSuchMethod( - Invocation.method( - #runJavaScript, - [javaScript], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future runJavaScript(String? javaScript) => + (super.noSuchMethod( + Invocation.method(#runJavaScript, [javaScript]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future runJavaScriptReturningResult(String? javaScript) => (super.noSuchMethod( - Invocation.method( - #runJavaScriptReturningResult, - [javaScript], - ), - returnValue: _i8.Future.value(_FakeObject_5( - this, - Invocation.method( - #runJavaScriptReturningResult, - [javaScript], - ), - )), - returnValueForMissingStub: _i8.Future.value(_FakeObject_5( - this, - Invocation.method( - #runJavaScriptReturningResult, - [javaScript], - ), - )), - ) as _i8.Future); + Invocation.method(#runJavaScriptReturningResult, [javaScript]), + returnValue: _i8.Future.value( + _FakeObject_5( + this, + Invocation.method(#runJavaScriptReturningResult, [javaScript]), + ), + ), + returnValueForMissingStub: _i8.Future.value( + _FakeObject_5( + this, + Invocation.method(#runJavaScriptReturningResult, [javaScript]), + ), + ), + ) + as _i8.Future); @override _i8.Future addJavaScriptChannel( - _i3.JavaScriptChannelParams? javaScriptChannelParams) => + _i3.JavaScriptChannelParams? javaScriptChannelParams, + ) => (super.noSuchMethod( - Invocation.method( - #addJavaScriptChannel, - [javaScriptChannelParams], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#addJavaScriptChannel, [javaScriptChannelParams]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future removeJavaScriptChannel(String? javaScriptChannelName) => (super.noSuchMethod( - Invocation.method( - #removeJavaScriptChannel, - [javaScriptChannelName], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#removeJavaScriptChannel, [ + javaScriptChannelName, + ]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future getTitle() => (super.noSuchMethod( - Invocation.method( - #getTitle, - [], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future getTitle() => + (super.noSuchMethod( + Invocation.method(#getTitle, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future scrollTo( - int? x, - int? y, - ) => + _i8.Future scrollTo(int? x, int? y) => (super.noSuchMethod( - Invocation.method( - #scrollTo, - [ - x, - y, - ], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i8.Future scrollBy( - int? x, - int? y, - ) => + Invocation.method(#scrollTo, [x, y]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i8.Future scrollBy(int? x, int? y) => (super.noSuchMethod( - Invocation.method( - #scrollBy, - [ - x, - y, - ], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i8.Future<_i4.Offset> getScrollPosition() => (super.noSuchMethod( - Invocation.method( - #getScrollPosition, - [], - ), - returnValue: _i8.Future<_i4.Offset>.value(_FakeOffset_6( - this, - Invocation.method( - #getScrollPosition, - [], - ), - )), - returnValueForMissingStub: _i8.Future<_i4.Offset>.value(_FakeOffset_6( - this, - Invocation.method( - #getScrollPosition, - [], - ), - )), - ) as _i8.Future<_i4.Offset>); - - @override - _i8.Future enableZoom(bool? enabled) => (super.noSuchMethod( - Invocation.method( - #enableZoom, - [enabled], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i8.Future setBackgroundColor(_i4.Color? color) => (super.noSuchMethod( - Invocation.method( - #setBackgroundColor, - [color], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#scrollBy, [x, y]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i8.Future<_i4.Offset> getScrollPosition() => + (super.noSuchMethod( + Invocation.method(#getScrollPosition, []), + returnValue: _i8.Future<_i4.Offset>.value( + _FakeOffset_6(this, Invocation.method(#getScrollPosition, [])), + ), + returnValueForMissingStub: _i8.Future<_i4.Offset>.value( + _FakeOffset_6(this, Invocation.method(#getScrollPosition, [])), + ), + ) + as _i8.Future<_i4.Offset>); + + @override + _i8.Future enableZoom(bool? enabled) => + (super.noSuchMethod( + Invocation.method(#enableZoom, [enabled]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i8.Future setBackgroundColor(_i4.Color? color) => + (super.noSuchMethod( + Invocation.method(#setBackgroundColor, [color]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setJavaScriptMode(_i3.JavaScriptMode? javaScriptMode) => (super.noSuchMethod( - Invocation.method( - #setJavaScriptMode, - [javaScriptMode], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setJavaScriptMode, [javaScriptMode]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future setUserAgent(String? userAgent) => (super.noSuchMethod( - Invocation.method( - #setUserAgent, - [userAgent], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future setUserAgent(String? userAgent) => + (super.noSuchMethod( + Invocation.method(#setUserAgent, [userAgent]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setOnScrollPositionChange( - void Function(_i3.ScrollPositionChange)? onScrollPositionChange) => + void Function(_i3.ScrollPositionChange)? onScrollPositionChange, + ) => (super.noSuchMethod( - Invocation.method( - #setOnScrollPositionChange, - [onScrollPositionChange], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setOnScrollPositionChange, [ + onScrollPositionChange, + ]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setMediaPlaybackRequiresUserGesture(bool? require) => (super.noSuchMethod( - Invocation.method( - #setMediaPlaybackRequiresUserGesture, - [require], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i8.Future setTextZoom(int? textZoom) => (super.noSuchMethod( - Invocation.method( - #setTextZoom, - [textZoom], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i8.Future setAllowContentAccess(bool? enabled) => (super.noSuchMethod( - Invocation.method( - #setAllowContentAccess, - [enabled], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i8.Future setGeolocationEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method( - #setGeolocationEnabled, - [enabled], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setMediaPlaybackRequiresUserGesture, [require]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i8.Future setTextZoom(int? textZoom) => + (super.noSuchMethod( + Invocation.method(#setTextZoom, [textZoom]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i8.Future setAllowContentAccess(bool? enabled) => + (super.noSuchMethod( + Invocation.method(#setAllowContentAccess, [enabled]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i8.Future setGeolocationEnabled(bool? enabled) => + (super.noSuchMethod( + Invocation.method(#setGeolocationEnabled, [enabled]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setOnShowFileSelector( - _i8.Future> Function(_i7.FileSelectorParams)? - onShowFileSelector) => + _i8.Future> Function(_i7.FileSelectorParams)? + onShowFileSelector, + ) => (super.noSuchMethod( - Invocation.method( - #setOnShowFileSelector, - [onShowFileSelector], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setOnShowFileSelector, [onShowFileSelector]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setOnPlatformPermissionRequest( - void Function(_i3.PlatformWebViewPermissionRequest)? - onPermissionRequest) => + void Function(_i3.PlatformWebViewPermissionRequest)? onPermissionRequest, + ) => (super.noSuchMethod( - Invocation.method( - #setOnPlatformPermissionRequest, - [onPermissionRequest], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setOnPlatformPermissionRequest, [ + onPermissionRequest, + ]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setGeolocationPermissionsPromptCallbacks({ @@ -851,17 +686,14 @@ class MockAndroidWebViewController extends _i1.Mock _i7.OnGeolocationPermissionsHidePrompt? onHidePrompt, }) => (super.noSuchMethod( - Invocation.method( - #setGeolocationPermissionsPromptCallbacks, - [], - { - #onShowPrompt: onShowPrompt, - #onHidePrompt: onHidePrompt, - }, - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setGeolocationPermissionsPromptCallbacks, [], { + #onShowPrompt: onShowPrompt, + #onHidePrompt: onHidePrompt, + }), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setCustomWidgetCallbacks({ @@ -869,100 +701,94 @@ class MockAndroidWebViewController extends _i1.Mock required _i7.OnHideCustomWidgetCallback? onHideCustomWidget, }) => (super.noSuchMethod( - Invocation.method( - #setCustomWidgetCallbacks, - [], - { - #onShowCustomWidget: onShowCustomWidget, - #onHideCustomWidget: onHideCustomWidget, - }, - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setCustomWidgetCallbacks, [], { + #onShowCustomWidget: onShowCustomWidget, + #onHideCustomWidget: onHideCustomWidget, + }), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setOnConsoleMessage( - void Function(_i3.JavaScriptConsoleMessage)? onConsoleMessage) => + void Function(_i3.JavaScriptConsoleMessage)? onConsoleMessage, + ) => (super.noSuchMethod( - Invocation.method( - #setOnConsoleMessage, - [onConsoleMessage], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setOnConsoleMessage, [onConsoleMessage]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future getUserAgent() => (super.noSuchMethod( - Invocation.method( - #getUserAgent, - [], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future getUserAgent() => + (super.noSuchMethod( + Invocation.method(#getUserAgent, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setOnJavaScriptAlertDialog( - _i8.Future Function(_i3.JavaScriptAlertDialogRequest)? - onJavaScriptAlertDialog) => + _i8.Future Function(_i3.JavaScriptAlertDialogRequest)? + onJavaScriptAlertDialog, + ) => (super.noSuchMethod( - Invocation.method( - #setOnJavaScriptAlertDialog, - [onJavaScriptAlertDialog], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setOnJavaScriptAlertDialog, [ + onJavaScriptAlertDialog, + ]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setOnJavaScriptConfirmDialog( - _i8.Future Function(_i3.JavaScriptConfirmDialogRequest)? - onJavaScriptConfirmDialog) => + _i8.Future Function(_i3.JavaScriptConfirmDialogRequest)? + onJavaScriptConfirmDialog, + ) => (super.noSuchMethod( - Invocation.method( - #setOnJavaScriptConfirmDialog, - [onJavaScriptConfirmDialog], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setOnJavaScriptConfirmDialog, [ + onJavaScriptConfirmDialog, + ]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setOnJavaScriptTextInputDialog( - _i8.Future Function(_i3.JavaScriptTextInputDialogRequest)? - onJavaScriptTextInputDialog) => - (super.noSuchMethod( - Invocation.method( - #setOnJavaScriptTextInputDialog, - [onJavaScriptTextInputDialog], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i8.Future verticalScrollBarEnabled(bool? enabled) => - (super.noSuchMethod( - Invocation.method( - #verticalScrollBarEnabled, - [enabled], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i8.Future horizontalScrollBarEnabled(bool? enabled) => - (super.noSuchMethod( - Invocation.method( - #horizontalScrollBarEnabled, - [enabled], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future Function(_i3.JavaScriptTextInputDialogRequest)? + onJavaScriptTextInputDialog, + ) => + (super.noSuchMethod( + Invocation.method(#setOnJavaScriptTextInputDialog, [ + onJavaScriptTextInputDialog, + ]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i8.Future setVerticalScrollBarEnabled(bool? enabled) => + (super.noSuchMethod( + Invocation.method(#setVerticalScrollBarEnabled, [enabled]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i8.Future setHorizontalScrollBarEnabled(bool? enabled) => + (super.noSuchMethod( + Invocation.method(#setHorizontalScrollBarEnabled, [enabled]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); } /// A class which mocks [AndroidWebViewProxy]. @@ -971,649 +797,583 @@ class MockAndroidWebViewController extends _i1.Mock class MockAndroidWebViewProxy extends _i1.Mock implements _i9.AndroidWebViewProxy { @override - _i2.WebView Function( - {void Function( - _i2.WebView, - int, - int, - int, - int, - )? onScrollChanged}) get newWebView => (super.noSuchMethod( - Invocation.getter(#newWebView), - returnValue: ( - {void Function( - _i2.WebView, - int, - int, - int, - int, - )? onScrollChanged}) => - _FakeWebView_7( - this, - Invocation.getter(#newWebView), - ), - returnValueForMissingStub: ( - {void Function( - _i2.WebView, - int, - int, - int, - int, - )? onScrollChanged}) => - _FakeWebView_7( - this, - Invocation.getter(#newWebView), - ), - ) as _i2.WebView Function( - {void Function( - _i2.WebView, - int, - int, - int, - int, - )? onScrollChanged})); + _i2.WebView Function({ + void Function(_i2.WebView, int, int, int, int)? onScrollChanged, + }) + get newWebView => + (super.noSuchMethod( + Invocation.getter(#newWebView), + returnValue: + ({ + void Function(_i2.WebView, int, int, int, int)? + onScrollChanged, + }) => _FakeWebView_7(this, Invocation.getter(#newWebView)), + returnValueForMissingStub: + ({ + void Function(_i2.WebView, int, int, int, int)? + onScrollChanged, + }) => _FakeWebView_7(this, Invocation.getter(#newWebView)), + ) + as _i2.WebView Function({ + void Function(_i2.WebView, int, int, int, int)? onScrollChanged, + })); @override _i2.JavaScriptChannel Function({ required String channelName, - required void Function( - _i2.JavaScriptChannel, - String, - ) postMessage, - }) get newJavaScriptChannel => (super.noSuchMethod( - Invocation.getter(#newJavaScriptChannel), - returnValue: ({ - required String channelName, - required void Function( - _i2.JavaScriptChannel, - String, - ) postMessage, - }) => - _FakeJavaScriptChannel_8( - this, - Invocation.getter(#newJavaScriptChannel), - ), - returnValueForMissingStub: ({ - required String channelName, - required void Function( - _i2.JavaScriptChannel, - String, - ) postMessage, - }) => - _FakeJavaScriptChannel_8( - this, - Invocation.getter(#newJavaScriptChannel), - ), - ) as _i2.JavaScriptChannel Function({ - required String channelName, - required void Function( - _i2.JavaScriptChannel, - String, - ) postMessage, - })); + required void Function(_i2.JavaScriptChannel, String) postMessage, + }) + get newJavaScriptChannel => + (super.noSuchMethod( + Invocation.getter(#newJavaScriptChannel), + returnValue: + ({ + required String channelName, + required void Function(_i2.JavaScriptChannel, String) + postMessage, + }) => _FakeJavaScriptChannel_8( + this, + Invocation.getter(#newJavaScriptChannel), + ), + returnValueForMissingStub: + ({ + required String channelName, + required void Function(_i2.JavaScriptChannel, String) + postMessage, + }) => _FakeJavaScriptChannel_8( + this, + Invocation.getter(#newJavaScriptChannel), + ), + ) + as _i2.JavaScriptChannel Function({ + required String channelName, + required void Function(_i2.JavaScriptChannel, String) postMessage, + })); @override _i2.WebViewClient Function({ - void Function( - _i2.WebViewClient, - _i2.WebView, - String, - bool, - )? doUpdateVisitedHistory, - void Function( - _i2.WebViewClient, - _i2.WebView, - String, - )? onPageFinished, - void Function( - _i2.WebViewClient, - _i2.WebView, - String, - )? onPageStarted, - void Function( - _i2.WebViewClient, - _i2.WebView, - int, - String, - String, - )? onReceivedError, + void Function(_i2.WebViewClient, _i2.WebView, String, bool)? + doUpdateVisitedHistory, + void Function(_i2.WebViewClient, _i2.WebView, String)? onPageFinished, + void Function(_i2.WebViewClient, _i2.WebView, String)? onPageStarted, + void Function(_i2.WebViewClient, _i2.WebView, int, String, String)? + onReceivedError, void Function( _i2.WebViewClient, _i2.WebView, _i2.HttpAuthHandler, String, String, - )? onReceivedHttpAuthRequest, + )? + onReceivedHttpAuthRequest, void Function( _i2.WebViewClient, _i2.WebView, _i2.WebResourceRequest, _i2.WebResourceResponse, - )? onReceivedHttpError, + )? + onReceivedHttpError, void Function( _i2.WebViewClient, _i2.WebView, _i2.WebResourceRequest, _i2.WebResourceError, - )? onReceivedRequestError, + )? + onReceivedRequestError, void Function( _i2.WebViewClient, _i2.WebView, _i2.WebResourceRequest, _i2.WebResourceErrorCompat, - )? onReceivedRequestErrorCompat, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.WebResourceRequest, - )? requestLoading, - void Function( - _i2.WebViewClient, - _i2.WebView, + )? + onReceivedRequestErrorCompat, + void Function(_i2.WebViewClient, _i2.WebView, _i2.WebResourceRequest)? + requestLoading, + void Function(_i2.WebViewClient, _i2.WebView, String)? urlLoading, + }) + get newWebViewClient => + (super.noSuchMethod( + Invocation.getter(#newWebViewClient), + returnValue: + ({ + void Function(_i2.WebViewClient, _i2.WebView, String, bool)? + doUpdateVisitedHistory, + void Function(_i2.WebViewClient, _i2.WebView, String)? + onPageFinished, + void Function(_i2.WebViewClient, _i2.WebView, String)? + onPageStarted, + void Function( + _i2.WebViewClient, + _i2.WebView, + int, + String, + String, + )? + onReceivedError, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.HttpAuthHandler, + String, + String, + )? + onReceivedHttpAuthRequest, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.WebResourceRequest, + _i2.WebResourceResponse, + )? + onReceivedHttpError, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.WebResourceRequest, + _i2.WebResourceError, + )? + onReceivedRequestError, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.WebResourceRequest, + _i2.WebResourceErrorCompat, + )? + onReceivedRequestErrorCompat, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.WebResourceRequest, + )? + requestLoading, + void Function(_i2.WebViewClient, _i2.WebView, String)? + urlLoading, + }) => _FakeWebViewClient_1( + this, + Invocation.getter(#newWebViewClient), + ), + returnValueForMissingStub: + ({ + void Function(_i2.WebViewClient, _i2.WebView, String, bool)? + doUpdateVisitedHistory, + void Function(_i2.WebViewClient, _i2.WebView, String)? + onPageFinished, + void Function(_i2.WebViewClient, _i2.WebView, String)? + onPageStarted, + void Function( + _i2.WebViewClient, + _i2.WebView, + int, + String, + String, + )? + onReceivedError, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.HttpAuthHandler, + String, + String, + )? + onReceivedHttpAuthRequest, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.WebResourceRequest, + _i2.WebResourceResponse, + )? + onReceivedHttpError, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.WebResourceRequest, + _i2.WebResourceError, + )? + onReceivedRequestError, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.WebResourceRequest, + _i2.WebResourceErrorCompat, + )? + onReceivedRequestErrorCompat, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.WebResourceRequest, + )? + requestLoading, + void Function(_i2.WebViewClient, _i2.WebView, String)? + urlLoading, + }) => _FakeWebViewClient_1( + this, + Invocation.getter(#newWebViewClient), + ), + ) + as _i2.WebViewClient Function({ + void Function(_i2.WebViewClient, _i2.WebView, String, bool)? + doUpdateVisitedHistory, + void Function(_i2.WebViewClient, _i2.WebView, String)? + onPageFinished, + void Function(_i2.WebViewClient, _i2.WebView, String)? + onPageStarted, + void Function(_i2.WebViewClient, _i2.WebView, int, String, String)? + onReceivedError, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.HttpAuthHandler, + String, + String, + )? + onReceivedHttpAuthRequest, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.WebResourceRequest, + _i2.WebResourceResponse, + )? + onReceivedHttpError, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.WebResourceRequest, + _i2.WebResourceError, + )? + onReceivedRequestError, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.WebResourceRequest, + _i2.WebResourceErrorCompat, + )? + onReceivedRequestErrorCompat, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.WebResourceRequest, + )? + requestLoading, + void Function(_i2.WebViewClient, _i2.WebView, String)? urlLoading, + })); + + @override + _i2.DownloadListener Function({ + required void Function( + _i2.DownloadListener, + String, + String, String, - )? urlLoading, - }) get newWebViewClient => (super.noSuchMethod( - Invocation.getter(#newWebViewClient), - returnValue: ({ - void Function( - _i2.WebViewClient, - _i2.WebView, - String, - bool, - )? doUpdateVisitedHistory, - void Function( - _i2.WebViewClient, - _i2.WebView, - String, - )? onPageFinished, - void Function( - _i2.WebViewClient, - _i2.WebView, - String, - )? onPageStarted, - void Function( - _i2.WebViewClient, - _i2.WebView, - int, - String, - String, - )? onReceivedError, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.HttpAuthHandler, - String, - String, - )? onReceivedHttpAuthRequest, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.WebResourceRequest, - _i2.WebResourceResponse, - )? onReceivedHttpError, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.WebResourceRequest, - _i2.WebResourceError, - )? onReceivedRequestError, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.WebResourceRequest, - _i2.WebResourceErrorCompat, - )? onReceivedRequestErrorCompat, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.WebResourceRequest, - )? requestLoading, - void Function( - _i2.WebViewClient, - _i2.WebView, - String, - )? urlLoading, - }) => - _FakeWebViewClient_1( - this, - Invocation.getter(#newWebViewClient), - ), - returnValueForMissingStub: ({ - void Function( - _i2.WebViewClient, - _i2.WebView, - String, - bool, - )? doUpdateVisitedHistory, - void Function( - _i2.WebViewClient, - _i2.WebView, - String, - )? onPageFinished, - void Function( - _i2.WebViewClient, - _i2.WebView, - String, - )? onPageStarted, - void Function( - _i2.WebViewClient, - _i2.WebView, - int, - String, - String, - )? onReceivedError, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.HttpAuthHandler, - String, - String, - )? onReceivedHttpAuthRequest, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.WebResourceRequest, - _i2.WebResourceResponse, - )? onReceivedHttpError, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.WebResourceRequest, - _i2.WebResourceError, - )? onReceivedRequestError, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.WebResourceRequest, - _i2.WebResourceErrorCompat, - )? onReceivedRequestErrorCompat, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.WebResourceRequest, - )? requestLoading, - void Function( - _i2.WebViewClient, - _i2.WebView, - String, - )? urlLoading, - }) => - _FakeWebViewClient_1( - this, - Invocation.getter(#newWebViewClient), - ), - ) as _i2.WebViewClient Function({ - void Function( - _i2.WebViewClient, - _i2.WebView, - String, - bool, - )? doUpdateVisitedHistory, - void Function( - _i2.WebViewClient, - _i2.WebView, - String, - )? onPageFinished, - void Function( - _i2.WebViewClient, - _i2.WebView, - String, - )? onPageStarted, - void Function( - _i2.WebViewClient, - _i2.WebView, - int, - String, - String, - )? onReceivedError, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.HttpAuthHandler, - String, - String, - )? onReceivedHttpAuthRequest, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.WebResourceRequest, - _i2.WebResourceResponse, - )? onReceivedHttpError, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.WebResourceRequest, - _i2.WebResourceError, - )? onReceivedRequestError, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.WebResourceRequest, - _i2.WebResourceErrorCompat, - )? onReceivedRequestErrorCompat, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.WebResourceRequest, - )? requestLoading, - void Function( - _i2.WebViewClient, - _i2.WebView, - String, - )? urlLoading, - })); - - @override - _i2.DownloadListener Function( - {required void Function( - _i2.DownloadListener, - String, - String, - String, - String, - int, - ) onDownloadStart}) get newDownloadListener => (super.noSuchMethod( - Invocation.getter(#newDownloadListener), - returnValue: ( - {required void Function( - _i2.DownloadListener, - String, - String, - String, - String, - int, - ) onDownloadStart}) => - _FakeDownloadListener_2( - this, - Invocation.getter(#newDownloadListener), - ), - returnValueForMissingStub: ( - {required void Function( - _i2.DownloadListener, - String, - String, - String, - String, - int, - ) onDownloadStart}) => - _FakeDownloadListener_2( - this, - Invocation.getter(#newDownloadListener), - ), - ) as _i2.DownloadListener Function( - {required void Function( - _i2.DownloadListener, - String, - String, - String, - String, - int, - ) onDownloadStart})); + String, + int, + ) + onDownloadStart, + }) + get newDownloadListener => + (super.noSuchMethod( + Invocation.getter(#newDownloadListener), + returnValue: + ({ + required void Function( + _i2.DownloadListener, + String, + String, + String, + String, + int, + ) + onDownloadStart, + }) => _FakeDownloadListener_2( + this, + Invocation.getter(#newDownloadListener), + ), + returnValueForMissingStub: + ({ + required void Function( + _i2.DownloadListener, + String, + String, + String, + String, + int, + ) + onDownloadStart, + }) => _FakeDownloadListener_2( + this, + Invocation.getter(#newDownloadListener), + ), + ) + as _i2.DownloadListener Function({ + required void Function( + _i2.DownloadListener, + String, + String, + String, + String, + int, + ) + onDownloadStart, + })); @override _i2.WebChromeClient Function({ - void Function( - _i2.WebChromeClient, - _i2.ConsoleMessage, - )? onConsoleMessage, + void Function(_i2.WebChromeClient, _i2.ConsoleMessage)? onConsoleMessage, void Function(_i2.WebChromeClient)? onGeolocationPermissionsHidePrompt, void Function( _i2.WebChromeClient, String, _i2.GeolocationPermissionsCallback, - )? onGeolocationPermissionsShowPrompt, + )? + onGeolocationPermissionsShowPrompt, void Function(_i2.WebChromeClient)? onHideCustomView, - _i8.Future Function( - _i2.WebChromeClient, - _i2.WebView, - String, - String, - )? onJsAlert, - _i8.Future Function( - _i2.WebChromeClient, - _i2.WebView, - String, - String, - )? onJsConfirm, + _i8.Future Function(_i2.WebChromeClient, _i2.WebView, String, String)? + onJsAlert, + _i8.Future Function(_i2.WebChromeClient, _i2.WebView, String, String)? + onJsConfirm, _i8.Future Function( _i2.WebChromeClient, _i2.WebView, String, String, String, - )? onJsPrompt, - void Function( - _i2.WebChromeClient, - _i2.PermissionRequest, - )? onPermissionRequest, - void Function( - _i2.WebChromeClient, - _i2.WebView, - int, - )? onProgressChanged, - void Function( - _i2.WebChromeClient, - _i2.View, - _i2.CustomViewCallback, - )? onShowCustomView, + )? + onJsPrompt, + void Function(_i2.WebChromeClient, _i2.PermissionRequest)? + onPermissionRequest, + void Function(_i2.WebChromeClient, _i2.WebView, int)? onProgressChanged, + void Function(_i2.WebChromeClient, _i2.View, _i2.CustomViewCallback)? + onShowCustomView, _i8.Future> Function( _i2.WebChromeClient, _i2.WebView, _i2.FileChooserParams, - )? onShowFileChooser, - }) get newWebChromeClient => (super.noSuchMethod( - Invocation.getter(#newWebChromeClient), - returnValue: ({ - void Function( - _i2.WebChromeClient, - _i2.ConsoleMessage, - )? onConsoleMessage, - void Function(_i2.WebChromeClient)? - onGeolocationPermissionsHidePrompt, - void Function( - _i2.WebChromeClient, - String, - _i2.GeolocationPermissionsCallback, - )? onGeolocationPermissionsShowPrompt, - void Function(_i2.WebChromeClient)? onHideCustomView, - _i8.Future Function( - _i2.WebChromeClient, - _i2.WebView, - String, - String, - )? onJsAlert, - _i8.Future Function( - _i2.WebChromeClient, - _i2.WebView, - String, - String, - )? onJsConfirm, - _i8.Future Function( - _i2.WebChromeClient, - _i2.WebView, - String, - String, - String, - )? onJsPrompt, - void Function( - _i2.WebChromeClient, - _i2.PermissionRequest, - )? onPermissionRequest, - void Function( - _i2.WebChromeClient, - _i2.WebView, - int, - )? onProgressChanged, - void Function( - _i2.WebChromeClient, - _i2.View, - _i2.CustomViewCallback, - )? onShowCustomView, - _i8.Future> Function( - _i2.WebChromeClient, - _i2.WebView, - _i2.FileChooserParams, - )? onShowFileChooser, - }) => - _FakeWebChromeClient_0( - this, - Invocation.getter(#newWebChromeClient), - ), - returnValueForMissingStub: ({ - void Function( - _i2.WebChromeClient, - _i2.ConsoleMessage, - )? onConsoleMessage, - void Function(_i2.WebChromeClient)? - onGeolocationPermissionsHidePrompt, - void Function( - _i2.WebChromeClient, - String, - _i2.GeolocationPermissionsCallback, - )? onGeolocationPermissionsShowPrompt, - void Function(_i2.WebChromeClient)? onHideCustomView, - _i8.Future Function( - _i2.WebChromeClient, - _i2.WebView, - String, - String, - )? onJsAlert, - _i8.Future Function( - _i2.WebChromeClient, - _i2.WebView, - String, - String, - )? onJsConfirm, - _i8.Future Function( - _i2.WebChromeClient, - _i2.WebView, - String, - String, - String, - )? onJsPrompt, - void Function( - _i2.WebChromeClient, - _i2.PermissionRequest, - )? onPermissionRequest, - void Function( - _i2.WebChromeClient, - _i2.WebView, - int, - )? onProgressChanged, - void Function( - _i2.WebChromeClient, - _i2.View, - _i2.CustomViewCallback, - )? onShowCustomView, - _i8.Future> Function( - _i2.WebChromeClient, - _i2.WebView, - _i2.FileChooserParams, - )? onShowFileChooser, - }) => - _FakeWebChromeClient_0( - this, - Invocation.getter(#newWebChromeClient), - ), - ) as _i2.WebChromeClient Function({ - void Function( - _i2.WebChromeClient, - _i2.ConsoleMessage, - )? onConsoleMessage, - void Function(_i2.WebChromeClient)? onGeolocationPermissionsHidePrompt, - void Function( - _i2.WebChromeClient, - String, - _i2.GeolocationPermissionsCallback, - )? onGeolocationPermissionsShowPrompt, - void Function(_i2.WebChromeClient)? onHideCustomView, - _i8.Future Function( - _i2.WebChromeClient, - _i2.WebView, - String, - String, - )? onJsAlert, - _i8.Future Function( - _i2.WebChromeClient, - _i2.WebView, - String, - String, - )? onJsConfirm, - _i8.Future Function( - _i2.WebChromeClient, - _i2.WebView, - String, - String, - String, - )? onJsPrompt, - void Function( - _i2.WebChromeClient, - _i2.PermissionRequest, - )? onPermissionRequest, - void Function( - _i2.WebChromeClient, - _i2.WebView, - int, - )? onProgressChanged, - void Function( - _i2.WebChromeClient, - _i2.View, - _i2.CustomViewCallback, - )? onShowCustomView, - _i8.Future> Function( - _i2.WebChromeClient, - _i2.WebView, - _i2.FileChooserParams, - )? onShowFileChooser, - })); + )? + onShowFileChooser, + }) + get newWebChromeClient => + (super.noSuchMethod( + Invocation.getter(#newWebChromeClient), + returnValue: + ({ + void Function(_i2.WebChromeClient, _i2.ConsoleMessage)? + onConsoleMessage, + void Function(_i2.WebChromeClient)? + onGeolocationPermissionsHidePrompt, + void Function( + _i2.WebChromeClient, + String, + _i2.GeolocationPermissionsCallback, + )? + onGeolocationPermissionsShowPrompt, + void Function(_i2.WebChromeClient)? onHideCustomView, + _i8.Future Function( + _i2.WebChromeClient, + _i2.WebView, + String, + String, + )? + onJsAlert, + _i8.Future Function( + _i2.WebChromeClient, + _i2.WebView, + String, + String, + )? + onJsConfirm, + _i8.Future Function( + _i2.WebChromeClient, + _i2.WebView, + String, + String, + String, + )? + onJsPrompt, + void Function(_i2.WebChromeClient, _i2.PermissionRequest)? + onPermissionRequest, + void Function(_i2.WebChromeClient, _i2.WebView, int)? + onProgressChanged, + void Function( + _i2.WebChromeClient, + _i2.View, + _i2.CustomViewCallback, + )? + onShowCustomView, + _i8.Future> Function( + _i2.WebChromeClient, + _i2.WebView, + _i2.FileChooserParams, + )? + onShowFileChooser, + }) => _FakeWebChromeClient_0( + this, + Invocation.getter(#newWebChromeClient), + ), + returnValueForMissingStub: + ({ + void Function(_i2.WebChromeClient, _i2.ConsoleMessage)? + onConsoleMessage, + void Function(_i2.WebChromeClient)? + onGeolocationPermissionsHidePrompt, + void Function( + _i2.WebChromeClient, + String, + _i2.GeolocationPermissionsCallback, + )? + onGeolocationPermissionsShowPrompt, + void Function(_i2.WebChromeClient)? onHideCustomView, + _i8.Future Function( + _i2.WebChromeClient, + _i2.WebView, + String, + String, + )? + onJsAlert, + _i8.Future Function( + _i2.WebChromeClient, + _i2.WebView, + String, + String, + )? + onJsConfirm, + _i8.Future Function( + _i2.WebChromeClient, + _i2.WebView, + String, + String, + String, + )? + onJsPrompt, + void Function(_i2.WebChromeClient, _i2.PermissionRequest)? + onPermissionRequest, + void Function(_i2.WebChromeClient, _i2.WebView, int)? + onProgressChanged, + void Function( + _i2.WebChromeClient, + _i2.View, + _i2.CustomViewCallback, + )? + onShowCustomView, + _i8.Future> Function( + _i2.WebChromeClient, + _i2.WebView, + _i2.FileChooserParams, + )? + onShowFileChooser, + }) => _FakeWebChromeClient_0( + this, + Invocation.getter(#newWebChromeClient), + ), + ) + as _i2.WebChromeClient Function({ + void Function(_i2.WebChromeClient, _i2.ConsoleMessage)? + onConsoleMessage, + void Function(_i2.WebChromeClient)? + onGeolocationPermissionsHidePrompt, + void Function( + _i2.WebChromeClient, + String, + _i2.GeolocationPermissionsCallback, + )? + onGeolocationPermissionsShowPrompt, + void Function(_i2.WebChromeClient)? onHideCustomView, + _i8.Future Function( + _i2.WebChromeClient, + _i2.WebView, + String, + String, + )? + onJsAlert, + _i8.Future Function( + _i2.WebChromeClient, + _i2.WebView, + String, + String, + )? + onJsConfirm, + _i8.Future Function( + _i2.WebChromeClient, + _i2.WebView, + String, + String, + String, + )? + onJsPrompt, + void Function(_i2.WebChromeClient, _i2.PermissionRequest)? + onPermissionRequest, + void Function(_i2.WebChromeClient, _i2.WebView, int)? + onProgressChanged, + void Function( + _i2.WebChromeClient, + _i2.View, + _i2.CustomViewCallback, + )? + onShowCustomView, + _i8.Future> Function( + _i2.WebChromeClient, + _i2.WebView, + _i2.FileChooserParams, + )? + onShowFileChooser, + })); @override _i8.Future Function(bool) get setWebContentsDebuggingEnabledWebView => (super.noSuchMethod( - Invocation.getter(#setWebContentsDebuggingEnabledWebView), - returnValue: (bool __p0) => _i8.Future.value(), - returnValueForMissingStub: (bool __p0) => _i8.Future.value(), - ) as _i8.Future Function(bool)); + Invocation.getter(#setWebContentsDebuggingEnabledWebView), + returnValue: (bool __p0) => _i8.Future.value(), + returnValueForMissingStub: (bool __p0) => _i8.Future.value(), + ) + as _i8.Future Function(bool)); @override - _i2.CookieManager Function() get instanceCookieManager => (super.noSuchMethod( - Invocation.getter(#instanceCookieManager), - returnValue: () => _FakeCookieManager_9( - this, - Invocation.getter(#instanceCookieManager), - ), - returnValueForMissingStub: () => _FakeCookieManager_9( - this, - Invocation.getter(#instanceCookieManager), - ), - ) as _i2.CookieManager Function()); + _i2.CookieManager Function() get instanceCookieManager => + (super.noSuchMethod( + Invocation.getter(#instanceCookieManager), + returnValue: + () => _FakeCookieManager_9( + this, + Invocation.getter(#instanceCookieManager), + ), + returnValueForMissingStub: + () => _FakeCookieManager_9( + this, + Invocation.getter(#instanceCookieManager), + ), + ) + as _i2.CookieManager Function()); @override _i2.FlutterAssetManager Function() get instanceFlutterAssetManager => (super.noSuchMethod( - Invocation.getter(#instanceFlutterAssetManager), - returnValue: () => _FakeFlutterAssetManager_10( - this, - Invocation.getter(#instanceFlutterAssetManager), - ), - returnValueForMissingStub: () => _FakeFlutterAssetManager_10( - this, - Invocation.getter(#instanceFlutterAssetManager), - ), - ) as _i2.FlutterAssetManager Function()); - - @override - _i2.WebStorage Function() get instanceWebStorage => (super.noSuchMethod( - Invocation.getter(#instanceWebStorage), - returnValue: () => _FakeWebStorage_11( - this, - Invocation.getter(#instanceWebStorage), - ), - returnValueForMissingStub: () => _FakeWebStorage_11( - this, - Invocation.getter(#instanceWebStorage), - ), - ) as _i2.WebStorage Function()); + Invocation.getter(#instanceFlutterAssetManager), + returnValue: + () => _FakeFlutterAssetManager_10( + this, + Invocation.getter(#instanceFlutterAssetManager), + ), + returnValueForMissingStub: + () => _FakeFlutterAssetManager_10( + this, + Invocation.getter(#instanceFlutterAssetManager), + ), + ) + as _i2.FlutterAssetManager Function()); + + @override + _i2.WebStorage Function() get instanceWebStorage => + (super.noSuchMethod( + Invocation.getter(#instanceWebStorage), + returnValue: + () => _FakeWebStorage_11( + this, + Invocation.getter(#instanceWebStorage), + ), + returnValueForMissingStub: + () => _FakeWebStorage_11( + this, + Invocation.getter(#instanceWebStorage), + ), + ) + as _i2.WebStorage Function()); } /// A class which mocks [AndroidWebViewWidgetCreationParams]. @@ -1623,67 +1383,77 @@ class MockAndroidWebViewProxy extends _i1.Mock class MockAndroidWebViewWidgetCreationParams extends _i1.Mock implements _i7.AndroidWebViewWidgetCreationParams { @override - _i2.PigeonInstanceManager get instanceManager => (super.noSuchMethod( - Invocation.getter(#instanceManager), - returnValue: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#instanceManager), - ), - ) as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get instanceManager => + (super.noSuchMethod( + Invocation.getter(#instanceManager), + returnValue: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#instanceManager), + ), + ) + as _i2.PigeonInstanceManager); @override _i5.PlatformViewsServiceProxy get platformViewsServiceProxy => (super.noSuchMethod( - Invocation.getter(#platformViewsServiceProxy), - returnValue: _FakePlatformViewsServiceProxy_13( - this, - Invocation.getter(#platformViewsServiceProxy), - ), - returnValueForMissingStub: _FakePlatformViewsServiceProxy_13( - this, - Invocation.getter(#platformViewsServiceProxy), - ), - ) as _i5.PlatformViewsServiceProxy); - - @override - bool get displayWithHybridComposition => (super.noSuchMethod( - Invocation.getter(#displayWithHybridComposition), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); - - @override - _i3.PlatformWebViewController get controller => (super.noSuchMethod( - Invocation.getter(#controller), - returnValue: _FakePlatformWebViewController_14( - this, - Invocation.getter(#controller), - ), - returnValueForMissingStub: _FakePlatformWebViewController_14( - this, - Invocation.getter(#controller), - ), - ) as _i3.PlatformWebViewController); - - @override - _i4.TextDirection get layoutDirection => (super.noSuchMethod( - Invocation.getter(#layoutDirection), - returnValue: _i4.TextDirection.rtl, - returnValueForMissingStub: _i4.TextDirection.rtl, - ) as _i4.TextDirection); + Invocation.getter(#platformViewsServiceProxy), + returnValue: _FakePlatformViewsServiceProxy_13( + this, + Invocation.getter(#platformViewsServiceProxy), + ), + returnValueForMissingStub: _FakePlatformViewsServiceProxy_13( + this, + Invocation.getter(#platformViewsServiceProxy), + ), + ) + as _i5.PlatformViewsServiceProxy); + + @override + bool get displayWithHybridComposition => + (super.noSuchMethod( + Invocation.getter(#displayWithHybridComposition), + returnValue: false, + returnValueForMissingStub: false, + ) + as bool); + + @override + _i3.PlatformWebViewController get controller => + (super.noSuchMethod( + Invocation.getter(#controller), + returnValue: _FakePlatformWebViewController_14( + this, + Invocation.getter(#controller), + ), + returnValueForMissingStub: _FakePlatformWebViewController_14( + this, + Invocation.getter(#controller), + ), + ) + as _i3.PlatformWebViewController); + + @override + _i4.TextDirection get layoutDirection => + (super.noSuchMethod( + Invocation.getter(#layoutDirection), + returnValue: _i4.TextDirection.rtl, + returnValueForMissingStub: _i4.TextDirection.rtl, + ) + as _i4.TextDirection); @override Set<_i10.Factory<_i11.OneSequenceGestureRecognizer>> get gestureRecognizers => (super.noSuchMethod( - Invocation.getter(#gestureRecognizers), - returnValue: <_i10.Factory<_i11.OneSequenceGestureRecognizer>>{}, - returnValueForMissingStub: <_i10 - .Factory<_i11.OneSequenceGestureRecognizer>>{}, - ) as Set<_i10.Factory<_i11.OneSequenceGestureRecognizer>>); + Invocation.getter(#gestureRecognizers), + returnValue: <_i10.Factory<_i11.OneSequenceGestureRecognizer>>{}, + returnValueForMissingStub: + <_i10.Factory<_i11.OneSequenceGestureRecognizer>>{}, + ) + as Set<_i10.Factory<_i11.OneSequenceGestureRecognizer>>); } /// A class which mocks [ExpensiveAndroidViewController]. @@ -1692,187 +1462,160 @@ class MockAndroidWebViewWidgetCreationParams extends _i1.Mock class MockExpensiveAndroidViewController extends _i1.Mock implements _i6.ExpensiveAndroidViewController { @override - bool get requiresViewComposition => (super.noSuchMethod( - Invocation.getter(#requiresViewComposition), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); + bool get requiresViewComposition => + (super.noSuchMethod( + Invocation.getter(#requiresViewComposition), + returnValue: false, + returnValueForMissingStub: false, + ) + as bool); @override - int get viewId => (super.noSuchMethod( - Invocation.getter(#viewId), - returnValue: 0, - returnValueForMissingStub: 0, - ) as int); + int get viewId => + (super.noSuchMethod( + Invocation.getter(#viewId), + returnValue: 0, + returnValueForMissingStub: 0, + ) + as int); @override - bool get awaitingCreation => (super.noSuchMethod( - Invocation.getter(#awaitingCreation), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); + bool get awaitingCreation => + (super.noSuchMethod( + Invocation.getter(#awaitingCreation), + returnValue: false, + returnValueForMissingStub: false, + ) + as bool); @override - _i6.PointTransformer get pointTransformer => (super.noSuchMethod( - Invocation.getter(#pointTransformer), - returnValue: (_i4.Offset position) => _FakeOffset_6( - this, - Invocation.getter(#pointTransformer), - ), - returnValueForMissingStub: (_i4.Offset position) => _FakeOffset_6( - this, - Invocation.getter(#pointTransformer), - ), - ) as _i6.PointTransformer); + _i6.PointTransformer get pointTransformer => + (super.noSuchMethod( + Invocation.getter(#pointTransformer), + returnValue: + (_i4.Offset position) => + _FakeOffset_6(this, Invocation.getter(#pointTransformer)), + returnValueForMissingStub: + (_i4.Offset position) => + _FakeOffset_6(this, Invocation.getter(#pointTransformer)), + ) + as _i6.PointTransformer); @override set pointTransformer(_i6.PointTransformer? transformer) => super.noSuchMethod( - Invocation.setter( - #pointTransformer, - transformer, - ), - returnValueForMissingStub: null, - ); + Invocation.setter(#pointTransformer, transformer), + returnValueForMissingStub: null, + ); @override - bool get isCreated => (super.noSuchMethod( - Invocation.getter(#isCreated), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); + bool get isCreated => + (super.noSuchMethod( + Invocation.getter(#isCreated), + returnValue: false, + returnValueForMissingStub: false, + ) + as bool); @override List<_i6.PlatformViewCreatedCallback> get createdCallbacks => (super.noSuchMethod( - Invocation.getter(#createdCallbacks), - returnValue: <_i6.PlatformViewCreatedCallback>[], - returnValueForMissingStub: <_i6.PlatformViewCreatedCallback>[], - ) as List<_i6.PlatformViewCreatedCallback>); + Invocation.getter(#createdCallbacks), + returnValue: <_i6.PlatformViewCreatedCallback>[], + returnValueForMissingStub: <_i6.PlatformViewCreatedCallback>[], + ) + as List<_i6.PlatformViewCreatedCallback>); @override - _i8.Future setOffset(_i4.Offset? off) => (super.noSuchMethod( - Invocation.method( - #setOffset, - [off], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future setOffset(_i4.Offset? off) => + (super.noSuchMethod( + Invocation.method(#setOffset, [off]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future create({ - _i4.Size? size, - _i4.Offset? position, - }) => + _i8.Future create({_i4.Size? size, _i4.Offset? position}) => (super.noSuchMethod( - Invocation.method( - #create, - [], - { - #size: size, - #position: position, - }, - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i8.Future<_i4.Size> setSize(_i4.Size? size) => (super.noSuchMethod( - Invocation.method( - #setSize, - [size], - ), - returnValue: _i8.Future<_i4.Size>.value(_FakeSize_15( - this, - Invocation.method( - #setSize, - [size], - ), - )), - returnValueForMissingStub: _i8.Future<_i4.Size>.value(_FakeSize_15( - this, - Invocation.method( - #setSize, - [size], - ), - )), - ) as _i8.Future<_i4.Size>); + Invocation.method(#create, [], {#size: size, #position: position}), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i8.Future<_i4.Size> setSize(_i4.Size? size) => + (super.noSuchMethod( + Invocation.method(#setSize, [size]), + returnValue: _i8.Future<_i4.Size>.value( + _FakeSize_15(this, Invocation.method(#setSize, [size])), + ), + returnValueForMissingStub: _i8.Future<_i4.Size>.value( + _FakeSize_15(this, Invocation.method(#setSize, [size])), + ), + ) + as _i8.Future<_i4.Size>); @override _i8.Future sendMotionEvent(_i6.AndroidMotionEvent? event) => (super.noSuchMethod( - Invocation.method( - #sendMotionEvent, - [event], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#sendMotionEvent, [event]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override void addOnPlatformViewCreatedListener( - _i6.PlatformViewCreatedCallback? listener) => - super.noSuchMethod( - Invocation.method( - #addOnPlatformViewCreatedListener, - [listener], - ), - returnValueForMissingStub: null, - ); + _i6.PlatformViewCreatedCallback? listener, + ) => super.noSuchMethod( + Invocation.method(#addOnPlatformViewCreatedListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeOnPlatformViewCreatedListener( - _i6.PlatformViewCreatedCallback? listener) => - super.noSuchMethod( - Invocation.method( - #removeOnPlatformViewCreatedListener, - [listener], - ), - returnValueForMissingStub: null, - ); + _i6.PlatformViewCreatedCallback? listener, + ) => super.noSuchMethod( + Invocation.method(#removeOnPlatformViewCreatedListener, [listener]), + returnValueForMissingStub: null, + ); @override _i8.Future setLayoutDirection(_i4.TextDirection? layoutDirection) => (super.noSuchMethod( - Invocation.method( - #setLayoutDirection, - [layoutDirection], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setLayoutDirection, [layoutDirection]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future dispatchPointerEvent(_i11.PointerEvent? event) => (super.noSuchMethod( - Invocation.method( - #dispatchPointerEvent, - [event], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i8.Future clearFocus() => (super.noSuchMethod( - Invocation.method( - #clearFocus, - [], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i8.Future dispose() => (super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#dispatchPointerEvent, [event]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i8.Future clearFocus() => + (super.noSuchMethod( + Invocation.method(#clearFocus, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i8.Future dispose() => + (super.noSuchMethod( + Invocation.method(#dispose, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); } /// A class which mocks [FlutterAssetManager]. @@ -1881,73 +1624,64 @@ class MockExpensiveAndroidViewController extends _i1.Mock class MockFlutterAssetManager extends _i1.Mock implements _i2.FlutterAssetManager { @override - _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) as _i2.PigeonInstanceManager); - - @override - _i8.Future> list(String? path) => (super.noSuchMethod( - Invocation.method( - #list, - [path], - ), - returnValue: _i8.Future>.value([]), - returnValueForMissingStub: _i8.Future>.value([]), - ) as _i8.Future>); + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); + + @override + _i8.Future> list(String? path) => + (super.noSuchMethod( + Invocation.method(#list, [path]), + returnValue: _i8.Future>.value([]), + returnValueForMissingStub: _i8.Future>.value( + [], + ), + ) + as _i8.Future>); @override _i8.Future getAssetFilePathByName(String? name) => (super.noSuchMethod( - Invocation.method( - #getAssetFilePathByName, - [name], - ), - returnValue: _i8.Future.value(_i12.dummyValue( - this, - Invocation.method( - #getAssetFilePathByName, - [name], - ), - )), - returnValueForMissingStub: - _i8.Future.value(_i12.dummyValue( - this, - Invocation.method( - #getAssetFilePathByName, - [name], - ), - )), - ) as _i8.Future); - - @override - _i2.FlutterAssetManager pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeFlutterAssetManager_10( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - returnValueForMissingStub: _FakeFlutterAssetManager_10( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.FlutterAssetManager); + Invocation.method(#getAssetFilePathByName, [name]), + returnValue: _i8.Future.value( + _i12.dummyValue( + this, + Invocation.method(#getAssetFilePathByName, [name]), + ), + ), + returnValueForMissingStub: _i8.Future.value( + _i12.dummyValue( + this, + Invocation.method(#getAssetFilePathByName, [name]), + ), + ), + ) + as _i8.Future); + + @override + _i2.FlutterAssetManager pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeFlutterAssetManager_10( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeFlutterAssetManager_10( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.FlutterAssetManager); } /// A class which mocks [GeolocationPermissionsCallback]. @@ -1956,58 +1690,43 @@ class MockFlutterAssetManager extends _i1.Mock class MockGeolocationPermissionsCallback extends _i1.Mock implements _i2.GeolocationPermissionsCallback { @override - _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) as _i2.PigeonInstanceManager); - - @override - _i8.Future invoke( - String? origin, - bool? allow, - bool? retain, - ) => - (super.noSuchMethod( - Invocation.method( - #invoke, - [ - origin, - allow, - retain, - ], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i2.GeolocationPermissionsCallback pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeGeolocationPermissionsCallback_16( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - returnValueForMissingStub: _FakeGeolocationPermissionsCallback_16( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.GeolocationPermissionsCallback); + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); + + @override + _i8.Future invoke(String? origin, bool? allow, bool? retain) => + (super.noSuchMethod( + Invocation.method(#invoke, [origin, allow, retain]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i2.GeolocationPermissionsCallback pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeGeolocationPermissionsCallback_16( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeGeolocationPermissionsCallback_16( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.GeolocationPermissionsCallback); } /// A class which mocks [JavaScriptChannel]. @@ -2015,71 +1734,60 @@ class MockGeolocationPermissionsCallback extends _i1.Mock /// See the documentation for Mockito's code generation for more information. class MockJavaScriptChannel extends _i1.Mock implements _i2.JavaScriptChannel { @override - String get channelName => (super.noSuchMethod( - Invocation.getter(#channelName), - returnValue: _i12.dummyValue( - this, - Invocation.getter(#channelName), - ), - returnValueForMissingStub: _i12.dummyValue( - this, - Invocation.getter(#channelName), - ), - ) as String); - - @override - void Function( - _i2.JavaScriptChannel, - String, - ) get postMessage => (super.noSuchMethod( - Invocation.getter(#postMessage), - returnValue: ( - _i2.JavaScriptChannel pigeon_instance, - String message, - ) {}, - returnValueForMissingStub: ( - _i2.JavaScriptChannel pigeon_instance, - String message, - ) {}, - ) as void Function( - _i2.JavaScriptChannel, - String, - )); - - @override - _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) as _i2.PigeonInstanceManager); - - @override - _i2.JavaScriptChannel pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeJavaScriptChannel_8( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - returnValueForMissingStub: _FakeJavaScriptChannel_8( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.JavaScriptChannel); + String get channelName => + (super.noSuchMethod( + Invocation.getter(#channelName), + returnValue: _i12.dummyValue( + this, + Invocation.getter(#channelName), + ), + returnValueForMissingStub: _i12.dummyValue( + this, + Invocation.getter(#channelName), + ), + ) + as String); + + @override + void Function(_i2.JavaScriptChannel, String) get postMessage => + (super.noSuchMethod( + Invocation.getter(#postMessage), + returnValue: + (_i2.JavaScriptChannel pigeon_instance, String message) {}, + returnValueForMissingStub: + (_i2.JavaScriptChannel pigeon_instance, String message) {}, + ) + as void Function(_i2.JavaScriptChannel, String)); + + @override + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); + + @override + _i2.JavaScriptChannel pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeJavaScriptChannel_8( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeJavaScriptChannel_8( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.JavaScriptChannel); } /// A class which mocks [PermissionRequest]. @@ -2087,66 +1795,61 @@ class MockJavaScriptChannel extends _i1.Mock implements _i2.JavaScriptChannel { /// See the documentation for Mockito's code generation for more information. class MockPermissionRequest extends _i1.Mock implements _i2.PermissionRequest { @override - List get resources => (super.noSuchMethod( - Invocation.getter(#resources), - returnValue: [], - returnValueForMissingStub: [], - ) as List); - - @override - _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) as _i2.PigeonInstanceManager); - - @override - _i8.Future grant(List? resources) => (super.noSuchMethod( - Invocation.method( - #grant, - [resources], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i8.Future deny() => (super.noSuchMethod( - Invocation.method( - #deny, - [], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i2.PermissionRequest pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakePermissionRequest_17( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - returnValueForMissingStub: _FakePermissionRequest_17( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.PermissionRequest); + List get resources => + (super.noSuchMethod( + Invocation.getter(#resources), + returnValue: [], + returnValueForMissingStub: [], + ) + as List); + + @override + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); + + @override + _i8.Future grant(List? resources) => + (super.noSuchMethod( + Invocation.method(#grant, [resources]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i8.Future deny() => + (super.noSuchMethod( + Invocation.method(#deny, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i2.PermissionRequest pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakePermissionRequest_17( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakePermissionRequest_17( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.PermissionRequest); } /// A class which mocks [PlatformViewsServiceProxy]. @@ -2165,49 +1868,38 @@ class MockPlatformViewsServiceProxy extends _i1.Mock _i4.VoidCallback? onFocus, }) => (super.noSuchMethod( - Invocation.method( - #initExpensiveAndroidView, - [], - { - #id: id, - #viewType: viewType, - #layoutDirection: layoutDirection, - #creationParams: creationParams, - #creationParamsCodec: creationParamsCodec, - #onFocus: onFocus, - }, - ), - returnValue: _FakeExpensiveAndroidViewController_18( - this, - Invocation.method( - #initExpensiveAndroidView, - [], - { + Invocation.method(#initExpensiveAndroidView, [], { #id: id, #viewType: viewType, #layoutDirection: layoutDirection, #creationParams: creationParams, #creationParamsCodec: creationParamsCodec, #onFocus: onFocus, - }, - ), - ), - returnValueForMissingStub: _FakeExpensiveAndroidViewController_18( - this, - Invocation.method( - #initExpensiveAndroidView, - [], - { - #id: id, - #viewType: viewType, - #layoutDirection: layoutDirection, - #creationParams: creationParams, - #creationParamsCodec: creationParamsCodec, - #onFocus: onFocus, - }, - ), - ), - ) as _i6.ExpensiveAndroidViewController); + }), + returnValue: _FakeExpensiveAndroidViewController_18( + this, + Invocation.method(#initExpensiveAndroidView, [], { + #id: id, + #viewType: viewType, + #layoutDirection: layoutDirection, + #creationParams: creationParams, + #creationParamsCodec: creationParamsCodec, + #onFocus: onFocus, + }), + ), + returnValueForMissingStub: _FakeExpensiveAndroidViewController_18( + this, + Invocation.method(#initExpensiveAndroidView, [], { + #id: id, + #viewType: viewType, + #layoutDirection: layoutDirection, + #creationParams: creationParams, + #creationParamsCodec: creationParamsCodec, + #onFocus: onFocus, + }), + ), + ) + as _i6.ExpensiveAndroidViewController); @override _i6.SurfaceAndroidViewController initSurfaceAndroidView({ @@ -2219,49 +1911,38 @@ class MockPlatformViewsServiceProxy extends _i1.Mock _i4.VoidCallback? onFocus, }) => (super.noSuchMethod( - Invocation.method( - #initSurfaceAndroidView, - [], - { - #id: id, - #viewType: viewType, - #layoutDirection: layoutDirection, - #creationParams: creationParams, - #creationParamsCodec: creationParamsCodec, - #onFocus: onFocus, - }, - ), - returnValue: _FakeSurfaceAndroidViewController_19( - this, - Invocation.method( - #initSurfaceAndroidView, - [], - { - #id: id, - #viewType: viewType, - #layoutDirection: layoutDirection, - #creationParams: creationParams, - #creationParamsCodec: creationParamsCodec, - #onFocus: onFocus, - }, - ), - ), - returnValueForMissingStub: _FakeSurfaceAndroidViewController_19( - this, - Invocation.method( - #initSurfaceAndroidView, - [], - { + Invocation.method(#initSurfaceAndroidView, [], { #id: id, #viewType: viewType, #layoutDirection: layoutDirection, #creationParams: creationParams, #creationParamsCodec: creationParamsCodec, #onFocus: onFocus, - }, - ), - ), - ) as _i6.SurfaceAndroidViewController); + }), + returnValue: _FakeSurfaceAndroidViewController_19( + this, + Invocation.method(#initSurfaceAndroidView, [], { + #id: id, + #viewType: viewType, + #layoutDirection: layoutDirection, + #creationParams: creationParams, + #creationParamsCodec: creationParamsCodec, + #onFocus: onFocus, + }), + ), + returnValueForMissingStub: _FakeSurfaceAndroidViewController_19( + this, + Invocation.method(#initSurfaceAndroidView, [], { + #id: id, + #viewType: viewType, + #layoutDirection: layoutDirection, + #creationParams: creationParams, + #creationParamsCodec: creationParamsCodec, + #onFocus: onFocus, + }), + ), + ) + as _i6.SurfaceAndroidViewController); } /// A class which mocks [SurfaceAndroidViewController]. @@ -2270,187 +1951,160 @@ class MockPlatformViewsServiceProxy extends _i1.Mock class MockSurfaceAndroidViewController extends _i1.Mock implements _i6.SurfaceAndroidViewController { @override - bool get requiresViewComposition => (super.noSuchMethod( - Invocation.getter(#requiresViewComposition), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); + bool get requiresViewComposition => + (super.noSuchMethod( + Invocation.getter(#requiresViewComposition), + returnValue: false, + returnValueForMissingStub: false, + ) + as bool); @override - int get viewId => (super.noSuchMethod( - Invocation.getter(#viewId), - returnValue: 0, - returnValueForMissingStub: 0, - ) as int); + int get viewId => + (super.noSuchMethod( + Invocation.getter(#viewId), + returnValue: 0, + returnValueForMissingStub: 0, + ) + as int); @override - bool get awaitingCreation => (super.noSuchMethod( - Invocation.getter(#awaitingCreation), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); + bool get awaitingCreation => + (super.noSuchMethod( + Invocation.getter(#awaitingCreation), + returnValue: false, + returnValueForMissingStub: false, + ) + as bool); @override - _i6.PointTransformer get pointTransformer => (super.noSuchMethod( - Invocation.getter(#pointTransformer), - returnValue: (_i4.Offset position) => _FakeOffset_6( - this, - Invocation.getter(#pointTransformer), - ), - returnValueForMissingStub: (_i4.Offset position) => _FakeOffset_6( - this, - Invocation.getter(#pointTransformer), - ), - ) as _i6.PointTransformer); + _i6.PointTransformer get pointTransformer => + (super.noSuchMethod( + Invocation.getter(#pointTransformer), + returnValue: + (_i4.Offset position) => + _FakeOffset_6(this, Invocation.getter(#pointTransformer)), + returnValueForMissingStub: + (_i4.Offset position) => + _FakeOffset_6(this, Invocation.getter(#pointTransformer)), + ) + as _i6.PointTransformer); @override set pointTransformer(_i6.PointTransformer? transformer) => super.noSuchMethod( - Invocation.setter( - #pointTransformer, - transformer, - ), - returnValueForMissingStub: null, - ); + Invocation.setter(#pointTransformer, transformer), + returnValueForMissingStub: null, + ); @override - bool get isCreated => (super.noSuchMethod( - Invocation.getter(#isCreated), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); + bool get isCreated => + (super.noSuchMethod( + Invocation.getter(#isCreated), + returnValue: false, + returnValueForMissingStub: false, + ) + as bool); @override List<_i6.PlatformViewCreatedCallback> get createdCallbacks => (super.noSuchMethod( - Invocation.getter(#createdCallbacks), - returnValue: <_i6.PlatformViewCreatedCallback>[], - returnValueForMissingStub: <_i6.PlatformViewCreatedCallback>[], - ) as List<_i6.PlatformViewCreatedCallback>); + Invocation.getter(#createdCallbacks), + returnValue: <_i6.PlatformViewCreatedCallback>[], + returnValueForMissingStub: <_i6.PlatformViewCreatedCallback>[], + ) + as List<_i6.PlatformViewCreatedCallback>); @override - _i8.Future setOffset(_i4.Offset? off) => (super.noSuchMethod( - Invocation.method( - #setOffset, - [off], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future setOffset(_i4.Offset? off) => + (super.noSuchMethod( + Invocation.method(#setOffset, [off]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future create({ - _i4.Size? size, - _i4.Offset? position, - }) => + _i8.Future create({_i4.Size? size, _i4.Offset? position}) => (super.noSuchMethod( - Invocation.method( - #create, - [], - { - #size: size, - #position: position, - }, - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i8.Future<_i4.Size> setSize(_i4.Size? size) => (super.noSuchMethod( - Invocation.method( - #setSize, - [size], - ), - returnValue: _i8.Future<_i4.Size>.value(_FakeSize_15( - this, - Invocation.method( - #setSize, - [size], - ), - )), - returnValueForMissingStub: _i8.Future<_i4.Size>.value(_FakeSize_15( - this, - Invocation.method( - #setSize, - [size], - ), - )), - ) as _i8.Future<_i4.Size>); + Invocation.method(#create, [], {#size: size, #position: position}), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i8.Future<_i4.Size> setSize(_i4.Size? size) => + (super.noSuchMethod( + Invocation.method(#setSize, [size]), + returnValue: _i8.Future<_i4.Size>.value( + _FakeSize_15(this, Invocation.method(#setSize, [size])), + ), + returnValueForMissingStub: _i8.Future<_i4.Size>.value( + _FakeSize_15(this, Invocation.method(#setSize, [size])), + ), + ) + as _i8.Future<_i4.Size>); @override _i8.Future sendMotionEvent(_i6.AndroidMotionEvent? event) => (super.noSuchMethod( - Invocation.method( - #sendMotionEvent, - [event], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#sendMotionEvent, [event]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override void addOnPlatformViewCreatedListener( - _i6.PlatformViewCreatedCallback? listener) => - super.noSuchMethod( - Invocation.method( - #addOnPlatformViewCreatedListener, - [listener], - ), - returnValueForMissingStub: null, - ); + _i6.PlatformViewCreatedCallback? listener, + ) => super.noSuchMethod( + Invocation.method(#addOnPlatformViewCreatedListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeOnPlatformViewCreatedListener( - _i6.PlatformViewCreatedCallback? listener) => - super.noSuchMethod( - Invocation.method( - #removeOnPlatformViewCreatedListener, - [listener], - ), - returnValueForMissingStub: null, - ); + _i6.PlatformViewCreatedCallback? listener, + ) => super.noSuchMethod( + Invocation.method(#removeOnPlatformViewCreatedListener, [listener]), + returnValueForMissingStub: null, + ); @override _i8.Future setLayoutDirection(_i4.TextDirection? layoutDirection) => (super.noSuchMethod( - Invocation.method( - #setLayoutDirection, - [layoutDirection], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setLayoutDirection, [layoutDirection]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future dispatchPointerEvent(_i11.PointerEvent? event) => (super.noSuchMethod( - Invocation.method( - #dispatchPointerEvent, - [event], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i8.Future clearFocus() => (super.noSuchMethod( - Invocation.method( - #clearFocus, - [], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i8.Future dispose() => (super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#dispatchPointerEvent, [event]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i8.Future clearFocus() => + (super.noSuchMethod( + Invocation.method(#clearFocus, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i8.Future dispose() => + (super.noSuchMethod( + Invocation.method(#dispose, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); } /// A class which mocks [WebChromeClient]. @@ -2458,94 +2112,85 @@ class MockSurfaceAndroidViewController extends _i1.Mock /// See the documentation for Mockito's code generation for more information. class MockWebChromeClient extends _i1.Mock implements _i2.WebChromeClient { @override - _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); @override _i8.Future setSynchronousReturnValueForOnShowFileChooser(bool? value) => (super.noSuchMethod( - Invocation.method( - #setSynchronousReturnValueForOnShowFileChooser, - [value], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setSynchronousReturnValueForOnShowFileChooser, [ + value, + ]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setSynchronousReturnValueForOnConsoleMessage(bool? value) => (super.noSuchMethod( - Invocation.method( - #setSynchronousReturnValueForOnConsoleMessage, - [value], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setSynchronousReturnValueForOnConsoleMessage, [ + value, + ]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setSynchronousReturnValueForOnJsAlert(bool? value) => (super.noSuchMethod( - Invocation.method( - #setSynchronousReturnValueForOnJsAlert, - [value], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setSynchronousReturnValueForOnJsAlert, [value]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setSynchronousReturnValueForOnJsConfirm(bool? value) => (super.noSuchMethod( - Invocation.method( - #setSynchronousReturnValueForOnJsConfirm, - [value], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setSynchronousReturnValueForOnJsConfirm, [ + value, + ]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setSynchronousReturnValueForOnJsPrompt(bool? value) => (super.noSuchMethod( - Invocation.method( - #setSynchronousReturnValueForOnJsPrompt, - [value], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i2.WebChromeClient pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeWebChromeClient_0( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - returnValueForMissingStub: _FakeWebChromeClient_0( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.WebChromeClient); + Invocation.method(#setSynchronousReturnValueForOnJsPrompt, [value]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i2.WebChromeClient pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWebChromeClient_0( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeWebChromeClient_0( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WebChromeClient); } /// A class which mocks [WebSettings]. @@ -2553,217 +2198,190 @@ class MockWebChromeClient extends _i1.Mock implements _i2.WebChromeClient { /// See the documentation for Mockito's code generation for more information. class MockWebSettings extends _i1.Mock implements _i2.WebSettings { @override - _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) as _i2.PigeonInstanceManager); - - @override - _i8.Future setDomStorageEnabled(bool? flag) => (super.noSuchMethod( - Invocation.method( - #setDomStorageEnabled, - [flag], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); + + @override + _i8.Future setDomStorageEnabled(bool? flag) => + (super.noSuchMethod( + Invocation.method(#setDomStorageEnabled, [flag]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setJavaScriptCanOpenWindowsAutomatically(bool? flag) => (super.noSuchMethod( - Invocation.method( - #setJavaScriptCanOpenWindowsAutomatically, - [flag], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setJavaScriptCanOpenWindowsAutomatically, [ + flag, + ]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setSupportMultipleWindows(bool? support) => (super.noSuchMethod( - Invocation.method( - #setSupportMultipleWindows, - [support], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setSupportMultipleWindows, [support]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future setJavaScriptEnabled(bool? flag) => (super.noSuchMethod( - Invocation.method( - #setJavaScriptEnabled, - [flag], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future setJavaScriptEnabled(bool? flag) => + (super.noSuchMethod( + Invocation.method(#setJavaScriptEnabled, [flag]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setUserAgentString(String? userAgentString) => (super.noSuchMethod( - Invocation.method( - #setUserAgentString, - [userAgentString], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setUserAgentString, [userAgentString]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setMediaPlaybackRequiresUserGesture(bool? require) => (super.noSuchMethod( - Invocation.method( - #setMediaPlaybackRequiresUserGesture, - [require], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setMediaPlaybackRequiresUserGesture, [require]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future setSupportZoom(bool? support) => (super.noSuchMethod( - Invocation.method( - #setSupportZoom, - [support], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future setSupportZoom(bool? support) => + (super.noSuchMethod( + Invocation.method(#setSupportZoom, [support]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setLoadWithOverviewMode(bool? overview) => (super.noSuchMethod( - Invocation.method( - #setLoadWithOverviewMode, - [overview], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i8.Future setUseWideViewPort(bool? use) => (super.noSuchMethod( - Invocation.method( - #setUseWideViewPort, - [use], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i8.Future setDisplayZoomControls(bool? enabled) => (super.noSuchMethod( - Invocation.method( - #setDisplayZoomControls, - [enabled], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i8.Future setBuiltInZoomControls(bool? enabled) => (super.noSuchMethod( - Invocation.method( - #setBuiltInZoomControls, - [enabled], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i8.Future setAllowFileAccess(bool? enabled) => (super.noSuchMethod( - Invocation.method( - #setAllowFileAccess, - [enabled], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i8.Future setAllowContentAccess(bool? enabled) => (super.noSuchMethod( - Invocation.method( - #setAllowContentAccess, - [enabled], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i8.Future setGeolocationEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method( - #setGeolocationEnabled, - [enabled], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i8.Future setTextZoom(int? textZoom) => (super.noSuchMethod( - Invocation.method( - #setTextZoom, - [textZoom], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i8.Future getUserAgentString() => (super.noSuchMethod( - Invocation.method( - #getUserAgentString, - [], - ), - returnValue: _i8.Future.value(_i12.dummyValue( - this, - Invocation.method( - #getUserAgentString, - [], - ), - )), - returnValueForMissingStub: - _i8.Future.value(_i12.dummyValue( - this, - Invocation.method( - #getUserAgentString, - [], - ), - )), - ) as _i8.Future); - - @override - _i2.WebSettings pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeWebSettings_20( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - returnValueForMissingStub: _FakeWebSettings_20( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.WebSettings); + Invocation.method(#setLoadWithOverviewMode, [overview]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i8.Future setUseWideViewPort(bool? use) => + (super.noSuchMethod( + Invocation.method(#setUseWideViewPort, [use]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i8.Future setDisplayZoomControls(bool? enabled) => + (super.noSuchMethod( + Invocation.method(#setDisplayZoomControls, [enabled]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i8.Future setBuiltInZoomControls(bool? enabled) => + (super.noSuchMethod( + Invocation.method(#setBuiltInZoomControls, [enabled]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i8.Future setAllowFileAccess(bool? enabled) => + (super.noSuchMethod( + Invocation.method(#setAllowFileAccess, [enabled]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i8.Future setAllowContentAccess(bool? enabled) => + (super.noSuchMethod( + Invocation.method(#setAllowContentAccess, [enabled]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i8.Future setGeolocationEnabled(bool? enabled) => + (super.noSuchMethod( + Invocation.method(#setGeolocationEnabled, [enabled]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i8.Future setTextZoom(int? textZoom) => + (super.noSuchMethod( + Invocation.method(#setTextZoom, [textZoom]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i8.Future getUserAgentString() => + (super.noSuchMethod( + Invocation.method(#getUserAgentString, []), + returnValue: _i8.Future.value( + _i12.dummyValue( + this, + Invocation.method(#getUserAgentString, []), + ), + ), + returnValueForMissingStub: _i8.Future.value( + _i12.dummyValue( + this, + Invocation.method(#getUserAgentString, []), + ), + ), + ) + as _i8.Future); + + @override + _i2.WebSettings pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWebSettings_20( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeWebSettings_20( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WebSettings); } /// A class which mocks [WebView]. @@ -2771,71 +2389,58 @@ class MockWebSettings extends _i1.Mock implements _i2.WebSettings { /// See the documentation for Mockito's code generation for more information. class MockWebView extends _i1.Mock implements _i2.WebView { @override - _i2.WebSettings get settings => (super.noSuchMethod( - Invocation.getter(#settings), - returnValue: _FakeWebSettings_20( - this, - Invocation.getter(#settings), - ), - returnValueForMissingStub: _FakeWebSettings_20( - this, - Invocation.getter(#settings), - ), - ) as _i2.WebSettings); - - @override - _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) as _i2.PigeonInstanceManager); - - @override - _i2.WebSettings pigeonVar_settings() => (super.noSuchMethod( - Invocation.method( - #pigeonVar_settings, - [], - ), - returnValue: _FakeWebSettings_20( - this, - Invocation.method( - #pigeonVar_settings, - [], - ), - ), - returnValueForMissingStub: _FakeWebSettings_20( - this, - Invocation.method( - #pigeonVar_settings, - [], - ), - ), - ) as _i2.WebSettings); - - @override - _i8.Future loadData( - String? data, - String? mimeType, - String? encoding, - ) => + _i2.WebSettings get settings => (super.noSuchMethod( - Invocation.method( - #loadData, - [ - data, - mimeType, - encoding, - ], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.getter(#settings), + returnValue: _FakeWebSettings_20( + this, + Invocation.getter(#settings), + ), + returnValueForMissingStub: _FakeWebSettings_20( + this, + Invocation.getter(#settings), + ), + ) + as _i2.WebSettings); + + @override + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); + + @override + _i2.WebSettings pigeonVar_settings() => + (super.noSuchMethod( + Invocation.method(#pigeonVar_settings, []), + returnValue: _FakeWebSettings_20( + this, + Invocation.method(#pigeonVar_settings, []), + ), + returnValueForMissingStub: _FakeWebSettings_20( + this, + Invocation.method(#pigeonVar_settings, []), + ), + ) + as _i2.WebSettings); + + @override + _i8.Future loadData(String? data, String? mimeType, String? encoding) => + (super.noSuchMethod( + Invocation.method(#loadData, [data, mimeType, encoding]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future loadDataWithBaseUrl( @@ -2846,319 +2451,249 @@ class MockWebView extends _i1.Mock implements _i2.WebView { String? historyUrl, ) => (super.noSuchMethod( - Invocation.method( - #loadDataWithBaseUrl, - [ - baseUrl, - data, - mimeType, - encoding, - historyUrl, - ], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i8.Future loadUrl( - String? url, - Map? headers, - ) => + Invocation.method(#loadDataWithBaseUrl, [ + baseUrl, + data, + mimeType, + encoding, + historyUrl, + ]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i8.Future loadUrl(String? url, Map? headers) => (super.noSuchMethod( - Invocation.method( - #loadUrl, - [ - url, - headers, - ], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i8.Future postUrl( - String? url, - _i13.Uint8List? data, - ) => + Invocation.method(#loadUrl, [url, headers]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i8.Future postUrl(String? url, _i13.Uint8List? data) => (super.noSuchMethod( - Invocation.method( - #postUrl, - [ - url, - data, - ], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i8.Future getUrl() => (super.noSuchMethod( - Invocation.method( - #getUrl, - [], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i8.Future canGoBack() => (super.noSuchMethod( - Invocation.method( - #canGoBack, - [], - ), - returnValue: _i8.Future.value(false), - returnValueForMissingStub: _i8.Future.value(false), - ) as _i8.Future); - - @override - _i8.Future canGoForward() => (super.noSuchMethod( - Invocation.method( - #canGoForward, - [], - ), - returnValue: _i8.Future.value(false), - returnValueForMissingStub: _i8.Future.value(false), - ) as _i8.Future); - - @override - _i8.Future goBack() => (super.noSuchMethod( - Invocation.method( - #goBack, - [], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i8.Future goForward() => (super.noSuchMethod( - Invocation.method( - #goForward, - [], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i8.Future reload() => (super.noSuchMethod( - Invocation.method( - #reload, - [], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i8.Future clearCache(bool? includeDiskFiles) => (super.noSuchMethod( - Invocation.method( - #clearCache, - [includeDiskFiles], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#postUrl, [url, data]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i8.Future getUrl() => + (super.noSuchMethod( + Invocation.method(#getUrl, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i8.Future canGoBack() => + (super.noSuchMethod( + Invocation.method(#canGoBack, []), + returnValue: _i8.Future.value(false), + returnValueForMissingStub: _i8.Future.value(false), + ) + as _i8.Future); + + @override + _i8.Future canGoForward() => + (super.noSuchMethod( + Invocation.method(#canGoForward, []), + returnValue: _i8.Future.value(false), + returnValueForMissingStub: _i8.Future.value(false), + ) + as _i8.Future); + + @override + _i8.Future goBack() => + (super.noSuchMethod( + Invocation.method(#goBack, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i8.Future goForward() => + (super.noSuchMethod( + Invocation.method(#goForward, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i8.Future reload() => + (super.noSuchMethod( + Invocation.method(#reload, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i8.Future clearCache(bool? includeDiskFiles) => + (super.noSuchMethod( + Invocation.method(#clearCache, [includeDiskFiles]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future evaluateJavascript(String? javascriptString) => (super.noSuchMethod( - Invocation.method( - #evaluateJavascript, - [javascriptString], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#evaluateJavascript, [javascriptString]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future getTitle() => (super.noSuchMethod( - Invocation.method( - #getTitle, - [], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future getTitle() => + (super.noSuchMethod( + Invocation.method(#getTitle, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setWebViewClient(_i2.WebViewClient? client) => (super.noSuchMethod( - Invocation.method( - #setWebViewClient, - [client], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setWebViewClient, [client]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future addJavaScriptChannel(_i2.JavaScriptChannel? channel) => (super.noSuchMethod( - Invocation.method( - #addJavaScriptChannel, - [channel], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#addJavaScriptChannel, [channel]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future removeJavaScriptChannel(String? name) => (super.noSuchMethod( - Invocation.method( - #removeJavaScriptChannel, - [name], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future removeJavaScriptChannel(String? name) => + (super.noSuchMethod( + Invocation.method(#removeJavaScriptChannel, [name]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setDownloadListener(_i2.DownloadListener? listener) => (super.noSuchMethod( - Invocation.method( - #setDownloadListener, - [listener], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setDownloadListener, [listener]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setWebChromeClient(_i2.WebChromeClient? client) => (super.noSuchMethod( - Invocation.method( - #setWebChromeClient, - [client], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i8.Future setBackgroundColor(int? color) => (super.noSuchMethod( - Invocation.method( - #setBackgroundColor, - [color], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i8.Future verticalScrollBarEnabled(bool? enabled) => - (super.noSuchMethod( - Invocation.method( - #verticalScrollBarEnabled, - [enabled], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i8.Future horizontalScrollBarEnabled(bool? enabled) => - (super.noSuchMethod( - Invocation.method( - #horizontalScrollBarEnabled, - [enabled], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i8.Future destroy() => (super.noSuchMethod( - Invocation.method( - #destroy, - [], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i2.WebView pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeWebView_7( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - returnValueForMissingStub: _FakeWebView_7( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.WebView); - - @override - _i8.Future scrollTo( - int? x, - int? y, - ) => + Invocation.method(#setWebChromeClient, [client]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i8.Future setBackgroundColor(int? color) => (super.noSuchMethod( - Invocation.method( - #scrollTo, - [ - x, - y, - ], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i8.Future scrollBy( - int? x, - int? y, - ) => + Invocation.method(#setBackgroundColor, [color]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i8.Future destroy() => (super.noSuchMethod( - Invocation.method( - #scrollBy, - [ - x, - y, - ], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i8.Future<_i2.WebViewPoint> getScrollPosition() => (super.noSuchMethod( - Invocation.method( - #getScrollPosition, - [], - ), - returnValue: _i8.Future<_i2.WebViewPoint>.value(_FakeWebViewPoint_21( - this, - Invocation.method( - #getScrollPosition, - [], - ), - )), - returnValueForMissingStub: - _i8.Future<_i2.WebViewPoint>.value(_FakeWebViewPoint_21( - this, - Invocation.method( - #getScrollPosition, - [], - ), - )), - ) as _i8.Future<_i2.WebViewPoint>); + Invocation.method(#destroy, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i2.WebView pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWebView_7( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeWebView_7( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WebView); + + @override + _i8.Future scrollTo(int? x, int? y) => + (super.noSuchMethod( + Invocation.method(#scrollTo, [x, y]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i8.Future scrollBy(int? x, int? y) => + (super.noSuchMethod( + Invocation.method(#scrollBy, [x, y]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i8.Future<_i2.WebViewPoint> getScrollPosition() => + (super.noSuchMethod( + Invocation.method(#getScrollPosition, []), + returnValue: _i8.Future<_i2.WebViewPoint>.value( + _FakeWebViewPoint_21( + this, + Invocation.method(#getScrollPosition, []), + ), + ), + returnValueForMissingStub: _i8.Future<_i2.WebViewPoint>.value( + _FakeWebViewPoint_21( + this, + Invocation.method(#getScrollPosition, []), + ), + ), + ) + as _i8.Future<_i2.WebViewPoint>); + + @override + _i8.Future setVerticalScrollBarEnabled(bool? enabled) => + (super.noSuchMethod( + Invocation.method(#setVerticalScrollBarEnabled, [enabled]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i8.Future setHorizontalScrollBarEnabled(bool? enabled) => + (super.noSuchMethod( + Invocation.method(#setHorizontalScrollBarEnabled, [enabled]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); } /// A class which mocks [WebViewClient]. @@ -3166,51 +2701,48 @@ class MockWebView extends _i1.Mock implements _i2.WebView { /// See the documentation for Mockito's code generation for more information. class MockWebViewClient extends _i1.Mock implements _i2.WebViewClient { @override - _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); @override _i8.Future setSynchronousReturnValueForShouldOverrideUrlLoading( - bool? value) => - (super.noSuchMethod( - Invocation.method( - #setSynchronousReturnValueForShouldOverrideUrlLoading, - [value], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i2.WebViewClient pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeWebViewClient_1( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - returnValueForMissingStub: _FakeWebViewClient_1( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.WebViewClient); + bool? value, + ) => + (super.noSuchMethod( + Invocation.method( + #setSynchronousReturnValueForShouldOverrideUrlLoading, + [value], + ), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i2.WebViewClient pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWebViewClient_1( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeWebViewClient_1( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WebViewClient); } /// A class which mocks [WebStorage]. @@ -3218,47 +2750,41 @@ class MockWebViewClient extends _i1.Mock implements _i2.WebViewClient { /// See the documentation for Mockito's code generation for more information. class MockWebStorage extends _i1.Mock implements _i2.WebStorage { @override - _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) as _i2.PigeonInstanceManager); - - @override - _i8.Future deleteAllData() => (super.noSuchMethod( - Invocation.method( - #deleteAllData, - [], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i2.WebStorage pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeWebStorage_11( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - returnValueForMissingStub: _FakeWebStorage_11( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.WebStorage); + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); + + @override + _i8.Future deleteAllData() => + (super.noSuchMethod( + Invocation.method(#deleteAllData, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i2.WebStorage pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWebStorage_11( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeWebStorage_11( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WebStorage); } diff --git a/packages/webview_flutter/webview_flutter_android/test/android_webview_cookie_manager_test.mocks.dart b/packages/webview_flutter/webview_flutter_android/test/android_webview_cookie_manager_test.mocks.dart index 6ca7e6589fc..4d7cfb875e5 100644 --- a/packages/webview_flutter/webview_flutter_android/test/android_webview_cookie_manager_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_android/test/android_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_android/test/android_webview_cookie_manager_test.dart. // Do not manually edit this file. @@ -21,6 +21,7 @@ import 'package:webview_flutter_platform_interface/webview_flutter_platform_inte // 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 @@ -28,23 +29,13 @@ import 'package:webview_flutter_platform_interface/webview_flutter_platform_inte 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 _FakeCookieManager_1 extends _i1.SmartFake implements _i2.CookieManager { - _FakeCookieManager_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeCookieManager_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakePlatformWebViewControllerCreationParams_2 extends _i1.SmartFake @@ -52,30 +43,17 @@ class _FakePlatformWebViewControllerCreationParams_2 extends _i1.SmartFake _FakePlatformWebViewControllerCreationParams_2( Object parent, Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + ) : super(parent, parentInvocation); } class _FakeObject_3 extends _i1.SmartFake implements Object { - _FakeObject_3( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeObject_3(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeOffset_4 extends _i1.SmartFake implements _i4.Offset { - _FakeOffset_4( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeOffset_4(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [CookieManager]. @@ -87,39 +65,32 @@ class MockCookieManager extends _i1.Mock implements _i2.CookieManager { } @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 - _i5.Future setCookie( - String? url, - String? value, - ) => + _i5.Future setCookie(String? url, String? value) => (super.noSuchMethod( - Invocation.method( - #setCookie, - [ - url, - value, - ], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setCookie, [url, value]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future removeAllCookies() => (super.noSuchMethod( - Invocation.method( - #removeAllCookies, - [], - ), - returnValue: _i5.Future.value(false), - ) as _i5.Future); + _i5.Future removeAllCookies() => + (super.noSuchMethod( + Invocation.method(#removeAllCookies, []), + returnValue: _i5.Future.value(false), + ) + as _i5.Future); @override _i5.Future setAcceptThirdPartyCookies( @@ -127,31 +98,22 @@ class MockCookieManager extends _i1.Mock implements _i2.CookieManager { bool? accept, ) => (super.noSuchMethod( - Invocation.method( - #setAcceptThirdPartyCookies, - [ - webView, - accept, - ], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - - @override - _i2.CookieManager pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeCookieManager_1( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.CookieManager); + Invocation.method(#setAcceptThirdPartyCookies, [webView, accept]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); + + @override + _i2.CookieManager pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeCookieManager_1( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.CookieManager); } /// A class which mocks [AndroidWebViewController]. @@ -164,391 +126,335 @@ class MockAndroidWebViewController extends _i1.Mock } @override - int get webViewIdentifier => (super.noSuchMethod( - Invocation.getter(#webViewIdentifier), - returnValue: 0, - ) as int); + int get webViewIdentifier => + (super.noSuchMethod(Invocation.getter(#webViewIdentifier), returnValue: 0) + as int); @override - _i3.PlatformWebViewControllerCreationParams get params => (super.noSuchMethod( - Invocation.getter(#params), - returnValue: _FakePlatformWebViewControllerCreationParams_2( - this, - Invocation.getter(#params), - ), - ) as _i3.PlatformWebViewControllerCreationParams); + _i3.PlatformWebViewControllerCreationParams get params => + (super.noSuchMethod( + Invocation.getter(#params), + returnValue: _FakePlatformWebViewControllerCreationParams_2( + this, + Invocation.getter(#params), + ), + ) + as _i3.PlatformWebViewControllerCreationParams); @override - _i5.Future setAllowFileAccess(bool? allow) => (super.noSuchMethod( - Invocation.method( - #setAllowFileAccess, - [allow], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future setAllowFileAccess(bool? allow) => + (super.noSuchMethod( + Invocation.method(#setAllowFileAccess, [allow]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future loadFile(String? absoluteFilePath) => (super.noSuchMethod( - Invocation.method( - #loadFile, - [absoluteFilePath], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future loadFile(String? absoluteFilePath) => + (super.noSuchMethod( + Invocation.method(#loadFile, [absoluteFilePath]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future loadFlutterAsset(String? key) => (super.noSuchMethod( - Invocation.method( - #loadFlutterAsset, - [key], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future loadFlutterAsset(String? key) => + (super.noSuchMethod( + Invocation.method(#loadFlutterAsset, [key]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future loadHtmlString( - String? html, { - String? baseUrl, - }) => + _i5.Future loadHtmlString(String? html, {String? baseUrl}) => (super.noSuchMethod( - Invocation.method( - #loadHtmlString, - [html], - {#baseUrl: baseUrl}, - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#loadHtmlString, [html], {#baseUrl: baseUrl}), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future loadRequest(_i3.LoadRequestParams? params) => (super.noSuchMethod( - Invocation.method( - #loadRequest, - [params], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - - @override - _i5.Future currentUrl() => (super.noSuchMethod( - Invocation.method( - #currentUrl, - [], - ), - returnValue: _i5.Future.value(), - ) as _i5.Future); - - @override - _i5.Future canGoBack() => (super.noSuchMethod( - Invocation.method( - #canGoBack, - [], - ), - returnValue: _i5.Future.value(false), - ) as _i5.Future); - - @override - _i5.Future canGoForward() => (super.noSuchMethod( - Invocation.method( - #canGoForward, - [], - ), - returnValue: _i5.Future.value(false), - ) as _i5.Future); - - @override - _i5.Future goBack() => (super.noSuchMethod( - Invocation.method( - #goBack, - [], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - - @override - _i5.Future goForward() => (super.noSuchMethod( - Invocation.method( - #goForward, - [], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - - @override - _i5.Future reload() => (super.noSuchMethod( - Invocation.method( - #reload, - [], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - - @override - _i5.Future clearCache() => (super.noSuchMethod( - Invocation.method( - #clearCache, - [], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - - @override - _i5.Future clearLocalStorage() => (super.noSuchMethod( - Invocation.method( - #clearLocalStorage, - [], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#loadRequest, [params]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); + + @override + _i5.Future currentUrl() => + (super.noSuchMethod( + Invocation.method(#currentUrl, []), + returnValue: _i5.Future.value(), + ) + as _i5.Future); + + @override + _i5.Future canGoBack() => + (super.noSuchMethod( + Invocation.method(#canGoBack, []), + returnValue: _i5.Future.value(false), + ) + as _i5.Future); + + @override + _i5.Future canGoForward() => + (super.noSuchMethod( + Invocation.method(#canGoForward, []), + returnValue: _i5.Future.value(false), + ) + as _i5.Future); + + @override + _i5.Future goBack() => + (super.noSuchMethod( + Invocation.method(#goBack, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); + + @override + _i5.Future goForward() => + (super.noSuchMethod( + Invocation.method(#goForward, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); + + @override + _i5.Future reload() => + (super.noSuchMethod( + Invocation.method(#reload, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); + + @override + _i5.Future clearCache() => + (super.noSuchMethod( + Invocation.method(#clearCache, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); + + @override + _i5.Future clearLocalStorage() => + (super.noSuchMethod( + Invocation.method(#clearLocalStorage, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setPlatformNavigationDelegate( - _i3.PlatformNavigationDelegate? handler) => + _i3.PlatformNavigationDelegate? handler, + ) => (super.noSuchMethod( - Invocation.method( - #setPlatformNavigationDelegate, - [handler], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setPlatformNavigationDelegate, [handler]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future runJavaScript(String? javaScript) => (super.noSuchMethod( - Invocation.method( - #runJavaScript, - [javaScript], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future runJavaScript(String? javaScript) => + (super.noSuchMethod( + Invocation.method(#runJavaScript, [javaScript]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future runJavaScriptReturningResult(String? javaScript) => (super.noSuchMethod( - Invocation.method( - #runJavaScriptReturningResult, - [javaScript], - ), - returnValue: _i5.Future.value(_FakeObject_3( - this, - Invocation.method( - #runJavaScriptReturningResult, - [javaScript], - ), - )), - ) as _i5.Future); + Invocation.method(#runJavaScriptReturningResult, [javaScript]), + returnValue: _i5.Future.value( + _FakeObject_3( + this, + Invocation.method(#runJavaScriptReturningResult, [javaScript]), + ), + ), + ) + as _i5.Future); @override _i5.Future addJavaScriptChannel( - _i3.JavaScriptChannelParams? javaScriptChannelParams) => + _i3.JavaScriptChannelParams? javaScriptChannelParams, + ) => (super.noSuchMethod( - Invocation.method( - #addJavaScriptChannel, - [javaScriptChannelParams], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#addJavaScriptChannel, [javaScriptChannelParams]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future removeJavaScriptChannel(String? javaScriptChannelName) => (super.noSuchMethod( - Invocation.method( - #removeJavaScriptChannel, - [javaScriptChannelName], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#removeJavaScriptChannel, [ + javaScriptChannelName, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future getTitle() => (super.noSuchMethod( - Invocation.method( - #getTitle, - [], - ), - returnValue: _i5.Future.value(), - ) as _i5.Future); + _i5.Future getTitle() => + (super.noSuchMethod( + Invocation.method(#getTitle, []), + returnValue: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future scrollTo( - int? x, - int? y, - ) => + _i5.Future scrollTo(int? x, int? y) => (super.noSuchMethod( - Invocation.method( - #scrollTo, - [ - x, - y, - ], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - - @override - _i5.Future scrollBy( - int? x, - int? y, - ) => + Invocation.method(#scrollTo, [x, y]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); + + @override + _i5.Future scrollBy(int? x, int? y) => + (super.noSuchMethod( + Invocation.method(#scrollBy, [x, y]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); + + @override + _i5.Future<_i4.Offset> getScrollPosition() => (super.noSuchMethod( - Invocation.method( - #scrollBy, - [ - x, - y, - ], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - - @override - _i5.Future<_i4.Offset> getScrollPosition() => (super.noSuchMethod( - Invocation.method( - #getScrollPosition, - [], - ), - returnValue: _i5.Future<_i4.Offset>.value(_FakeOffset_4( - this, - Invocation.method( - #getScrollPosition, - [], - ), - )), - ) as _i5.Future<_i4.Offset>); - - @override - _i5.Future enableZoom(bool? enabled) => (super.noSuchMethod( - Invocation.method( - #enableZoom, - [enabled], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - - @override - _i5.Future setBackgroundColor(_i4.Color? color) => (super.noSuchMethod( - Invocation.method( - #setBackgroundColor, - [color], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#getScrollPosition, []), + returnValue: _i5.Future<_i4.Offset>.value( + _FakeOffset_4(this, Invocation.method(#getScrollPosition, [])), + ), + ) + as _i5.Future<_i4.Offset>); + + @override + _i5.Future enableZoom(bool? enabled) => + (super.noSuchMethod( + Invocation.method(#enableZoom, [enabled]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); + + @override + _i5.Future setBackgroundColor(_i4.Color? color) => + (super.noSuchMethod( + Invocation.method(#setBackgroundColor, [color]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setJavaScriptMode(_i3.JavaScriptMode? javaScriptMode) => (super.noSuchMethod( - Invocation.method( - #setJavaScriptMode, - [javaScriptMode], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setJavaScriptMode, [javaScriptMode]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future setUserAgent(String? userAgent) => (super.noSuchMethod( - Invocation.method( - #setUserAgent, - [userAgent], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future setUserAgent(String? userAgent) => + (super.noSuchMethod( + Invocation.method(#setUserAgent, [userAgent]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setOnScrollPositionChange( - void Function(_i3.ScrollPositionChange)? onScrollPositionChange) => + void Function(_i3.ScrollPositionChange)? onScrollPositionChange, + ) => (super.noSuchMethod( - Invocation.method( - #setOnScrollPositionChange, - [onScrollPositionChange], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setOnScrollPositionChange, [ + onScrollPositionChange, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setMediaPlaybackRequiresUserGesture(bool? require) => (super.noSuchMethod( - Invocation.method( - #setMediaPlaybackRequiresUserGesture, - [require], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - - @override - _i5.Future setTextZoom(int? textZoom) => (super.noSuchMethod( - Invocation.method( - #setTextZoom, - [textZoom], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - - @override - _i5.Future setAllowContentAccess(bool? enabled) => (super.noSuchMethod( - Invocation.method( - #setAllowContentAccess, - [enabled], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - - @override - _i5.Future setGeolocationEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method( - #setGeolocationEnabled, - [enabled], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setMediaPlaybackRequiresUserGesture, [require]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); + + @override + _i5.Future setTextZoom(int? textZoom) => + (super.noSuchMethod( + Invocation.method(#setTextZoom, [textZoom]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); + + @override + _i5.Future setAllowContentAccess(bool? enabled) => + (super.noSuchMethod( + Invocation.method(#setAllowContentAccess, [enabled]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); + + @override + _i5.Future setGeolocationEnabled(bool? enabled) => + (super.noSuchMethod( + Invocation.method(#setGeolocationEnabled, [enabled]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setOnShowFileSelector( - _i5.Future> Function(_i6.FileSelectorParams)? - onShowFileSelector) => + _i5.Future> Function(_i6.FileSelectorParams)? + onShowFileSelector, + ) => (super.noSuchMethod( - Invocation.method( - #setOnShowFileSelector, - [onShowFileSelector], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setOnShowFileSelector, [onShowFileSelector]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setOnPlatformPermissionRequest( - void Function(_i3.PlatformWebViewPermissionRequest)? - onPermissionRequest) => + void Function(_i3.PlatformWebViewPermissionRequest)? onPermissionRequest, + ) => (super.noSuchMethod( - Invocation.method( - #setOnPlatformPermissionRequest, - [onPermissionRequest], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setOnPlatformPermissionRequest, [ + onPermissionRequest, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setGeolocationPermissionsPromptCallbacks({ @@ -556,17 +462,14 @@ class MockAndroidWebViewController extends _i1.Mock _i6.OnGeolocationPermissionsHidePrompt? onHidePrompt, }) => (super.noSuchMethod( - Invocation.method( - #setGeolocationPermissionsPromptCallbacks, - [], - { - #onShowPrompt: onShowPrompt, - #onHidePrompt: onHidePrompt, - }, - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setGeolocationPermissionsPromptCallbacks, [], { + #onShowPrompt: onShowPrompt, + #onHidePrompt: onHidePrompt, + }), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setCustomWidgetCallbacks({ @@ -574,97 +477,91 @@ class MockAndroidWebViewController extends _i1.Mock required _i6.OnHideCustomWidgetCallback? onHideCustomWidget, }) => (super.noSuchMethod( - Invocation.method( - #setCustomWidgetCallbacks, - [], - { - #onShowCustomWidget: onShowCustomWidget, - #onHideCustomWidget: onHideCustomWidget, - }, - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setCustomWidgetCallbacks, [], { + #onShowCustomWidget: onShowCustomWidget, + #onHideCustomWidget: onHideCustomWidget, + }), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setOnConsoleMessage( - void Function(_i3.JavaScriptConsoleMessage)? onConsoleMessage) => + void Function(_i3.JavaScriptConsoleMessage)? onConsoleMessage, + ) => (super.noSuchMethod( - Invocation.method( - #setOnConsoleMessage, - [onConsoleMessage], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setOnConsoleMessage, [onConsoleMessage]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future getUserAgent() => (super.noSuchMethod( - Invocation.method( - #getUserAgent, - [], - ), - returnValue: _i5.Future.value(), - ) as _i5.Future); + _i5.Future getUserAgent() => + (super.noSuchMethod( + Invocation.method(#getUserAgent, []), + returnValue: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setOnJavaScriptAlertDialog( - _i5.Future Function(_i3.JavaScriptAlertDialogRequest)? - onJavaScriptAlertDialog) => + _i5.Future Function(_i3.JavaScriptAlertDialogRequest)? + onJavaScriptAlertDialog, + ) => (super.noSuchMethod( - Invocation.method( - #setOnJavaScriptAlertDialog, - [onJavaScriptAlertDialog], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setOnJavaScriptAlertDialog, [ + onJavaScriptAlertDialog, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setOnJavaScriptConfirmDialog( - _i5.Future Function(_i3.JavaScriptConfirmDialogRequest)? - onJavaScriptConfirmDialog) => + _i5.Future Function(_i3.JavaScriptConfirmDialogRequest)? + onJavaScriptConfirmDialog, + ) => (super.noSuchMethod( - Invocation.method( - #setOnJavaScriptConfirmDialog, - [onJavaScriptConfirmDialog], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setOnJavaScriptConfirmDialog, [ + onJavaScriptConfirmDialog, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setOnJavaScriptTextInputDialog( - _i5.Future Function(_i3.JavaScriptTextInputDialogRequest)? - onJavaScriptTextInputDialog) => - (super.noSuchMethod( - Invocation.method( - #setOnJavaScriptTextInputDialog, - [onJavaScriptTextInputDialog], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - - @override - _i5.Future verticalScrollBarEnabled(bool? enabled) => - (super.noSuchMethod( - Invocation.method( - #verticalScrollBarEnabled, - [enabled], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - - @override - _i5.Future horizontalScrollBarEnabled(bool? enabled) => - (super.noSuchMethod( - Invocation.method( - #horizontalScrollBarEnabled, - [enabled], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future Function(_i3.JavaScriptTextInputDialogRequest)? + onJavaScriptTextInputDialog, + ) => + (super.noSuchMethod( + Invocation.method(#setOnJavaScriptTextInputDialog, [ + onJavaScriptTextInputDialog, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); + + @override + _i5.Future setVerticalScrollBarEnabled(bool? enabled) => + (super.noSuchMethod( + Invocation.method(#setVerticalScrollBarEnabled, [enabled]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); + + @override + _i5.Future setHorizontalScrollBarEnabled(bool? enabled) => + (super.noSuchMethod( + Invocation.method(#setHorizontalScrollBarEnabled, [enabled]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); } diff --git a/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_cookie_manager_test.mocks.dart b/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_cookie_manager_test.mocks.dart index 28c0d95b814..74d4075c1b5 100644 --- a/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_cookie_manager_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_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_android/test/legacy/webview_android_cookie_manager_test.dart. // Do not manually edit this file. @@ -16,6 +16,7 @@ import 'package:webview_flutter_android/src/android_webkit.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,23 +24,13 @@ import 'package:webview_flutter_android/src/android_webkit.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 _FakeCookieManager_1 extends _i1.SmartFake implements _i2.CookieManager { - _FakeCookieManager_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeCookieManager_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [CookieManager]. @@ -51,39 +42,32 @@ class MockCookieManager extends _i1.Mock implements _i2.CookieManager { } @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( - String? url, - String? value, - ) => + _i3.Future setCookie(String? url, String? value) => (super.noSuchMethod( - Invocation.method( - #setCookie, - [ - url, - value, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#setCookie, [url, value]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override - _i3.Future removeAllCookies() => (super.noSuchMethod( - Invocation.method( - #removeAllCookies, - [], - ), - returnValue: _i3.Future.value(false), - ) as _i3.Future); + _i3.Future removeAllCookies() => + (super.noSuchMethod( + Invocation.method(#removeAllCookies, []), + returnValue: _i3.Future.value(false), + ) + as _i3.Future); @override _i3.Future setAcceptThirdPartyCookies( @@ -91,29 +75,20 @@ class MockCookieManager extends _i1.Mock implements _i2.CookieManager { bool? accept, ) => (super.noSuchMethod( - Invocation.method( - #setAcceptThirdPartyCookies, - [ - webView, - accept, - ], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#setAcceptThirdPartyCookies, [webView, accept]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override - _i2.CookieManager pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeCookieManager_1( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.CookieManager); + _i2.CookieManager pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeCookieManager_1( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.CookieManager); } diff --git a/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_widget_test.mocks.dart b/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_widget_test.mocks.dart index ff695040404..d6d61dc4844 100644 --- a/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_widget_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_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_android/test/legacy/webview_android_widget_test.dart. // Do not manually edit this file. @@ -22,6 +22,7 @@ import 'package:webview_flutter_platform_interface/src/webview_flutter_platform_ // 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 @@ -29,129 +30,69 @@ import 'package:webview_flutter_platform_interface/src/webview_flutter_platform_ 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 _FakeFlutterAssetManager_1 extends _i1.SmartFake implements _i2.FlutterAssetManager { - _FakeFlutterAssetManager_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeFlutterAssetManager_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeWebSettings_2 extends _i1.SmartFake implements _i2.WebSettings { - _FakeWebSettings_2( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWebSettings_2(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeWebStorage_3 extends _i1.SmartFake implements _i2.WebStorage { - _FakeWebStorage_3( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWebStorage_3(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeWebView_4 extends _i1.SmartFake implements _i2.WebView { - _FakeWebView_4( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWebView_4(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeWebViewPoint_5 extends _i1.SmartFake implements _i2.WebViewPoint { - _FakeWebViewPoint_5( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWebViewPoint_5(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeWebResourceRequest_6 extends _i1.SmartFake implements _i2.WebResourceRequest { - _FakeWebResourceRequest_6( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWebResourceRequest_6(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeDownloadListener_7 extends _i1.SmartFake implements _i2.DownloadListener { - _FakeDownloadListener_7( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeDownloadListener_7(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeJavascriptChannelRegistry_8 extends _i1.SmartFake implements _i3.JavascriptChannelRegistry { - _FakeJavascriptChannelRegistry_8( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeJavascriptChannelRegistry_8(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeJavaScriptChannel_9 extends _i1.SmartFake implements _i2.JavaScriptChannel { - _FakeJavaScriptChannel_9( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeJavaScriptChannel_9(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeWebChromeClient_10 extends _i1.SmartFake implements _i2.WebChromeClient { - _FakeWebChromeClient_10( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWebChromeClient_10(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeWebViewClient_11 extends _i1.SmartFake implements _i2.WebViewClient { - _FakeWebViewClient_11( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWebViewClient_11(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [FlutterAssetManager]. @@ -164,53 +105,47 @@ class MockFlutterAssetManager 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> list(String? path) => (super.noSuchMethod( - Invocation.method( - #list, - [path], - ), - returnValue: _i4.Future>.value([]), - ) as _i4.Future>); + _i4.Future> list(String? path) => + (super.noSuchMethod( + Invocation.method(#list, [path]), + returnValue: _i4.Future>.value([]), + ) + as _i4.Future>); @override _i4.Future getAssetFilePathByName(String? name) => (super.noSuchMethod( - Invocation.method( - #getAssetFilePathByName, - [name], - ), - returnValue: _i4.Future.value(_i5.dummyValue( - this, - Invocation.method( - #getAssetFilePathByName, - [name], - ), - )), - ) as _i4.Future); - - @override - _i2.FlutterAssetManager pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeFlutterAssetManager_1( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.FlutterAssetManager); + Invocation.method(#getAssetFilePathByName, [name]), + returnValue: _i4.Future.value( + _i5.dummyValue( + this, + Invocation.method(#getAssetFilePathByName, [name]), + ), + ), + ) + as _i4.Future); + + @override + _i2.FlutterAssetManager pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeFlutterAssetManager_1( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.FlutterAssetManager); } /// A class which mocks [WebSettings]. @@ -222,198 +157,176 @@ class MockWebSettings extends _i1.Mock implements _i2.WebSettings { } @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 setDomStorageEnabled(bool? flag) => (super.noSuchMethod( - Invocation.method( - #setDomStorageEnabled, - [flag], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + _i4.Future setDomStorageEnabled(bool? flag) => + (super.noSuchMethod( + Invocation.method(#setDomStorageEnabled, [flag]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override _i4.Future setJavaScriptCanOpenWindowsAutomatically(bool? flag) => (super.noSuchMethod( - Invocation.method( - #setJavaScriptCanOpenWindowsAutomatically, - [flag], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#setJavaScriptCanOpenWindowsAutomatically, [ + flag, + ]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override _i4.Future setSupportMultipleWindows(bool? support) => (super.noSuchMethod( - Invocation.method( - #setSupportMultipleWindows, - [support], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#setSupportMultipleWindows, [support]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override - _i4.Future setJavaScriptEnabled(bool? flag) => (super.noSuchMethod( - Invocation.method( - #setJavaScriptEnabled, - [flag], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + _i4.Future setJavaScriptEnabled(bool? flag) => + (super.noSuchMethod( + Invocation.method(#setJavaScriptEnabled, [flag]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override _i4.Future setUserAgentString(String? userAgentString) => (super.noSuchMethod( - Invocation.method( - #setUserAgentString, - [userAgentString], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#setUserAgentString, [userAgentString]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override _i4.Future setMediaPlaybackRequiresUserGesture(bool? require) => (super.noSuchMethod( - Invocation.method( - #setMediaPlaybackRequiresUserGesture, - [require], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#setMediaPlaybackRequiresUserGesture, [require]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override - _i4.Future setSupportZoom(bool? support) => (super.noSuchMethod( - Invocation.method( - #setSupportZoom, - [support], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + _i4.Future setSupportZoom(bool? support) => + (super.noSuchMethod( + Invocation.method(#setSupportZoom, [support]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override _i4.Future setLoadWithOverviewMode(bool? overview) => (super.noSuchMethod( - Invocation.method( - #setLoadWithOverviewMode, - [overview], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - - @override - _i4.Future setUseWideViewPort(bool? use) => (super.noSuchMethod( - Invocation.method( - #setUseWideViewPort, - [use], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - - @override - _i4.Future setDisplayZoomControls(bool? enabled) => (super.noSuchMethod( - Invocation.method( - #setDisplayZoomControls, - [enabled], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - - @override - _i4.Future setBuiltInZoomControls(bool? enabled) => (super.noSuchMethod( - Invocation.method( - #setBuiltInZoomControls, - [enabled], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - - @override - _i4.Future setAllowFileAccess(bool? enabled) => (super.noSuchMethod( - Invocation.method( - #setAllowFileAccess, - [enabled], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - - @override - _i4.Future setAllowContentAccess(bool? enabled) => (super.noSuchMethod( - Invocation.method( - #setAllowContentAccess, - [enabled], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - - @override - _i4.Future setGeolocationEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method( - #setGeolocationEnabled, - [enabled], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - - @override - _i4.Future setTextZoom(int? textZoom) => (super.noSuchMethod( - Invocation.method( - #setTextZoom, - [textZoom], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - - @override - _i4.Future getUserAgentString() => (super.noSuchMethod( - Invocation.method( - #getUserAgentString, - [], - ), - returnValue: _i4.Future.value(_i5.dummyValue( - this, - Invocation.method( - #getUserAgentString, - [], - ), - )), - ) as _i4.Future); - - @override - _i2.WebSettings pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeWebSettings_2( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.WebSettings); + Invocation.method(#setLoadWithOverviewMode, [overview]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); + + @override + _i4.Future setUseWideViewPort(bool? use) => + (super.noSuchMethod( + Invocation.method(#setUseWideViewPort, [use]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); + + @override + _i4.Future setDisplayZoomControls(bool? enabled) => + (super.noSuchMethod( + Invocation.method(#setDisplayZoomControls, [enabled]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); + + @override + _i4.Future setBuiltInZoomControls(bool? enabled) => + (super.noSuchMethod( + Invocation.method(#setBuiltInZoomControls, [enabled]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); + + @override + _i4.Future setAllowFileAccess(bool? enabled) => + (super.noSuchMethod( + Invocation.method(#setAllowFileAccess, [enabled]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); + + @override + _i4.Future setAllowContentAccess(bool? enabled) => + (super.noSuchMethod( + Invocation.method(#setAllowContentAccess, [enabled]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); + + @override + _i4.Future setGeolocationEnabled(bool? enabled) => + (super.noSuchMethod( + Invocation.method(#setGeolocationEnabled, [enabled]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); + + @override + _i4.Future setTextZoom(int? textZoom) => + (super.noSuchMethod( + Invocation.method(#setTextZoom, [textZoom]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); + + @override + _i4.Future getUserAgentString() => + (super.noSuchMethod( + Invocation.method(#getUserAgentString, []), + returnValue: _i4.Future.value( + _i5.dummyValue( + this, + Invocation.method(#getUserAgentString, []), + ), + ), + ) + as _i4.Future); + + @override + _i2.WebSettings pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWebSettings_2( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WebSettings); } /// A class which mocks [WebStorage]. @@ -425,38 +338,35 @@ class MockWebStorage extends _i1.Mock implements _i2.WebStorage { } @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 deleteAllData() => (super.noSuchMethod( - Invocation.method( - #deleteAllData, - [], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - - @override - _i2.WebStorage pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeWebStorage_3( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.WebStorage); + _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 deleteAllData() => + (super.noSuchMethod( + Invocation.method(#deleteAllData, []), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); + + @override + _i2.WebStorage pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWebStorage_3( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WebStorage); } /// A class which mocks [WebView]. @@ -468,56 +378,43 @@ class MockWebView extends _i1.Mock implements _i2.WebView { } @override - _i2.WebSettings get settings => (super.noSuchMethod( - Invocation.getter(#settings), - returnValue: _FakeWebSettings_2( - this, - Invocation.getter(#settings), - ), - ) as _i2.WebSettings); - - @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.WebSettings pigeonVar_settings() => (super.noSuchMethod( - Invocation.method( - #pigeonVar_settings, - [], - ), - returnValue: _FakeWebSettings_2( - this, - Invocation.method( - #pigeonVar_settings, - [], - ), - ), - ) as _i2.WebSettings); - - @override - _i4.Future loadData( - String? data, - String? mimeType, - String? encoding, - ) => + _i2.WebSettings get settings => (super.noSuchMethod( - Invocation.method( - #loadData, - [ - data, - mimeType, - encoding, - ], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.getter(#settings), + returnValue: _FakeWebSettings_2(this, Invocation.getter(#settings)), + ) + as _i2.WebSettings); + + @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.WebSettings pigeonVar_settings() => + (super.noSuchMethod( + Invocation.method(#pigeonVar_settings, []), + returnValue: _FakeWebSettings_2( + this, + Invocation.method(#pigeonVar_settings, []), + ), + ) + as _i2.WebSettings); + + @override + _i4.Future loadData(String? data, String? mimeType, String? encoding) => + (super.noSuchMethod( + Invocation.method(#loadData, [data, mimeType, encoding]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override _i4.Future loadDataWithBaseUrl( @@ -528,277 +425,234 @@ class MockWebView extends _i1.Mock implements _i2.WebView { String? historyUrl, ) => (super.noSuchMethod( - Invocation.method( - #loadDataWithBaseUrl, - [ - baseUrl, - data, - mimeType, - encoding, - historyUrl, - ], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - - @override - _i4.Future loadUrl( - String? url, - Map? headers, - ) => + Invocation.method(#loadDataWithBaseUrl, [ + baseUrl, + data, + mimeType, + encoding, + historyUrl, + ]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); + + @override + _i4.Future loadUrl(String? url, Map? headers) => (super.noSuchMethod( - Invocation.method( - #loadUrl, - [ - url, - headers, - ], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - - @override - _i4.Future postUrl( - String? url, - _i6.Uint8List? data, - ) => + Invocation.method(#loadUrl, [url, headers]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); + + @override + _i4.Future postUrl(String? url, _i6.Uint8List? data) => + (super.noSuchMethod( + Invocation.method(#postUrl, [url, data]), + 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 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( - #postUrl, - [ - url, - data, - ], - ), - 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 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 clearCache(bool? includeDiskFiles) => (super.noSuchMethod( - Invocation.method( - #clearCache, - [includeDiskFiles], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + 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 clearCache(bool? includeDiskFiles) => + (super.noSuchMethod( + Invocation.method(#clearCache, [includeDiskFiles]), + 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 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 setWebViewClient(_i2.WebViewClient? client) => (super.noSuchMethod( - Invocation.method( - #setWebViewClient, - [client], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#setWebViewClient, [client]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override _i4.Future addJavaScriptChannel(_i2.JavaScriptChannel? channel) => (super.noSuchMethod( - Invocation.method( - #addJavaScriptChannel, - [channel], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#addJavaScriptChannel, [channel]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override - _i4.Future removeJavaScriptChannel(String? name) => (super.noSuchMethod( - Invocation.method( - #removeJavaScriptChannel, - [name], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + _i4.Future removeJavaScriptChannel(String? name) => + (super.noSuchMethod( + Invocation.method(#removeJavaScriptChannel, [name]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override _i4.Future setDownloadListener(_i2.DownloadListener? listener) => (super.noSuchMethod( - Invocation.method( - #setDownloadListener, - [listener], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#setDownloadListener, [listener]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override _i4.Future setWebChromeClient(_i2.WebChromeClient? client) => (super.noSuchMethod( - Invocation.method( - #setWebChromeClient, - [client], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - - @override - _i4.Future setBackgroundColor(int? color) => (super.noSuchMethod( - Invocation.method( - #setBackgroundColor, - [color], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - - @override - _i4.Future destroy() => (super.noSuchMethod( - Invocation.method( - #destroy, - [], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - - @override - _i2.WebView pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeWebView_4( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.WebView); - - @override - _i4.Future scrollTo( - int? x, - int? y, - ) => + Invocation.method(#setWebChromeClient, [client]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); + + @override + _i4.Future setBackgroundColor(int? color) => (super.noSuchMethod( - Invocation.method( - #scrollTo, - [ - x, - y, - ], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - - @override - _i4.Future scrollBy( - int? x, - int? y, - ) => + Invocation.method(#setBackgroundColor, [color]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); + + @override + _i4.Future destroy() => (super.noSuchMethod( - Invocation.method( - #scrollBy, - [ - x, - y, - ], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - - @override - _i4.Future<_i2.WebViewPoint> getScrollPosition() => (super.noSuchMethod( - Invocation.method( - #getScrollPosition, - [], - ), - returnValue: _i4.Future<_i2.WebViewPoint>.value(_FakeWebViewPoint_5( - this, - Invocation.method( - #getScrollPosition, - [], - ), - )), - ) as _i4.Future<_i2.WebViewPoint>); + Invocation.method(#destroy, []), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); + + @override + _i2.WebView pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWebView_4( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WebView); + + @override + _i4.Future scrollTo(int? x, int? y) => + (super.noSuchMethod( + Invocation.method(#scrollTo, [x, y]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); + + @override + _i4.Future scrollBy(int? x, int? y) => + (super.noSuchMethod( + Invocation.method(#scrollBy, [x, y]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); + + @override + _i4.Future<_i2.WebViewPoint> getScrollPosition() => + (super.noSuchMethod( + Invocation.method(#getScrollPosition, []), + returnValue: _i4.Future<_i2.WebViewPoint>.value( + _FakeWebViewPoint_5( + this, + Invocation.method(#getScrollPosition, []), + ), + ), + ) + as _i4.Future<_i2.WebViewPoint>); + + @override + _i4.Future setVerticalScrollBarEnabled(bool? enabled) => + (super.noSuchMethod( + Invocation.method(#setVerticalScrollBarEnabled, [enabled]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); + + @override + _i4.Future setHorizontalScrollBarEnabled(bool? enabled) => + (super.noSuchMethod( + Invocation.method(#setHorizontalScrollBarEnabled, [enabled]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); } /// A class which mocks [WebResourceRequest]. @@ -811,58 +665,58 @@ class MockWebResourceRequest extends _i1.Mock } @override - String get url => (super.noSuchMethod( - Invocation.getter(#url), - returnValue: _i5.dummyValue( - this, - Invocation.getter(#url), - ), - ) as String); - - @override - bool get isForMainFrame => (super.noSuchMethod( - Invocation.getter(#isForMainFrame), - returnValue: false, - ) as bool); - - @override - bool get hasGesture => (super.noSuchMethod( - Invocation.getter(#hasGesture), - returnValue: false, - ) as bool); - - @override - String get method => (super.noSuchMethod( - Invocation.getter(#method), - returnValue: _i5.dummyValue( - this, - Invocation.getter(#method), - ), - ) as String); - - @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.WebResourceRequest pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeWebResourceRequest_6( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.WebResourceRequest); + String get url => + (super.noSuchMethod( + Invocation.getter(#url), + returnValue: _i5.dummyValue(this, Invocation.getter(#url)), + ) + as String); + + @override + bool get isForMainFrame => + (super.noSuchMethod( + Invocation.getter(#isForMainFrame), + returnValue: false, + ) + as bool); + + @override + bool get hasGesture => + (super.noSuchMethod(Invocation.getter(#hasGesture), returnValue: false) + as bool); + + @override + String get method => + (super.noSuchMethod( + Invocation.getter(#method), + returnValue: _i5.dummyValue( + this, + Invocation.getter(#method), + ), + ) + as String); + + @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.WebResourceRequest pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWebResourceRequest_6( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WebResourceRequest); } /// A class which mocks [DownloadListener]. @@ -874,55 +728,50 @@ class MockDownloadListener extends _i1.Mock implements _i2.DownloadListener { } @override - void Function( - _i2.DownloadListener, - String, - String, - String, - String, - int, - ) get onDownloadStart => (super.noSuchMethod( - Invocation.getter(#onDownloadStart), - returnValue: ( - _i2.DownloadListener pigeon_instance, - String url, - String userAgent, - String contentDisposition, - String mimetype, - int contentLength, - ) {}, - ) as void Function( - _i2.DownloadListener, - String, - String, - String, - String, - int, - )); - - @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.DownloadListener pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeDownloadListener_7( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.DownloadListener); + void Function(_i2.DownloadListener, String, String, String, String, int) + get onDownloadStart => + (super.noSuchMethod( + Invocation.getter(#onDownloadStart), + returnValue: + ( + _i2.DownloadListener pigeon_instance, + String url, + String userAgent, + String contentDisposition, + String mimetype, + int contentLength, + ) {}, + ) + as void Function( + _i2.DownloadListener, + String, + String, + String, + String, + int, + )); + + @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.DownloadListener pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeDownloadListener_7( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.DownloadListener); } /// A class which mocks [WebViewAndroidJavaScriptChannel]. @@ -937,60 +786,55 @@ class MockWebViewAndroidJavaScriptChannel extends _i1.Mock @override _i3.JavascriptChannelRegistry get javascriptChannelRegistry => (super.noSuchMethod( - Invocation.getter(#javascriptChannelRegistry), - returnValue: _FakeJavascriptChannelRegistry_8( - this, - Invocation.getter(#javascriptChannelRegistry), - ), - ) as _i3.JavascriptChannelRegistry); - - @override - String get channelName => (super.noSuchMethod( - Invocation.getter(#channelName), - returnValue: _i5.dummyValue( - this, - Invocation.getter(#channelName), - ), - ) as String); - - @override - void Function( - _i2.JavaScriptChannel, - String, - ) get postMessage => (super.noSuchMethod( - Invocation.getter(#postMessage), - returnValue: ( - _i2.JavaScriptChannel pigeon_instance, - String message, - ) {}, - ) as void Function( - _i2.JavaScriptChannel, - String, - )); - - @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.JavaScriptChannel pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeJavaScriptChannel_9( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.JavaScriptChannel); + Invocation.getter(#javascriptChannelRegistry), + returnValue: _FakeJavascriptChannelRegistry_8( + this, + Invocation.getter(#javascriptChannelRegistry), + ), + ) + as _i3.JavascriptChannelRegistry); + + @override + String get channelName => + (super.noSuchMethod( + Invocation.getter(#channelName), + returnValue: _i5.dummyValue( + this, + Invocation.getter(#channelName), + ), + ) + as String); + + @override + void Function(_i2.JavaScriptChannel, String) get postMessage => + (super.noSuchMethod( + Invocation.getter(#postMessage), + returnValue: + (_i2.JavaScriptChannel pigeon_instance, String message) {}, + ) + as void Function(_i2.JavaScriptChannel, String)); + + @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.JavaScriptChannel pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeJavaScriptChannel_9( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.JavaScriptChannel); } /// A class which mocks [WebChromeClient]. @@ -1002,83 +846,77 @@ class MockWebChromeClient extends _i1.Mock implements _i2.WebChromeClient { } @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 setSynchronousReturnValueForOnShowFileChooser(bool? value) => (super.noSuchMethod( - Invocation.method( - #setSynchronousReturnValueForOnShowFileChooser, - [value], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#setSynchronousReturnValueForOnShowFileChooser, [ + value, + ]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override _i4.Future setSynchronousReturnValueForOnConsoleMessage(bool? value) => (super.noSuchMethod( - Invocation.method( - #setSynchronousReturnValueForOnConsoleMessage, - [value], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#setSynchronousReturnValueForOnConsoleMessage, [ + value, + ]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override _i4.Future setSynchronousReturnValueForOnJsAlert(bool? value) => (super.noSuchMethod( - Invocation.method( - #setSynchronousReturnValueForOnJsAlert, - [value], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#setSynchronousReturnValueForOnJsAlert, [value]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override _i4.Future setSynchronousReturnValueForOnJsConfirm(bool? value) => (super.noSuchMethod( - Invocation.method( - #setSynchronousReturnValueForOnJsConfirm, - [value], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#setSynchronousReturnValueForOnJsConfirm, [ + value, + ]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override _i4.Future setSynchronousReturnValueForOnJsPrompt(bool? value) => (super.noSuchMethod( - Invocation.method( - #setSynchronousReturnValueForOnJsPrompt, - [value], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - - @override - _i2.WebChromeClient pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeWebChromeClient_10( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.WebChromeClient); + Invocation.method(#setSynchronousReturnValueForOnJsPrompt, [value]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); + + @override + _i2.WebChromeClient pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWebChromeClient_10( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WebChromeClient); } /// A class which mocks [WebViewClient]. @@ -1090,40 +928,40 @@ class MockWebViewClient extends _i1.Mock implements _i2.WebViewClient { } @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 setSynchronousReturnValueForShouldOverrideUrlLoading( - bool? value) => - (super.noSuchMethod( - Invocation.method( - #setSynchronousReturnValueForShouldOverrideUrlLoading, - [value], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - - @override - _i2.WebViewClient pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), - returnValue: _FakeWebViewClient_11( - this, - Invocation.method( - #pigeon_copy, - [], - ), - ), - ) as _i2.WebViewClient); + bool? value, + ) => + (super.noSuchMethod( + Invocation.method( + #setSynchronousReturnValueForShouldOverrideUrlLoading, + [value], + ), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); + + @override + _i2.WebViewClient pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWebViewClient_11( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WebViewClient); } /// A class which mocks [JavascriptChannelRegistry]. @@ -1136,34 +974,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<_i3.JavascriptChannel>? channels) => super.noSuchMethod( - Invocation.method( - #updateJavascriptChannelsFromSet, - [channels], - ), + Invocation.method(#updateJavascriptChannelsFromSet, [channels]), returnValueForMissingStub: null, ); } @@ -1183,52 +1011,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(_i3.WebResourceError? error) => super.noSuchMethod( - Invocation.method( - #onWebResourceError, - [error], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#onWebResourceError, [error]), + returnValueForMissingStub: null, + ); } /// A class which mocks [WebViewProxy]. @@ -1240,94 +1053,62 @@ class MockWebViewProxy extends _i1.Mock implements _i7.WebViewProxy { } @override - _i2.WebView createWebView() => (super.noSuchMethod( - Invocation.method( - #createWebView, - [], - ), - returnValue: _FakeWebView_4( - this, - Invocation.method( - #createWebView, - [], - ), - ), - ) as _i2.WebView); + _i2.WebView createWebView() => + (super.noSuchMethod( + Invocation.method(#createWebView, []), + returnValue: _FakeWebView_4( + this, + Invocation.method(#createWebView, []), + ), + ) + as _i2.WebView); @override _i2.WebViewClient createWebViewClient({ - void Function( - _i2.WebViewClient, - _i2.WebView, - String, - )? onPageStarted, - void Function( - _i2.WebViewClient, - _i2.WebView, - String, - )? onPageFinished, + void Function(_i2.WebViewClient, _i2.WebView, String)? onPageStarted, + void Function(_i2.WebViewClient, _i2.WebView, String)? onPageFinished, void Function( _i2.WebViewClient, _i2.WebView, _i2.WebResourceRequest, _i2.WebResourceError, - )? onReceivedRequestError, - void Function( - _i2.WebViewClient, - _i2.WebView, - int, - String, - String, - )? onReceivedError, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.WebResourceRequest, - )? requestLoading, - void Function( - _i2.WebViewClient, - _i2.WebView, - String, - )? urlLoading, + )? + onReceivedRequestError, + void Function(_i2.WebViewClient, _i2.WebView, int, String, String)? + onReceivedError, + void Function(_i2.WebViewClient, _i2.WebView, _i2.WebResourceRequest)? + requestLoading, + void Function(_i2.WebViewClient, _i2.WebView, String)? urlLoading, }) => (super.noSuchMethod( - Invocation.method( - #createWebViewClient, - [], - { - #onPageStarted: onPageStarted, - #onPageFinished: onPageFinished, - #onReceivedRequestError: onReceivedRequestError, - #onReceivedError: onReceivedError, - #requestLoading: requestLoading, - #urlLoading: urlLoading, - }, - ), - returnValue: _FakeWebViewClient_11( - this, - Invocation.method( - #createWebViewClient, - [], - { + Invocation.method(#createWebViewClient, [], { #onPageStarted: onPageStarted, #onPageFinished: onPageFinished, #onReceivedRequestError: onReceivedRequestError, #onReceivedError: onReceivedError, #requestLoading: requestLoading, #urlLoading: urlLoading, - }, - ), - ), - ) as _i2.WebViewClient); + }), + returnValue: _FakeWebViewClient_11( + this, + Invocation.method(#createWebViewClient, [], { + #onPageStarted: onPageStarted, + #onPageFinished: onPageFinished, + #onReceivedRequestError: onReceivedRequestError, + #onReceivedError: onReceivedError, + #requestLoading: requestLoading, + #urlLoading: urlLoading, + }), + ), + ) + as _i2.WebViewClient); @override _i4.Future setWebContentsDebuggingEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method( - #setWebContentsDebuggingEnabled, - [enabled], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#setWebContentsDebuggingEnabled, [enabled]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); } From 8475a1eda7f72636d5e3c635ab7c69e6452e0883 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Mon, 7 Apr 2025 23:06:06 -0400 Subject: [PATCH 09/29] java side impl --- .../plugins/webviewflutter/ViewProxyApi.java | 10 +++++++++ .../webviewflutter/WebViewProxyApi.java | 10 --------- .../plugins/webviewflutter/ViewTest.java | 22 +++++++++++++++++++ 3 files changed, 32 insertions(+), 10 deletions(-) diff --git a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/ViewProxyApi.java b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/ViewProxyApi.java index e5efbd15f81..02e28978be5 100644 --- a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/ViewProxyApi.java +++ b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/ViewProxyApi.java @@ -34,4 +34,14 @@ public void scrollBy(@NonNull View pigeon_instance, long x, long y) { public WebViewPoint getScrollPosition(@NonNull View pigeon_instance) { return new WebViewPoint(pigeon_instance.getScrollX(), pigeon_instance.getScrollY()); } + + @Override + public void setVerticalScrollBarEnabled(@NonNull View pigeon_instance, boolean enabled) { + pigeon_instance.setVerticalScrollBarEnabled(enabled); + } + + @Override + public void setHorizontalScrollBarEnabled(@NonNull View pigeon_instance, boolean enabled) { + pigeon_instance.setHorizontalScrollBarEnabled(enabled); + } } diff --git a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebViewProxyApi.java b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebViewProxyApi.java index 7164fd2d682..7f976905526 100644 --- a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebViewProxyApi.java +++ b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebViewProxyApi.java @@ -271,16 +271,6 @@ public void setBackgroundColor(@NonNull WebView pigeon_instance, long color) { pigeon_instance.setBackgroundColor((int) color); } - @Override - public void verticalScrollBarEnabled(@NonNull WebView pigeon_instance, boolean enabled) { - pigeon_instance.setVerticalScrollBarEnabled(enabled); - } - - @Override - public void horizontalScrollBarEnabled(@NonNull WebView pigeon_instance, boolean enabled) { - pigeon_instance.setHorizontalScrollBarEnabled(enabled); - } - @NonNull @Override public ProxyApiRegistrar getPigeonRegistrar() { diff --git a/packages/webview_flutter/webview_flutter_android/android/src/test/java/io/flutter/plugins/webviewflutter/ViewTest.java b/packages/webview_flutter/webview_flutter_android/android/src/test/java/io/flutter/plugins/webviewflutter/ViewTest.java index 2ae41983d44..a785ba39f9b 100644 --- a/packages/webview_flutter/webview_flutter_android/android/src/test/java/io/flutter/plugins/webviewflutter/ViewTest.java +++ b/packages/webview_flutter/webview_flutter_android/android/src/test/java/io/flutter/plugins/webviewflutter/ViewTest.java @@ -49,4 +49,26 @@ public void getScrollPosition() { assertEquals(value.getX(), api.getScrollPosition(instance).getX()); assertEquals(value.getY(), api.getScrollPosition(instance).getY()); } + + @Test + public void setVerticalScrollBarEnabled() { + final PigeonApiView api = new TestProxyApiRegistrar().getPigeonApiView(); + + final View instance = mock(View.class); + final boolean enabled = true; + api.setVerticalScrollBarEnabled(instance, enabled); + + verify(instance).setVerticalScrollBarEnabled(enabled); + } + + @Test + public void setHorizontalScrollBarEnabled() { + final PigeonApiView api = new TestProxyApiRegistrar().getPigeonApiView(); + + final View instance = mock(View.class); + final boolean enabled = false; + api.setHorizontalScrollBarEnabled(instance, enabled); + + verify(instance).setHorizontalScrollBarEnabled(enabled); + } } From 7499acd9855ca50913570a8a96dc09586f0e4070 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Mon, 7 Apr 2025 23:22:41 -0400 Subject: [PATCH 10/29] ios impl --- .../Tests/ScrollViewProxyAPITests.swift | 22 + .../ScrollViewProxyAPIDelegate.swift | 8 + .../WebKitLibrary.g.swift | 4665 +++++++---------- .../lib/src/common/web_kit.g.dart | 367 +- .../lib/src/webkit_webview_controller.dart | 10 + .../pigeons/web_kit.dart | 10 + .../web_kit_cookie_manager_test.mocks.dart | 163 +- .../web_kit_webview_widget_test.mocks.dart | 1807 ++++--- ...webkit_navigation_delegate_test.mocks.dart | 257 +- .../test/webkit_webview_controller_test.dart | 30 + .../webkit_webview_controller_test.mocks.dart | 1948 ++++--- ...kit_webview_cookie_manager_test.mocks.dart | 163 +- .../webkit_webview_widget_test.mocks.dart | 361 +- 13 files changed, 4692 insertions(+), 5119 deletions(-) diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/ScrollViewProxyAPITests.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/ScrollViewProxyAPITests.swift index 60f39d11f1b..707b2e87c89 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/ScrollViewProxyAPITests.swift +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/ScrollViewProxyAPITests.swift @@ -125,6 +125,28 @@ class ScrollViewProxyAPITests: XCTestCase { XCTAssertEqual(instance.alwaysBounceHorizontal, value) } + + @MainActor func testSetShowsVerticalScrollIndicator() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiUIScrollView(registrar) + + let instance = TestScrollView() + let value = true + try? api.pigeonDelegate.setShowsVerticalScrollIndicator(pigeonApi: api, pigeonInstance: instance, value: value) + + XCTAssertEqual(instance.showsVerticalScrollIndicator, value) + } + + @MainActor func testSetShowsHorizontalScrollIndicator() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiUIScrollView(registrar) + + let instance = TestScrollView() + let value = true + try? api.pigeonDelegate.setShowsHorizontalScrollIndicator(pigeonApi: api, pigeonInstance: instance, value: value) + + XCTAssertEqual(instance.showsHorizontalScrollIndicator, value) + } #endif } diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/ScrollViewProxyAPIDelegate.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/ScrollViewProxyAPIDelegate.swift index bb098a29a0c..7e89286124e 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/ScrollViewProxyAPIDelegate.swift +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/ScrollViewProxyAPIDelegate.swift @@ -88,5 +88,13 @@ class ScrollViewProxyAPIDelegate: PigeonApiDelegateUIScrollView { ) throws { pigeonInstance.alwaysBounceHorizontal = value } + + func setShowsVerticalScrollIndicator(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws { + pigeonInstance.showsVerticalScrollIndicator = value + } + + func setShowsHorizontalScrollIndicator(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws { + pigeonInstance.showsHorizontalScrollIndicator = value + } #endif } 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 177b66a2e6c..c48599ef7cf 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,14 +1,13 @@ // 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.2.1), do not edit directly. +// Autogenerated from Pigeon (v24.2.2), do not edit directly. // See also: https://pub.dev/packages/pigeon import Foundation import WebKit - #if !os(macOS) - import UIKit +import UIKit #endif #if os(iOS) @@ -34,7 +33,7 @@ final class PigeonError: Error { var localizedDescription: String { return "PigeonError(code: \(code), message: \(message ?? ""), details: \(details ?? "")" - } + } } private func wrapResult(_ result: Any?) -> [Any?] { @@ -64,9 +63,7 @@ private func wrapError(_ error: Any) -> [Any?] { } private func createConnectionError(withChannelName channelName: String) -> PigeonError { - return PigeonError( - code: "channel-error", message: "Unable to establish connection on channel: '\(channelName)'.", - details: "") + return PigeonError(code: "channel-error", message: "Unable to establish connection on channel: '\(channelName)'.", details: "") } private func isNullish(_ value: Any?) -> Bool { @@ -83,6 +80,7 @@ protocol WebKitLibraryPigeonInternalFinalizerDelegate: AnyObject { func onDeinit(identifier: Int64) } + // Attaches to an object to receive a callback when the object is deallocated. internal final class WebKitLibraryPigeonInternalFinalizer { private static let associatedObjectKey = malloc(1)! @@ -98,8 +96,7 @@ internal final class WebKitLibraryPigeonInternalFinalizer { } internal static func attach( - to instance: AnyObject, identifier: Int64, - delegate: WebKitLibraryPigeonInternalFinalizerDelegate + to instance: AnyObject, identifier: Int64, delegate: WebKitLibraryPigeonInternalFinalizerDelegate ) { let finalizer = WebKitLibraryPigeonInternalFinalizer(identifier: identifier, delegate: delegate) objc_setAssociatedObject(instance, associatedObjectKey, finalizer, .OBJC_ASSOCIATION_RETAIN) @@ -114,6 +111,7 @@ internal final class WebKitLibraryPigeonInternalFinalizer { } } + /// Maintains instances used to communicate with the corresponding objects in Dart. /// /// Objects stored in this container are represented by an object in Dart that is also stored in @@ -217,8 +215,7 @@ final class WebKitLibraryPigeonInstanceManager { identifiers.setObject(NSNumber(value: identifier), forKey: instance) weakInstances.setObject(instance, forKey: NSNumber(value: identifier)) strongInstances.setObject(instance, forKey: NSNumber(value: identifier)) - WebKitLibraryPigeonInternalFinalizer.attach( - to: instance, identifier: identifier, delegate: finalizerDelegate) + WebKitLibraryPigeonInternalFinalizer.attach(to: instance, identifier: identifier, delegate: finalizerDelegate) } /// Retrieves the identifier paired with an instance. @@ -295,6 +292,7 @@ final class WebKitLibraryPigeonInstanceManager { } } + private class WebKitLibraryPigeonInstanceManagerApi { /// The codec used for serializing messages. var codec: FlutterStandardMessageCodec { WebKitLibraryPigeonCodec.shared } @@ -307,14 +305,9 @@ private class WebKitLibraryPigeonInstanceManagerApi { } /// Sets up an instance of `WebKitLibraryPigeonInstanceManagerApi` to handle messages through the `binaryMessenger`. - static func setUpMessageHandlers( - binaryMessenger: FlutterBinaryMessenger, instanceManager: WebKitLibraryPigeonInstanceManager? - ) { + static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, instanceManager: WebKitLibraryPigeonInstanceManager?) { let codec = WebKitLibraryPigeonCodec.shared - let removeStrongReferenceChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.webview_flutter_wkwebview.PigeonInternalInstanceManager.removeStrongReference", - binaryMessenger: binaryMessenger, codec: codec) + let removeStrongReferenceChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.PigeonInternalInstanceManager.removeStrongReference", binaryMessenger: binaryMessenger, codec: codec) if let instanceManager = instanceManager { removeStrongReferenceChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -329,9 +322,7 @@ private class WebKitLibraryPigeonInstanceManagerApi { } else { removeStrongReferenceChannel.setMessageHandler(nil) } - let clearChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.PigeonInternalInstanceManager.clear", - binaryMessenger: binaryMessenger, codec: codec) + let clearChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.PigeonInternalInstanceManager.clear", binaryMessenger: binaryMessenger, codec: codec) if let instanceManager = instanceManager { clearChannel.setMessageHandler { _, reply in do { @@ -347,13 +338,9 @@ private class WebKitLibraryPigeonInstanceManagerApi { } /// Sends a message to the Dart `InstanceManager` to remove the strong reference of the instance associated with `identifier`. - func removeStrongReference( - identifier identifierArg: Int64, completion: @escaping (Result) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.PigeonInternalInstanceManager.removeStrongReference" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func removeStrongReference(identifier identifierArg: Int64, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.PigeonInternalInstanceManager.removeStrongReference" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([identifierArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -376,130 +363,102 @@ protocol WebKitLibraryPigeonProxyApiDelegate { func pigeonApiURLRequest(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiURLRequest /// An implementation of [PigeonApiHTTPURLResponse] used to add a new Dart instance of /// `HTTPURLResponse` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiHTTPURLResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiHTTPURLResponse + func pigeonApiHTTPURLResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiHTTPURLResponse /// An implementation of [PigeonApiURLResponse] used to add a new Dart instance of /// `URLResponse` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiURLResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiURLResponse + func pigeonApiURLResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiURLResponse /// An implementation of [PigeonApiWKUserScript] used to add a new Dart instance of /// `WKUserScript` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKUserScript(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiWKUserScript + func pigeonApiWKUserScript(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKUserScript /// An implementation of [PigeonApiWKNavigationAction] used to add a new Dart instance of /// `WKNavigationAction` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKNavigationAction(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiWKNavigationAction + func pigeonApiWKNavigationAction(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKNavigationAction /// An implementation of [PigeonApiWKNavigationResponse] used to add a new Dart instance of /// `WKNavigationResponse` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKNavigationResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiWKNavigationResponse + func pigeonApiWKNavigationResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKNavigationResponse /// An implementation of [PigeonApiWKFrameInfo] used to add a new Dart instance of /// `WKFrameInfo` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKFrameInfo(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiWKFrameInfo + func pigeonApiWKFrameInfo(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKFrameInfo /// An implementation of [PigeonApiNSError] used to add a new Dart instance of /// `NSError` to the Dart `InstanceManager` and make calls to Dart. func pigeonApiNSError(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiNSError /// An implementation of [PigeonApiWKScriptMessage] used to add a new Dart instance of /// `WKScriptMessage` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKScriptMessage(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiWKScriptMessage + func pigeonApiWKScriptMessage(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKScriptMessage /// An implementation of [PigeonApiWKSecurityOrigin] used to add a new Dart instance of /// `WKSecurityOrigin` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKSecurityOrigin(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiWKSecurityOrigin + func pigeonApiWKSecurityOrigin(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKSecurityOrigin /// An implementation of [PigeonApiHTTPCookie] used to add a new Dart instance of /// `HTTPCookie` to the Dart `InstanceManager` and make calls to Dart. func pigeonApiHTTPCookie(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiHTTPCookie /// An implementation of [PigeonApiAuthenticationChallengeResponse] used to add a new Dart instance of /// `AuthenticationChallengeResponse` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiAuthenticationChallengeResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiAuthenticationChallengeResponse + func pigeonApiAuthenticationChallengeResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiAuthenticationChallengeResponse /// An implementation of [PigeonApiWKWebsiteDataStore] used to add a new Dart instance of /// `WKWebsiteDataStore` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKWebsiteDataStore(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiWKWebsiteDataStore + func pigeonApiWKWebsiteDataStore(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKWebsiteDataStore /// An implementation of [PigeonApiUIView] used to add a new Dart instance of /// `UIView` to the Dart `InstanceManager` and make calls to Dart. func pigeonApiUIView(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiUIView /// An implementation of [PigeonApiUIScrollView] used to add a new Dart instance of /// `UIScrollView` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiUIScrollView(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiUIScrollView + func pigeonApiUIScrollView(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiUIScrollView /// An implementation of [PigeonApiWKWebViewConfiguration] used to add a new Dart instance of /// `WKWebViewConfiguration` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKWebViewConfiguration(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiWKWebViewConfiguration + func pigeonApiWKWebViewConfiguration(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKWebViewConfiguration /// An implementation of [PigeonApiWKUserContentController] used to add a new Dart instance of /// `WKUserContentController` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKUserContentController(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiWKUserContentController + func pigeonApiWKUserContentController(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKUserContentController /// An implementation of [PigeonApiWKPreferences] used to add a new Dart instance of /// `WKPreferences` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKPreferences(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiWKPreferences + func pigeonApiWKPreferences(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKPreferences /// An implementation of [PigeonApiWKScriptMessageHandler] used to add a new Dart instance of /// `WKScriptMessageHandler` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKScriptMessageHandler(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiWKScriptMessageHandler + func pigeonApiWKScriptMessageHandler(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKScriptMessageHandler /// An implementation of [PigeonApiWKNavigationDelegate] used to add a new Dart instance of /// `WKNavigationDelegate` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKNavigationDelegate(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiWKNavigationDelegate + func pigeonApiWKNavigationDelegate(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKNavigationDelegate /// An implementation of [PigeonApiNSObject] used to add a new Dart instance of /// `NSObject` to the Dart `InstanceManager` and make calls to Dart. func pigeonApiNSObject(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiNSObject /// An implementation of [PigeonApiUIViewWKWebView] used to add a new Dart instance of /// `UIViewWKWebView` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiUIViewWKWebView(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiUIViewWKWebView + func pigeonApiUIViewWKWebView(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiUIViewWKWebView /// An implementation of [PigeonApiNSViewWKWebView] used to add a new Dart instance of /// `NSViewWKWebView` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiNSViewWKWebView(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiNSViewWKWebView + func pigeonApiNSViewWKWebView(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiNSViewWKWebView /// An implementation of [PigeonApiWKWebView] used to add a new Dart instance of /// `WKWebView` to the Dart `InstanceManager` and make calls to Dart. func pigeonApiWKWebView(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKWebView /// An implementation of [PigeonApiWKUIDelegate] used to add a new Dart instance of /// `WKUIDelegate` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKUIDelegate(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiWKUIDelegate + func pigeonApiWKUIDelegate(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKUIDelegate /// An implementation of [PigeonApiWKHTTPCookieStore] used to add a new Dart instance of /// `WKHTTPCookieStore` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKHTTPCookieStore(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiWKHTTPCookieStore + func pigeonApiWKHTTPCookieStore(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKHTTPCookieStore /// An implementation of [PigeonApiUIScrollViewDelegate] used to add a new Dart instance of /// `UIScrollViewDelegate` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiUIScrollViewDelegate(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiUIScrollViewDelegate + func pigeonApiUIScrollViewDelegate(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiUIScrollViewDelegate /// An implementation of [PigeonApiURLCredential] used to add a new Dart instance of /// `URLCredential` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiURLCredential(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiURLCredential + func pigeonApiURLCredential(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiURLCredential /// An implementation of [PigeonApiURLProtectionSpace] used to add a new Dart instance of /// `URLProtectionSpace` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiURLProtectionSpace(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiURLProtectionSpace + func pigeonApiURLProtectionSpace(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiURLProtectionSpace /// An implementation of [PigeonApiURLAuthenticationChallenge] used to add a new Dart instance of /// `URLAuthenticationChallenge` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiURLAuthenticationChallenge(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiURLAuthenticationChallenge + func pigeonApiURLAuthenticationChallenge(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiURLAuthenticationChallenge /// 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 + func pigeonApiWKWebpagePreferences(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKWebpagePreferences } extension WebKitLibraryPigeonProxyApiDelegate { - func pigeonApiURLResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiURLResponse - { - return PigeonApiURLResponse( - pigeonRegistrar: registrar, delegate: PigeonApiDelegateURLResponse()) + func pigeonApiURLResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiURLResponse { + return PigeonApiURLResponse(pigeonRegistrar: registrar, delegate: PigeonApiDelegateURLResponse()) } func pigeonApiWKWebView(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKWebView { return PigeonApiWKWebView(pigeonRegistrar: registrar, delegate: PigeonApiDelegateWKWebView()) @@ -544,68 +503,41 @@ open class WebKitLibraryPigeonProxyApiRegistrar { } func setUp() { - WebKitLibraryPigeonInstanceManagerApi.setUpMessageHandlers( - binaryMessenger: binaryMessenger, instanceManager: instanceManager) - PigeonApiURLRequest.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiURLRequest(self)) - PigeonApiWKUserScript.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKUserScript(self)) - PigeonApiHTTPCookie.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiHTTPCookie(self)) - PigeonApiAuthenticationChallengeResponse.setUpMessageHandlers( - binaryMessenger: binaryMessenger, - api: apiDelegate.pigeonApiAuthenticationChallengeResponse(self)) - PigeonApiWKWebsiteDataStore.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKWebsiteDataStore(self)) - PigeonApiUIView.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiUIView(self)) - PigeonApiUIScrollView.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiUIScrollView(self)) - PigeonApiWKWebViewConfiguration.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKWebViewConfiguration(self)) - PigeonApiWKUserContentController.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKUserContentController(self)) - PigeonApiWKPreferences.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKPreferences(self)) - PigeonApiWKScriptMessageHandler.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKScriptMessageHandler(self)) - PigeonApiWKNavigationDelegate.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKNavigationDelegate(self)) - PigeonApiNSObject.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiNSObject(self)) - PigeonApiUIViewWKWebView.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiUIViewWKWebView(self)) - PigeonApiNSViewWKWebView.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiNSViewWKWebView(self)) - PigeonApiWKUIDelegate.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKUIDelegate(self)) - PigeonApiWKHTTPCookieStore.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKHTTPCookieStore(self)) - PigeonApiUIScrollViewDelegate.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiUIScrollViewDelegate(self)) - PigeonApiURLCredential.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiURLCredential(self)) - PigeonApiURLAuthenticationChallenge.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiURLAuthenticationChallenge(self)) - PigeonApiURL.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiURL(self)) - PigeonApiWKWebpagePreferences.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKWebpagePreferences(self)) + WebKitLibraryPigeonInstanceManagerApi.setUpMessageHandlers(binaryMessenger: binaryMessenger, instanceManager: instanceManager) + PigeonApiURLRequest.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiURLRequest(self)) + PigeonApiWKUserScript.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKUserScript(self)) + PigeonApiHTTPCookie.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiHTTPCookie(self)) + PigeonApiAuthenticationChallengeResponse.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiAuthenticationChallengeResponse(self)) + PigeonApiWKWebsiteDataStore.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKWebsiteDataStore(self)) + PigeonApiUIView.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiUIView(self)) + PigeonApiUIScrollView.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiUIScrollView(self)) + PigeonApiWKWebViewConfiguration.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKWebViewConfiguration(self)) + PigeonApiWKUserContentController.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKUserContentController(self)) + PigeonApiWKPreferences.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKPreferences(self)) + PigeonApiWKScriptMessageHandler.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKScriptMessageHandler(self)) + PigeonApiWKNavigationDelegate.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKNavigationDelegate(self)) + PigeonApiNSObject.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiNSObject(self)) + PigeonApiUIViewWKWebView.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiUIViewWKWebView(self)) + PigeonApiNSViewWKWebView.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiNSViewWKWebView(self)) + PigeonApiWKUIDelegate.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKUIDelegate(self)) + PigeonApiWKHTTPCookieStore.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKHTTPCookieStore(self)) + PigeonApiUIScrollViewDelegate.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiUIScrollViewDelegate(self)) + PigeonApiURLCredential.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiURLCredential(self)) + PigeonApiURLAuthenticationChallenge.setUpMessageHandlers(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( - binaryMessenger: binaryMessenger, instanceManager: nil) + WebKitLibraryPigeonInstanceManagerApi.setUpMessageHandlers(binaryMessenger: binaryMessenger, instanceManager: nil) PigeonApiURLRequest.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiWKUserScript.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiHTTPCookie.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) - PigeonApiAuthenticationChallengeResponse.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: nil) + PigeonApiAuthenticationChallengeResponse.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiWKWebsiteDataStore.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiUIView.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiUIScrollView.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiWKWebViewConfiguration.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) - PigeonApiWKUserContentController.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: nil) + PigeonApiWKUserContentController.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiWKPreferences.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiWKScriptMessageHandler.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiWKNavigationDelegate.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) @@ -616,8 +548,7 @@ open class WebKitLibraryPigeonProxyApiRegistrar { PigeonApiWKHTTPCookieStore.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiUIScrollViewDelegate.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiURLCredential.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) - PigeonApiURLAuthenticationChallenge.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: nil) + PigeonApiURLAuthenticationChallenge.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiURL.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiWKWebpagePreferences.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) } @@ -658,272 +589,252 @@ private class WebKitLibraryPigeonInternalProxyApiCodecReaderWriter: FlutterStand } override func writeValue(_ value: Any) { - if value is [Any] || value is Bool || value is Data || value is [AnyHashable: Any] - || value is Double || value is FlutterStandardTypedData || value is Int64 || value is String - || value is KeyValueObservingOptions || value is KeyValueChange - || value is KeyValueChangeKey || value is UserScriptInjectionTime - || value is AudiovisualMediaType || value is WebsiteDataType - || value is NavigationActionPolicy || value is NavigationResponsePolicy - || value is HttpCookiePropertyKey || value is NavigationType || value is PermissionDecision - || value is MediaCaptureType || value is UrlSessionAuthChallengeDisposition - || value is UrlCredentialPersistence - { + if value is [Any] || value is Bool || value is Data || value is [AnyHashable: Any] || value is Double || value is FlutterStandardTypedData || value is Int64 || value is String || value is KeyValueObservingOptions || value is KeyValueChange || value is KeyValueChangeKey || value is UserScriptInjectionTime || value is AudiovisualMediaType || value is WebsiteDataType || value is NavigationActionPolicy || value is NavigationResponsePolicy || value is HttpCookiePropertyKey || value is NavigationType || value is PermissionDecision || value is MediaCaptureType || value is UrlSessionAuthChallengeDisposition || value is UrlCredentialPersistence { super.writeValue(value) return } + if let instance = value as? URLRequestWrapper { pigeonRegistrar.apiDelegate.pigeonApiURLRequest(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } + if let instance = value as? HTTPURLResponse { pigeonRegistrar.apiDelegate.pigeonApiHTTPURLResponse(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } + if let instance = value as? URLResponse { pigeonRegistrar.apiDelegate.pigeonApiURLResponse(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } + if let instance = value as? WKUserScript { pigeonRegistrar.apiDelegate.pigeonApiWKUserScript(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } + if let instance = value as? WKNavigationAction { pigeonRegistrar.apiDelegate.pigeonApiWKNavigationAction(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } + if let instance = value as? WKNavigationResponse { - pigeonRegistrar.apiDelegate.pigeonApiWKNavigationResponse(pigeonRegistrar) - .pigeonNewInstance( - pigeonInstance: instance - ) { _ in } + pigeonRegistrar.apiDelegate.pigeonApiWKNavigationResponse(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } + if let instance = value as? WKFrameInfo { pigeonRegistrar.apiDelegate.pigeonApiWKFrameInfo(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } + if let instance = value as? NSError { pigeonRegistrar.apiDelegate.pigeonApiNSError(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } + if let instance = value as? WKScriptMessage { pigeonRegistrar.apiDelegate.pigeonApiWKScriptMessage(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } + if let instance = value as? WKSecurityOrigin { pigeonRegistrar.apiDelegate.pigeonApiWKSecurityOrigin(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } + if let instance = value as? HTTPCookie { pigeonRegistrar.apiDelegate.pigeonApiHTTPCookie(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } + if let instance = value as? AuthenticationChallengeResponse { - pigeonRegistrar.apiDelegate.pigeonApiAuthenticationChallengeResponse(pigeonRegistrar) - .pigeonNewInstance( - pigeonInstance: instance - ) { _ in } + pigeonRegistrar.apiDelegate.pigeonApiAuthenticationChallengeResponse(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } + if let instance = value as? WKWebsiteDataStore { pigeonRegistrar.apiDelegate.pigeonApiWKWebsiteDataStore(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } #if !os(macOS) - if let instance = value as? UIScrollView { - pigeonRegistrar.apiDelegate.pigeonApiUIScrollView(pigeonRegistrar).pigeonNewInstance( - pigeonInstance: instance - ) { _ in } - super.writeByte(128) - super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) - return - } + if let instance = value as? UIScrollView { + pigeonRegistrar.apiDelegate.pigeonApiUIScrollView(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + return + } #endif if let instance = value as? WKWebViewConfiguration { - pigeonRegistrar.apiDelegate.pigeonApiWKWebViewConfiguration(pigeonRegistrar) - .pigeonNewInstance( - pigeonInstance: instance - ) { _ in } + pigeonRegistrar.apiDelegate.pigeonApiWKWebViewConfiguration(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } + if let instance = value as? WKUserContentController { - pigeonRegistrar.apiDelegate.pigeonApiWKUserContentController(pigeonRegistrar) - .pigeonNewInstance( - pigeonInstance: instance - ) { _ in } + pigeonRegistrar.apiDelegate.pigeonApiWKUserContentController(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } + if let instance = value as? WKPreferences { pigeonRegistrar.apiDelegate.pigeonApiWKPreferences(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } + if let instance = value as? WKScriptMessageHandler { - pigeonRegistrar.apiDelegate.pigeonApiWKScriptMessageHandler(pigeonRegistrar) - .pigeonNewInstance( - pigeonInstance: instance - ) { _ in } + pigeonRegistrar.apiDelegate.pigeonApiWKScriptMessageHandler(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } + if let instance = value as? WKNavigationDelegate { - pigeonRegistrar.apiDelegate.pigeonApiWKNavigationDelegate(pigeonRegistrar) - .pigeonNewInstance( - pigeonInstance: instance - ) { _ in } + pigeonRegistrar.apiDelegate.pigeonApiWKNavigationDelegate(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } #if !os(macOS) - if let instance = value as? WKWebView { - pigeonRegistrar.apiDelegate.pigeonApiUIViewWKWebView(pigeonRegistrar).pigeonNewInstance( - pigeonInstance: instance - ) { _ in } - super.writeByte(128) - super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) - return - } + if let instance = value as? WKWebView { + pigeonRegistrar.apiDelegate.pigeonApiUIViewWKWebView(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + return + } #endif #if !os(macOS) - if let instance = value as? UIView { - pigeonRegistrar.apiDelegate.pigeonApiUIView(pigeonRegistrar).pigeonNewInstance( - pigeonInstance: instance - ) { _ in } - super.writeByte(128) - super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) - return - } + if let instance = value as? UIView { + pigeonRegistrar.apiDelegate.pigeonApiUIView(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + return + } #endif #if !os(iOS) - if let instance = value as? WKWebView { - pigeonRegistrar.apiDelegate.pigeonApiNSViewWKWebView(pigeonRegistrar).pigeonNewInstance( - pigeonInstance: instance - ) { _ in } - super.writeByte(128) - super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) - return - } + if let instance = value as? WKWebView { + pigeonRegistrar.apiDelegate.pigeonApiNSViewWKWebView(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + return + } #endif if let instance = value as? WKWebView { @@ -932,45 +843,42 @@ private class WebKitLibraryPigeonInternalProxyApiCodecReaderWriter: FlutterStand ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } + if let instance = value as? WKUIDelegate { pigeonRegistrar.apiDelegate.pigeonApiWKUIDelegate(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } + if let instance = value as? WKHTTPCookieStore { pigeonRegistrar.apiDelegate.pigeonApiWKHTTPCookieStore(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } #if !os(macOS) - if let instance = value as? UIScrollViewDelegate { - pigeonRegistrar.apiDelegate.pigeonApiUIScrollViewDelegate(pigeonRegistrar) - .pigeonNewInstance( - pigeonInstance: instance - ) { _ in } - super.writeByte(128) - super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) - return - } + if let instance = value as? UIScrollViewDelegate { + pigeonRegistrar.apiDelegate.pigeonApiUIScrollViewDelegate(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + return + } #endif if let instance = value as? URLCredential { @@ -979,70 +887,67 @@ private class WebKitLibraryPigeonInternalProxyApiCodecReaderWriter: FlutterStand ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } + if let instance = value as? URLProtectionSpace { pigeonRegistrar.apiDelegate.pigeonApiURLProtectionSpace(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } + if let instance = value as? URLAuthenticationChallenge { - pigeonRegistrar.apiDelegate.pigeonApiURLAuthenticationChallenge(pigeonRegistrar) - .pigeonNewInstance( - pigeonInstance: instance - ) { _ in } + pigeonRegistrar.apiDelegate.pigeonApiURLAuthenticationChallenge(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } + if let instance = value as? URL { pigeonRegistrar.apiDelegate.pigeonApiURL(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } + if #available(iOS 13.0.0, macOS 10.15.0, *), let instance = value as? WKWebpagePreferences { - pigeonRegistrar.apiDelegate.pigeonApiWKWebpagePreferences(pigeonRegistrar) - .pigeonNewInstance( - pigeonInstance: instance - ) { _ in } + pigeonRegistrar.apiDelegate.pigeonApiWKWebpagePreferences(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } + if let instance = value as? NSObject { pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } - if let instance = value as AnyObject?, - pigeonRegistrar.instanceManager.containsInstance(instance) + + if let instance = value as AnyObject?, pigeonRegistrar.instanceManager.containsInstance(instance) { super.writeByte(128) super.writeValue( @@ -1060,13 +965,11 @@ private class WebKitLibraryPigeonInternalProxyApiCodecReaderWriter: FlutterStand } override func reader(with data: Data) -> FlutterStandardReader { - return WebKitLibraryPigeonInternalProxyApiCodecReader( - data: data, pigeonRegistrar: pigeonRegistrar) + return WebKitLibraryPigeonInternalProxyApiCodecReader(data: data, pigeonRegistrar: pigeonRegistrar) } override func writer(with data: NSMutableData) -> FlutterStandardWriter { - return WebKitLibraryPigeonInternalProxyApiCodecWriter( - data: data, pigeonRegistrar: pigeonRegistrar) + return WebKitLibraryPigeonInternalProxyApiCodecWriter(data: data, pigeonRegistrar: pigeonRegistrar) } } @@ -1493,36 +1396,27 @@ class WebKitLibraryPigeonCodec: FlutterStandardMessageCodec, @unchecked Sendable } protocol PigeonApiDelegateURLRequest { - func pigeonDefaultConstructor(pigeonApi: PigeonApiURLRequest, url: String) throws - -> URLRequestWrapper + func pigeonDefaultConstructor(pigeonApi: PigeonApiURLRequest, url: String) throws -> URLRequestWrapper /// The URL being requested. func getUrl(pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper) throws -> String? /// The HTTP request method. - func setHttpMethod( - pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper, method: String?) throws + func setHttpMethod(pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper, method: String?) throws /// The HTTP request method. - func getHttpMethod(pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper) throws - -> String? + func getHttpMethod(pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper) throws -> String? /// The request body. - func setHttpBody( - pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper, - body: FlutterStandardTypedData?) throws + func setHttpBody(pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper, body: FlutterStandardTypedData?) throws /// The request body. - func getHttpBody(pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper) throws - -> FlutterStandardTypedData? + func getHttpBody(pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper) throws -> FlutterStandardTypedData? /// A dictionary containing all of the HTTP header fields for a request. - func setAllHttpHeaderFields( - pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper, fields: [String: String]?) - throws + func setAllHttpHeaderFields(pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper, fields: [String: String]?) throws /// A dictionary containing all of the HTTP header fields for a request. - func getAllHttpHeaderFields(pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper) - throws -> [String: String]? + func getAllHttpHeaderFields(pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper) throws -> [String: String]? } protocol PigeonApiProtocolURLRequest { } -final class PigeonApiURLRequest: PigeonApiProtocolURLRequest { +final class PigeonApiURLRequest: PigeonApiProtocolURLRequest { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateURLRequest ///An implementation of [NSObject] used to access callback methods @@ -1530,23 +1424,17 @@ final class PigeonApiURLRequest: PigeonApiProtocolURLRequest { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateURLRequest) - { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateURLRequest) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers( - binaryMessenger: FlutterBinaryMessenger, api: PigeonApiURLRequest? - ) { + static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiURLRequest?) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( - pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.pigeon_defaultConstructor", - binaryMessenger: binaryMessenger, codec: codec) + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.pigeon_defaultConstructor", binaryMessenger: binaryMessenger, codec: codec) if let api = api { pigeonDefaultConstructorChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1554,8 +1442,8 @@ final class PigeonApiURLRequest: PigeonApiProtocolURLRequest { let urlArg = args[1] as! String do { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api, url: urlArg), - withIdentifier: pigeonIdentifierArg) +try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api, url: urlArg), +withIdentifier: pigeonIdentifierArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -1564,16 +1452,13 @@ final class PigeonApiURLRequest: PigeonApiProtocolURLRequest { } else { pigeonDefaultConstructorChannel.setMessageHandler(nil) } - let getUrlChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.getUrl", - binaryMessenger: binaryMessenger, codec: codec) + let getUrlChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.getUrl", binaryMessenger: binaryMessenger, codec: codec) if let api = api { getUrlChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! URLRequestWrapper do { - let result = try api.pigeonDelegate.getUrl( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) + let result = try api.pigeonDelegate.getUrl(pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -1582,17 +1467,14 @@ final class PigeonApiURLRequest: PigeonApiProtocolURLRequest { } else { getUrlChannel.setMessageHandler(nil) } - let setHttpMethodChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.setHttpMethod", - binaryMessenger: binaryMessenger, codec: codec) + let setHttpMethodChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.setHttpMethod", binaryMessenger: binaryMessenger, codec: codec) if let api = api { setHttpMethodChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! URLRequestWrapper let methodArg: String? = nilOrValue(args[1]) do { - try api.pigeonDelegate.setHttpMethod( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, method: methodArg) + try api.pigeonDelegate.setHttpMethod(pigeonApi: api, pigeonInstance: pigeonInstanceArg, method: methodArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -1601,16 +1483,13 @@ final class PigeonApiURLRequest: PigeonApiProtocolURLRequest { } else { setHttpMethodChannel.setMessageHandler(nil) } - let getHttpMethodChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.getHttpMethod", - binaryMessenger: binaryMessenger, codec: codec) + let getHttpMethodChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.getHttpMethod", binaryMessenger: binaryMessenger, codec: codec) if let api = api { getHttpMethodChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! URLRequestWrapper do { - let result = try api.pigeonDelegate.getHttpMethod( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) + let result = try api.pigeonDelegate.getHttpMethod(pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -1619,17 +1498,14 @@ final class PigeonApiURLRequest: PigeonApiProtocolURLRequest { } else { getHttpMethodChannel.setMessageHandler(nil) } - let setHttpBodyChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.setHttpBody", - binaryMessenger: binaryMessenger, codec: codec) + let setHttpBodyChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.setHttpBody", binaryMessenger: binaryMessenger, codec: codec) if let api = api { setHttpBodyChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! URLRequestWrapper let bodyArg: FlutterStandardTypedData? = nilOrValue(args[1]) do { - try api.pigeonDelegate.setHttpBody( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, body: bodyArg) + try api.pigeonDelegate.setHttpBody(pigeonApi: api, pigeonInstance: pigeonInstanceArg, body: bodyArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -1638,16 +1514,13 @@ final class PigeonApiURLRequest: PigeonApiProtocolURLRequest { } else { setHttpBodyChannel.setMessageHandler(nil) } - let getHttpBodyChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.getHttpBody", - binaryMessenger: binaryMessenger, codec: codec) + let getHttpBodyChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.getHttpBody", binaryMessenger: binaryMessenger, codec: codec) if let api = api { getHttpBodyChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! URLRequestWrapper do { - let result = try api.pigeonDelegate.getHttpBody( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) + let result = try api.pigeonDelegate.getHttpBody(pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -1656,17 +1529,14 @@ final class PigeonApiURLRequest: PigeonApiProtocolURLRequest { } else { getHttpBodyChannel.setMessageHandler(nil) } - let setAllHttpHeaderFieldsChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.setAllHttpHeaderFields", - binaryMessenger: binaryMessenger, codec: codec) + let setAllHttpHeaderFieldsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.setAllHttpHeaderFields", binaryMessenger: binaryMessenger, codec: codec) if let api = api { setAllHttpHeaderFieldsChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! URLRequestWrapper let fieldsArg: [String: String]? = nilOrValue(args[1]) do { - try api.pigeonDelegate.setAllHttpHeaderFields( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, fields: fieldsArg) + try api.pigeonDelegate.setAllHttpHeaderFields(pigeonApi: api, pigeonInstance: pigeonInstanceArg, fields: fieldsArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -1675,16 +1545,13 @@ final class PigeonApiURLRequest: PigeonApiProtocolURLRequest { } else { setAllHttpHeaderFieldsChannel.setMessageHandler(nil) } - let getAllHttpHeaderFieldsChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.getAllHttpHeaderFields", - binaryMessenger: binaryMessenger, codec: codec) + let getAllHttpHeaderFieldsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.getAllHttpHeaderFields", binaryMessenger: binaryMessenger, codec: codec) if let api = api { getAllHttpHeaderFieldsChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! URLRequestWrapper do { - let result = try api.pigeonDelegate.getAllHttpHeaderFields( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) + let result = try api.pigeonDelegate.getAllHttpHeaderFields(pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -1696,26 +1563,21 @@ final class PigeonApiURLRequest: PigeonApiProtocolURLRequest { } ///Creates a Dart instance of URLRequest and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: URLRequestWrapper, completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: URLRequestWrapper, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) + } 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) + 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))) @@ -1735,14 +1597,13 @@ final class PigeonApiURLRequest: PigeonApiProtocolURLRequest { } protocol PigeonApiDelegateHTTPURLResponse { /// The response’s HTTP status code. - func statusCode(pigeonApi: PigeonApiHTTPURLResponse, pigeonInstance: HTTPURLResponse) throws - -> Int64 + func statusCode(pigeonApi: PigeonApiHTTPURLResponse, pigeonInstance: HTTPURLResponse) throws -> Int64 } protocol PigeonApiProtocolHTTPURLResponse { } -final class PigeonApiHTTPURLResponse: PigeonApiProtocolHTTPURLResponse { +final class PigeonApiHTTPURLResponse: PigeonApiProtocolHTTPURLResponse { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateHTTPURLResponse ///An implementation of [URLResponse] used to access callback methods @@ -1750,36 +1611,27 @@ final class PigeonApiHTTPURLResponse: PigeonApiProtocolHTTPURLResponse { return pigeonRegistrar.apiDelegate.pigeonApiURLResponse(pigeonRegistrar) } - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, - delegate: PigeonApiDelegateHTTPURLResponse - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateHTTPURLResponse) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } ///Creates a Dart instance of HTTPURLResponse and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: HTTPURLResponse, completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: HTTPURLResponse, 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) { + } 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) + } 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) + 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))) @@ -1803,7 +1655,7 @@ open class PigeonApiDelegateURLResponse { protocol PigeonApiProtocolURLResponse { } -final class PigeonApiURLResponse: PigeonApiProtocolURLResponse { +final class PigeonApiURLResponse: PigeonApiProtocolURLResponse { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateURLResponse ///An implementation of [NSObject] used to access callback methods @@ -1811,33 +1663,26 @@ final class PigeonApiURLResponse: PigeonApiProtocolURLResponse { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateURLResponse - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateURLResponse) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } ///Creates a Dart instance of URLResponse and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: URLResponse, completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: URLResponse, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) + } 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) + 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))) @@ -1858,25 +1703,20 @@ final class PigeonApiURLResponse: PigeonApiProtocolURLResponse { protocol PigeonApiDelegateWKUserScript { /// Creates a user script object that contains the specified source code and /// attributes. - func pigeonDefaultConstructor( - pigeonApi: PigeonApiWKUserScript, source: String, injectionTime: UserScriptInjectionTime, - isForMainFrameOnly: Bool - ) throws -> WKUserScript + func pigeonDefaultConstructor(pigeonApi: PigeonApiWKUserScript, source: String, injectionTime: UserScriptInjectionTime, isForMainFrameOnly: Bool) throws -> WKUserScript /// The script’s source code. func source(pigeonApi: PigeonApiWKUserScript, pigeonInstance: WKUserScript) throws -> String /// The time at which to inject the script into the webpage. - func injectionTime(pigeonApi: PigeonApiWKUserScript, pigeonInstance: WKUserScript) throws - -> UserScriptInjectionTime + func injectionTime(pigeonApi: PigeonApiWKUserScript, pigeonInstance: WKUserScript) throws -> UserScriptInjectionTime /// A Boolean value that indicates whether to inject the script into the main /// frame or all frames. - func isForMainFrameOnly(pigeonApi: PigeonApiWKUserScript, pigeonInstance: WKUserScript) throws - -> Bool + func isForMainFrameOnly(pigeonApi: PigeonApiWKUserScript, pigeonInstance: WKUserScript) throws -> Bool } protocol PigeonApiProtocolWKUserScript { } -final class PigeonApiWKUserScript: PigeonApiProtocolWKUserScript { +final class PigeonApiWKUserScript: PigeonApiProtocolWKUserScript { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKUserScript ///An implementation of [NSObject] used to access callback methods @@ -1884,24 +1724,17 @@ final class PigeonApiWKUserScript: PigeonApiProtocolWKUserScript { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKUserScript - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKUserScript) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers( - binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKUserScript? - ) { + static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKUserScript?) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( - pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserScript.pigeon_defaultConstructor", - binaryMessenger: binaryMessenger, codec: codec) + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserScript.pigeon_defaultConstructor", binaryMessenger: binaryMessenger, codec: codec) if let api = api { pigeonDefaultConstructorChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1911,10 +1744,8 @@ final class PigeonApiWKUserScript: PigeonApiProtocolWKUserScript { let isForMainFrameOnlyArg = args[3] as! Bool do { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - try api.pigeonDelegate.pigeonDefaultConstructor( - pigeonApi: api, source: sourceArg, injectionTime: injectionTimeArg, - isForMainFrameOnly: isForMainFrameOnlyArg), - withIdentifier: pigeonIdentifierArg) +try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api, source: sourceArg, injectionTime: injectionTimeArg, isForMainFrameOnly: isForMainFrameOnlyArg), +withIdentifier: pigeonIdentifierArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -1926,34 +1757,25 @@ final class PigeonApiWKUserScript: PigeonApiProtocolWKUserScript { } ///Creates a Dart instance of WKUserScript and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: WKUserScript, completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: WKUserScript, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) + } 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 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 + 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 @@ -1972,22 +1794,19 @@ final class PigeonApiWKUserScript: PigeonApiProtocolWKUserScript { } protocol PigeonApiDelegateWKNavigationAction { /// The URL request object associated with the navigation action. - func request(pigeonApi: PigeonApiWKNavigationAction, pigeonInstance: WKNavigationAction) throws - -> URLRequestWrapper + func request(pigeonApi: PigeonApiWKNavigationAction, pigeonInstance: WKNavigationAction) throws -> URLRequestWrapper /// The frame in which to display the new content. /// /// If the target of the navigation is a new window, this property is nil. - func targetFrame(pigeonApi: PigeonApiWKNavigationAction, pigeonInstance: WKNavigationAction) - throws -> WKFrameInfo? + func targetFrame(pigeonApi: PigeonApiWKNavigationAction, pigeonInstance: WKNavigationAction) throws -> WKFrameInfo? /// The type of action that triggered the navigation. - func navigationType(pigeonApi: PigeonApiWKNavigationAction, pigeonInstance: WKNavigationAction) - throws -> NavigationType + func navigationType(pigeonApi: PigeonApiWKNavigationAction, pigeonInstance: WKNavigationAction) throws -> NavigationType } protocol PigeonApiProtocolWKNavigationAction { } -final class PigeonApiWKNavigationAction: PigeonApiProtocolWKNavigationAction { +final class PigeonApiWKNavigationAction: PigeonApiProtocolWKNavigationAction { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKNavigationAction ///An implementation of [NSObject] used to access callback methods @@ -1995,42 +1814,30 @@ final class PigeonApiWKNavigationAction: PigeonApiProtocolWKNavigationAction { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, - delegate: PigeonApiDelegateWKNavigationAction - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKNavigationAction) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } ///Creates a Dart instance of WKNavigationAction and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: WKNavigationAction, completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: WKNavigationAction, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) + } 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 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 + 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 @@ -2049,19 +1856,16 @@ final class PigeonApiWKNavigationAction: PigeonApiProtocolWKNavigationAction { } protocol PigeonApiDelegateWKNavigationResponse { /// The frame’s response. - func response(pigeonApi: PigeonApiWKNavigationResponse, pigeonInstance: WKNavigationResponse) - throws -> URLResponse + func response(pigeonApi: PigeonApiWKNavigationResponse, pigeonInstance: WKNavigationResponse) throws -> URLResponse /// A Boolean value that indicates whether the response targets the web view’s /// main frame. - func isForMainFrame( - pigeonApi: PigeonApiWKNavigationResponse, pigeonInstance: WKNavigationResponse - ) throws -> Bool + func isForMainFrame(pigeonApi: PigeonApiWKNavigationResponse, pigeonInstance: WKNavigationResponse) throws -> Bool } protocol PigeonApiProtocolWKNavigationResponse { } -final class PigeonApiWKNavigationResponse: PigeonApiProtocolWKNavigationResponse { +final class PigeonApiWKNavigationResponse: PigeonApiProtocolWKNavigationResponse { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKNavigationResponse ///An implementation of [NSObject] used to access callback methods @@ -2069,40 +1873,29 @@ final class PigeonApiWKNavigationResponse: PigeonApiProtocolWKNavigationResponse return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, - delegate: PigeonApiDelegateWKNavigationResponse - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKNavigationResponse) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } ///Creates a Dart instance of WKNavigationResponse and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: WKNavigationResponse, completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: WKNavigationResponse, 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) { + } 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) + } 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 + 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 @@ -2124,14 +1917,13 @@ protocol PigeonApiDelegateWKFrameInfo { /// or a subframe. func isMainFrame(pigeonApi: PigeonApiWKFrameInfo, pigeonInstance: WKFrameInfo) throws -> Bool /// The frame’s current request. - func request(pigeonApi: PigeonApiWKFrameInfo, pigeonInstance: WKFrameInfo) throws - -> URLRequestWrapper? + func request(pigeonApi: PigeonApiWKFrameInfo, pigeonInstance: WKFrameInfo) throws -> URLRequestWrapper? } protocol PigeonApiProtocolWKFrameInfo { } -final class PigeonApiWKFrameInfo: PigeonApiProtocolWKFrameInfo { +final class PigeonApiWKFrameInfo: PigeonApiProtocolWKFrameInfo { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKFrameInfo ///An implementation of [NSObject] used to access callback methods @@ -2139,36 +1931,28 @@ final class PigeonApiWKFrameInfo: PigeonApiProtocolWKFrameInfo { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKFrameInfo - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKFrameInfo) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } ///Creates a Dart instance of WKFrameInfo and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: WKFrameInfo, completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: WKFrameInfo, 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) { + } 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) + } 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) + 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))) @@ -2198,7 +1982,7 @@ protocol PigeonApiDelegateNSError { protocol PigeonApiProtocolNSError { } -final class PigeonApiNSError: PigeonApiProtocolNSError { +final class PigeonApiNSError: PigeonApiProtocolNSError { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateNSError ///An implementation of [NSObject] used to access callback methods @@ -2211,32 +1995,25 @@ final class PigeonApiNSError: PigeonApiProtocolNSError { self.pigeonDelegate = delegate } ///Creates a Dart instance of NSError and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: NSError, completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: NSError, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) + } 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 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 + 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 @@ -2263,7 +2040,7 @@ protocol PigeonApiDelegateWKScriptMessage { protocol PigeonApiProtocolWKScriptMessage { } -final class PigeonApiWKScriptMessage: PigeonApiProtocolWKScriptMessage { +final class PigeonApiWKScriptMessage: PigeonApiProtocolWKScriptMessage { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKScriptMessage ///An implementation of [NSObject] used to access callback methods @@ -2271,36 +2048,28 @@ final class PigeonApiWKScriptMessage: PigeonApiProtocolWKScriptMessage { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, - delegate: PigeonApiDelegateWKScriptMessage - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKScriptMessage) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } ///Creates a Dart instance of WKScriptMessage and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: WKScriptMessage, completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: WKScriptMessage, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) + } 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) + 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))) @@ -2324,14 +2093,13 @@ protocol PigeonApiDelegateWKSecurityOrigin { /// The security origin's port. func port(pigeonApi: PigeonApiWKSecurityOrigin, pigeonInstance: WKSecurityOrigin) throws -> Int64 /// The security origin's protocol. - func securityProtocol(pigeonApi: PigeonApiWKSecurityOrigin, pigeonInstance: WKSecurityOrigin) - throws -> String + func securityProtocol(pigeonApi: PigeonApiWKSecurityOrigin, pigeonInstance: WKSecurityOrigin) throws -> String } protocol PigeonApiProtocolWKSecurityOrigin { } -final class PigeonApiWKSecurityOrigin: PigeonApiProtocolWKSecurityOrigin { +final class PigeonApiWKSecurityOrigin: PigeonApiProtocolWKSecurityOrigin { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKSecurityOrigin ///An implementation of [NSObject] used to access callback methods @@ -2339,40 +2107,30 @@ final class PigeonApiWKSecurityOrigin: PigeonApiProtocolWKSecurityOrigin { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, - delegate: PigeonApiDelegateWKSecurityOrigin - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKSecurityOrigin) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } ///Creates a Dart instance of WKSecurityOrigin and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: WKSecurityOrigin, completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: WKSecurityOrigin, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) + } 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 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 + 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 @@ -2390,18 +2148,15 @@ final class PigeonApiWKSecurityOrigin: PigeonApiProtocolWKSecurityOrigin { } } protocol PigeonApiDelegateHTTPCookie { - func pigeonDefaultConstructor( - pigeonApi: PigeonApiHTTPCookie, properties: [HttpCookiePropertyKey: Any] - ) throws -> HTTPCookie + func pigeonDefaultConstructor(pigeonApi: PigeonApiHTTPCookie, properties: [HttpCookiePropertyKey: Any]) throws -> HTTPCookie /// The cookie’s properties. - func getProperties(pigeonApi: PigeonApiHTTPCookie, pigeonInstance: HTTPCookie) throws - -> [HttpCookiePropertyKey: Any]? + func getProperties(pigeonApi: PigeonApiHTTPCookie, pigeonInstance: HTTPCookie) throws -> [HttpCookiePropertyKey: Any]? } protocol PigeonApiProtocolHTTPCookie { } -final class PigeonApiHTTPCookie: PigeonApiProtocolHTTPCookie { +final class PigeonApiHTTPCookie: PigeonApiProtocolHTTPCookie { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateHTTPCookie ///An implementation of [NSObject] used to access callback methods @@ -2409,23 +2164,17 @@ final class PigeonApiHTTPCookie: PigeonApiProtocolHTTPCookie { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateHTTPCookie) - { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateHTTPCookie) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers( - binaryMessenger: FlutterBinaryMessenger, api: PigeonApiHTTPCookie? - ) { + static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiHTTPCookie?) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( - pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.HTTPCookie.pigeon_defaultConstructor", - binaryMessenger: binaryMessenger, codec: codec) + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.HTTPCookie.pigeon_defaultConstructor", binaryMessenger: binaryMessenger, codec: codec) if let api = api { pigeonDefaultConstructorChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2433,9 +2182,8 @@ final class PigeonApiHTTPCookie: PigeonApiProtocolHTTPCookie { let propertiesArg = args[1] as? [HttpCookiePropertyKey: Any] do { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - try api.pigeonDelegate.pigeonDefaultConstructor( - pigeonApi: api, properties: propertiesArg!), - withIdentifier: pigeonIdentifierArg) +try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api, properties: propertiesArg!), +withIdentifier: pigeonIdentifierArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -2444,16 +2192,13 @@ final class PigeonApiHTTPCookie: PigeonApiProtocolHTTPCookie { } else { pigeonDefaultConstructorChannel.setMessageHandler(nil) } - let getPropertiesChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.HTTPCookie.getProperties", - binaryMessenger: binaryMessenger, codec: codec) + let getPropertiesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.HTTPCookie.getProperties", binaryMessenger: binaryMessenger, codec: codec) if let api = api { getPropertiesChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! HTTPCookie do { - let result = try api.pigeonDelegate.getProperties( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) + let result = try api.pigeonDelegate.getProperties(pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -2465,26 +2210,21 @@ final class PigeonApiHTTPCookie: PigeonApiProtocolHTTPCookie { } ///Creates a Dart instance of HTTPCookie and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: HTTPCookie, completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: HTTPCookie, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) + } 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) + 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))) @@ -2503,51 +2243,31 @@ final class PigeonApiHTTPCookie: PigeonApiProtocolHTTPCookie { } } protocol PigeonApiDelegateAuthenticationChallengeResponse { - func pigeonDefaultConstructor( - pigeonApi: PigeonApiAuthenticationChallengeResponse, - disposition: UrlSessionAuthChallengeDisposition, credential: URLCredential? - ) throws -> AuthenticationChallengeResponse + func pigeonDefaultConstructor(pigeonApi: PigeonApiAuthenticationChallengeResponse, disposition: UrlSessionAuthChallengeDisposition, credential: URLCredential?) throws -> AuthenticationChallengeResponse /// The option to use to handle the challenge. - func disposition( - pigeonApi: PigeonApiAuthenticationChallengeResponse, - pigeonInstance: AuthenticationChallengeResponse - ) throws -> UrlSessionAuthChallengeDisposition + func disposition(pigeonApi: PigeonApiAuthenticationChallengeResponse, pigeonInstance: AuthenticationChallengeResponse) throws -> UrlSessionAuthChallengeDisposition /// The credential to use for authentication when the disposition parameter /// contains the value URLSession.AuthChallengeDisposition.useCredential. - func credential( - pigeonApi: PigeonApiAuthenticationChallengeResponse, - pigeonInstance: AuthenticationChallengeResponse - ) throws -> URLCredential? + func credential(pigeonApi: PigeonApiAuthenticationChallengeResponse, pigeonInstance: AuthenticationChallengeResponse) throws -> URLCredential? } protocol PigeonApiProtocolAuthenticationChallengeResponse { } -final class PigeonApiAuthenticationChallengeResponse: - PigeonApiProtocolAuthenticationChallengeResponse -{ +final class PigeonApiAuthenticationChallengeResponse: PigeonApiProtocolAuthenticationChallengeResponse { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateAuthenticationChallengeResponse - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, - delegate: PigeonApiDelegateAuthenticationChallengeResponse - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateAuthenticationChallengeResponse) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers( - binaryMessenger: FlutterBinaryMessenger, api: PigeonApiAuthenticationChallengeResponse? - ) { + static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiAuthenticationChallengeResponse?) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( - pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.webview_flutter_wkwebview.AuthenticationChallengeResponse.pigeon_defaultConstructor", - binaryMessenger: binaryMessenger, codec: codec) + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.AuthenticationChallengeResponse.pigeon_defaultConstructor", binaryMessenger: binaryMessenger, codec: codec) if let api = api { pigeonDefaultConstructorChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2556,9 +2276,8 @@ final class PigeonApiAuthenticationChallengeResponse: let credentialArg: URLCredential? = nilOrValue(args[2]) do { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - try api.pigeonDelegate.pigeonDefaultConstructor( - pigeonApi: api, disposition: dispositionArg, credential: credentialArg), - withIdentifier: pigeonIdentifierArg) +try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api, disposition: dispositionArg, credential: credentialArg), +withIdentifier: pigeonIdentifierArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -2570,33 +2289,24 @@ final class PigeonApiAuthenticationChallengeResponse: } ///Creates a Dart instance of AuthenticationChallengeResponse and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: AuthenticationChallengeResponse, - completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: AuthenticationChallengeResponse, 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) { + } 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) + } 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 + 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 @@ -2617,19 +2327,15 @@ protocol PigeonApiDelegateWKWebsiteDataStore { /// The default data store, which stores data persistently to disk. func defaultDataStore(pigeonApi: PigeonApiWKWebsiteDataStore) throws -> WKWebsiteDataStore /// The object that manages the HTTP cookies for your website. - func httpCookieStore(pigeonApi: PigeonApiWKWebsiteDataStore, pigeonInstance: WKWebsiteDataStore) - throws -> WKHTTPCookieStore + func httpCookieStore(pigeonApi: PigeonApiWKWebsiteDataStore, pigeonInstance: WKWebsiteDataStore) throws -> WKHTTPCookieStore /// Removes the specified types of website data from one or more data records. - func removeDataOfTypes( - pigeonApi: PigeonApiWKWebsiteDataStore, pigeonInstance: WKWebsiteDataStore, - dataTypes: [WebsiteDataType], modificationTimeInSecondsSinceEpoch: Double, - completion: @escaping (Result) -> Void) + func removeDataOfTypes(pigeonApi: PigeonApiWKWebsiteDataStore, pigeonInstance: WKWebsiteDataStore, dataTypes: [WebsiteDataType], modificationTimeInSecondsSinceEpoch: Double, completion: @escaping (Result) -> Void) } protocol PigeonApiProtocolWKWebsiteDataStore { } -final class PigeonApiWKWebsiteDataStore: PigeonApiProtocolWKWebsiteDataStore { +final class PigeonApiWKWebsiteDataStore: PigeonApiProtocolWKWebsiteDataStore { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKWebsiteDataStore ///An implementation of [NSObject] used to access callback methods @@ -2637,33 +2343,23 @@ final class PigeonApiWKWebsiteDataStore: PigeonApiProtocolWKWebsiteDataStore { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, - delegate: PigeonApiDelegateWKWebsiteDataStore - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKWebsiteDataStore) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers( - binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKWebsiteDataStore? - ) { + static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKWebsiteDataStore?) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( - pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let defaultDataStoreChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStore.defaultDataStore", - binaryMessenger: binaryMessenger, codec: codec) + let defaultDataStoreChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStore.defaultDataStore", binaryMessenger: binaryMessenger, codec: codec) if let api = api { defaultDataStoreChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonIdentifierArg = args[0] as! Int64 do { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - try api.pigeonDelegate.defaultDataStore(pigeonApi: api), - withIdentifier: pigeonIdentifierArg) + api.pigeonRegistrar.instanceManager.addDartCreatedInstance(try api.pigeonDelegate.defaultDataStore(pigeonApi: api), withIdentifier: pigeonIdentifierArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -2672,19 +2368,14 @@ final class PigeonApiWKWebsiteDataStore: PigeonApiProtocolWKWebsiteDataStore { } else { defaultDataStoreChannel.setMessageHandler(nil) } - let httpCookieStoreChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStore.httpCookieStore", - binaryMessenger: binaryMessenger, codec: codec) + let httpCookieStoreChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStore.httpCookieStore", binaryMessenger: binaryMessenger, codec: codec) if let api = api { httpCookieStoreChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKWebsiteDataStore let pigeonIdentifierArg = args[1] as! Int64 do { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - try api.pigeonDelegate.httpCookieStore( - pigeonApi: api, pigeonInstance: pigeonInstanceArg), - withIdentifier: pigeonIdentifierArg) + api.pigeonRegistrar.instanceManager.addDartCreatedInstance(try api.pigeonDelegate.httpCookieStore(pigeonApi: api, pigeonInstance: pigeonInstanceArg), withIdentifier: pigeonIdentifierArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -2693,19 +2384,14 @@ final class PigeonApiWKWebsiteDataStore: PigeonApiProtocolWKWebsiteDataStore { } else { httpCookieStoreChannel.setMessageHandler(nil) } - let removeDataOfTypesChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStore.removeDataOfTypes", - binaryMessenger: binaryMessenger, codec: codec) + let removeDataOfTypesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStore.removeDataOfTypes", binaryMessenger: binaryMessenger, codec: codec) if let api = api { removeDataOfTypesChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKWebsiteDataStore let dataTypesArg = args[1] as! [WebsiteDataType] let modificationTimeInSecondsSinceEpochArg = args[2] as! Double - api.pigeonDelegate.removeDataOfTypes( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, dataTypes: dataTypesArg, - modificationTimeInSecondsSinceEpoch: modificationTimeInSecondsSinceEpochArg - ) { result in + api.pigeonDelegate.removeDataOfTypes(pigeonApi: api, pigeonInstance: pigeonInstanceArg, dataTypes: dataTypesArg, modificationTimeInSecondsSinceEpoch: modificationTimeInSecondsSinceEpochArg) { result in switch result { case .success(let res): reply(wrapResult(res)) @@ -2720,26 +2406,21 @@ final class PigeonApiWKWebsiteDataStore: PigeonApiProtocolWKWebsiteDataStore { } ///Creates a Dart instance of WKWebsiteDataStore and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: WKWebsiteDataStore, completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: WKWebsiteDataStore, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) + } 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) + 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))) @@ -2759,20 +2440,19 @@ final class PigeonApiWKWebsiteDataStore: PigeonApiProtocolWKWebsiteDataStore { } protocol PigeonApiDelegateUIView { #if !os(macOS) - /// The view’s background color. - func setBackgroundColor(pigeonApi: PigeonApiUIView, pigeonInstance: UIView, value: Int64?) - throws + /// The view’s background color. + func setBackgroundColor(pigeonApi: PigeonApiUIView, pigeonInstance: UIView, value: Int64?) throws #endif #if !os(macOS) - /// A Boolean value that determines whether the view is opaque. - func setOpaque(pigeonApi: PigeonApiUIView, pigeonInstance: UIView, opaque: Bool) throws + /// A Boolean value that determines whether the view is opaque. + func setOpaque(pigeonApi: PigeonApiUIView, pigeonInstance: UIView, opaque: Bool) throws #endif } protocol PigeonApiProtocolUIView { } -final class PigeonApiUIView: PigeonApiProtocolUIView { +final class PigeonApiUIView: PigeonApiProtocolUIView { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateUIView ///An implementation of [NSObject] used to access callback methods @@ -2788,162 +2468,152 @@ final class PigeonApiUIView: PigeonApiProtocolUIView { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( - pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() #if !os(macOS) - let setBackgroundColorChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIView.setBackgroundColor", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setBackgroundColorChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! UIView - let valueArg: Int64? = nilOrValue(args[1]) - do { - try api.pigeonDelegate.setBackgroundColor( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let setBackgroundColorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIView.setBackgroundColor", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setBackgroundColorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIView + let valueArg: Int64? = nilOrValue(args[1]) + do { + try api.pigeonDelegate.setBackgroundColor(pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - setBackgroundColorChannel.setMessageHandler(nil) } + } else { + setBackgroundColorChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let setOpaqueChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIView.setOpaque", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setOpaqueChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! UIView - let opaqueArg = args[1] as! Bool - do { - try api.pigeonDelegate.setOpaque( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, opaque: opaqueArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let setOpaqueChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIView.setOpaque", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setOpaqueChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIView + let opaqueArg = args[1] as! Bool + do { + try api.pigeonDelegate.setOpaque(pigeonApi: api, pigeonInstance: pigeonInstanceArg, opaque: opaqueArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - setOpaqueChannel.setMessageHandler(nil) } + } else { + setOpaqueChannel.setMessageHandler(nil) + } #endif } #if !os(macOS) - ///Creates a Dart instance of UIView and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: UIView, 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.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(())) - } + ///Creates a Dart instance of UIView and attaches it to [pigeonInstance]. + func pigeonNewInstance(pigeonInstance: UIView, 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.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(())) } } } + } #endif } protocol PigeonApiDelegateUIScrollView { #if !os(macOS) - /// The point at which the origin of the content view is offset from the - /// origin of the scroll view. - func getContentOffset(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView) throws - -> [Double] + /// The point at which the origin of the content view is offset from the + /// origin of the scroll view. + func getContentOffset(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView) throws -> [Double] + #endif + #if !os(macOS) + /// Move the scrolled position of your view. + /// + /// Convenience method to synchronize change to the x and y scroll position. + func scrollBy(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, x: Double, y: Double) throws + #endif + #if !os(macOS) + /// The point at which the origin of the content view is offset from the + /// origin of the scroll view. + func setContentOffset(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, x: Double, y: Double) throws #endif #if !os(macOS) - /// Move the scrolled position of your view. - /// - /// Convenience method to synchronize change to the x and y scroll position. - func scrollBy( - pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, x: Double, y: Double) throws + /// The delegate of the scroll view. + func setDelegate(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, delegate: UIScrollViewDelegate?) throws #endif #if !os(macOS) - /// The point at which the origin of the content view is offset from the - /// origin of the scroll view. - func setContentOffset( - pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, x: Double, y: Double) throws + /// Whether the scroll view bounces past the edge of content and back again. + func setBounces(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws #endif #if !os(macOS) - /// The delegate of the scroll view. - func setDelegate( - pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, - delegate: UIScrollViewDelegate?) throws + /// Whether the scroll view bounces when it reaches the ends of its horizontal + /// axis. + func setBouncesHorizontally(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws #endif #if !os(macOS) - /// Whether the scroll view bounces past the edge of content and back again. - func setBounces(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) - throws + /// Whether the scroll view bounces when it reaches the ends of its vertical + /// axis. + func setBouncesVertically(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws #endif #if !os(macOS) - /// Whether the scroll view bounces when it reaches the ends of its horizontal - /// axis. - func setBouncesHorizontally( - pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws + /// Whether bouncing always occurs when vertical scrolling reaches the end of + /// the content. + /// + /// If the value of this property is true and `bouncesVertically` is true, the + /// scroll view allows vertical dragging even if the content is smaller than + /// the bounds of the scroll view. + func setAlwaysBounceVertical(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws #endif #if !os(macOS) - /// Whether the scroll view bounces when it reaches the ends of its vertical - /// axis. - func setBouncesVertically( - pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws + /// Whether bouncing always occurs when horizontal scrolling reaches the end + /// of the content view. + /// + /// If the value of this property is true and `bouncesHorizontally` is true, + /// the scroll view allows horizontal dragging even if the content is smaller + /// than the bounds of the scroll view. + func setAlwaysBounceHorizontal(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws #endif #if !os(macOS) - /// Whether bouncing always occurs when vertical scrolling reaches the end of - /// the content. - /// - /// If the value of this property is true and `bouncesVertically` is true, the - /// scroll view allows vertical dragging even if the content is smaller than - /// the bounds of the scroll view. - func setAlwaysBounceVertical( - pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws + /// Whether the vertical scroll indicator is visible. + /// + /// The default value is true. + func setShowsVerticalScrollIndicator(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws #endif #if !os(macOS) - /// Whether bouncing always occurs when horizontal scrolling reaches the end - /// of the content view. - /// - /// If the value of this property is true and `bouncesHorizontally` is true, - /// the scroll view allows horizontal dragging even if the content is smaller - /// than the bounds of the scroll view. - func setAlwaysBounceHorizontal( - pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws + /// Whether the horizontal scroll indicator is visible. + /// + /// The default value is true. + func setShowsHorizontalScrollIndicator(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws #endif } protocol PigeonApiProtocolUIScrollView { } -final class PigeonApiUIScrollView: PigeonApiProtocolUIScrollView { +final class PigeonApiUIScrollView: PigeonApiProtocolUIScrollView { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateUIScrollView ///An implementation of [UIView] used to access callback methods @@ -2951,309 +2621,287 @@ final class PigeonApiUIScrollView: PigeonApiProtocolUIScrollView { return pigeonRegistrar.apiDelegate.pigeonApiUIView(pigeonRegistrar) } - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateUIScrollView - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateUIScrollView) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers( - binaryMessenger: FlutterBinaryMessenger, api: PigeonApiUIScrollView? - ) { + static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiUIScrollView?) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( - pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() #if !os(macOS) - let getContentOffsetChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.getContentOffset", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - getContentOffsetChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! UIScrollView - do { - let result = try api.pigeonDelegate.getContentOffset( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } + let getContentOffsetChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.getContentOffset", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getContentOffsetChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + do { + let result = try api.pigeonDelegate.getContentOffset(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) } - } else { - getContentOffsetChannel.setMessageHandler(nil) } + } else { + getContentOffsetChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let scrollByChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.scrollBy", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - scrollByChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! UIScrollView - let xArg = args[1] as! Double - let yArg = args[2] as! Double - do { - try api.pigeonDelegate.scrollBy( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, x: xArg, y: yArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let scrollByChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.scrollBy", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + scrollByChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + let xArg = args[1] as! Double + let yArg = args[2] as! Double + do { + try api.pigeonDelegate.scrollBy(pigeonApi: api, pigeonInstance: pigeonInstanceArg, x: xArg, y: yArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - scrollByChannel.setMessageHandler(nil) } + } else { + scrollByChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let setContentOffsetChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setContentOffset", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setContentOffsetChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! UIScrollView - let xArg = args[1] as! Double - let yArg = args[2] as! Double - do { - try api.pigeonDelegate.setContentOffset( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, x: xArg, y: yArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let setContentOffsetChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setContentOffset", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setContentOffsetChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + let xArg = args[1] as! Double + let yArg = args[2] as! Double + do { + try api.pigeonDelegate.setContentOffset(pigeonApi: api, pigeonInstance: pigeonInstanceArg, x: xArg, y: yArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - setContentOffsetChannel.setMessageHandler(nil) } - #endif + } else { + setContentOffsetChannel.setMessageHandler(nil) + } + #endif #if !os(macOS) - let setDelegateChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setDelegate", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setDelegateChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! UIScrollView - let delegateArg: UIScrollViewDelegate? = nilOrValue(args[1]) - do { - try api.pigeonDelegate.setDelegate( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, delegate: delegateArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let setDelegateChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setDelegate", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setDelegateChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + let delegateArg: UIScrollViewDelegate? = nilOrValue(args[1]) + do { + try api.pigeonDelegate.setDelegate(pigeonApi: api, pigeonInstance: pigeonInstanceArg, delegate: delegateArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - setDelegateChannel.setMessageHandler(nil) } + } else { + setDelegateChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let setBouncesChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setBounces", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setBouncesChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! UIScrollView - let valueArg = args[1] as! Bool - do { - try api.pigeonDelegate.setBounces( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let setBouncesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setBounces", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setBouncesChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + let valueArg = args[1] as! Bool + do { + try api.pigeonDelegate.setBounces(pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - setBouncesChannel.setMessageHandler(nil) } + } else { + setBouncesChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let setBouncesHorizontallyChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setBouncesHorizontally", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setBouncesHorizontallyChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! UIScrollView - let valueArg = args[1] as! Bool - do { - try api.pigeonDelegate.setBouncesHorizontally( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let setBouncesHorizontallyChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setBouncesHorizontally", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setBouncesHorizontallyChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + let valueArg = args[1] as! Bool + do { + try api.pigeonDelegate.setBouncesHorizontally(pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - setBouncesHorizontallyChannel.setMessageHandler(nil) } + } else { + setBouncesHorizontallyChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let setBouncesVerticallyChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setBouncesVertically", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setBouncesVerticallyChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! UIScrollView - let valueArg = args[1] as! Bool - do { - try api.pigeonDelegate.setBouncesVertically( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let setBouncesVerticallyChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setBouncesVertically", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setBouncesVerticallyChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + let valueArg = args[1] as! Bool + do { + try api.pigeonDelegate.setBouncesVertically(pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - setBouncesVerticallyChannel.setMessageHandler(nil) } + } else { + setBouncesVerticallyChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let setAlwaysBounceVerticalChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setAlwaysBounceVertical", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setAlwaysBounceVerticalChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! UIScrollView - let valueArg = args[1] as! Bool - do { - try api.pigeonDelegate.setAlwaysBounceVertical( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let setAlwaysBounceVerticalChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setAlwaysBounceVertical", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setAlwaysBounceVerticalChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + let valueArg = args[1] as! Bool + do { + try api.pigeonDelegate.setAlwaysBounceVertical(pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - setAlwaysBounceVerticalChannel.setMessageHandler(nil) } + } else { + setAlwaysBounceVerticalChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let setAlwaysBounceHorizontalChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setAlwaysBounceHorizontal", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setAlwaysBounceHorizontalChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! UIScrollView - let valueArg = args[1] as! Bool - do { - try api.pigeonDelegate.setAlwaysBounceHorizontal( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let setAlwaysBounceHorizontalChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setAlwaysBounceHorizontal", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setAlwaysBounceHorizontalChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + let valueArg = args[1] as! Bool + do { + try api.pigeonDelegate.setAlwaysBounceHorizontal(pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + setAlwaysBounceHorizontalChannel.setMessageHandler(nil) + } + #endif + #if !os(macOS) + let setShowsVerticalScrollIndicatorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setShowsVerticalScrollIndicator", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setShowsVerticalScrollIndicatorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + let valueArg = args[1] as! Bool + do { + try api.pigeonDelegate.setShowsVerticalScrollIndicator(pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + setShowsVerticalScrollIndicatorChannel.setMessageHandler(nil) + } + #endif + #if !os(macOS) + let setShowsHorizontalScrollIndicatorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setShowsHorizontalScrollIndicator", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setShowsHorizontalScrollIndicatorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + let valueArg = args[1] as! Bool + do { + try api.pigeonDelegate.setShowsHorizontalScrollIndicator(pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - setAlwaysBounceHorizontalChannel.setMessageHandler(nil) } + } else { + setShowsHorizontalScrollIndicatorChannel.setMessageHandler(nil) + } #endif } #if !os(macOS) - ///Creates a Dart instance of UIScrollView and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: UIScrollView, 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.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(())) - } + ///Creates a Dart instance of UIScrollView and attaches it to [pigeonInstance]. + func pigeonNewInstance(pigeonInstance: UIScrollView, 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.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(())) } } } + } #endif } protocol PigeonApiDelegateWKWebViewConfiguration { - func pigeonDefaultConstructor(pigeonApi: PigeonApiWKWebViewConfiguration) throws - -> WKWebViewConfiguration + func pigeonDefaultConstructor(pigeonApi: PigeonApiWKWebViewConfiguration) throws -> WKWebViewConfiguration /// The object that coordinates interactions between your app’s native code /// and the webpage’s scripts and other content. - func setUserContentController( - pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, - controller: WKUserContentController) throws + func setUserContentController(pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, controller: WKUserContentController) throws /// The object that coordinates interactions between your app’s native code /// and the webpage’s scripts and other content. - func getUserContentController( - pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration - ) throws -> WKUserContentController + func getUserContentController(pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration) throws -> WKUserContentController /// The object you use to get and set the site’s cookies and to track the /// cached data objects. - func setWebsiteDataStore( - pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, - dataStore: WKWebsiteDataStore) throws + func setWebsiteDataStore(pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, dataStore: WKWebsiteDataStore) throws /// The object you use to get and set the site’s cookies and to track the /// cached data objects. - func getWebsiteDataStore( - pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration - ) throws -> WKWebsiteDataStore + func getWebsiteDataStore(pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration) throws -> WKWebsiteDataStore /// The object that manages the preference-related settings for the web view. - func setPreferences( - pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, - preferences: WKPreferences) throws + func setPreferences(pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, preferences: WKPreferences) throws /// The object that manages the preference-related settings for the web view. - func getPreferences( - pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration - ) throws -> WKPreferences + func getPreferences(pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration) throws -> WKPreferences /// A Boolean value that indicates whether HTML5 videos play inline or use the /// native full-screen controller. - func setAllowsInlineMediaPlayback( - pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, allow: Bool) - throws + func setAllowsInlineMediaPlayback(pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, allow: Bool) throws /// A Boolean value that indicates whether the web view limits navigation to /// pages within the app’s domain. - func setLimitsNavigationsToAppBoundDomains( - pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, limit: Bool) - throws + func setLimitsNavigationsToAppBoundDomains(pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, limit: Bool) throws /// The media types that require a user gesture to begin playing. - func setMediaTypesRequiringUserActionForPlayback( - pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, - type: AudiovisualMediaType) throws + 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 + func getDefaultWebpagePreferences(pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration) throws -> WKWebpagePreferences } protocol PigeonApiProtocolWKWebViewConfiguration { } -final class PigeonApiWKWebViewConfiguration: PigeonApiProtocolWKWebViewConfiguration { +final class PigeonApiWKWebViewConfiguration: PigeonApiProtocolWKWebViewConfiguration { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKWebViewConfiguration ///An implementation of [NSObject] used to access callback methods @@ -3261,34 +2909,25 @@ final class PigeonApiWKWebViewConfiguration: PigeonApiProtocolWKWebViewConfigura return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, - delegate: PigeonApiDelegateWKWebViewConfiguration - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKWebViewConfiguration) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers( - binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKWebViewConfiguration? - ) { + static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKWebViewConfiguration?) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( - pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.pigeon_defaultConstructor", - binaryMessenger: binaryMessenger, codec: codec) + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.pigeon_defaultConstructor", binaryMessenger: binaryMessenger, codec: codec) if let api = api { pigeonDefaultConstructorChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonIdentifierArg = args[0] as! Int64 do { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), - withIdentifier: pigeonIdentifierArg) +try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), +withIdentifier: pigeonIdentifierArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3297,18 +2936,14 @@ final class PigeonApiWKWebViewConfiguration: PigeonApiProtocolWKWebViewConfigura } else { pigeonDefaultConstructorChannel.setMessageHandler(nil) } - let setUserContentControllerChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setUserContentController", - binaryMessenger: binaryMessenger, codec: codec) + let setUserContentControllerChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setUserContentController", binaryMessenger: binaryMessenger, codec: codec) if let api = api { setUserContentControllerChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKWebViewConfiguration let controllerArg = args[1] as! WKUserContentController do { - try api.pigeonDelegate.setUserContentController( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, controller: controllerArg) + try api.pigeonDelegate.setUserContentController(pigeonApi: api, pigeonInstance: pigeonInstanceArg, controller: controllerArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3317,17 +2952,13 @@ final class PigeonApiWKWebViewConfiguration: PigeonApiProtocolWKWebViewConfigura } else { setUserContentControllerChannel.setMessageHandler(nil) } - let getUserContentControllerChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.getUserContentController", - binaryMessenger: binaryMessenger, codec: codec) + let getUserContentControllerChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.getUserContentController", binaryMessenger: binaryMessenger, codec: codec) if let api = api { getUserContentControllerChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKWebViewConfiguration do { - let result = try api.pigeonDelegate.getUserContentController( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) + let result = try api.pigeonDelegate.getUserContentController(pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -3336,18 +2967,14 @@ final class PigeonApiWKWebViewConfiguration: PigeonApiProtocolWKWebViewConfigura } else { getUserContentControllerChannel.setMessageHandler(nil) } - let setWebsiteDataStoreChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setWebsiteDataStore", - binaryMessenger: binaryMessenger, codec: codec) + let setWebsiteDataStoreChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setWebsiteDataStore", binaryMessenger: binaryMessenger, codec: codec) if let api = api { setWebsiteDataStoreChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKWebViewConfiguration let dataStoreArg = args[1] as! WKWebsiteDataStore do { - try api.pigeonDelegate.setWebsiteDataStore( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, dataStore: dataStoreArg) + try api.pigeonDelegate.setWebsiteDataStore(pigeonApi: api, pigeonInstance: pigeonInstanceArg, dataStore: dataStoreArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3356,17 +2983,13 @@ final class PigeonApiWKWebViewConfiguration: PigeonApiProtocolWKWebViewConfigura } else { setWebsiteDataStoreChannel.setMessageHandler(nil) } - let getWebsiteDataStoreChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.getWebsiteDataStore", - binaryMessenger: binaryMessenger, codec: codec) + let getWebsiteDataStoreChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.getWebsiteDataStore", binaryMessenger: binaryMessenger, codec: codec) if let api = api { getWebsiteDataStoreChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKWebViewConfiguration do { - let result = try api.pigeonDelegate.getWebsiteDataStore( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) + let result = try api.pigeonDelegate.getWebsiteDataStore(pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -3375,17 +2998,14 @@ final class PigeonApiWKWebViewConfiguration: PigeonApiProtocolWKWebViewConfigura } else { getWebsiteDataStoreChannel.setMessageHandler(nil) } - let setPreferencesChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setPreferences", - binaryMessenger: binaryMessenger, codec: codec) + let setPreferencesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setPreferences", binaryMessenger: binaryMessenger, codec: codec) if let api = api { setPreferencesChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKWebViewConfiguration let preferencesArg = args[1] as! WKPreferences do { - try api.pigeonDelegate.setPreferences( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, preferences: preferencesArg) + try api.pigeonDelegate.setPreferences(pigeonApi: api, pigeonInstance: pigeonInstanceArg, preferences: preferencesArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3394,16 +3014,13 @@ final class PigeonApiWKWebViewConfiguration: PigeonApiProtocolWKWebViewConfigura } else { setPreferencesChannel.setMessageHandler(nil) } - let getPreferencesChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.getPreferences", - binaryMessenger: binaryMessenger, codec: codec) + let getPreferencesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.getPreferences", binaryMessenger: binaryMessenger, codec: codec) if let api = api { getPreferencesChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKWebViewConfiguration do { - let result = try api.pigeonDelegate.getPreferences( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) + let result = try api.pigeonDelegate.getPreferences(pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -3412,18 +3029,14 @@ final class PigeonApiWKWebViewConfiguration: PigeonApiProtocolWKWebViewConfigura } else { getPreferencesChannel.setMessageHandler(nil) } - let setAllowsInlineMediaPlaybackChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setAllowsInlineMediaPlayback", - binaryMessenger: binaryMessenger, codec: codec) + let setAllowsInlineMediaPlaybackChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setAllowsInlineMediaPlayback", binaryMessenger: binaryMessenger, codec: codec) if let api = api { setAllowsInlineMediaPlaybackChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKWebViewConfiguration let allowArg = args[1] as! Bool do { - try api.pigeonDelegate.setAllowsInlineMediaPlayback( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, allow: allowArg) + try api.pigeonDelegate.setAllowsInlineMediaPlayback(pigeonApi: api, pigeonInstance: pigeonInstanceArg, allow: allowArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3432,18 +3045,14 @@ final class PigeonApiWKWebViewConfiguration: PigeonApiProtocolWKWebViewConfigura } else { setAllowsInlineMediaPlaybackChannel.setMessageHandler(nil) } - let setLimitsNavigationsToAppBoundDomainsChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setLimitsNavigationsToAppBoundDomains", - binaryMessenger: binaryMessenger, codec: codec) + let setLimitsNavigationsToAppBoundDomainsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setLimitsNavigationsToAppBoundDomains", binaryMessenger: binaryMessenger, codec: codec) if let api = api { setLimitsNavigationsToAppBoundDomainsChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKWebViewConfiguration let limitArg = args[1] as! Bool do { - try api.pigeonDelegate.setLimitsNavigationsToAppBoundDomains( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, limit: limitArg) + try api.pigeonDelegate.setLimitsNavigationsToAppBoundDomains(pigeonApi: api, pigeonInstance: pigeonInstanceArg, limit: limitArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3452,18 +3061,14 @@ final class PigeonApiWKWebViewConfiguration: PigeonApiProtocolWKWebViewConfigura } else { setLimitsNavigationsToAppBoundDomainsChannel.setMessageHandler(nil) } - let setMediaTypesRequiringUserActionForPlaybackChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setMediaTypesRequiringUserActionForPlayback", - binaryMessenger: binaryMessenger, codec: codec) + let setMediaTypesRequiringUserActionForPlaybackChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setMediaTypesRequiringUserActionForPlayback", binaryMessenger: binaryMessenger, codec: codec) if let api = api { setMediaTypesRequiringUserActionForPlaybackChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKWebViewConfiguration let typeArg = args[1] as! AudiovisualMediaType do { - try api.pigeonDelegate.setMediaTypesRequiringUserActionForPlayback( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, type: typeArg) + try api.pigeonDelegate.setMediaTypesRequiringUserActionForPlayback(pigeonApi: api, pigeonInstance: pigeonInstanceArg, type: typeArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3473,17 +3078,13 @@ final class PigeonApiWKWebViewConfiguration: PigeonApiProtocolWKWebViewConfigura 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) + 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) + let result = try api.pigeonDelegate.getDefaultWebpagePreferences(pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -3492,21 +3093,16 @@ final class PigeonApiWKWebViewConfiguration: PigeonApiProtocolWKWebViewConfigura } else { getDefaultWebpagePreferencesChannel.setMessageHandler(nil) } - } else { + } else { let getDefaultWebpagePreferencesChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.getDefaultWebpagePreferences", + 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 - ))) + 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) @@ -3515,27 +3111,21 @@ final class PigeonApiWKWebViewConfiguration: PigeonApiProtocolWKWebViewConfigura } ///Creates a Dart instance of WKWebViewConfiguration and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: WKWebViewConfiguration, - completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: WKWebViewConfiguration, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) + } 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) + 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))) @@ -3555,31 +3145,23 @@ final class PigeonApiWKWebViewConfiguration: PigeonApiProtocolWKWebViewConfigura } protocol PigeonApiDelegateWKUserContentController { /// Installs a message handler that you can call from your JavaScript code. - func addScriptMessageHandler( - pigeonApi: PigeonApiWKUserContentController, pigeonInstance: WKUserContentController, - handler: WKScriptMessageHandler, name: String) throws + func addScriptMessageHandler(pigeonApi: PigeonApiWKUserContentController, pigeonInstance: WKUserContentController, handler: WKScriptMessageHandler, name: String) throws /// Uninstalls the custom message handler with the specified name from your /// JavaScript code. - func removeScriptMessageHandler( - pigeonApi: PigeonApiWKUserContentController, pigeonInstance: WKUserContentController, - name: String) throws + func removeScriptMessageHandler(pigeonApi: PigeonApiWKUserContentController, pigeonInstance: WKUserContentController, name: String) throws /// Uninstalls all custom message handlers associated with the user content /// controller. - func removeAllScriptMessageHandlers( - pigeonApi: PigeonApiWKUserContentController, pigeonInstance: WKUserContentController) throws + func removeAllScriptMessageHandlers(pigeonApi: PigeonApiWKUserContentController, pigeonInstance: WKUserContentController) throws /// Injects the specified script into the webpage’s content. - func addUserScript( - pigeonApi: PigeonApiWKUserContentController, pigeonInstance: WKUserContentController, - userScript: WKUserScript) throws + func addUserScript(pigeonApi: PigeonApiWKUserContentController, pigeonInstance: WKUserContentController, userScript: WKUserScript) throws /// Removes all user scripts from the web view. - func removeAllUserScripts( - pigeonApi: PigeonApiWKUserContentController, pigeonInstance: WKUserContentController) throws + func removeAllUserScripts(pigeonApi: PigeonApiWKUserContentController, pigeonInstance: WKUserContentController) throws } protocol PigeonApiProtocolWKUserContentController { } -final class PigeonApiWKUserContentController: PigeonApiProtocolWKUserContentController { +final class PigeonApiWKUserContentController: PigeonApiProtocolWKUserContentController { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKUserContentController ///An implementation of [NSObject] used to access callback methods @@ -3587,26 +3169,17 @@ final class PigeonApiWKUserContentController: PigeonApiProtocolWKUserContentCont return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, - delegate: PigeonApiDelegateWKUserContentController - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKUserContentController) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers( - binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKUserContentController? - ) { + static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKUserContentController?) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( - pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let addScriptMessageHandlerChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.addScriptMessageHandler", - binaryMessenger: binaryMessenger, codec: codec) + let addScriptMessageHandlerChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.addScriptMessageHandler", binaryMessenger: binaryMessenger, codec: codec) if let api = api { addScriptMessageHandlerChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -3614,8 +3187,7 @@ final class PigeonApiWKUserContentController: PigeonApiProtocolWKUserContentCont let handlerArg = args[1] as! WKScriptMessageHandler let nameArg = args[2] as! String do { - try api.pigeonDelegate.addScriptMessageHandler( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, handler: handlerArg, name: nameArg) + try api.pigeonDelegate.addScriptMessageHandler(pigeonApi: api, pigeonInstance: pigeonInstanceArg, handler: handlerArg, name: nameArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3624,18 +3196,14 @@ final class PigeonApiWKUserContentController: PigeonApiProtocolWKUserContentCont } else { addScriptMessageHandlerChannel.setMessageHandler(nil) } - let removeScriptMessageHandlerChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.removeScriptMessageHandler", - binaryMessenger: binaryMessenger, codec: codec) + let removeScriptMessageHandlerChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.removeScriptMessageHandler", binaryMessenger: binaryMessenger, codec: codec) if let api = api { removeScriptMessageHandlerChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKUserContentController let nameArg = args[1] as! String do { - try api.pigeonDelegate.removeScriptMessageHandler( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, name: nameArg) + try api.pigeonDelegate.removeScriptMessageHandler(pigeonApi: api, pigeonInstance: pigeonInstanceArg, name: nameArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3644,17 +3212,13 @@ final class PigeonApiWKUserContentController: PigeonApiProtocolWKUserContentCont } else { removeScriptMessageHandlerChannel.setMessageHandler(nil) } - let removeAllScriptMessageHandlersChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.removeAllScriptMessageHandlers", - binaryMessenger: binaryMessenger, codec: codec) + let removeAllScriptMessageHandlersChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.removeAllScriptMessageHandlers", binaryMessenger: binaryMessenger, codec: codec) if let api = api { removeAllScriptMessageHandlersChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKUserContentController do { - try api.pigeonDelegate.removeAllScriptMessageHandlers( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) + try api.pigeonDelegate.removeAllScriptMessageHandlers(pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3663,17 +3227,14 @@ final class PigeonApiWKUserContentController: PigeonApiProtocolWKUserContentCont } else { removeAllScriptMessageHandlersChannel.setMessageHandler(nil) } - let addUserScriptChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.addUserScript", - binaryMessenger: binaryMessenger, codec: codec) + let addUserScriptChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.addUserScript", binaryMessenger: binaryMessenger, codec: codec) if let api = api { addUserScriptChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKUserContentController let userScriptArg = args[1] as! WKUserScript do { - try api.pigeonDelegate.addUserScript( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, userScript: userScriptArg) + try api.pigeonDelegate.addUserScript(pigeonApi: api, pigeonInstance: pigeonInstanceArg, userScript: userScriptArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3682,17 +3243,13 @@ final class PigeonApiWKUserContentController: PigeonApiProtocolWKUserContentCont } else { addUserScriptChannel.setMessageHandler(nil) } - let removeAllUserScriptsChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.removeAllUserScripts", - binaryMessenger: binaryMessenger, codec: codec) + let removeAllUserScriptsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.removeAllUserScripts", binaryMessenger: binaryMessenger, codec: codec) if let api = api { removeAllUserScriptsChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKUserContentController do { - try api.pigeonDelegate.removeAllUserScripts( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) + try api.pigeonDelegate.removeAllUserScripts(pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3704,27 +3261,21 @@ final class PigeonApiWKUserContentController: PigeonApiProtocolWKUserContentCont } ///Creates a Dart instance of WKUserContentController and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: WKUserContentController, - completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: WKUserContentController, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) + } 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) + 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))) @@ -3744,14 +3295,13 @@ final class PigeonApiWKUserContentController: PigeonApiProtocolWKUserContentCont } protocol PigeonApiDelegateWKPreferences { /// A Boolean value that indicates whether JavaScript is enabled. - func setJavaScriptEnabled( - pigeonApi: PigeonApiWKPreferences, pigeonInstance: WKPreferences, enabled: Bool) throws + func setJavaScriptEnabled(pigeonApi: PigeonApiWKPreferences, pigeonInstance: WKPreferences, enabled: Bool) throws } protocol PigeonApiProtocolWKPreferences { } -final class PigeonApiWKPreferences: PigeonApiProtocolWKPreferences { +final class PigeonApiWKPreferences: PigeonApiProtocolWKPreferences { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKPreferences ///An implementation of [NSObject] used to access callback methods @@ -3759,32 +3309,24 @@ final class PigeonApiWKPreferences: PigeonApiProtocolWKPreferences { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKPreferences - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKPreferences) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers( - binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKPreferences? - ) { + static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKPreferences?) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( - pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let setJavaScriptEnabledChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKPreferences.setJavaScriptEnabled", - binaryMessenger: binaryMessenger, codec: codec) + let setJavaScriptEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKPreferences.setJavaScriptEnabled", binaryMessenger: binaryMessenger, codec: codec) if let api = api { setJavaScriptEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKPreferences let enabledArg = args[1] as! Bool do { - try api.pigeonDelegate.setJavaScriptEnabled( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, enabled: enabledArg) + try api.pigeonDelegate.setJavaScriptEnabled(pigeonApi: api, pigeonInstance: pigeonInstanceArg, enabled: enabledArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3796,26 +3338,21 @@ final class PigeonApiWKPreferences: PigeonApiProtocolWKPreferences { } ///Creates a Dart instance of WKPreferences and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: WKPreferences, completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: WKPreferences, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) + } 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) + 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))) @@ -3834,19 +3371,15 @@ final class PigeonApiWKPreferences: PigeonApiProtocolWKPreferences { } } protocol PigeonApiDelegateWKScriptMessageHandler { - func pigeonDefaultConstructor(pigeonApi: PigeonApiWKScriptMessageHandler) throws - -> WKScriptMessageHandler + func pigeonDefaultConstructor(pigeonApi: PigeonApiWKScriptMessageHandler) throws -> WKScriptMessageHandler } protocol PigeonApiProtocolWKScriptMessageHandler { /// Tells the handler that a webpage sent a script message. - func didReceiveScriptMessage( - pigeonInstance pigeonInstanceArg: WKScriptMessageHandler, - controller controllerArg: WKUserContentController, message messageArg: WKScriptMessage, - completion: @escaping (Result) -> Void) + func didReceiveScriptMessage(pigeonInstance pigeonInstanceArg: WKScriptMessageHandler, controller controllerArg: WKUserContentController, message messageArg: WKScriptMessage, completion: @escaping (Result) -> Void) } -final class PigeonApiWKScriptMessageHandler: PigeonApiProtocolWKScriptMessageHandler { +final class PigeonApiWKScriptMessageHandler: PigeonApiProtocolWKScriptMessageHandler { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKScriptMessageHandler ///An implementation of [NSObject] used to access callback methods @@ -3854,34 +3387,25 @@ final class PigeonApiWKScriptMessageHandler: PigeonApiProtocolWKScriptMessageHan return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, - delegate: PigeonApiDelegateWKScriptMessageHandler - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKScriptMessageHandler) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers( - binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKScriptMessageHandler? - ) { + static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKScriptMessageHandler?) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( - pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.webview_flutter_wkwebview.WKScriptMessageHandler.pigeon_defaultConstructor", - binaryMessenger: binaryMessenger, codec: codec) + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKScriptMessageHandler.pigeon_defaultConstructor", binaryMessenger: binaryMessenger, codec: codec) if let api = api { pigeonDefaultConstructorChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonIdentifierArg = args[0] as! Int64 do { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), - withIdentifier: pigeonIdentifierArg) +try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), +withIdentifier: pigeonIdentifierArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3893,34 +3417,25 @@ final class PigeonApiWKScriptMessageHandler: PigeonApiProtocolWKScriptMessageHan } ///Creates a Dart instance of WKScriptMessageHandler and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: WKScriptMessageHandler, - completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: WKScriptMessageHandler, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { + } 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: ""))) + message: "Error: Attempting to create a new Dart instance of WKScriptMessageHandler, but the class has a nonnull callback method.", details: ""))) } } /// Tells the handler that a webpage sent a script message. - func didReceiveScriptMessage( - pigeonInstance pigeonInstanceArg: WKScriptMessageHandler, - controller controllerArg: WKUserContentController, message messageArg: WKScriptMessage, - completion: @escaping (Result) -> Void - ) { + func didReceiveScriptMessage(pigeonInstance pigeonInstanceArg: WKScriptMessageHandler, controller controllerArg: WKUserContentController, message messageArg: WKScriptMessage, completion: @escaping (Result) -> Void) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -3931,10 +3446,8 @@ final class PigeonApiWKScriptMessageHandler: PigeonApiProtocolWKScriptMessageHan } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.WKScriptMessageHandler.didReceiveScriptMessage" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKScriptMessageHandler.didReceiveScriptMessage" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([pigeonInstanceArg, controllerArg, messageArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -3953,44 +3466,27 @@ final class PigeonApiWKScriptMessageHandler: PigeonApiProtocolWKScriptMessageHan } protocol PigeonApiDelegateWKNavigationDelegate { - func pigeonDefaultConstructor(pigeonApi: PigeonApiWKNavigationDelegate) throws - -> WKNavigationDelegate + func pigeonDefaultConstructor(pigeonApi: PigeonApiWKNavigationDelegate) throws -> WKNavigationDelegate } protocol PigeonApiProtocolWKNavigationDelegate { /// Tells the delegate that navigation is complete. - func didFinishNavigation( - pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, - url urlArg: String?, completion: @escaping (Result) -> Void) + func didFinishNavigation(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, url urlArg: String?, completion: @escaping (Result) -> Void) /// Tells the delegate that navigation from the main frame has started. - func didStartProvisionalNavigation( - pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, - url urlArg: String?, completion: @escaping (Result) -> Void) + func didStartProvisionalNavigation(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, url urlArg: String?, completion: @escaping (Result) -> Void) /// Asks the delegate for permission to navigate to new content based on the /// specified action information. - func decidePolicyForNavigationAction( - pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, - navigationAction navigationActionArg: WKNavigationAction, - completion: @escaping (Result) -> Void) + func decidePolicyForNavigationAction(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, navigationAction navigationActionArg: WKNavigationAction, completion: @escaping (Result) -> Void) /// Asks the delegate for permission to navigate to new content after the /// response to the navigation request is known. - func decidePolicyForNavigationResponse( - pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, - navigationResponse navigationResponseArg: WKNavigationResponse, - completion: @escaping (Result) -> Void) + func decidePolicyForNavigationResponse(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, navigationResponse navigationResponseArg: WKNavigationResponse, completion: @escaping (Result) -> Void) /// Tells the delegate that an error occurred during navigation. - func didFailNavigation( - pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, - error errorArg: NSError, completion: @escaping (Result) -> Void) + func didFailNavigation(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, error errorArg: NSError, completion: @escaping (Result) -> Void) /// Tells the delegate that an error occurred during the early navigation /// process. - func didFailProvisionalNavigation( - pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, - error errorArg: NSError, completion: @escaping (Result) -> Void) + func didFailProvisionalNavigation(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, error errorArg: NSError, completion: @escaping (Result) -> Void) /// Tells the delegate that the web view’s content process was terminated. - func webViewWebContentProcessDidTerminate( - pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, - completion: @escaping (Result) -> Void) + func webViewWebContentProcessDidTerminate(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, completion: @escaping (Result) -> Void) /// Asks the delegate to respond to an authentication challenge. /// /// This return value expects a List with: @@ -4002,13 +3498,10 @@ protocol PigeonApiProtocolWKNavigationDelegate { /// "password": "", /// "persistence": , /// ] - func didReceiveAuthenticationChallenge( - pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, - challenge challengeArg: URLAuthenticationChallenge, - completion: @escaping (Result<[Any?], PigeonError>) -> Void) + func didReceiveAuthenticationChallenge(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, challenge challengeArg: URLAuthenticationChallenge, completion: @escaping (Result<[Any?], PigeonError>) -> Void) } -final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate { +final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKNavigationDelegate ///An implementation of [NSObject] used to access callback methods @@ -4016,34 +3509,25 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, - delegate: PigeonApiDelegateWKNavigationDelegate - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKNavigationDelegate) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers( - binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKNavigationDelegate? - ) { + static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKNavigationDelegate?) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( - pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.pigeon_defaultConstructor", - binaryMessenger: binaryMessenger, codec: codec) + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.pigeon_defaultConstructor", binaryMessenger: binaryMessenger, codec: codec) if let api = api { pigeonDefaultConstructorChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonIdentifierArg = args[0] as! Int64 do { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), - withIdentifier: pigeonIdentifierArg) +try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), +withIdentifier: pigeonIdentifierArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -4055,32 +3539,25 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate } ///Creates a Dart instance of WKNavigationDelegate and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: WKNavigationDelegate, completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: WKNavigationDelegate, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { + } 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: ""))) + message: "Error: Attempting to create a new Dart instance of WKNavigationDelegate, but the class has a nonnull callback method.", details: ""))) } } /// Tells the delegate that navigation is complete. - func didFinishNavigation( - pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, - url urlArg: String?, completion: @escaping (Result) -> Void - ) { + func didFinishNavigation(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, url urlArg: String?, completion: @escaping (Result) -> Void) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -4091,10 +3568,8 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didFinishNavigation" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didFinishNavigation" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([pigeonInstanceArg, webViewArg, urlArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -4112,10 +3587,7 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate } /// Tells the delegate that navigation from the main frame has started. - func didStartProvisionalNavigation( - pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, - url urlArg: String?, completion: @escaping (Result) -> Void - ) { + func didStartProvisionalNavigation(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, url urlArg: String?, completion: @escaping (Result) -> Void) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -4126,10 +3598,8 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didStartProvisionalNavigation" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didStartProvisionalNavigation" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([pigeonInstanceArg, webViewArg, urlArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -4148,11 +3618,7 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate /// Asks the delegate for permission to navigate to new content based on the /// specified action information. - func decidePolicyForNavigationAction( - pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, - navigationAction navigationActionArg: WKNavigationAction, - completion: @escaping (Result) -> Void - ) { + func decidePolicyForNavigationAction(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, navigationAction navigationActionArg: WKNavigationAction, completion: @escaping (Result) -> Void) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -4163,12 +3629,9 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.decidePolicyForNavigationAction" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, webViewArg, navigationActionArg] as [Any?]) { - response in + let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.decidePolicyForNavigationAction" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, webViewArg, navigationActionArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -4179,11 +3642,7 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) + completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! NavigationActionPolicy completion(.success(result)) @@ -4193,11 +3652,7 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate /// Asks the delegate for permission to navigate to new content after the /// response to the navigation request is known. - func decidePolicyForNavigationResponse( - pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, - navigationResponse navigationResponseArg: WKNavigationResponse, - completion: @escaping (Result) -> Void - ) { + func decidePolicyForNavigationResponse(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, navigationResponse navigationResponseArg: WKNavigationResponse, completion: @escaping (Result) -> Void) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -4208,12 +3663,9 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.decidePolicyForNavigationResponse" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, webViewArg, navigationResponseArg] as [Any?]) { - response in + let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.decidePolicyForNavigationResponse" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, webViewArg, navigationResponseArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -4224,11 +3676,7 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) + completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! NavigationResponsePolicy completion(.success(result)) @@ -4237,10 +3685,7 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate } /// Tells the delegate that an error occurred during navigation. - func didFailNavigation( - pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, - error errorArg: NSError, completion: @escaping (Result) -> Void - ) { + func didFailNavigation(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, error errorArg: NSError, completion: @escaping (Result) -> Void) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -4251,10 +3696,8 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didFailNavigation" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didFailNavigation" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([pigeonInstanceArg, webViewArg, errorArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -4273,10 +3716,7 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate /// Tells the delegate that an error occurred during the early navigation /// process. - func didFailProvisionalNavigation( - pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, - error errorArg: NSError, completion: @escaping (Result) -> Void - ) { + func didFailProvisionalNavigation(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, error errorArg: NSError, completion: @escaping (Result) -> Void) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -4287,10 +3727,8 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didFailProvisionalNavigation" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didFailProvisionalNavigation" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([pigeonInstanceArg, webViewArg, errorArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -4308,10 +3746,7 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate } /// Tells the delegate that the web view’s content process was terminated. - func webViewWebContentProcessDidTerminate( - pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, - completion: @escaping (Result) -> Void - ) { + func webViewWebContentProcessDidTerminate(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, completion: @escaping (Result) -> Void) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -4322,10 +3757,8 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.webViewWebContentProcessDidTerminate" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.webViewWebContentProcessDidTerminate" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([pigeonInstanceArg, webViewArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -4353,11 +3786,7 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate /// "password": "", /// "persistence": , /// ] - func didReceiveAuthenticationChallenge( - pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, - challenge challengeArg: URLAuthenticationChallenge, - completion: @escaping (Result<[Any?], PigeonError>) -> Void - ) { + func didReceiveAuthenticationChallenge(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, challenge challengeArg: URLAuthenticationChallenge, completion: @escaping (Result<[Any?], PigeonError>) -> Void) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -4368,10 +3797,8 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didReceiveAuthenticationChallenge" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didReceiveAuthenticationChallenge" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([pigeonInstanceArg, webViewArg, challengeArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -4383,11 +3810,7 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) + completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! [Any?] completion(.success(result)) @@ -4400,52 +3823,41 @@ protocol PigeonApiDelegateNSObject { func pigeonDefaultConstructor(pigeonApi: PigeonApiNSObject) throws -> NSObject /// Registers the observer object to receive KVO notifications for the key /// path relative to the object receiving this message. - func addObserver( - pigeonApi: PigeonApiNSObject, pigeonInstance: NSObject, observer: NSObject, keyPath: String, - options: [KeyValueObservingOptions]) throws + func addObserver(pigeonApi: PigeonApiNSObject, pigeonInstance: NSObject, observer: NSObject, keyPath: String, options: [KeyValueObservingOptions]) throws /// Stops the observer object from receiving change notifications for the /// property specified by the key path relative to the object receiving this /// message. - func removeObserver( - pigeonApi: PigeonApiNSObject, pigeonInstance: NSObject, observer: NSObject, keyPath: String) - throws + func removeObserver(pigeonApi: PigeonApiNSObject, pigeonInstance: NSObject, observer: NSObject, keyPath: String) throws } protocol PigeonApiProtocolNSObject { /// Informs the observing object when the value at the specified key path /// relative to the observed object has changed. - func observeValue( - pigeonInstance pigeonInstanceArg: NSObject, keyPath keyPathArg: String?, - object objectArg: NSObject?, change changeArg: [KeyValueChangeKey: Any?]?, - completion: @escaping (Result) -> Void) + func observeValue(pigeonInstance pigeonInstanceArg: NSObject, keyPath keyPathArg: String?, object objectArg: NSObject?, change changeArg: [KeyValueChangeKey: Any?]?, completion: @escaping (Result) -> Void) } -final class PigeonApiNSObject: PigeonApiProtocolNSObject { +final class PigeonApiNSObject: PigeonApiProtocolNSObject { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateNSObject init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateNSObject) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiNSObject?) - { + static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiNSObject?) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( - pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSObject.pigeon_defaultConstructor", - binaryMessenger: binaryMessenger, codec: codec) + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSObject.pigeon_defaultConstructor", binaryMessenger: binaryMessenger, codec: codec) if let api = api { pigeonDefaultConstructorChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonIdentifierArg = args[0] as! Int64 do { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), - withIdentifier: pigeonIdentifierArg) +try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), +withIdentifier: pigeonIdentifierArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -4454,9 +3866,7 @@ final class PigeonApiNSObject: PigeonApiProtocolNSObject { } else { pigeonDefaultConstructorChannel.setMessageHandler(nil) } - let addObserverChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSObject.addObserver", - binaryMessenger: binaryMessenger, codec: codec) + let addObserverChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSObject.addObserver", binaryMessenger: binaryMessenger, codec: codec) if let api = api { addObserverChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -4465,9 +3875,7 @@ final class PigeonApiNSObject: PigeonApiProtocolNSObject { let keyPathArg = args[2] as! String let optionsArg = args[3] as! [KeyValueObservingOptions] do { - try api.pigeonDelegate.addObserver( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, observer: observerArg, - keyPath: keyPathArg, options: optionsArg) + try api.pigeonDelegate.addObserver(pigeonApi: api, pigeonInstance: pigeonInstanceArg, observer: observerArg, keyPath: keyPathArg, options: optionsArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -4476,9 +3884,7 @@ final class PigeonApiNSObject: PigeonApiProtocolNSObject { } else { addObserverChannel.setMessageHandler(nil) } - let removeObserverChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSObject.removeObserver", - binaryMessenger: binaryMessenger, codec: codec) + let removeObserverChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSObject.removeObserver", binaryMessenger: binaryMessenger, codec: codec) if let api = api { removeObserverChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -4486,9 +3892,7 @@ final class PigeonApiNSObject: PigeonApiProtocolNSObject { let observerArg = args[1] as! NSObject let keyPathArg = args[2] as! String do { - try api.pigeonDelegate.removeObserver( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, observer: observerArg, - keyPath: keyPathArg) + try api.pigeonDelegate.removeObserver(pigeonApi: api, pigeonInstance: pigeonInstanceArg, observer: observerArg, keyPath: keyPathArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -4500,26 +3904,21 @@ final class PigeonApiNSObject: PigeonApiProtocolNSObject { } ///Creates a Dart instance of NSObject and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: NSObject, completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: NSObject, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) + } 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) + 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))) @@ -4538,11 +3937,7 @@ final class PigeonApiNSObject: PigeonApiProtocolNSObject { } /// Informs the observing object when the value at the specified key path /// relative to the observed object has changed. - func observeValue( - pigeonInstance pigeonInstanceArg: NSObject, keyPath keyPathArg: String?, - object objectArg: NSObject?, change changeArg: [KeyValueChangeKey: Any?]?, - completion: @escaping (Result) -> Void - ) { + func observeValue(pigeonInstance pigeonInstanceArg: NSObject, keyPath keyPathArg: String?, object objectArg: NSObject?, change changeArg: [KeyValueChangeKey: Any?]?, completion: @escaping (Result) -> Void) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -4554,10 +3949,8 @@ final class PigeonApiNSObject: PigeonApiProtocolNSObject { let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.NSObject.observeValue" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, keyPathArg, objectArg, changeArg] as [Any?]) { - response in + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, keyPathArg, objectArg, changeArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -4576,125 +3969,104 @@ final class PigeonApiNSObject: PigeonApiProtocolNSObject { } protocol PigeonApiDelegateUIViewWKWebView { #if !os(macOS) - func pigeonDefaultConstructor( - pigeonApi: PigeonApiUIViewWKWebView, initialConfiguration: WKWebViewConfiguration - ) throws -> WKWebView + func pigeonDefaultConstructor(pigeonApi: PigeonApiUIViewWKWebView, initialConfiguration: WKWebViewConfiguration) throws -> WKWebView #endif #if !os(macOS) - /// The object that contains the configuration details for the web view. - func configuration(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws - -> WKWebViewConfiguration + /// The object that contains the configuration details for the web view. + func configuration(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> WKWebViewConfiguration #endif #if !os(macOS) - /// The scroll view associated with the web view. - func scrollView(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws - -> UIScrollView + /// The scroll view associated with the web view. + func scrollView(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> UIScrollView #endif #if !os(macOS) - /// The object you use to integrate custom user interface elements, such as - /// contextual menus or panels, into web view interactions. - func setUIDelegate( - pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, delegate: WKUIDelegate) throws + /// The object you use to integrate custom user interface elements, such as + /// contextual menus or panels, into web view interactions. + func setUIDelegate(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, delegate: WKUIDelegate) throws #endif #if !os(macOS) - /// The object you use to manage navigation behavior for the web view. - func setNavigationDelegate( - pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, delegate: WKNavigationDelegate - ) throws + /// The object you use to manage navigation behavior for the web view. + func setNavigationDelegate(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, delegate: WKNavigationDelegate) throws #endif #if !os(macOS) - /// The URL for the current webpage. - func getUrl(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> String? + /// The URL for the current webpage. + func getUrl(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> String? #endif #if !os(macOS) - /// An estimate of what fraction of the current navigation has been loaded. - func getEstimatedProgress(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws - -> Double + /// An estimate of what fraction of the current navigation has been loaded. + func getEstimatedProgress(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> Double #endif #if !os(macOS) - /// Loads the web content that the specified URL request object references and - /// navigates to that content. - func load( - pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, request: URLRequestWrapper) - throws + /// Loads the web content that the specified URL request object references and + /// navigates to that content. + func load(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, request: URLRequestWrapper) throws #endif #if !os(macOS) - /// Loads the contents of the specified HTML string and navigates to it. - func loadHtmlString( - pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, string: String, - baseUrl: String?) throws + /// Loads the contents of the specified HTML string and navigates to it. + func loadHtmlString(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, string: String, baseUrl: String?) throws #endif #if !os(macOS) - /// Loads the web content from the specified file and navigates to it. - func loadFileUrl( - pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, url: String, - readAccessUrl: String) throws + /// Loads the web content from the specified file and navigates to it. + func loadFileUrl(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, url: String, readAccessUrl: String) throws #endif #if !os(macOS) - /// Convenience method to load a Flutter asset. - func loadFlutterAsset( - pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, key: String) throws + /// Convenience method to load a Flutter asset. + func loadFlutterAsset(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, key: String) throws #endif #if !os(macOS) - /// A Boolean value that indicates whether there is a valid back item in the - /// back-forward list. - func canGoBack(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> Bool + /// A Boolean value that indicates whether there is a valid back item in the + /// back-forward list. + func canGoBack(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> Bool #endif #if !os(macOS) - /// A Boolean value that indicates whether there is a valid forward item in - /// the back-forward list. - func canGoForward(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> Bool + /// A Boolean value that indicates whether there is a valid forward item in + /// the back-forward list. + func canGoForward(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> Bool #endif #if !os(macOS) - /// Navigates to the back item in the back-forward list. - func goBack(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws + /// Navigates to the back item in the back-forward list. + func goBack(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws #endif #if !os(macOS) - /// Navigates to the forward item in the back-forward list. - func goForward(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws + /// Navigates to the forward item in the back-forward list. + func goForward(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws #endif #if !os(macOS) - /// Reloads the current webpage. - func reload(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws + /// Reloads the current webpage. + func reload(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws #endif #if !os(macOS) - /// The page title. - func getTitle(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> String? + /// The page title. + func getTitle(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> String? #endif #if !os(macOS) - /// A Boolean value that indicates whether horizontal swipe gestures trigger - /// backward and forward page navigation. - func setAllowsBackForwardNavigationGestures( - pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, allow: Bool) throws + /// A Boolean value that indicates whether horizontal swipe gestures trigger + /// backward and forward page navigation. + func setAllowsBackForwardNavigationGestures(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, allow: Bool) throws #endif #if !os(macOS) - /// The custom user agent string. - func setCustomUserAgent( - pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, userAgent: String?) throws + /// The custom user agent string. + func setCustomUserAgent(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, userAgent: String?) throws #endif #if !os(macOS) - /// Evaluates the specified JavaScript string. - func evaluateJavaScript( - pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, javaScriptString: String, - completion: @escaping (Result) -> Void) + /// Evaluates the specified JavaScript string. + func evaluateJavaScript(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, javaScriptString: String, completion: @escaping (Result) -> Void) #endif #if !os(macOS) - /// A Boolean value that indicates whether you can inspect the view with - /// Safari Web Inspector. - func setInspectable( - pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, inspectable: Bool) throws + /// A Boolean value that indicates whether you can inspect the view with + /// Safari Web Inspector. + func setInspectable(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, inspectable: Bool) throws #endif #if !os(macOS) - /// The custom user agent string. - func getCustomUserAgent(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws - -> String? + /// The custom user agent string. + func getCustomUserAgent(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> String? #endif } protocol PigeonApiProtocolUIViewWKWebView { } -final class PigeonApiUIViewWKWebView: PigeonApiProtocolUIViewWKWebView { +final class PigeonApiUIViewWKWebView: PigeonApiProtocolUIViewWKWebView { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateUIViewWKWebView ///An implementation of [UIView] used to access callback methods @@ -4707,644 +4079,542 @@ final class PigeonApiUIViewWKWebView: PigeonApiProtocolUIViewWKWebView { return pigeonRegistrar.apiDelegate.pigeonApiWKWebView(pigeonRegistrar) } - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, - delegate: PigeonApiDelegateUIViewWKWebView - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateUIViewWKWebView) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers( - binaryMessenger: FlutterBinaryMessenger, api: PigeonApiUIViewWKWebView? - ) { + static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiUIViewWKWebView?) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( - pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() #if !os(macOS) - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.pigeon_defaultConstructor", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - pigeonDefaultConstructorChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonIdentifierArg = args[0] as! Int64 - let initialConfigurationArg = args[1] as! WKWebViewConfiguration - do { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - try api.pigeonDelegate.pigeonDefaultConstructor( - pigeonApi: api, initialConfiguration: initialConfigurationArg), - withIdentifier: pigeonIdentifierArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.pigeon_defaultConstructor", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + pigeonDefaultConstructorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonIdentifierArg = args[0] as! Int64 + let initialConfigurationArg = args[1] as! WKWebViewConfiguration + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( +try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api, initialConfiguration: initialConfigurationArg), +withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - pigeonDefaultConstructorChannel.setMessageHandler(nil) } + } else { + pigeonDefaultConstructorChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let configurationChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.configuration", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - configurationChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let pigeonIdentifierArg = args[1] as! Int64 - do { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - try api.pigeonDelegate.configuration( - pigeonApi: api, pigeonInstance: pigeonInstanceArg), - withIdentifier: pigeonIdentifierArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let configurationChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.configuration", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + configurationChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let pigeonIdentifierArg = args[1] as! Int64 + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance(try api.pigeonDelegate.configuration(pigeonApi: api, pigeonInstance: pigeonInstanceArg), withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - configurationChannel.setMessageHandler(nil) } + } else { + configurationChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let scrollViewChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.scrollView", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - scrollViewChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let pigeonIdentifierArg = args[1] as! Int64 - do { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - try api.pigeonDelegate.scrollView(pigeonApi: api, pigeonInstance: pigeonInstanceArg), - withIdentifier: pigeonIdentifierArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let scrollViewChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.scrollView", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + scrollViewChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let pigeonIdentifierArg = args[1] as! Int64 + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance(try api.pigeonDelegate.scrollView(pigeonApi: api, pigeonInstance: pigeonInstanceArg), withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - scrollViewChannel.setMessageHandler(nil) } + } else { + scrollViewChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let setUIDelegateChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setUIDelegate", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setUIDelegateChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let delegateArg = args[1] as! WKUIDelegate - do { - try api.pigeonDelegate.setUIDelegate( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, delegate: delegateArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let setUIDelegateChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setUIDelegate", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setUIDelegateChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let delegateArg = args[1] as! WKUIDelegate + do { + try api.pigeonDelegate.setUIDelegate(pigeonApi: api, pigeonInstance: pigeonInstanceArg, delegate: delegateArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - setUIDelegateChannel.setMessageHandler(nil) } + } else { + setUIDelegateChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let setNavigationDelegateChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setNavigationDelegate", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setNavigationDelegateChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let delegateArg = args[1] as! WKNavigationDelegate - do { - try api.pigeonDelegate.setNavigationDelegate( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, delegate: delegateArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let setNavigationDelegateChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setNavigationDelegate", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setNavigationDelegateChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let delegateArg = args[1] as! WKNavigationDelegate + do { + try api.pigeonDelegate.setNavigationDelegate(pigeonApi: api, pigeonInstance: pigeonInstanceArg, delegate: delegateArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - setNavigationDelegateChannel.setMessageHandler(nil) } + } else { + setNavigationDelegateChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let getUrlChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.getUrl", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - getUrlChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - let result = try api.pigeonDelegate.getUrl( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } + let getUrlChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.getUrl", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getUrlChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.getUrl(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) } - } else { - getUrlChannel.setMessageHandler(nil) } + } else { + getUrlChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let getEstimatedProgressChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.getEstimatedProgress", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - getEstimatedProgressChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - let result = try api.pigeonDelegate.getEstimatedProgress( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } + let getEstimatedProgressChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.getEstimatedProgress", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getEstimatedProgressChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.getEstimatedProgress(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) } - } else { - getEstimatedProgressChannel.setMessageHandler(nil) } + } else { + getEstimatedProgressChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let loadChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.load", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - loadChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let requestArg = args[1] as! URLRequestWrapper - do { - try api.pigeonDelegate.load( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, request: requestArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let loadChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.load", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + loadChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let requestArg = args[1] as! URLRequestWrapper + do { + try api.pigeonDelegate.load(pigeonApi: api, pigeonInstance: pigeonInstanceArg, request: requestArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - loadChannel.setMessageHandler(nil) } + } else { + loadChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let loadHtmlStringChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.loadHtmlString", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - loadHtmlStringChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let stringArg = args[1] as! String - let baseUrlArg: String? = nilOrValue(args[2]) - do { - try api.pigeonDelegate.loadHtmlString( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, string: stringArg, - baseUrl: baseUrlArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let loadHtmlStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.loadHtmlString", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + loadHtmlStringChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let stringArg = args[1] as! String + let baseUrlArg: String? = nilOrValue(args[2]) + do { + try api.pigeonDelegate.loadHtmlString(pigeonApi: api, pigeonInstance: pigeonInstanceArg, string: stringArg, baseUrl: baseUrlArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - loadHtmlStringChannel.setMessageHandler(nil) } + } else { + loadHtmlStringChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let loadFileUrlChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.loadFileUrl", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - loadFileUrlChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let urlArg = args[1] as! String - let readAccessUrlArg = args[2] as! String - do { - try api.pigeonDelegate.loadFileUrl( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, url: urlArg, - readAccessUrl: readAccessUrlArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let loadFileUrlChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.loadFileUrl", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + loadFileUrlChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let urlArg = args[1] as! String + let readAccessUrlArg = args[2] as! String + do { + try api.pigeonDelegate.loadFileUrl(pigeonApi: api, pigeonInstance: pigeonInstanceArg, url: urlArg, readAccessUrl: readAccessUrlArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - loadFileUrlChannel.setMessageHandler(nil) } + } else { + loadFileUrlChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let loadFlutterAssetChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.loadFlutterAsset", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - loadFlutterAssetChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let keyArg = args[1] as! String - do { - try api.pigeonDelegate.loadFlutterAsset( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, key: keyArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let loadFlutterAssetChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.loadFlutterAsset", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + loadFlutterAssetChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let keyArg = args[1] as! String + do { + try api.pigeonDelegate.loadFlutterAsset(pigeonApi: api, pigeonInstance: pigeonInstanceArg, key: keyArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - loadFlutterAssetChannel.setMessageHandler(nil) } + } else { + loadFlutterAssetChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let canGoBackChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.canGoBack", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - canGoBackChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - let result = try api.pigeonDelegate.canGoBack( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } + let canGoBackChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.canGoBack", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + canGoBackChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.canGoBack(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) } - } else { - canGoBackChannel.setMessageHandler(nil) } + } else { + canGoBackChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let canGoForwardChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.canGoForward", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - canGoForwardChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - let result = try api.pigeonDelegate.canGoForward( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } + let canGoForwardChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.canGoForward", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + canGoForwardChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.canGoForward(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) } - } else { - canGoForwardChannel.setMessageHandler(nil) } + } else { + canGoForwardChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let goBackChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.goBack", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - goBackChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - try api.pigeonDelegate.goBack(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let goBackChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.goBack", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + goBackChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + try api.pigeonDelegate.goBack(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - goBackChannel.setMessageHandler(nil) } + } else { + goBackChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let goForwardChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.goForward", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - goForwardChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - try api.pigeonDelegate.goForward(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let goForwardChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.goForward", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + goForwardChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + try api.pigeonDelegate.goForward(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - goForwardChannel.setMessageHandler(nil) } + } else { + goForwardChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let reloadChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.reload", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - reloadChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - try api.pigeonDelegate.reload(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let reloadChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.reload", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + reloadChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + try api.pigeonDelegate.reload(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - reloadChannel.setMessageHandler(nil) } + } else { + reloadChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let getTitleChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.getTitle", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - getTitleChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - let result = try api.pigeonDelegate.getTitle( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } + let getTitleChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.getTitle", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getTitleChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.getTitle(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) } - } else { - getTitleChannel.setMessageHandler(nil) } + } else { + getTitleChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let setAllowsBackForwardNavigationGesturesChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setAllowsBackForwardNavigationGestures", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setAllowsBackForwardNavigationGesturesChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let allowArg = args[1] as! Bool - do { - try api.pigeonDelegate.setAllowsBackForwardNavigationGestures( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, allow: allowArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let setAllowsBackForwardNavigationGesturesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setAllowsBackForwardNavigationGestures", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setAllowsBackForwardNavigationGesturesChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let allowArg = args[1] as! Bool + do { + try api.pigeonDelegate.setAllowsBackForwardNavigationGestures(pigeonApi: api, pigeonInstance: pigeonInstanceArg, allow: allowArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - setAllowsBackForwardNavigationGesturesChannel.setMessageHandler(nil) } + } else { + setAllowsBackForwardNavigationGesturesChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let setCustomUserAgentChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setCustomUserAgent", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setCustomUserAgentChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let userAgentArg: String? = nilOrValue(args[1]) - do { - try api.pigeonDelegate.setCustomUserAgent( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, userAgent: userAgentArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let setCustomUserAgentChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setCustomUserAgent", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setCustomUserAgentChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let userAgentArg: String? = nilOrValue(args[1]) + do { + try api.pigeonDelegate.setCustomUserAgent(pigeonApi: api, pigeonInstance: pigeonInstanceArg, userAgent: userAgentArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - setCustomUserAgentChannel.setMessageHandler(nil) } + } else { + setCustomUserAgentChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let evaluateJavaScriptChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.evaluateJavaScript", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - evaluateJavaScriptChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let javaScriptStringArg = args[1] as! String - api.pigeonDelegate.evaluateJavaScript( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, javaScriptString: javaScriptStringArg - ) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } + let evaluateJavaScriptChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.evaluateJavaScript", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + evaluateJavaScriptChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let javaScriptStringArg = args[1] as! String + api.pigeonDelegate.evaluateJavaScript(pigeonApi: api, pigeonInstance: pigeonInstanceArg, javaScriptString: javaScriptStringArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) } } - } else { - evaluateJavaScriptChannel.setMessageHandler(nil) } + } else { + evaluateJavaScriptChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let setInspectableChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setInspectable", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setInspectableChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let inspectableArg = args[1] as! Bool - do { - try api.pigeonDelegate.setInspectable( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, inspectable: inspectableArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let setInspectableChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setInspectable", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setInspectableChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let inspectableArg = args[1] as! Bool + do { + try api.pigeonDelegate.setInspectable(pigeonApi: api, pigeonInstance: pigeonInstanceArg, inspectable: inspectableArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - setInspectableChannel.setMessageHandler(nil) } + } else { + setInspectableChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let getCustomUserAgentChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.getCustomUserAgent", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - getCustomUserAgentChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - let result = try api.pigeonDelegate.getCustomUserAgent( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } + let getCustomUserAgentChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.getCustomUserAgent", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getCustomUserAgentChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.getCustomUserAgent(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) } - } else { - getCustomUserAgentChannel.setMessageHandler(nil) } + } else { + getCustomUserAgentChannel.setMessageHandler(nil) + } #endif } #if !os(macOS) - ///Creates a Dart instance of UIViewWKWebView 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: ""))) - } 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(())) - } + ///Creates a Dart instance of UIViewWKWebView 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: ""))) + } 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(())) } } } + } #endif } protocol PigeonApiDelegateNSViewWKWebView { #if !os(iOS) - func pigeonDefaultConstructor( - pigeonApi: PigeonApiNSViewWKWebView, initialConfiguration: WKWebViewConfiguration - ) throws -> WKWebView + func pigeonDefaultConstructor(pigeonApi: PigeonApiNSViewWKWebView, initialConfiguration: WKWebViewConfiguration) throws -> WKWebView #endif #if !os(iOS) - /// The object that contains the configuration details for the web view. - func configuration(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws - -> WKWebViewConfiguration + /// The object that contains the configuration details for the web view. + func configuration(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> WKWebViewConfiguration #endif #if !os(iOS) - /// The object you use to integrate custom user interface elements, such as - /// contextual menus or panels, into web view interactions. - func setUIDelegate( - pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, delegate: WKUIDelegate) throws + /// The object you use to integrate custom user interface elements, such as + /// contextual menus or panels, into web view interactions. + func setUIDelegate(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, delegate: WKUIDelegate) throws #endif #if !os(iOS) - /// The object you use to manage navigation behavior for the web view. - func setNavigationDelegate( - pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, delegate: WKNavigationDelegate - ) throws + /// The object you use to manage navigation behavior for the web view. + func setNavigationDelegate(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, delegate: WKNavigationDelegate) throws #endif #if !os(iOS) - /// The URL for the current webpage. - func getUrl(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> String? + /// The URL for the current webpage. + func getUrl(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> String? #endif #if !os(iOS) - /// An estimate of what fraction of the current navigation has been loaded. - func getEstimatedProgress(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws - -> Double + /// An estimate of what fraction of the current navigation has been loaded. + func getEstimatedProgress(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> Double #endif #if !os(iOS) - /// Loads the web content that the specified URL request object references and - /// navigates to that content. - func load( - pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, request: URLRequestWrapper) - throws + /// Loads the web content that the specified URL request object references and + /// navigates to that content. + func load(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, request: URLRequestWrapper) throws #endif #if !os(iOS) - /// Loads the contents of the specified HTML string and navigates to it. - func loadHtmlString( - pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, string: String, - baseUrl: String?) throws + /// Loads the contents of the specified HTML string and navigates to it. + func loadHtmlString(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, string: String, baseUrl: String?) throws #endif #if !os(iOS) - /// Loads the web content from the specified file and navigates to it. - func loadFileUrl( - pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, url: String, - readAccessUrl: String) throws + /// Loads the web content from the specified file and navigates to it. + func loadFileUrl(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, url: String, readAccessUrl: String) throws #endif #if !os(iOS) - /// Convenience method to load a Flutter asset. - func loadFlutterAsset( - pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, key: String) throws + /// Convenience method to load a Flutter asset. + func loadFlutterAsset(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, key: String) throws #endif #if !os(iOS) - /// A Boolean value that indicates whether there is a valid back item in the - /// back-forward list. - func canGoBack(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> Bool + /// A Boolean value that indicates whether there is a valid back item in the + /// back-forward list. + func canGoBack(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> Bool #endif #if !os(iOS) - /// A Boolean value that indicates whether there is a valid forward item in - /// the back-forward list. - func canGoForward(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> Bool + /// A Boolean value that indicates whether there is a valid forward item in + /// the back-forward list. + func canGoForward(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> Bool #endif #if !os(iOS) - /// Navigates to the back item in the back-forward list. - func goBack(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws + /// Navigates to the back item in the back-forward list. + func goBack(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws #endif #if !os(iOS) - /// Navigates to the forward item in the back-forward list. - func goForward(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws + /// Navigates to the forward item in the back-forward list. + func goForward(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws #endif #if !os(iOS) - /// Reloads the current webpage. - func reload(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws + /// Reloads the current webpage. + func reload(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws #endif #if !os(iOS) - /// The page title. - func getTitle(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> String? + /// The page title. + func getTitle(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> String? #endif #if !os(iOS) - /// A Boolean value that indicates whether horizontal swipe gestures trigger - /// backward and forward page navigation. - func setAllowsBackForwardNavigationGestures( - pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, allow: Bool) throws + /// A Boolean value that indicates whether horizontal swipe gestures trigger + /// backward and forward page navigation. + func setAllowsBackForwardNavigationGestures(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, allow: Bool) throws #endif #if !os(iOS) - /// The custom user agent string. - func setCustomUserAgent( - pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, userAgent: String?) throws + /// The custom user agent string. + func setCustomUserAgent(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, userAgent: String?) throws #endif #if !os(iOS) - /// Evaluates the specified JavaScript string. - func evaluateJavaScript( - pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, javaScriptString: String, - completion: @escaping (Result) -> Void) + /// Evaluates the specified JavaScript string. + func evaluateJavaScript(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, javaScriptString: String, completion: @escaping (Result) -> Void) #endif #if !os(iOS) - /// A Boolean value that indicates whether you can inspect the view with - /// Safari Web Inspector. - func setInspectable( - pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, inspectable: Bool) throws + /// A Boolean value that indicates whether you can inspect the view with + /// Safari Web Inspector. + func setInspectable(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, inspectable: Bool) throws #endif #if !os(iOS) - /// The custom user agent string. - func getCustomUserAgent(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws - -> String? + /// The custom user agent string. + func getCustomUserAgent(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> String? #endif } protocol PigeonApiProtocolNSViewWKWebView { } -final class PigeonApiNSViewWKWebView: PigeonApiProtocolNSViewWKWebView { +final class PigeonApiNSViewWKWebView: PigeonApiProtocolNSViewWKWebView { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateNSViewWKWebView ///An implementation of [NSObject] used to access callback methods @@ -5357,504 +4627,426 @@ final class PigeonApiNSViewWKWebView: PigeonApiProtocolNSViewWKWebView { return pigeonRegistrar.apiDelegate.pigeonApiWKWebView(pigeonRegistrar) } - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, - delegate: PigeonApiDelegateNSViewWKWebView - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateNSViewWKWebView) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers( - binaryMessenger: FlutterBinaryMessenger, api: PigeonApiNSViewWKWebView? - ) { + static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiNSViewWKWebView?) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( - pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() #if !os(iOS) - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.pigeon_defaultConstructor", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - pigeonDefaultConstructorChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonIdentifierArg = args[0] as! Int64 - let initialConfigurationArg = args[1] as! WKWebViewConfiguration - do { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - try api.pigeonDelegate.pigeonDefaultConstructor( - pigeonApi: api, initialConfiguration: initialConfigurationArg), - withIdentifier: pigeonIdentifierArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.pigeon_defaultConstructor", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + pigeonDefaultConstructorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonIdentifierArg = args[0] as! Int64 + let initialConfigurationArg = args[1] as! WKWebViewConfiguration + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( +try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api, initialConfiguration: initialConfigurationArg), +withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - pigeonDefaultConstructorChannel.setMessageHandler(nil) } + } else { + pigeonDefaultConstructorChannel.setMessageHandler(nil) + } #endif #if !os(iOS) - let configurationChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.configuration", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - configurationChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let pigeonIdentifierArg = args[1] as! Int64 - do { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - try api.pigeonDelegate.configuration( - pigeonApi: api, pigeonInstance: pigeonInstanceArg), - withIdentifier: pigeonIdentifierArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let configurationChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.configuration", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + configurationChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let pigeonIdentifierArg = args[1] as! Int64 + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance(try api.pigeonDelegate.configuration(pigeonApi: api, pigeonInstance: pigeonInstanceArg), withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - configurationChannel.setMessageHandler(nil) } + } else { + configurationChannel.setMessageHandler(nil) + } #endif #if !os(iOS) - let setUIDelegateChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setUIDelegate", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setUIDelegateChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let delegateArg = args[1] as! WKUIDelegate - do { - try api.pigeonDelegate.setUIDelegate( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, delegate: delegateArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let setUIDelegateChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setUIDelegate", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setUIDelegateChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let delegateArg = args[1] as! WKUIDelegate + do { + try api.pigeonDelegate.setUIDelegate(pigeonApi: api, pigeonInstance: pigeonInstanceArg, delegate: delegateArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - setUIDelegateChannel.setMessageHandler(nil) } + } else { + setUIDelegateChannel.setMessageHandler(nil) + } #endif #if !os(iOS) - let setNavigationDelegateChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setNavigationDelegate", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setNavigationDelegateChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let delegateArg = args[1] as! WKNavigationDelegate - do { - try api.pigeonDelegate.setNavigationDelegate( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, delegate: delegateArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let setNavigationDelegateChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setNavigationDelegate", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setNavigationDelegateChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let delegateArg = args[1] as! WKNavigationDelegate + do { + try api.pigeonDelegate.setNavigationDelegate(pigeonApi: api, pigeonInstance: pigeonInstanceArg, delegate: delegateArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - setNavigationDelegateChannel.setMessageHandler(nil) } + } else { + setNavigationDelegateChannel.setMessageHandler(nil) + } #endif #if !os(iOS) - let getUrlChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.getUrl", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - getUrlChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - let result = try api.pigeonDelegate.getUrl( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } + let getUrlChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.getUrl", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getUrlChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.getUrl(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) } - } else { - getUrlChannel.setMessageHandler(nil) } + } else { + getUrlChannel.setMessageHandler(nil) + } #endif #if !os(iOS) - let getEstimatedProgressChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.getEstimatedProgress", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - getEstimatedProgressChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - let result = try api.pigeonDelegate.getEstimatedProgress( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } + let getEstimatedProgressChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.getEstimatedProgress", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getEstimatedProgressChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.getEstimatedProgress(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) } - } else { - getEstimatedProgressChannel.setMessageHandler(nil) } + } else { + getEstimatedProgressChannel.setMessageHandler(nil) + } #endif #if !os(iOS) - let loadChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.load", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - loadChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let requestArg = args[1] as! URLRequestWrapper - do { - try api.pigeonDelegate.load( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, request: requestArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let loadChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.load", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + loadChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let requestArg = args[1] as! URLRequestWrapper + do { + try api.pigeonDelegate.load(pigeonApi: api, pigeonInstance: pigeonInstanceArg, request: requestArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - loadChannel.setMessageHandler(nil) } + } else { + loadChannel.setMessageHandler(nil) + } #endif #if !os(iOS) - let loadHtmlStringChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.loadHtmlString", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - loadHtmlStringChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let stringArg = args[1] as! String - let baseUrlArg: String? = nilOrValue(args[2]) - do { - try api.pigeonDelegate.loadHtmlString( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, string: stringArg, - baseUrl: baseUrlArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let loadHtmlStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.loadHtmlString", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + loadHtmlStringChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let stringArg = args[1] as! String + let baseUrlArg: String? = nilOrValue(args[2]) + do { + try api.pigeonDelegate.loadHtmlString(pigeonApi: api, pigeonInstance: pigeonInstanceArg, string: stringArg, baseUrl: baseUrlArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - loadHtmlStringChannel.setMessageHandler(nil) } + } else { + loadHtmlStringChannel.setMessageHandler(nil) + } #endif #if !os(iOS) - let loadFileUrlChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.loadFileUrl", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - loadFileUrlChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let urlArg = args[1] as! String - let readAccessUrlArg = args[2] as! String - do { - try api.pigeonDelegate.loadFileUrl( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, url: urlArg, - readAccessUrl: readAccessUrlArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let loadFileUrlChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.loadFileUrl", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + loadFileUrlChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let urlArg = args[1] as! String + let readAccessUrlArg = args[2] as! String + do { + try api.pigeonDelegate.loadFileUrl(pigeonApi: api, pigeonInstance: pigeonInstanceArg, url: urlArg, readAccessUrl: readAccessUrlArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - loadFileUrlChannel.setMessageHandler(nil) } + } else { + loadFileUrlChannel.setMessageHandler(nil) + } #endif #if !os(iOS) - let loadFlutterAssetChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.loadFlutterAsset", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - loadFlutterAssetChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let keyArg = args[1] as! String - do { - try api.pigeonDelegate.loadFlutterAsset( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, key: keyArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let loadFlutterAssetChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.loadFlutterAsset", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + loadFlutterAssetChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let keyArg = args[1] as! String + do { + try api.pigeonDelegate.loadFlutterAsset(pigeonApi: api, pigeonInstance: pigeonInstanceArg, key: keyArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - loadFlutterAssetChannel.setMessageHandler(nil) } + } else { + loadFlutterAssetChannel.setMessageHandler(nil) + } #endif #if !os(iOS) - let canGoBackChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.canGoBack", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - canGoBackChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - let result = try api.pigeonDelegate.canGoBack( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } + let canGoBackChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.canGoBack", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + canGoBackChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.canGoBack(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) } - } else { - canGoBackChannel.setMessageHandler(nil) } + } else { + canGoBackChannel.setMessageHandler(nil) + } #endif #if !os(iOS) - let canGoForwardChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.canGoForward", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - canGoForwardChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - let result = try api.pigeonDelegate.canGoForward( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } + let canGoForwardChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.canGoForward", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + canGoForwardChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.canGoForward(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) } - } else { - canGoForwardChannel.setMessageHandler(nil) } + } else { + canGoForwardChannel.setMessageHandler(nil) + } #endif #if !os(iOS) - let goBackChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.goBack", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - goBackChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - try api.pigeonDelegate.goBack(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let goBackChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.goBack", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + goBackChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + try api.pigeonDelegate.goBack(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - goBackChannel.setMessageHandler(nil) } + } else { + goBackChannel.setMessageHandler(nil) + } #endif #if !os(iOS) - let goForwardChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.goForward", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - goForwardChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - try api.pigeonDelegate.goForward(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let goForwardChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.goForward", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + goForwardChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + try api.pigeonDelegate.goForward(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - goForwardChannel.setMessageHandler(nil) } + } else { + goForwardChannel.setMessageHandler(nil) + } #endif #if !os(iOS) - let reloadChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.reload", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - reloadChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - try api.pigeonDelegate.reload(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let reloadChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.reload", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + reloadChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + try api.pigeonDelegate.reload(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - reloadChannel.setMessageHandler(nil) } + } else { + reloadChannel.setMessageHandler(nil) + } #endif #if !os(iOS) - let getTitleChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.getTitle", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - getTitleChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - let result = try api.pigeonDelegate.getTitle( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } + let getTitleChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.getTitle", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getTitleChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.getTitle(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) } - } else { - getTitleChannel.setMessageHandler(nil) } + } else { + getTitleChannel.setMessageHandler(nil) + } #endif #if !os(iOS) - let setAllowsBackForwardNavigationGesturesChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setAllowsBackForwardNavigationGestures", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setAllowsBackForwardNavigationGesturesChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let allowArg = args[1] as! Bool - do { - try api.pigeonDelegate.setAllowsBackForwardNavigationGestures( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, allow: allowArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let setAllowsBackForwardNavigationGesturesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setAllowsBackForwardNavigationGestures", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setAllowsBackForwardNavigationGesturesChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let allowArg = args[1] as! Bool + do { + try api.pigeonDelegate.setAllowsBackForwardNavigationGestures(pigeonApi: api, pigeonInstance: pigeonInstanceArg, allow: allowArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - setAllowsBackForwardNavigationGesturesChannel.setMessageHandler(nil) } + } else { + setAllowsBackForwardNavigationGesturesChannel.setMessageHandler(nil) + } #endif #if !os(iOS) - let setCustomUserAgentChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setCustomUserAgent", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setCustomUserAgentChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let userAgentArg: String? = nilOrValue(args[1]) - do { - try api.pigeonDelegate.setCustomUserAgent( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, userAgent: userAgentArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let setCustomUserAgentChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setCustomUserAgent", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setCustomUserAgentChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let userAgentArg: String? = nilOrValue(args[1]) + do { + try api.pigeonDelegate.setCustomUserAgent(pigeonApi: api, pigeonInstance: pigeonInstanceArg, userAgent: userAgentArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - setCustomUserAgentChannel.setMessageHandler(nil) } + } else { + setCustomUserAgentChannel.setMessageHandler(nil) + } #endif #if !os(iOS) - let evaluateJavaScriptChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.evaluateJavaScript", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - evaluateJavaScriptChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let javaScriptStringArg = args[1] as! String - api.pigeonDelegate.evaluateJavaScript( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, javaScriptString: javaScriptStringArg - ) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } + let evaluateJavaScriptChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.evaluateJavaScript", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + evaluateJavaScriptChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let javaScriptStringArg = args[1] as! String + api.pigeonDelegate.evaluateJavaScript(pigeonApi: api, pigeonInstance: pigeonInstanceArg, javaScriptString: javaScriptStringArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) } } - } else { - evaluateJavaScriptChannel.setMessageHandler(nil) } + } else { + evaluateJavaScriptChannel.setMessageHandler(nil) + } #endif #if !os(iOS) - let setInspectableChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setInspectable", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setInspectableChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let inspectableArg = args[1] as! Bool - do { - try api.pigeonDelegate.setInspectable( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, inspectable: inspectableArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let setInspectableChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setInspectable", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setInspectableChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let inspectableArg = args[1] as! Bool + do { + try api.pigeonDelegate.setInspectable(pigeonApi: api, pigeonInstance: pigeonInstanceArg, inspectable: inspectableArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - setInspectableChannel.setMessageHandler(nil) } + } else { + setInspectableChannel.setMessageHandler(nil) + } #endif #if !os(iOS) - let getCustomUserAgentChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.getCustomUserAgent", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - getCustomUserAgentChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - let result = try api.pigeonDelegate.getCustomUserAgent( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } + let getCustomUserAgentChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.getCustomUserAgent", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getCustomUserAgentChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.getCustomUserAgent(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) } - } else { - getCustomUserAgentChannel.setMessageHandler(nil) } + } else { + getCustomUserAgentChannel.setMessageHandler(nil) + } #endif } #if !os(iOS) - ///Creates a Dart instance of NSViewWKWebView 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: ""))) - } 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(())) - } + ///Creates a Dart instance of NSViewWKWebView 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: ""))) + } 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(())) } } } + } #endif } open class PigeonApiDelegateWKWebView { @@ -5863,7 +5055,7 @@ open class PigeonApiDelegateWKWebView { protocol PigeonApiProtocolWKWebView { } -final class PigeonApiWKWebView: PigeonApiProtocolWKWebView { +final class PigeonApiWKWebView: PigeonApiProtocolWKWebView { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKWebView ///An implementation of [NSObject] used to access callback methods @@ -5871,32 +5063,26 @@ final class PigeonApiWKWebView: PigeonApiProtocolWKWebView { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKWebView) - { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKWebView) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } ///Creates a Dart instance of WKWebView and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: WKWebView, completion: @escaping (Result) -> 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) + } 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) + 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))) @@ -5920,35 +5106,19 @@ protocol PigeonApiDelegateWKUIDelegate { protocol PigeonApiProtocolWKUIDelegate { /// Creates a new web view. - func onCreateWebView( - pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, - configuration configurationArg: WKWebViewConfiguration, - navigationAction navigationActionArg: WKNavigationAction, - completion: @escaping (Result) -> Void) + func onCreateWebView(pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, configuration configurationArg: WKWebViewConfiguration, navigationAction navigationActionArg: WKNavigationAction, completion: @escaping (Result) -> Void) /// Determines whether a web resource, which the security origin object /// describes, can access to the device’s microphone audio and camera video. - func requestMediaCapturePermission( - pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, - origin originArg: WKSecurityOrigin, frame frameArg: WKFrameInfo, type typeArg: MediaCaptureType, - completion: @escaping (Result) -> Void) + func requestMediaCapturePermission(pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, origin originArg: WKSecurityOrigin, frame frameArg: WKFrameInfo, type typeArg: MediaCaptureType, completion: @escaping (Result) -> Void) /// Displays a JavaScript alert panel. - func runJavaScriptAlertPanel( - pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, - message messageArg: String, frame frameArg: WKFrameInfo, - completion: @escaping (Result) -> Void) + func runJavaScriptAlertPanel(pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, message messageArg: String, frame frameArg: WKFrameInfo, completion: @escaping (Result) -> Void) /// Displays a JavaScript confirm panel. - func runJavaScriptConfirmPanel( - pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, - message messageArg: String, frame frameArg: WKFrameInfo, - completion: @escaping (Result) -> Void) + func runJavaScriptConfirmPanel(pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, message messageArg: String, frame frameArg: WKFrameInfo, completion: @escaping (Result) -> Void) /// Displays a JavaScript text input panel. - func runJavaScriptTextInputPanel( - pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, - prompt promptArg: String, defaultText defaultTextArg: String?, frame frameArg: WKFrameInfo, - completion: @escaping (Result) -> Void) + func runJavaScriptTextInputPanel(pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, prompt promptArg: String, defaultText defaultTextArg: String?, frame frameArg: WKFrameInfo, completion: @escaping (Result) -> Void) } -final class PigeonApiWKUIDelegate: PigeonApiProtocolWKUIDelegate { +final class PigeonApiWKUIDelegate: PigeonApiProtocolWKUIDelegate { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKUIDelegate ///An implementation of [NSObject] used to access callback methods @@ -5956,32 +5126,25 @@ final class PigeonApiWKUIDelegate: PigeonApiProtocolWKUIDelegate { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKUIDelegate - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKUIDelegate) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers( - binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKUIDelegate? - ) { + static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKUIDelegate?) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( - pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.pigeon_defaultConstructor", - binaryMessenger: binaryMessenger, codec: codec) + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.pigeon_defaultConstructor", binaryMessenger: binaryMessenger, codec: codec) if let api = api { pigeonDefaultConstructorChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonIdentifierArg = args[0] as! Int64 do { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), - withIdentifier: pigeonIdentifierArg) +try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), +withIdentifier: pigeonIdentifierArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -5993,34 +5156,25 @@ final class PigeonApiWKUIDelegate: PigeonApiProtocolWKUIDelegate { } ///Creates a Dart instance of WKUIDelegate and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: WKUIDelegate, completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: WKUIDelegate, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { + } 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: ""))) + message: "Error: Attempting to create a new Dart instance of WKUIDelegate, but the class has a nonnull callback method.", details: ""))) } } /// Creates a new web view. - func onCreateWebView( - pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, - configuration configurationArg: WKWebViewConfiguration, - navigationAction navigationActionArg: WKNavigationAction, - completion: @escaping (Result) -> Void - ) { + func onCreateWebView(pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, configuration configurationArg: WKWebViewConfiguration, navigationAction navigationActionArg: WKNavigationAction, completion: @escaping (Result) -> Void) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -6031,13 +5185,9 @@ final class PigeonApiWKUIDelegate: PigeonApiProtocolWKUIDelegate { } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.onCreateWebView" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage( - [pigeonInstanceArg, webViewArg, configurationArg, navigationActionArg] as [Any?] - ) { response in + let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.onCreateWebView" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, webViewArg, configurationArg, navigationActionArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -6055,11 +5205,7 @@ final class PigeonApiWKUIDelegate: PigeonApiProtocolWKUIDelegate { /// Determines whether a web resource, which the security origin object /// describes, can access to the device’s microphone audio and camera video. - func requestMediaCapturePermission( - pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, - origin originArg: WKSecurityOrigin, frame frameArg: WKFrameInfo, type typeArg: MediaCaptureType, - completion: @escaping (Result) -> Void - ) { + func requestMediaCapturePermission(pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, origin originArg: WKSecurityOrigin, frame frameArg: WKFrameInfo, type typeArg: MediaCaptureType, completion: @escaping (Result) -> Void) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -6070,12 +5216,9 @@ final class PigeonApiWKUIDelegate: PigeonApiProtocolWKUIDelegate { } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.requestMediaCapturePermission" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, webViewArg, originArg, frameArg, typeArg] as [Any?]) { - response in + let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.requestMediaCapturePermission" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, webViewArg, originArg, frameArg, typeArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -6086,11 +5229,7 @@ final class PigeonApiWKUIDelegate: PigeonApiProtocolWKUIDelegate { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) + completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! PermissionDecision completion(.success(result)) @@ -6099,11 +5238,7 @@ final class PigeonApiWKUIDelegate: PigeonApiProtocolWKUIDelegate { } /// Displays a JavaScript alert panel. - func runJavaScriptAlertPanel( - pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, - message messageArg: String, frame frameArg: WKFrameInfo, - completion: @escaping (Result) -> Void - ) { + func runJavaScriptAlertPanel(pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, message messageArg: String, frame frameArg: WKFrameInfo, completion: @escaping (Result) -> Void) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -6114,12 +5249,9 @@ final class PigeonApiWKUIDelegate: PigeonApiProtocolWKUIDelegate { } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.runJavaScriptAlertPanel" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, webViewArg, messageArg, frameArg] as [Any?]) { - response in + let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.runJavaScriptAlertPanel" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, webViewArg, messageArg, frameArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -6136,11 +5268,7 @@ final class PigeonApiWKUIDelegate: PigeonApiProtocolWKUIDelegate { } /// Displays a JavaScript confirm panel. - func runJavaScriptConfirmPanel( - pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, - message messageArg: String, frame frameArg: WKFrameInfo, - completion: @escaping (Result) -> Void - ) { + func runJavaScriptConfirmPanel(pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, message messageArg: String, frame frameArg: WKFrameInfo, completion: @escaping (Result) -> Void) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -6151,12 +5279,9 @@ final class PigeonApiWKUIDelegate: PigeonApiProtocolWKUIDelegate { } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.runJavaScriptConfirmPanel" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, webViewArg, messageArg, frameArg] as [Any?]) { - response in + let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.runJavaScriptConfirmPanel" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, webViewArg, messageArg, frameArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -6167,11 +5292,7 @@ final class PigeonApiWKUIDelegate: PigeonApiProtocolWKUIDelegate { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) + completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! Bool completion(.success(result)) @@ -6180,11 +5301,7 @@ final class PigeonApiWKUIDelegate: PigeonApiProtocolWKUIDelegate { } /// Displays a JavaScript text input panel. - func runJavaScriptTextInputPanel( - pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, - prompt promptArg: String, defaultText defaultTextArg: String?, frame frameArg: WKFrameInfo, - completion: @escaping (Result) -> Void - ) { + func runJavaScriptTextInputPanel(pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, prompt promptArg: String, defaultText defaultTextArg: String?, frame frameArg: WKFrameInfo, completion: @escaping (Result) -> Void) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -6195,13 +5312,9 @@ final class PigeonApiWKUIDelegate: PigeonApiProtocolWKUIDelegate { } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.runJavaScriptTextInputPanel" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage( - [pigeonInstanceArg, webViewArg, promptArg, defaultTextArg, frameArg] as [Any?] - ) { response in + let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.runJavaScriptTextInputPanel" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, webViewArg, promptArg, defaultTextArg, frameArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -6222,15 +5335,13 @@ final class PigeonApiWKUIDelegate: PigeonApiProtocolWKUIDelegate { protocol PigeonApiDelegateWKHTTPCookieStore { /// Sets a cookie policy that indicates whether the cookie store allows cookie /// storage. - func setCookie( - pigeonApi: PigeonApiWKHTTPCookieStore, pigeonInstance: WKHTTPCookieStore, cookie: HTTPCookie, - completion: @escaping (Result) -> Void) + func setCookie(pigeonApi: PigeonApiWKHTTPCookieStore, pigeonInstance: WKHTTPCookieStore, cookie: HTTPCookie, completion: @escaping (Result) -> Void) } protocol PigeonApiProtocolWKHTTPCookieStore { } -final class PigeonApiWKHTTPCookieStore: PigeonApiProtocolWKHTTPCookieStore { +final class PigeonApiWKHTTPCookieStore: PigeonApiProtocolWKHTTPCookieStore { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKHTTPCookieStore ///An implementation of [NSObject] used to access callback methods @@ -6238,33 +5349,23 @@ final class PigeonApiWKHTTPCookieStore: PigeonApiProtocolWKHTTPCookieStore { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, - delegate: PigeonApiDelegateWKHTTPCookieStore - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKHTTPCookieStore) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers( - binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKHTTPCookieStore? - ) { + static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKHTTPCookieStore?) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( - pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let setCookieChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKHTTPCookieStore.setCookie", - binaryMessenger: binaryMessenger, codec: codec) + let setCookieChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKHTTPCookieStore.setCookie", binaryMessenger: binaryMessenger, codec: codec) if let api = api { setCookieChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKHTTPCookieStore let cookieArg = args[1] as! HTTPCookie - api.pigeonDelegate.setCookie( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, cookie: cookieArg - ) { result in + api.pigeonDelegate.setCookie(pigeonApi: api, pigeonInstance: pigeonInstanceArg, cookie: cookieArg) { result in switch result { case .success: reply(wrapResult(nil)) @@ -6279,26 +5380,21 @@ final class PigeonApiWKHTTPCookieStore: PigeonApiProtocolWKHTTPCookieStore { } ///Creates a Dart instance of WKHTTPCookieStore and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: WKHTTPCookieStore, completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: WKHTTPCookieStore, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) + } 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) + 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))) @@ -6318,27 +5414,22 @@ final class PigeonApiWKHTTPCookieStore: PigeonApiProtocolWKHTTPCookieStore { } protocol PigeonApiDelegateUIScrollViewDelegate { #if !os(macOS) - func pigeonDefaultConstructor(pigeonApi: PigeonApiUIScrollViewDelegate) throws - -> UIScrollViewDelegate + func pigeonDefaultConstructor(pigeonApi: PigeonApiUIScrollViewDelegate) throws -> UIScrollViewDelegate #endif } protocol PigeonApiProtocolUIScrollViewDelegate { #if !os(macOS) - /// Tells the delegate when the user scrolls the content view within the - /// scroll view. - /// - /// Note that this is a convenient method that includes the `contentOffset` of - /// the `scrollView`. - func scrollViewDidScroll( - pigeonInstance pigeonInstanceArg: UIScrollViewDelegate, - scrollView scrollViewArg: UIScrollView, x xArg: Double, y yArg: Double, - completion: @escaping (Result) -> Void) - #endif + /// Tells the delegate when the user scrolls the content view within the + /// scroll view. + /// + /// Note that this is a convenient method that includes the `contentOffset` of + /// the `scrollView`. + func scrollViewDidScroll(pigeonInstance pigeonInstanceArg: UIScrollViewDelegate, scrollView scrollViewArg: UIScrollView, x xArg: Double, y yArg: Double, completion: @escaping (Result) -> Void) #endif } -final class PigeonApiUIScrollViewDelegate: PigeonApiProtocolUIScrollViewDelegate { +final class PigeonApiUIScrollViewDelegate: PigeonApiProtocolUIScrollViewDelegate { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateUIScrollViewDelegate ///An implementation of [NSObject] used to access callback methods @@ -6346,112 +5437,55 @@ final class PigeonApiUIScrollViewDelegate: PigeonApiProtocolUIScrollViewDelegate return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, - delegate: PigeonApiDelegateUIScrollViewDelegate - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateUIScrollViewDelegate) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers( - binaryMessenger: FlutterBinaryMessenger, api: PigeonApiUIScrollViewDelegate? - ) { + static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiUIScrollViewDelegate?) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( - pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() #if !os(macOS) - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewDelegate.pigeon_defaultConstructor", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - pigeonDefaultConstructorChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonIdentifierArg = args[0] as! Int64 - do { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), - withIdentifier: pigeonIdentifierArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewDelegate.pigeon_defaultConstructor", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + pigeonDefaultConstructorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonIdentifierArg = args[0] as! Int64 + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( +try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), +withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - pigeonDefaultConstructorChannel.setMessageHandler(nil) } + } else { + pigeonDefaultConstructorChannel.setMessageHandler(nil) + } #endif } #if !os(macOS) - ///Creates a Dart instance of UIScrollViewDelegate and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: UIScrollViewDelegate, - 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.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(())) - } - } - } - } - #endif - #if !os(macOS) - /// Tells the delegate when the user scrolls the content view within the - /// scroll view. - /// - /// Note that this is a convenient method that includes the `contentOffset` of - /// the `scrollView`. - func scrollViewDidScroll( - pigeonInstance pigeonInstanceArg: UIScrollViewDelegate, - scrollView scrollViewArg: UIScrollView, x xArg: Double, y yArg: Double, - completion: @escaping (Result) -> Void - ) { - if pigeonRegistrar.ignoreCallsToDart { - completion( - .failure( - PigeonError( - code: "ignore-calls-error", - message: "Calls to Dart are being ignored.", details: ""))) - return - } + ///Creates a Dart instance of UIScrollViewDelegate and attaches it to [pigeonInstance]. + func pigeonNewInstance(pigeonInstance: UIScrollViewDelegate, 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.UIScrollViewDelegate.scrollViewDidScroll" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, scrollViewArg, xArg, yArg] as [Any?]) { response in + 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 @@ -6466,22 +5500,55 @@ final class PigeonApiUIScrollViewDelegate: PigeonApiProtocolUIScrollViewDelegate } } } + } + #endif + #if !os(macOS) + /// Tells the delegate when the user scrolls the content view within the + /// scroll view. + /// + /// Note that this is a convenient method that includes the `contentOffset` of + /// the `scrollView`. + func scrollViewDidScroll(pigeonInstance pigeonInstanceArg: UIScrollViewDelegate, scrollView scrollViewArg: UIScrollView, x xArg: Double, y yArg: Double, completion: @escaping (Result) -> Void) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + PigeonError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewDelegate.scrollViewDidScroll" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, scrollViewArg, xArg, yArg] 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(())) + } + } + } #endif } protocol PigeonApiDelegateURLCredential { /// Creates a URL credential instance for internet password authentication /// with a given user name and password, using a given persistence setting. - func withUser( - pigeonApi: PigeonApiURLCredential, user: String, password: String, - persistence: UrlCredentialPersistence - ) throws -> URLCredential + func withUser(pigeonApi: PigeonApiURLCredential, user: String, password: String, persistence: UrlCredentialPersistence) throws -> URLCredential } protocol PigeonApiProtocolURLCredential { } -final class PigeonApiURLCredential: PigeonApiProtocolURLCredential { +final class PigeonApiURLCredential: PigeonApiProtocolURLCredential { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateURLCredential ///An implementation of [NSObject] used to access callback methods @@ -6489,24 +5556,17 @@ final class PigeonApiURLCredential: PigeonApiProtocolURLCredential { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateURLCredential - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateURLCredential) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers( - binaryMessenger: FlutterBinaryMessenger, api: PigeonApiURLCredential? - ) { + static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiURLCredential?) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( - pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let withUserChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLCredential.withUser", - binaryMessenger: binaryMessenger, codec: codec) + let withUserChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLCredential.withUser", binaryMessenger: binaryMessenger, codec: codec) if let api = api { withUserChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -6516,9 +5576,8 @@ final class PigeonApiURLCredential: PigeonApiProtocolURLCredential { let persistenceArg = args[3] as! UrlCredentialPersistence do { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - try api.pigeonDelegate.withUser( - pigeonApi: api, user: userArg, password: passwordArg, persistence: persistenceArg), - withIdentifier: pigeonIdentifierArg) +try api.pigeonDelegate.withUser(pigeonApi: api, user: userArg, password: passwordArg, persistence: persistenceArg), +withIdentifier: pigeonIdentifierArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -6530,26 +5589,21 @@ final class PigeonApiURLCredential: PigeonApiProtocolURLCredential { } ///Creates a Dart instance of URLCredential and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: URLCredential, completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: URLCredential, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) + } 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) + 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))) @@ -6569,24 +5623,19 @@ final class PigeonApiURLCredential: PigeonApiProtocolURLCredential { } protocol PigeonApiDelegateURLProtectionSpace { /// The receiver’s host. - func host(pigeonApi: PigeonApiURLProtectionSpace, pigeonInstance: URLProtectionSpace) throws - -> String + func host(pigeonApi: PigeonApiURLProtectionSpace, pigeonInstance: URLProtectionSpace) throws -> String /// The receiver’s port. - func port(pigeonApi: PigeonApiURLProtectionSpace, pigeonInstance: URLProtectionSpace) throws - -> Int64 + func port(pigeonApi: PigeonApiURLProtectionSpace, pigeonInstance: URLProtectionSpace) throws -> Int64 /// The receiver’s authentication realm. - func realm(pigeonApi: PigeonApiURLProtectionSpace, pigeonInstance: URLProtectionSpace) throws - -> String? + func realm(pigeonApi: PigeonApiURLProtectionSpace, pigeonInstance: URLProtectionSpace) throws -> String? /// The authentication method used by the receiver. - func authenticationMethod( - pigeonApi: PigeonApiURLProtectionSpace, pigeonInstance: URLProtectionSpace - ) throws -> String? + func authenticationMethod(pigeonApi: PigeonApiURLProtectionSpace, pigeonInstance: URLProtectionSpace) throws -> String? } protocol PigeonApiProtocolURLProtectionSpace { } -final class PigeonApiURLProtectionSpace: PigeonApiProtocolURLProtectionSpace { +final class PigeonApiURLProtectionSpace: PigeonApiProtocolURLProtectionSpace { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateURLProtectionSpace ///An implementation of [NSObject] used to access callback methods @@ -6594,42 +5643,31 @@ final class PigeonApiURLProtectionSpace: PigeonApiProtocolURLProtectionSpace { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, - delegate: PigeonApiDelegateURLProtectionSpace - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateURLProtectionSpace) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } ///Creates a Dart instance of URLProtectionSpace and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: URLProtectionSpace, completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: URLProtectionSpace, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) + } 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 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 + 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 @@ -6648,15 +5686,13 @@ final class PigeonApiURLProtectionSpace: PigeonApiProtocolURLProtectionSpace { } protocol PigeonApiDelegateURLAuthenticationChallenge { /// The receiver’s protection space. - func getProtectionSpace( - pigeonApi: PigeonApiURLAuthenticationChallenge, pigeonInstance: URLAuthenticationChallenge - ) throws -> URLProtectionSpace + func getProtectionSpace(pigeonApi: PigeonApiURLAuthenticationChallenge, pigeonInstance: URLAuthenticationChallenge) throws -> URLProtectionSpace } protocol PigeonApiProtocolURLAuthenticationChallenge { } -final class PigeonApiURLAuthenticationChallenge: PigeonApiProtocolURLAuthenticationChallenge { +final class PigeonApiURLAuthenticationChallenge: PigeonApiProtocolURLAuthenticationChallenge { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateURLAuthenticationChallenge ///An implementation of [NSObject] used to access callback methods @@ -6664,33 +5700,23 @@ final class PigeonApiURLAuthenticationChallenge: PigeonApiProtocolURLAuthenticat return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, - delegate: PigeonApiDelegateURLAuthenticationChallenge - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateURLAuthenticationChallenge) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers( - binaryMessenger: FlutterBinaryMessenger, api: PigeonApiURLAuthenticationChallenge? - ) { + static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiURLAuthenticationChallenge?) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( - pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let getProtectionSpaceChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.webview_flutter_wkwebview.URLAuthenticationChallenge.getProtectionSpace", - binaryMessenger: binaryMessenger, codec: codec) + let getProtectionSpaceChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLAuthenticationChallenge.getProtectionSpace", binaryMessenger: binaryMessenger, codec: codec) if let api = api { getProtectionSpaceChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! URLAuthenticationChallenge do { - let result = try api.pigeonDelegate.getProtectionSpace( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) + let result = try api.pigeonDelegate.getProtectionSpace(pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -6702,27 +5728,21 @@ final class PigeonApiURLAuthenticationChallenge: PigeonApiProtocolURLAuthenticat } ///Creates a Dart instance of URLAuthenticationChallenge and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: URLAuthenticationChallenge, - completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: URLAuthenticationChallenge, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) + } 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) + 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))) @@ -6748,7 +5768,7 @@ protocol PigeonApiDelegateURL { protocol PigeonApiProtocolURL { } -final class PigeonApiURL: PigeonApiProtocolURL { +final class PigeonApiURL: PigeonApiProtocolURL { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateURL ///An implementation of [NSObject] used to access callback methods @@ -6764,19 +5784,15 @@ final class PigeonApiURL: PigeonApiProtocolURL { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( - pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let getAbsoluteStringChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.URL.getAbsoluteString", - binaryMessenger: binaryMessenger, codec: codec) + let getAbsoluteStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.URL.getAbsoluteString", binaryMessenger: binaryMessenger, codec: codec) if let api = api { getAbsoluteStringChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! URL do { - let result = try api.pigeonDelegate.getAbsoluteString( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) + let result = try api.pigeonDelegate.getAbsoluteString(pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -6788,26 +5804,21 @@ final class PigeonApiURL: PigeonApiProtocolURL { } ///Creates a Dart instance of URL and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: URL, completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: URL, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) + } 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) + 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))) @@ -6829,15 +5840,13 @@ 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 + func setAllowsContentJavaScript(pigeonApi: PigeonApiWKWebpagePreferences, pigeonInstance: WKWebpagePreferences, allow: Bool) throws } protocol PigeonApiProtocolWKWebpagePreferences { } -final class PigeonApiWKWebpagePreferences: PigeonApiProtocolWKWebpagePreferences { +final class PigeonApiWKWebpagePreferences: PigeonApiProtocolWKWebpagePreferences { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKWebpagePreferences ///An implementation of [NSObject] used to access callback methods @@ -6845,35 +5854,25 @@ final class PigeonApiWKWebpagePreferences: PigeonApiProtocolWKWebpagePreferences return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, - delegate: PigeonApiDelegateWKWebpagePreferences - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKWebpagePreferences) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers( - binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKWebpagePreferences? - ) { + static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKWebpagePreferences?) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( - pigeonRegistrar: api!.pigeonRegistrar)) + 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) + 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) + try api.pigeonDelegate.setAllowsContentJavaScript(pigeonApi: api, pigeonInstance: pigeonInstanceArg, allow: allowArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -6882,21 +5881,16 @@ final class PigeonApiWKWebpagePreferences: PigeonApiProtocolWKWebpagePreferences } else { setAllowsContentJavaScriptChannel.setMessageHandler(nil) } - } else { + } else { let setAllowsContentJavaScriptChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebpagePreferences.setAllowsContentJavaScript", + 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 - ))) + 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) @@ -6906,26 +5900,21 @@ final class PigeonApiWKWebpagePreferences: PigeonApiProtocolWKWebpagePreferences ///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 - ) { + 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) + } 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) + 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))) 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 ee91ba63f41..ddd96153026 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,15 +1,14 @@ // 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.2.1), do not edit directly. +// Autogenerated from Pigeon (v24.2.2), 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 import 'dart:async'; import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; -import 'package:flutter/foundation.dart' - show ReadBuffer, WriteBuffer, immutable, protected; +import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer, immutable, protected; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart' show WidgetsFlutterBinding; @@ -20,8 +19,7 @@ PlatformException _createConnectionError(String channelName) { ); } -List wrapResponse( - {Object? result, PlatformException? error, bool empty = false}) { +List wrapResponse({Object? result, PlatformException? error, bool empty = false}) { if (empty) { return []; } @@ -30,7 +28,6 @@ List wrapResponse( } return [error.code, error.message, error.details]; } - /// An immutable object that serves as the base class for all ProxyApis and /// can provide functional copies of itself. /// @@ -113,10 +110,9 @@ class PigeonInstanceManager { // by calling instanceManager.getIdentifier() inside of `==` while this was a // HashMap). final Expando _identifiers = Expando(); - final Map> - _weakInstances = >{}; - final Map _strongInstances = - {}; + final Map> _weakInstances = + >{}; + final Map _strongInstances = {}; late final Finalizer _finalizer; int _nextIdentifier = 0; @@ -126,8 +122,7 @@ class PigeonInstanceManager { static PigeonInstanceManager _initInstance() { WidgetsFlutterBinding.ensureInitialized(); - final _PigeonInternalInstanceManagerApi api = - _PigeonInternalInstanceManagerApi(); + final _PigeonInternalInstanceManagerApi api = _PigeonInternalInstanceManagerApi(); // Clears the native `PigeonInstanceManager` on the initial use of the Dart one. api.clear(); final PigeonInstanceManager instanceManager = PigeonInstanceManager( @@ -135,70 +130,39 @@ class PigeonInstanceManager { api.removeStrongReference(identifier); }, ); - _PigeonInternalInstanceManagerApi.setUpMessageHandlers( - instanceManager: instanceManager); - URLRequest.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - HTTPURLResponse.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - URLResponse.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - WKUserScript.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - WKNavigationAction.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - WKNavigationResponse.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - WKFrameInfo.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - NSError.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - WKScriptMessage.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - WKSecurityOrigin.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - HTTPCookie.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - AuthenticationChallengeResponse.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - WKWebsiteDataStore.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); + _PigeonInternalInstanceManagerApi.setUpMessageHandlers(instanceManager: instanceManager); + URLRequest.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + HTTPURLResponse.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + URLResponse.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + WKUserScript.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + WKNavigationAction.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + WKNavigationResponse.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + WKFrameInfo.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + NSError.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + WKScriptMessage.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + WKSecurityOrigin.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + HTTPCookie.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + AuthenticationChallengeResponse.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + WKWebsiteDataStore.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); UIView.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - UIScrollView.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - WKWebViewConfiguration.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - WKUserContentController.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - WKPreferences.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - WKScriptMessageHandler.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - WKNavigationDelegate.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - NSObject.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - UIViewWKWebView.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - NSViewWKWebView.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - WKWebView.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - WKUIDelegate.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - WKHTTPCookieStore.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - UIScrollViewDelegate.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - URLCredential.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - URLProtectionSpace.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - URLAuthenticationChallenge.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); + UIScrollView.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + WKWebViewConfiguration.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + WKUserContentController.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + WKPreferences.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + WKScriptMessageHandler.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + WKNavigationDelegate.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + NSObject.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + UIViewWKWebView.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + NSViewWKWebView.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + WKWebView.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + WKUIDelegate.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + WKHTTPCookieStore.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + UIScrollViewDelegate.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + URLCredential.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + URLProtectionSpace.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + URLAuthenticationChallenge.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); URL.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WKWebpagePreferences.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); + WKWebpagePreferences.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); return instanceManager; } @@ -262,20 +226,15 @@ class PigeonInstanceManager { /// /// This method also expects the host `InstanceManager` to have a strong /// reference to the instance the identifier is associated with. - T? getInstanceWithWeakReference( - int identifier) { - final PigeonInternalProxyApiBaseClass? weakInstance = - _weakInstances[identifier]?.target; + T? getInstanceWithWeakReference(int identifier) { + final PigeonInternalProxyApiBaseClass? weakInstance = _weakInstances[identifier]?.target; if (weakInstance == null) { - final PigeonInternalProxyApiBaseClass? strongInstance = - _strongInstances[identifier]; + final PigeonInternalProxyApiBaseClass? strongInstance = _strongInstances[identifier]; if (strongInstance != null) { - final PigeonInternalProxyApiBaseClass copy = - strongInstance.pigeon_copy(); + final PigeonInternalProxyApiBaseClass copy = strongInstance.pigeon_copy(); _identifiers[copy] = identifier; - _weakInstances[identifier] = - WeakReference(copy); + _weakInstances[identifier] = WeakReference(copy); _finalizer.attach(copy, identifier, detach: copy); return copy as T; } @@ -299,20 +258,17 @@ class PigeonInstanceManager { /// added. /// /// Returns unique identifier of the [instance] added. - void addHostCreatedInstance( - PigeonInternalProxyApiBaseClass instance, int identifier) { + void addHostCreatedInstance(PigeonInternalProxyApiBaseClass instance, int identifier) { _addInstanceWithIdentifier(instance, identifier); } - void _addInstanceWithIdentifier( - PigeonInternalProxyApiBaseClass instance, int identifier) { + void _addInstanceWithIdentifier(PigeonInternalProxyApiBaseClass instance, int identifier) { assert(!containsIdentifier(identifier)); assert(getIdentifier(instance) == null); assert(identifier >= 0); _identifiers[instance] = identifier; - _weakInstances[identifier] = - WeakReference(instance); + _weakInstances[identifier] = WeakReference(instance); _finalizer.attach(instance, identifier, detach: instance); final PigeonInternalProxyApiBaseClass copy = instance.pigeon_copy(); @@ -439,30 +395,30 @@ class _PigeonInternalInstanceManagerApi { } class _PigeonInternalProxyApiBaseCodec extends _PigeonCodec { - const _PigeonInternalProxyApiBaseCodec(this.instanceManager); - final PigeonInstanceManager instanceManager; - @override - void writeValue(WriteBuffer buffer, Object? value) { - if (value is PigeonInternalProxyApiBaseClass) { - buffer.putUint8(128); - writeValue(buffer, instanceManager.getIdentifier(value)); - } else { - super.writeValue(buffer, value); - } - } - - @override - Object? readValueOfType(int type, ReadBuffer buffer) { - switch (type) { - case 128: - return instanceManager - .getInstanceWithWeakReference(readValue(buffer)! as int); - default: - return super.readValueOfType(type, buffer); - } - } + const _PigeonInternalProxyApiBaseCodec(this.instanceManager); + final PigeonInstanceManager instanceManager; + @override + void writeValue(WriteBuffer buffer, Object? value) { + if (value is PigeonInternalProxyApiBaseClass) { + buffer.putUint8(128); + writeValue(buffer, instanceManager.getIdentifier(value)); + } else { + super.writeValue(buffer, value); + } + } + @override + Object? readValueOfType(int type, ReadBuffer buffer) { + switch (type) { + case 128: + return instanceManager + .getInstanceWithWeakReference(readValue(buffer)! as int); + default: + return super.readValueOfType(type, buffer); + } + } } + /// The values that can be returned in a change dictionary. /// /// See https://developer.apple.com/documentation/foundation/nskeyvalueobservingoptions. @@ -470,15 +426,12 @@ enum KeyValueObservingOptions { /// Indicates that the change dictionary should provide the new attribute /// value, if applicable. newValue, - /// Indicates that the change dictionary should contain the old attribute /// value, if applicable. oldValue, - /// If specified, a notification should be sent to the observer immediately, /// before the observer registration method even returns. initialValue, - /// Whether separate notifications should be sent to the observer before and /// after each change, instead of a single notification after the change. priorNotification, @@ -490,19 +443,15 @@ enum KeyValueObservingOptions { enum KeyValueChange { /// Indicates that the value of the observed key path was set to a new value. setting, - /// Indicates that an object has been inserted into the to-many relationship /// that is being observed. insertion, - /// Indicates that an object has been removed from the to-many relationship /// that is being observed. removal, - /// Indicates that an object has been replaced in the to-many relationship /// that is being observed. replacement, - /// The value is not recognized by the wrapper. unknown, } @@ -516,28 +465,23 @@ enum KeyValueChangeKey { /// `KeyValueChange.replacement`, the value of this key is a Set object that /// contains the indexes of the inserted, removed, or replaced objects. indexes, - /// An object that contains a value corresponding to one of the /// `KeyValueChange` enum, indicating what sort of change has occurred. kind, - /// If the value of the `KeyValueChange.kind` entry is /// `KeyValueChange.setting, and `KeyValueObservingOptions.newValue` was /// specified when the observer was registered, the value of this key is the /// new value for the attribute. newValue, - /// If the `KeyValueObservingOptions.priorNotification` option was specified /// when the observer was registered this notification is sent prior to a /// change. notificationIsPrior, - /// If the value of the `KeyValueChange.kind` entry is /// `KeyValueChange.setting`, and `KeyValueObservingOptions.old` was specified /// when the observer was registered, the value of this key is the value /// before the attribute was changed. oldValue, - /// The value is not recognized by the wrapper. unknown, } @@ -549,11 +493,9 @@ enum UserScriptInjectionTime { /// A constant to inject the script after the creation of the webpage’s /// document element, but before loading any other content. atDocumentStart, - /// A constant to inject the script after the document finishes loading, but /// before loading any other subresources. atDocumentEnd, - /// The value is not recognized by the wrapper. unknown, } @@ -564,13 +506,10 @@ enum UserScriptInjectionTime { enum AudiovisualMediaType { /// No media types require a user gesture to begin playing. none, - /// Media types that contain audio require a user gesture to begin playing. audio, - /// Media types that contain video require a user gesture to begin playing. video, - /// All media types require a user gesture to begin playing. all, } @@ -582,25 +521,18 @@ enum AudiovisualMediaType { enum WebsiteDataType { /// Cookies. cookies, - /// In-memory caches. memoryCache, - /// On-disk caches. diskCache, - /// HTML offline web app caches. offlineWebApplicationCache, - /// HTML local storage. localStorage, - /// HTML session storage. sessionStorage, - /// WebSQL databases. webSQLDatabases, - /// IndexedDB databases. indexedDBDatabases, } @@ -612,10 +544,8 @@ enum WebsiteDataType { enum NavigationActionPolicy { /// Allow the navigation to continue. allow, - /// Cancel the navigation. cancel, - /// Allow the download to proceed. download, } @@ -627,10 +557,8 @@ enum NavigationActionPolicy { enum NavigationResponsePolicy { /// Allow the navigation to continue. allow, - /// Cancel the navigation. cancel, - /// Allow the download to proceed. download, } @@ -641,51 +569,37 @@ enum NavigationResponsePolicy { enum HttpCookiePropertyKey { /// A String object containing the comment for the cookie. comment, - /// An Uri object or String object containing the comment URL for the cookie. commentUrl, - /// Aa String object stating whether the cookie should be discarded at the end /// of the session. discard, - /// An String object containing the domain for the cookie. domain, - /// An Date object or String object specifying the expiration date for the /// cookie. expires, - /// An String object containing an integer value stating how long in seconds /// the cookie should be kept, at most. maximumAge, - /// An String object containing the name of the cookie (required). name, - /// A URL or String object containing the URL that set this cookie. originUrl, - /// A String object containing the path for the cookie. path, - /// An String object containing comma-separated integer values specifying the /// ports for the cookie. port, - /// A string indicating the same-site policy for the cookie. sameSitePolicy, - /// A String object indicating that the cookie should be transmitted only over /// secure channels. secure, - /// A String object containing the value of the cookie. value, - /// A String object that specifies the version of the cookie. version, - /// The value is not recognized by the wrapper. unknown, } @@ -696,22 +610,16 @@ enum HttpCookiePropertyKey { enum NavigationType { /// A link activation. linkActivated, - /// A request to submit a form. formSubmitted, - /// A request for the frame’s next or previous item. backForward, - /// A request to reload the webpage. reload, - /// A request to resubmit a form. formResubmitted, - /// A navigation request that originates for some other reason. other, - /// The value is not recognized by the wrapper. unknown, } @@ -722,10 +630,8 @@ enum NavigationType { enum PermissionDecision { /// Deny permission for the requested resource. deny, - /// Deny permission for the requested resource. grant, - /// Prompt the user for permission for the requested resource. prompt, } @@ -736,13 +642,10 @@ enum PermissionDecision { enum MediaCaptureType { /// A media device that can capture video. camera, - /// A media device or devices that can capture audio and video. cameraAndMicrophone, - /// A media device that can capture audio. microphone, - /// The value is not recognized by the wrapper. unknown, } @@ -753,18 +656,14 @@ enum MediaCaptureType { enum UrlSessionAuthChallengeDisposition { /// Use the specified credential, which may be nil. useCredential, - /// Use the default handling for the challenge as though this delegate method /// were not implemented. performDefaultHandling, - /// Cancel the entire request. cancelAuthenticationChallenge, - /// Reject this challenge, and call the authentication delegate method again /// with the next authentication protection space. rejectProtectionSpace, - /// The value is not recognized by the wrapper. unknown, } @@ -775,19 +674,17 @@ enum UrlSessionAuthChallengeDisposition { enum UrlCredentialPersistence { /// The credential should not be stored. none, - /// The credential should be stored only for this session. forSession, - /// The credential should be stored in the keychain. permanent, - /// The credential should be stored permanently in the keychain, and in /// addition should be distributed to other devices based on the owning Apple /// ID. synchronizable, } + class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override @@ -795,46 +692,46 @@ class _PigeonCodec extends StandardMessageCodec { if (value is int) { buffer.putUint8(4); buffer.putInt64(value); - } else if (value is KeyValueObservingOptions) { + } else if (value is KeyValueObservingOptions) { buffer.putUint8(129); writeValue(buffer, value.index); - } else if (value is KeyValueChange) { + } else if (value is KeyValueChange) { buffer.putUint8(130); writeValue(buffer, value.index); - } else if (value is KeyValueChangeKey) { + } else if (value is KeyValueChangeKey) { buffer.putUint8(131); writeValue(buffer, value.index); - } else if (value is UserScriptInjectionTime) { + } else if (value is UserScriptInjectionTime) { buffer.putUint8(132); writeValue(buffer, value.index); - } else if (value is AudiovisualMediaType) { + } else if (value is AudiovisualMediaType) { buffer.putUint8(133); writeValue(buffer, value.index); - } else if (value is WebsiteDataType) { + } else if (value is WebsiteDataType) { buffer.putUint8(134); writeValue(buffer, value.index); - } else if (value is NavigationActionPolicy) { + } else if (value is NavigationActionPolicy) { buffer.putUint8(135); writeValue(buffer, value.index); - } else if (value is NavigationResponsePolicy) { + } else if (value is NavigationResponsePolicy) { buffer.putUint8(136); writeValue(buffer, value.index); - } else if (value is HttpCookiePropertyKey) { + } else if (value is HttpCookiePropertyKey) { buffer.putUint8(137); writeValue(buffer, value.index); - } else if (value is NavigationType) { + } else if (value is NavigationType) { buffer.putUint8(138); writeValue(buffer, value.index); - } else if (value is PermissionDecision) { + } else if (value is PermissionDecision) { buffer.putUint8(139); writeValue(buffer, value.index); - } else if (value is MediaCaptureType) { + } else if (value is MediaCaptureType) { buffer.putUint8(140); writeValue(buffer, value.index); - } else if (value is UrlSessionAuthChallengeDisposition) { + } else if (value is UrlSessionAuthChallengeDisposition) { buffer.putUint8(141); writeValue(buffer, value.index); - } else if (value is UrlCredentialPersistence) { + } else if (value is UrlCredentialPersistence) { buffer.putUint8(142); writeValue(buffer, value.index); } else { @@ -845,48 +742,46 @@ class _PigeonCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 129: + case 129: final int? value = readValue(buffer) as int?; return value == null ? null : KeyValueObservingOptions.values[value]; - case 130: + case 130: final int? value = readValue(buffer) as int?; return value == null ? null : KeyValueChange.values[value]; - case 131: + case 131: final int? value = readValue(buffer) as int?; return value == null ? null : KeyValueChangeKey.values[value]; - case 132: + case 132: final int? value = readValue(buffer) as int?; return value == null ? null : UserScriptInjectionTime.values[value]; - case 133: + case 133: final int? value = readValue(buffer) as int?; return value == null ? null : AudiovisualMediaType.values[value]; - case 134: + case 134: final int? value = readValue(buffer) as int?; return value == null ? null : WebsiteDataType.values[value]; - case 135: + case 135: final int? value = readValue(buffer) as int?; return value == null ? null : NavigationActionPolicy.values[value]; - case 136: + case 136: final int? value = readValue(buffer) as int?; return value == null ? null : NavigationResponsePolicy.values[value]; - case 137: + case 137: final int? value = readValue(buffer) as int?; return value == null ? null : HttpCookiePropertyKey.values[value]; - case 138: + case 138: final int? value = readValue(buffer) as int?; return value == null ? null : NavigationType.values[value]; - case 139: + case 139: final int? value = readValue(buffer) as int?; return value == null ? null : PermissionDecision.values[value]; - case 140: + case 140: final int? value = readValue(buffer) as int?; return value == null ? null : MediaCaptureType.values[value]; - case 141: + case 141: final int? value = readValue(buffer) as int?; - return value == null - ? null - : UrlSessionAuthChallengeDisposition.values[value]; - case 142: + return value == null ? null : UrlSessionAuthChallengeDisposition.values[value]; + case 142: final int? value = readValue(buffer) as int?; return value == null ? null : UrlCredentialPersistence.values[value]; default: @@ -894,7 +789,6 @@ class _PigeonCodec extends StandardMessageCodec { } } } - /// A URL load request that is independent of protocol or URL scheme. /// /// See https://developer.apple.com/documentation/foundation/urlrequest. @@ -3129,6 +3023,70 @@ class UIScrollView extends UIView { } } + /// Whether the vertical scroll indicator is visible. + /// + /// The default value is true. + Future setShowsVerticalScrollIndicator(bool value) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecUIScrollView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setShowsVerticalScrollIndicator'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, value]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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; + } + } + + /// Whether the horizontal scroll indicator is visible. + /// + /// The default value is true. + Future setShowsHorizontalScrollIndicator(bool value) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecUIScrollView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setShowsHorizontalScrollIndicator'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, value]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture 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 UIScrollView pigeon_copy() { return UIScrollView.pigeon_detached( @@ -7964,3 +7922,4 @@ class WKWebpagePreferences extends NSObject { ); } } + 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 843c73f3de3..3b04175469e 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 @@ -547,6 +547,16 @@ class WebKitWebViewController extends PlatformWebViewController { return Offset(position[0], position[1]); } + @override + Future setVerticalScrollBarEnabled(bool enabled) { + return _webView.scrollView.setShowsVerticalScrollIndicator(enabled); + } + + @override + Future setHorizontalScrollBarEnabled(bool enabled) { + return _webView.scrollView.setShowsHorizontalScrollIndicator(enabled); + } + /// Whether horizontal swipe gestures trigger page navigation. Future setAllowsBackForwardNavigationGestures(bool enabled) { return _webView.setAllowsBackForwardNavigationGestures(enabled); 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 20b74cc72ad..402eaf5c56b 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/pigeons/web_kit.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/pigeons/web_kit.dart @@ -609,6 +609,16 @@ abstract class UIScrollView extends UIView { /// the scroll view allows horizontal dragging even if the content is smaller /// than the bounds of the scroll view. void setAlwaysBounceHorizontal(bool value); + + /// Whether the vertical scroll indicator is visible. + /// + /// The default value is true. + void setShowsVerticalScrollIndicator(bool value); + + /// Whether the horizontal scroll indicator is visible. + /// + /// The default value is true. + void setShowsHorizontalScrollIndicator(bool value); } /// A collection of properties that you use to initialize a web view.. 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 4e7d186e80f..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 @@ -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,29 +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( @@ -80,18 +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) => (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]. @@ -104,31 +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( @@ -136,21 +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( @@ -159,16 +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) => (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 94e5749c461..016dba58184 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,86 +36,86 @@ 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 _FakeWKNavigationDelegate_3 extends _i1.SmartFake implements _i2.WKNavigationDelegate { _FakeWKNavigationDelegate_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 _FakeWKScriptMessageHandler_5 extends _i1.SmartFake implements _i2.WKScriptMessageHandler { _FakeWKScriptMessageHandler_5(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWKWebView_6 extends _i1.SmartFake implements _i2.WKWebView { _FakeWKWebView_6(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWKWebViewConfiguration_7 extends _i1.SmartFake implements _i2.WKWebViewConfiguration { _FakeWKWebViewConfiguration_7(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeUIViewWKWebView_8 extends _i1.SmartFake implements _i2.UIViewWKWebView { _FakeUIViewWKWebView_8(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWKUserContentController_9 extends _i1.SmartFake implements _i2.WKUserContentController { _FakeWKUserContentController_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 _FakeWKHTTPCookieStore_12 extends _i1.SmartFake implements _i2.WKHTTPCookieStore { _FakeWKHTTPCookieStore_12(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWKUIDelegate_13 extends _i1.SmartFake implements _i2.WKUIDelegate { _FakeWKUIDelegate_13(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakePlatformWebView_14 extends _i1.SmartFake implements _i3.PlatformWebView { _FakePlatformWebView_14(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } /// A class which mocks [UIScrollView]. @@ -127,101 +127,142 @@ 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); + _i4.Future setShowsVerticalScrollIndicator(bool? value) => + (super.noSuchMethod( + Invocation.method(#setShowsVerticalScrollIndicator, [value]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @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 setShowsHorizontalScrollIndicator(bool? value) => + (super.noSuchMethod( + Invocation.method(#setShowsHorizontalScrollIndicator, [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); + _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( @@ -230,18 +271,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) => (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]. @@ -253,69 +296,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?>); + 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( @@ -324,18 +383,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) => (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]. @@ -352,79 +413,92 @@ 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> 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>.value([]), - ) as _i4.Future> 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); + ) + get didReceiveAuthenticationChallenge => + (super.noSuchMethod( + Invocation.getter(#didReceiveAuthenticationChallenge), + returnValue: + ( + _i2.WKNavigationDelegate pigeon_instance, + _i2.WKWebView webView, + _i2.URLAuthenticationChallenge challenge, + ) => _i4.Future>.value([]), + ) + as _i4.Future> 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); @override _i4.Future addObserver( @@ -433,18 +507,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) => (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]. @@ -456,29 +532,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); + _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_4( - this, - Invocation.method(#pigeon_copy, []), - ), - ) as _i2.WKPreferences); + _i2.WKPreferences pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKPreferences_4( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WKPreferences); @override _i4.Future addObserver( @@ -487,18 +569,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) => (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]. @@ -515,36 +599,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_5( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WKScriptMessageHandler); @override _i4.Future addObserver( @@ -553,18 +645,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) => (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]. @@ -576,22 +670,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_6( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WKWebView); @override _i4.Future addObserver( @@ -600,18 +698,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) => (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]. @@ -623,204 +723,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); + _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); + _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_7( - this, - Invocation.method(#pigeonVar_configuration, []), - ), - ) as _i2.WKWebViewConfiguration); + _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.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_8( - this, - Invocation.method(#pigeon_copy, []), - ), - ) as _i2.UIViewWKWebView); + _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); + _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( @@ -829,18 +977,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) => (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]. @@ -853,123 +1003,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, ) => (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>); + returnValue: _i4.Future<_i2.WKUserContentController>.value( + _FakeWKUserContentController_9( + 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>); + returnValue: _i4.Future<_i2.WKWebsiteDataStore>.value( + _FakeWKWebsiteDataStore_10( + 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); + 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, + _i4.Future<_i2.WKPreferences> getPreferences() => + (super.noSuchMethod( Invocation.method(#getPreferences, []), - ), - ), - ) as _i4.Future<_i2.WKPreferences>); + returnValue: _i4.Future<_i2.WKPreferences>.value( + _FakeWKPreferences_4( + 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); + 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_11( - this, Invocation.method(#getDefaultWebpagePreferences, []), - ), - ), - ) as _i4.Future<_i2.WKWebpagePreferences>); + returnValue: _i4.Future<_i2.WKWebpagePreferences>.value( + _FakeWKWebpagePreferences_11( + this, + Invocation.method(#getDefaultWebpagePreferences, []), + ), + ), + ) + as _i4.Future<_i2.WKWebpagePreferences>); @override - _i2.WKWebViewConfiguration pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWKWebViewConfiguration_7( - this, - Invocation.method(#pigeon_copy, []), - ), - ) as _i2.WKWebViewConfiguration); + _i2.WKWebViewConfiguration pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKWebViewConfiguration_7( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WKWebViewConfiguration); @override _i4.Future addObserver( @@ -978,18 +1143,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) => (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]. @@ -1002,31 +1169,37 @@ class MockWKWebsiteDataStore extends _i1.Mock } @override - _i2.WKHTTPCookieStore get httpCookieStore => (super.noSuchMethod( - Invocation.getter(#httpCookieStore), - returnValue: _FakeWKHTTPCookieStore_12( - this, - Invocation.getter(#httpCookieStore), - ), - ) as _i2.WKHTTPCookieStore); + _i2.WKHTTPCookieStore get httpCookieStore => + (super.noSuchMethod( + Invocation.getter(#httpCookieStore), + returnValue: _FakeWKHTTPCookieStore_12( + 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_12( - this, - Invocation.method(#pigeonVar_httpCookieStore, []), - ), - ) as _i2.WKHTTPCookieStore); + _i2.WKHTTPCookieStore pigeonVar_httpCookieStore() => + (super.noSuchMethod( + Invocation.method(#pigeonVar_httpCookieStore, []), + returnValue: _FakeWKHTTPCookieStore_12( + this, + Invocation.method(#pigeonVar_httpCookieStore, []), + ), + ) + as _i2.WKHTTPCookieStore); @override _i4.Future removeDataOfTypes( @@ -1034,21 +1207,24 @@ 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_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, []), + ), + ) + as _i2.WKWebsiteDataStore); @override _i4.Future addObserver( @@ -1057,18 +1233,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) => (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]. @@ -1086,25 +1264,28 @@ 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( @@ -1112,39 +1293,46 @@ 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_13( - 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_13( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WKUIDelegate); @override _i4.Future addObserver( @@ -1153,18 +1341,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) => (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]. @@ -1177,13 +1367,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( @@ -1191,49 +1383,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); + 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_9( - this, - Invocation.method(#pigeon_copy, []), - ), - ) as _i2.WKUserContentController); + _i2.WKUserContentController pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKUserContentController_9( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WKUserContentController); @override _i4.Future addObserver( @@ -1242,18 +1443,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) => (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]. @@ -1266,10 +1469,12 @@ 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) => @@ -1301,36 +1506,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]. @@ -1346,32 +1552,35 @@ 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_14( - 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_14( + 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({ @@ -1379,19 +1588,21 @@ class MockWebViewWidgetProxy extends _i1.Mock _i2.WKScriptMessageHandler, _i2.WKUserContentController, _i2.WKScriptMessage, - )? didReceiveScriptMessage, + )? + didReceiveScriptMessage, }) => (super.noSuchMethod( - Invocation.method(#createScriptMessageHandler, [], { - #didReceiveScriptMessage: didReceiveScriptMessage, - }), - returnValue: _FakeWKScriptMessageHandler_5( - this, - Invocation.method(#createScriptMessageHandler, [], { - #didReceiveScriptMessage: didReceiveScriptMessage, - }), - ), - ) as _i2.WKScriptMessageHandler); + Invocation.method(#createScriptMessageHandler, [], { + #didReceiveScriptMessage: didReceiveScriptMessage, + }), + returnValue: _FakeWKScriptMessageHandler_5( + this, + Invocation.method(#createScriptMessageHandler, [], { + #didReceiveScriptMessage: didReceiveScriptMessage, + }), + ), + ) + as _i2.WKScriptMessageHandler); @override _i2.WKUIDelegate createUIDelgate({ @@ -1400,77 +1611,86 @@ class MockWebViewWidgetProxy extends _i1.Mock _i2.WKWebView, _i2.WKWebViewConfiguration, _i2.WKNavigationAction, - )? onCreateWebView, + )? + onCreateWebView, }) => (super.noSuchMethod( - Invocation.method(#createUIDelgate, [], { - #onCreateWebView: onCreateWebView, - }), - returnValue: _FakeWKUIDelegate_13( - this, - Invocation.method(#createUIDelgate, [], { - #onCreateWebView: onCreateWebView, - }), - ), - ) as _i2.WKUIDelegate); + Invocation.method(#createUIDelgate, [], { + #onCreateWebView: onCreateWebView, + }), + returnValue: _FakeWKUIDelegate_13( + 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> 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, [], { - #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_3( + 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]. @@ -1483,30 +1703,35 @@ 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_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, []), + ), + ) + as _i2.WKWebpagePreferences); @override _i4.Future addObserver( @@ -1515,16 +1740,18 @@ 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 503c38a6dc5..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 @@ -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,34 +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>); + 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( @@ -98,18 +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) => (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]. @@ -121,69 +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( @@ -192,18 +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) => (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]. @@ -215,30 +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, + _i3.Future getAbsoluteString() => + (super.noSuchMethod( Invocation.method(#getAbsoluteString, []), - ), - ), - ) as _i3.Future); + 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( @@ -247,16 +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) => (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 e6a350de4e6..e0777514279 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 @@ -679,6 +679,36 @@ void main() { debugDefaultTargetPlatformOverride = null; }); + test('setVerticalScrollBarEnabled', () async { + final MockUIScrollView mockScrollView = MockUIScrollView(); + + final WebKitWebViewController controller = createControllerWithMocks( + mockScrollView: mockScrollView, + ); + + debugDefaultTargetPlatformOverride = TargetPlatform.iOS; + + await controller.setVerticalScrollBarEnabled(true); + verify(mockScrollView.setShowsVerticalScrollIndicator(true)); + + debugDefaultTargetPlatformOverride = null; + }); + + test('setHorizontalScrollBarEnabled', () async { + final MockUIScrollView mockScrollView = MockUIScrollView(); + + final WebKitWebViewController controller = createControllerWithMocks( + mockScrollView: mockScrollView, + ); + + debugDefaultTargetPlatformOverride = TargetPlatform.iOS; + + await controller.setHorizontalScrollBarEnabled(false); + verify(mockScrollView.setShowsHorizontalScrollIndicator(false)); + + debugDefaultTargetPlatformOverride = null; + }); + test('disable zoom', () async { final MockWKUserContentController mockUserContentController = MockWKUserContentController(); 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 59f32c8c453..8fa65f231ef 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,112 +113,153 @@ 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> 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); + _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 + _i3.Future setShowsVerticalScrollIndicator(bool? value) => + (super.noSuchMethod( + Invocation.method(#setShowsVerticalScrollIndicator, [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); + _i3.Future setShowsHorizontalScrollIndicator(bool? value) => + (super.noSuchMethod( + Invocation.method(#setShowsHorizontalScrollIndicator, [value]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @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 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); + _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( @@ -227,18 +268,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) => (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]. @@ -247,30 +290,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( @@ -279,18 +326,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) => (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]. @@ -298,44 +347,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, + _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, []), - ), - ), - ) 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); + 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( @@ -344,18 +399,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) => (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]. @@ -363,81 +420,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); + _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); + _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); + _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); + _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?>); + _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( @@ -446,18 +519,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) => (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]. @@ -465,37 +540,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( @@ -504,18 +585,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) => (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]. @@ -528,49 +611,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( @@ -579,18 +671,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) => (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]. @@ -599,17 +693,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( @@ -617,53 +713,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); + 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( @@ -672,18 +777,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) => (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]. @@ -691,57 +798,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( @@ -750,18 +868,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) => (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]. @@ -769,30 +889,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( @@ -801,18 +925,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) => (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]. @@ -821,156 +947,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, ) => (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>); + 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>); + 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); + 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, + _i3.Future<_i2.WKPreferences> getPreferences() => + (super.noSuchMethod( Invocation.method(#getPreferences, []), - ), - ), - ) as _i3.Future<_i2.WKPreferences>); + 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); + 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); + 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( @@ -979,18 +1121,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) => (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]. @@ -999,38 +1143,43 @@ 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( @@ -1039,18 +1188,20 @@ 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]. @@ -1058,235 +1209,283 @@ 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); - - @override - _i3.Future getCustomUserAgent() => (super.noSuchMethod( - Invocation.method(#getCustomUserAgent, []), - 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 - _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); + _i3.Future getCustomUserAgent() => + (super.noSuchMethod( + Invocation.method(#getCustomUserAgent, []), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @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 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); + _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( @@ -1295,18 +1494,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) => (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]. @@ -1315,43 +1516,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_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( @@ -1359,26 +1566,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); + 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( @@ -1387,16 +1597,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); } 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 d494fbba209..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 @@ -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,31 +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( @@ -82,21 +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( @@ -105,18 +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) => (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]. @@ -128,29 +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( @@ -159,16 +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) => (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 ce4ab60e4a0..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 @@ -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,25 +83,28 @@ 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( @@ -109,39 +112,46 @@ 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( @@ -150,18 +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) => (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]. @@ -174,123 +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, ) => (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>); + 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>); + 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, + _i3.Future<_i2.WKPreferences> getPreferences() => + (super.noSuchMethod( Invocation.method(#getPreferences, []), - ), - ), - ) as _i3.Future<_i2.WKPreferences>); + 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, ) => (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, []), - ), - ), - ) as _i3.Future<_i2.WKWebpagePreferences>); + 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); + _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( @@ -299,18 +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) => (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]. @@ -323,22 +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_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( @@ -347,16 +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) => (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 45f7a890a158f00e2dba325b31e7bac0f8685100 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Mon, 7 Apr 2025 23:25:15 -0400 Subject: [PATCH 11/29] app facing updated --- .../lib/src/webview_controller.dart | 12 +- .../legacy/webview_flutter_test.mocks.dart | 421 ++++------ .../test/navigation_delegate_test.mocks.dart | 246 +++--- .../test/webview_controller_test.dart | 12 +- .../test/webview_controller_test.mocks.dart | 762 ++++++++---------- .../webview_cookie_manager_test.mocks.dart | 49 +- .../test/webview_widget_test.mocks.dart | 693 +++++++--------- 7 files changed, 964 insertions(+), 1231 deletions(-) diff --git a/packages/webview_flutter/webview_flutter/lib/src/webview_controller.dart b/packages/webview_flutter/webview_flutter/lib/src/webview_controller.dart index 03a85132f69..9c0b560d4e6 100644 --- a/packages/webview_flutter/webview_flutter/lib/src/webview_controller.dart +++ b/packages/webview_flutter/webview_flutter/lib/src/webview_controller.dart @@ -406,14 +406,14 @@ class WebViewController { return platform.setOnScrollPositionChange(onScrollPositionChange); } - /// Define whether the vertical scrollbar should be drawn or not. The default value is true. - Future verticalScrollBarEnabled(bool enabled) { - return platform.verticalScrollBarEnabled(enabled); + /// Whether the vertical scrollbar should be drawn or not. + Future setVerticalScrollBarEnabled(bool enabled) { + return platform.setVerticalScrollBarEnabled(enabled); } - /// Define whether the horizontal scrollbar should be drawn or not. The default value is true. - Future horizontalScrollBarEnabled(bool enabled) { - return platform.horizontalScrollBarEnabled(enabled); + /// Whether the horizontal scrollbar should be drawn or not. + Future setHorizontalScrollBarEnabled(bool enabled) { + return platform.setHorizontalScrollBarEnabled(enabled); } } diff --git a/packages/webview_flutter/webview_flutter/test/legacy/webview_flutter_test.mocks.dart b/packages/webview_flutter/webview_flutter/test/legacy/webview_flutter_test.mocks.dart index ff3f06b0e65..7954c2f769a 100644 --- a/packages/webview_flutter/webview_flutter/test/legacy/webview_flutter_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter/test/legacy/webview_flutter_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/test/legacy/webview_flutter_test.dart. // Do not manually edit this file. @@ -29,19 +29,15 @@ import 'package:webview_flutter_platform_interface/src/legacy/types/types.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 // ignore_for_file: subtype_of_sealed_class class _FakeWidget_0 extends _i1.SmartFake implements _i2.Widget { - _FakeWidget_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWidget_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); @override String toString({_i3.DiagnosticLevel? minLevel = _i3.DiagnosticLevel.info}) => @@ -61,49 +57,42 @@ class MockWebViewPlatform extends _i1.Mock implements _i4.WebViewPlatform { required _i2.BuildContext? context, required _i5.CreationParams? creationParams, required _i6.WebViewPlatformCallbacksHandler? - webViewPlatformCallbacksHandler, + webViewPlatformCallbacksHandler, required _i7.JavascriptChannelRegistry? javascriptChannelRegistry, _i4.WebViewPlatformCreatedCallback? onWebViewPlatformCreated, Set<_i3.Factory<_i8.OneSequenceGestureRecognizer>>? gestureRecognizers, }) => (super.noSuchMethod( - Invocation.method( - #build, - [], - { - #context: context, - #creationParams: creationParams, - #webViewPlatformCallbacksHandler: webViewPlatformCallbacksHandler, - #javascriptChannelRegistry: javascriptChannelRegistry, - #onWebViewPlatformCreated: onWebViewPlatformCreated, - #gestureRecognizers: gestureRecognizers, - }, - ), - returnValue: _FakeWidget_0( - this, - Invocation.method( - #build, - [], - { + Invocation.method(#build, [], { #context: context, #creationParams: creationParams, #webViewPlatformCallbacksHandler: webViewPlatformCallbacksHandler, #javascriptChannelRegistry: javascriptChannelRegistry, #onWebViewPlatformCreated: onWebViewPlatformCreated, #gestureRecognizers: gestureRecognizers, - }, - ), - ), - ) as _i2.Widget); + }), + returnValue: _FakeWidget_0( + this, + Invocation.method(#build, [], { + #context: context, + #creationParams: creationParams, + #webViewPlatformCallbacksHandler: + webViewPlatformCallbacksHandler, + #javascriptChannelRegistry: javascriptChannelRegistry, + #onWebViewPlatformCreated: onWebViewPlatformCreated, + #gestureRecognizers: gestureRecognizers, + }), + ), + ) + as _i2.Widget); @override - _i9.Future clearCookies() => (super.noSuchMethod( - Invocation.method( - #clearCookies, - [], - ), - returnValue: _i9.Future.value(false), - ) as _i9.Future); + _i9.Future clearCookies() => + (super.noSuchMethod( + Invocation.method(#clearCookies, []), + returnValue: _i9.Future.value(false), + ) + as _i9.Future); } /// A class which mocks [WebViewPlatformController]. @@ -116,269 +105,215 @@ class MockWebViewPlatformController extends _i1.Mock } @override - _i9.Future loadFile(String? absoluteFilePath) => (super.noSuchMethod( - Invocation.method( - #loadFile, - [absoluteFilePath], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + _i9.Future loadFile(String? absoluteFilePath) => + (super.noSuchMethod( + Invocation.method(#loadFile, [absoluteFilePath]), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) + as _i9.Future); @override - _i9.Future loadFlutterAsset(String? key) => (super.noSuchMethod( - Invocation.method( - #loadFlutterAsset, - [key], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + _i9.Future loadFlutterAsset(String? key) => + (super.noSuchMethod( + Invocation.method(#loadFlutterAsset, [key]), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) + as _i9.Future); @override - _i9.Future loadHtmlString( - String? html, { - String? baseUrl, - }) => + _i9.Future loadHtmlString(String? html, {String? baseUrl}) => (super.noSuchMethod( - Invocation.method( - #loadHtmlString, - [html], - {#baseUrl: baseUrl}, - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + Invocation.method(#loadHtmlString, [html], {#baseUrl: baseUrl}), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) + as _i9.Future); @override - _i9.Future loadUrl( - String? url, - Map? headers, - ) => + _i9.Future loadUrl(String? url, Map? headers) => (super.noSuchMethod( - Invocation.method( - #loadUrl, - [ - url, - headers, - ], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + Invocation.method(#loadUrl, [url, headers]), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) + as _i9.Future); @override _i9.Future loadRequest(_i5.WebViewRequest? request) => (super.noSuchMethod( - Invocation.method( - #loadRequest, - [request], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + Invocation.method(#loadRequest, [request]), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) + as _i9.Future); @override _i9.Future updateSettings(_i5.WebSettings? setting) => (super.noSuchMethod( - Invocation.method( - #updateSettings, - [setting], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + Invocation.method(#updateSettings, [setting]), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) + as _i9.Future); @override - _i9.Future currentUrl() => (super.noSuchMethod( - Invocation.method( - #currentUrl, - [], - ), - returnValue: _i9.Future.value(), - ) as _i9.Future); + _i9.Future currentUrl() => + (super.noSuchMethod( + Invocation.method(#currentUrl, []), + returnValue: _i9.Future.value(), + ) + as _i9.Future); @override - _i9.Future canGoBack() => (super.noSuchMethod( - Invocation.method( - #canGoBack, - [], - ), - returnValue: _i9.Future.value(false), - ) as _i9.Future); + _i9.Future canGoBack() => + (super.noSuchMethod( + Invocation.method(#canGoBack, []), + returnValue: _i9.Future.value(false), + ) + as _i9.Future); @override - _i9.Future canGoForward() => (super.noSuchMethod( - Invocation.method( - #canGoForward, - [], - ), - returnValue: _i9.Future.value(false), - ) as _i9.Future); + _i9.Future canGoForward() => + (super.noSuchMethod( + Invocation.method(#canGoForward, []), + returnValue: _i9.Future.value(false), + ) + as _i9.Future); @override - _i9.Future goBack() => (super.noSuchMethod( - Invocation.method( - #goBack, - [], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + _i9.Future goBack() => + (super.noSuchMethod( + Invocation.method(#goBack, []), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) + as _i9.Future); @override - _i9.Future goForward() => (super.noSuchMethod( - Invocation.method( - #goForward, - [], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + _i9.Future goForward() => + (super.noSuchMethod( + Invocation.method(#goForward, []), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) + as _i9.Future); @override - _i9.Future reload() => (super.noSuchMethod( - Invocation.method( - #reload, - [], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + _i9.Future reload() => + (super.noSuchMethod( + Invocation.method(#reload, []), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) + as _i9.Future); @override - _i9.Future clearCache() => (super.noSuchMethod( - Invocation.method( - #clearCache, - [], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + _i9.Future clearCache() => + (super.noSuchMethod( + Invocation.method(#clearCache, []), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) + as _i9.Future); @override _i9.Future evaluateJavascript(String? javascript) => (super.noSuchMethod( - Invocation.method( - #evaluateJavascript, - [javascript], - ), - returnValue: _i9.Future.value(_i11.dummyValue( - this, - Invocation.method( - #evaluateJavascript, - [javascript], - ), - )), - ) as _i9.Future); + Invocation.method(#evaluateJavascript, [javascript]), + returnValue: _i9.Future.value( + _i11.dummyValue( + this, + Invocation.method(#evaluateJavascript, [javascript]), + ), + ), + ) + as _i9.Future); @override - _i9.Future runJavascript(String? javascript) => (super.noSuchMethod( - Invocation.method( - #runJavascript, - [javascript], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + _i9.Future runJavascript(String? javascript) => + (super.noSuchMethod( + Invocation.method(#runJavascript, [javascript]), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) + as _i9.Future); @override _i9.Future runJavascriptReturningResult(String? javascript) => (super.noSuchMethod( - Invocation.method( - #runJavascriptReturningResult, - [javascript], - ), - returnValue: _i9.Future.value(_i11.dummyValue( - this, - Invocation.method( - #runJavascriptReturningResult, - [javascript], - ), - )), - ) as _i9.Future); + Invocation.method(#runJavascriptReturningResult, [javascript]), + returnValue: _i9.Future.value( + _i11.dummyValue( + this, + Invocation.method(#runJavascriptReturningResult, [javascript]), + ), + ), + ) + as _i9.Future); @override _i9.Future addJavascriptChannels(Set? javascriptChannelNames) => (super.noSuchMethod( - Invocation.method( - #addJavascriptChannels, - [javascriptChannelNames], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + Invocation.method(#addJavascriptChannels, [javascriptChannelNames]), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) + as _i9.Future); @override _i9.Future removeJavascriptChannels( - Set? javascriptChannelNames) => + Set? javascriptChannelNames, + ) => (super.noSuchMethod( - Invocation.method( - #removeJavascriptChannels, - [javascriptChannelNames], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + Invocation.method(#removeJavascriptChannels, [ + javascriptChannelNames, + ]), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) + as _i9.Future); @override - _i9.Future getTitle() => (super.noSuchMethod( - Invocation.method( - #getTitle, - [], - ), - returnValue: _i9.Future.value(), - ) as _i9.Future); + _i9.Future getTitle() => + (super.noSuchMethod( + Invocation.method(#getTitle, []), + returnValue: _i9.Future.value(), + ) + as _i9.Future); @override - _i9.Future scrollTo( - int? x, - int? y, - ) => + _i9.Future scrollTo(int? x, int? y) => (super.noSuchMethod( - Invocation.method( - #scrollTo, - [ - x, - y, - ], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + Invocation.method(#scrollTo, [x, y]), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) + as _i9.Future); @override - _i9.Future scrollBy( - int? x, - int? y, - ) => + _i9.Future scrollBy(int? x, int? y) => (super.noSuchMethod( - Invocation.method( - #scrollBy, - [ - x, - y, - ], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + Invocation.method(#scrollBy, [x, y]), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) + as _i9.Future); @override - _i9.Future getScrollX() => (super.noSuchMethod( - Invocation.method( - #getScrollX, - [], - ), - returnValue: _i9.Future.value(0), - ) as _i9.Future); + _i9.Future getScrollX() => + (super.noSuchMethod( + Invocation.method(#getScrollX, []), + returnValue: _i9.Future.value(0), + ) + as _i9.Future); @override - _i9.Future getScrollY() => (super.noSuchMethod( - Invocation.method( - #getScrollY, - [], - ), - returnValue: _i9.Future.value(0), - ) as _i9.Future); + _i9.Future getScrollY() => + (super.noSuchMethod( + Invocation.method(#getScrollY, []), + returnValue: _i9.Future.value(0), + ) + as _i9.Future); } diff --git a/packages/webview_flutter/webview_flutter/test/navigation_delegate_test.mocks.dart b/packages/webview_flutter/webview_flutter/test/navigation_delegate_test.mocks.dart index 883191779cc..f1e0a343bee 100644 --- a/packages/webview_flutter/webview_flutter/test/navigation_delegate_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter/test/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/test/navigation_delegate_test.dart. // Do not manually edit this file. @@ -26,6 +26,7 @@ import 'package:webview_flutter_platform_interface/src/webview_platform.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 @@ -36,43 +37,25 @@ class _FakePlatformWebViewCookieManager_0 extends _i1.SmartFake _FakePlatformWebViewCookieManager_0( Object parent, Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + ) : super(parent, parentInvocation); } class _FakePlatformNavigationDelegate_1 extends _i1.SmartFake implements _i3.PlatformNavigationDelegate { - _FakePlatformNavigationDelegate_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakePlatformNavigationDelegate_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakePlatformWebViewController_2 extends _i1.SmartFake implements _i4.PlatformWebViewController { - _FakePlatformWebViewController_2( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakePlatformWebViewController_2(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakePlatformWebViewWidget_3 extends _i1.SmartFake implements _i5.PlatformWebViewWidget { - _FakePlatformWebViewWidget_3( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakePlatformWebViewWidget_3(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakePlatformNavigationDelegateCreationParams_4 extends _i1.SmartFake @@ -80,10 +63,7 @@ class _FakePlatformNavigationDelegateCreationParams_4 extends _i1.SmartFake _FakePlatformNavigationDelegateCreationParams_4( Object parent, Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + ) : super(parent, parentInvocation); } /// A class which mocks [WebViewPlatform]. @@ -96,71 +76,55 @@ class MockWebViewPlatform extends _i1.Mock implements _i7.WebViewPlatform { @override _i2.PlatformWebViewCookieManager createPlatformCookieManager( - _i6.PlatformWebViewCookieManagerCreationParams? params) => + _i6.PlatformWebViewCookieManagerCreationParams? params, + ) => (super.noSuchMethod( - Invocation.method( - #createPlatformCookieManager, - [params], - ), - returnValue: _FakePlatformWebViewCookieManager_0( - this, - Invocation.method( - #createPlatformCookieManager, - [params], - ), - ), - ) as _i2.PlatformWebViewCookieManager); + Invocation.method(#createPlatformCookieManager, [params]), + returnValue: _FakePlatformWebViewCookieManager_0( + this, + Invocation.method(#createPlatformCookieManager, [params]), + ), + ) + as _i2.PlatformWebViewCookieManager); @override _i3.PlatformNavigationDelegate createPlatformNavigationDelegate( - _i6.PlatformNavigationDelegateCreationParams? params) => + _i6.PlatformNavigationDelegateCreationParams? params, + ) => (super.noSuchMethod( - Invocation.method( - #createPlatformNavigationDelegate, - [params], - ), - returnValue: _FakePlatformNavigationDelegate_1( - this, - Invocation.method( - #createPlatformNavigationDelegate, - [params], - ), - ), - ) as _i3.PlatformNavigationDelegate); + Invocation.method(#createPlatformNavigationDelegate, [params]), + returnValue: _FakePlatformNavigationDelegate_1( + this, + Invocation.method(#createPlatformNavigationDelegate, [params]), + ), + ) + as _i3.PlatformNavigationDelegate); @override _i4.PlatformWebViewController createPlatformWebViewController( - _i6.PlatformWebViewControllerCreationParams? params) => + _i6.PlatformWebViewControllerCreationParams? params, + ) => (super.noSuchMethod( - Invocation.method( - #createPlatformWebViewController, - [params], - ), - returnValue: _FakePlatformWebViewController_2( - this, - Invocation.method( - #createPlatformWebViewController, - [params], - ), - ), - ) as _i4.PlatformWebViewController); + Invocation.method(#createPlatformWebViewController, [params]), + returnValue: _FakePlatformWebViewController_2( + this, + Invocation.method(#createPlatformWebViewController, [params]), + ), + ) + as _i4.PlatformWebViewController); @override _i5.PlatformWebViewWidget createPlatformWebViewWidget( - _i6.PlatformWebViewWidgetCreationParams? params) => + _i6.PlatformWebViewWidgetCreationParams? params, + ) => (super.noSuchMethod( - Invocation.method( - #createPlatformWebViewWidget, - [params], - ), - returnValue: _FakePlatformWebViewWidget_3( - this, - Invocation.method( - #createPlatformWebViewWidget, - [params], - ), - ), - ) as _i5.PlatformWebViewWidget); + Invocation.method(#createPlatformWebViewWidget, [params]), + returnValue: _FakePlatformWebViewWidget_3( + this, + Invocation.method(#createPlatformWebViewWidget, [params]), + ), + ) + as _i5.PlatformWebViewWidget); } /// A class which mocks [PlatformNavigationDelegate]. @@ -175,101 +139,89 @@ class MockPlatformNavigationDelegate extends _i1.Mock @override _i6.PlatformNavigationDelegateCreationParams get params => (super.noSuchMethod( - Invocation.getter(#params), - returnValue: _FakePlatformNavigationDelegateCreationParams_4( - this, - Invocation.getter(#params), - ), - ) as _i6.PlatformNavigationDelegateCreationParams); + Invocation.getter(#params), + returnValue: _FakePlatformNavigationDelegateCreationParams_4( + this, + Invocation.getter(#params), + ), + ) + as _i6.PlatformNavigationDelegateCreationParams); @override _i8.Future setOnNavigationRequest( - _i3.NavigationRequestCallback? onNavigationRequest) => + _i3.NavigationRequestCallback? onNavigationRequest, + ) => (super.noSuchMethod( - Invocation.method( - #setOnNavigationRequest, - [onNavigationRequest], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setOnNavigationRequest, [onNavigationRequest]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setOnPageStarted(_i3.PageEventCallback? onPageStarted) => (super.noSuchMethod( - Invocation.method( - #setOnPageStarted, - [onPageStarted], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setOnPageStarted, [onPageStarted]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setOnPageFinished(_i3.PageEventCallback? onPageFinished) => (super.noSuchMethod( - Invocation.method( - #setOnPageFinished, - [onPageFinished], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setOnPageFinished, [onPageFinished]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setOnHttpError(_i3.HttpResponseErrorCallback? onHttpError) => (super.noSuchMethod( - Invocation.method( - #setOnHttpError, - [onHttpError], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setOnHttpError, [onHttpError]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setOnProgress(_i3.ProgressCallback? onProgress) => (super.noSuchMethod( - Invocation.method( - #setOnProgress, - [onProgress], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setOnProgress, [onProgress]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setOnWebResourceError( - _i3.WebResourceErrorCallback? onWebResourceError) => + _i3.WebResourceErrorCallback? onWebResourceError, + ) => (super.noSuchMethod( - Invocation.method( - #setOnWebResourceError, - [onWebResourceError], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setOnWebResourceError, [onWebResourceError]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setOnUrlChange(_i3.UrlChangeCallback? onUrlChange) => (super.noSuchMethod( - Invocation.method( - #setOnUrlChange, - [onUrlChange], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setOnUrlChange, [onUrlChange]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setOnHttpAuthRequest( - _i3.HttpAuthRequestCallback? onHttpAuthRequest) => + _i3.HttpAuthRequestCallback? onHttpAuthRequest, + ) => (super.noSuchMethod( - Invocation.method( - #setOnHttpAuthRequest, - [onHttpAuthRequest], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setOnHttpAuthRequest, [onHttpAuthRequest]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); } diff --git a/packages/webview_flutter/webview_flutter/test/webview_controller_test.dart b/packages/webview_flutter/webview_flutter/test/webview_controller_test.dart index 49351a119c7..d70c9e1ed46 100644 --- a/packages/webview_flutter/webview_flutter/test/webview_controller_test.dart +++ b/packages/webview_flutter/webview_flutter/test/webview_controller_test.dart @@ -281,7 +281,7 @@ void main() { verify(mockPlatformWebViewController.scrollBy(2, 3)); }); - test('verticalScrollBarEnabled', () async { + test('setVerticalScrollBarEnabled', () async { final MockPlatformWebViewController mockPlatformWebViewController = MockPlatformWebViewController(); @@ -289,11 +289,11 @@ void main() { mockPlatformWebViewController, ); - await webViewController.verticalScrollBarEnabled(false); - verify(mockPlatformWebViewController.verticalScrollBarEnabled(false)); + await webViewController.setVerticalScrollBarEnabled(true); + verify(mockPlatformWebViewController.setVerticalScrollBarEnabled(true)); }); - test('horizontalScrollBarEnabled', () async { + test('setHorizontalScrollBarEnabled', () async { final MockPlatformWebViewController mockPlatformWebViewController = MockPlatformWebViewController(); @@ -301,8 +301,8 @@ void main() { mockPlatformWebViewController, ); - await webViewController.horizontalScrollBarEnabled(false); - verify(mockPlatformWebViewController.horizontalScrollBarEnabled(false)); + await webViewController.setHorizontalScrollBarEnabled(false); + verify(mockPlatformWebViewController.setHorizontalScrollBarEnabled(false)); }); test('getScrollPosition', () async { diff --git a/packages/webview_flutter/webview_flutter/test/webview_controller_test.mocks.dart b/packages/webview_flutter/webview_flutter/test/webview_controller_test.mocks.dart index 7bef6d0efe2..6cd93cf31d2 100644 --- a/packages/webview_flutter/webview_flutter/test/webview_controller_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter/test/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/test/webview_controller_test.dart. // Do not manually edit this file. @@ -21,6 +21,7 @@ import 'package:webview_flutter_platform_interface/src/types/types.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 @@ -31,30 +32,17 @@ class _FakePlatformWebViewControllerCreationParams_0 extends _i1.SmartFake _FakePlatformWebViewControllerCreationParams_0( Object parent, Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + ) : super(parent, parentInvocation); } class _FakeObject_1 extends _i1.SmartFake implements Object { - _FakeObject_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeObject_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeOffset_2 extends _i1.SmartFake implements _i3.Offset { - _FakeOffset_2( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeOffset_2(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakePlatformNavigationDelegateCreationParams_3 extends _i1.SmartFake @@ -62,10 +50,7 @@ class _FakePlatformNavigationDelegateCreationParams_3 extends _i1.SmartFake _FakePlatformNavigationDelegateCreationParams_3( Object parent, Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + ) : super(parent, parentInvocation); } /// A class which mocks [PlatformWebViewController]. @@ -78,403 +63,352 @@ class MockPlatformWebViewController extends _i1.Mock } @override - _i2.PlatformWebViewControllerCreationParams get params => (super.noSuchMethod( - Invocation.getter(#params), - returnValue: _FakePlatformWebViewControllerCreationParams_0( - this, - Invocation.getter(#params), - ), - ) as _i2.PlatformWebViewControllerCreationParams); + _i2.PlatformWebViewControllerCreationParams get params => + (super.noSuchMethod( + Invocation.getter(#params), + returnValue: _FakePlatformWebViewControllerCreationParams_0( + this, + Invocation.getter(#params), + ), + ) + as _i2.PlatformWebViewControllerCreationParams); @override - _i5.Future loadFile(String? absoluteFilePath) => (super.noSuchMethod( - Invocation.method( - #loadFile, - [absoluteFilePath], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future loadFile(String? absoluteFilePath) => + (super.noSuchMethod( + Invocation.method(#loadFile, [absoluteFilePath]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future loadFlutterAsset(String? key) => (super.noSuchMethod( - Invocation.method( - #loadFlutterAsset, - [key], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future loadFlutterAsset(String? key) => + (super.noSuchMethod( + Invocation.method(#loadFlutterAsset, [key]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future loadHtmlString( - String? html, { - String? baseUrl, - }) => + _i5.Future loadHtmlString(String? html, {String? baseUrl}) => (super.noSuchMethod( - Invocation.method( - #loadHtmlString, - [html], - {#baseUrl: baseUrl}, - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#loadHtmlString, [html], {#baseUrl: baseUrl}), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future loadRequest(_i2.LoadRequestParams? params) => (super.noSuchMethod( - Invocation.method( - #loadRequest, - [params], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - - @override - _i5.Future currentUrl() => (super.noSuchMethod( - Invocation.method( - #currentUrl, - [], - ), - returnValue: _i5.Future.value(), - ) as _i5.Future); - - @override - _i5.Future canGoBack() => (super.noSuchMethod( - Invocation.method( - #canGoBack, - [], - ), - returnValue: _i5.Future.value(false), - ) as _i5.Future); - - @override - _i5.Future canGoForward() => (super.noSuchMethod( - Invocation.method( - #canGoForward, - [], - ), - returnValue: _i5.Future.value(false), - ) as _i5.Future); - - @override - _i5.Future goBack() => (super.noSuchMethod( - Invocation.method( - #goBack, - [], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - - @override - _i5.Future goForward() => (super.noSuchMethod( - Invocation.method( - #goForward, - [], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - - @override - _i5.Future reload() => (super.noSuchMethod( - Invocation.method( - #reload, - [], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - - @override - _i5.Future clearCache() => (super.noSuchMethod( - Invocation.method( - #clearCache, - [], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - - @override - _i5.Future clearLocalStorage() => (super.noSuchMethod( - Invocation.method( - #clearLocalStorage, - [], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#loadRequest, [params]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); + + @override + _i5.Future currentUrl() => + (super.noSuchMethod( + Invocation.method(#currentUrl, []), + returnValue: _i5.Future.value(), + ) + as _i5.Future); + + @override + _i5.Future canGoBack() => + (super.noSuchMethod( + Invocation.method(#canGoBack, []), + returnValue: _i5.Future.value(false), + ) + as _i5.Future); + + @override + _i5.Future canGoForward() => + (super.noSuchMethod( + Invocation.method(#canGoForward, []), + returnValue: _i5.Future.value(false), + ) + as _i5.Future); + + @override + _i5.Future goBack() => + (super.noSuchMethod( + Invocation.method(#goBack, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); + + @override + _i5.Future goForward() => + (super.noSuchMethod( + Invocation.method(#goForward, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); + + @override + _i5.Future reload() => + (super.noSuchMethod( + Invocation.method(#reload, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); + + @override + _i5.Future clearCache() => + (super.noSuchMethod( + Invocation.method(#clearCache, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); + + @override + _i5.Future clearLocalStorage() => + (super.noSuchMethod( + Invocation.method(#clearLocalStorage, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setPlatformNavigationDelegate( - _i6.PlatformNavigationDelegate? handler) => + _i6.PlatformNavigationDelegate? handler, + ) => (super.noSuchMethod( - Invocation.method( - #setPlatformNavigationDelegate, - [handler], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setPlatformNavigationDelegate, [handler]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future runJavaScript(String? javaScript) => (super.noSuchMethod( - Invocation.method( - #runJavaScript, - [javaScript], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future runJavaScript(String? javaScript) => + (super.noSuchMethod( + Invocation.method(#runJavaScript, [javaScript]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future runJavaScriptReturningResult(String? javaScript) => (super.noSuchMethod( - Invocation.method( - #runJavaScriptReturningResult, - [javaScript], - ), - returnValue: _i5.Future.value(_FakeObject_1( - this, - Invocation.method( - #runJavaScriptReturningResult, - [javaScript], - ), - )), - ) as _i5.Future); + Invocation.method(#runJavaScriptReturningResult, [javaScript]), + returnValue: _i5.Future.value( + _FakeObject_1( + this, + Invocation.method(#runJavaScriptReturningResult, [javaScript]), + ), + ), + ) + as _i5.Future); @override _i5.Future addJavaScriptChannel( - _i4.JavaScriptChannelParams? javaScriptChannelParams) => + _i4.JavaScriptChannelParams? javaScriptChannelParams, + ) => (super.noSuchMethod( - Invocation.method( - #addJavaScriptChannel, - [javaScriptChannelParams], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#addJavaScriptChannel, [javaScriptChannelParams]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future removeJavaScriptChannel(String? javaScriptChannelName) => (super.noSuchMethod( - Invocation.method( - #removeJavaScriptChannel, - [javaScriptChannelName], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#removeJavaScriptChannel, [ + javaScriptChannelName, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future getTitle() => (super.noSuchMethod( - Invocation.method( - #getTitle, - [], - ), - returnValue: _i5.Future.value(), - ) as _i5.Future); + _i5.Future getTitle() => + (super.noSuchMethod( + Invocation.method(#getTitle, []), + returnValue: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future scrollTo( - int? x, - int? y, - ) => + _i5.Future scrollTo(int? x, int? y) => (super.noSuchMethod( - Invocation.method( - #scrollTo, - [ - x, - y, - ], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - - @override - _i5.Future scrollBy( - int? x, - int? y, - ) => + Invocation.method(#scrollTo, [x, y]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); + + @override + _i5.Future scrollBy(int? x, int? y) => + (super.noSuchMethod( + Invocation.method(#scrollBy, [x, y]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); + + @override + _i5.Future setVerticalScrollBarEnabled(bool? enabled) => + (super.noSuchMethod( + Invocation.method(#setVerticalScrollBarEnabled, [enabled]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); + + @override + _i5.Future setHorizontalScrollBarEnabled(bool? enabled) => + (super.noSuchMethod( + Invocation.method(#setHorizontalScrollBarEnabled, [enabled]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); + + @override + _i5.Future<_i3.Offset> getScrollPosition() => + (super.noSuchMethod( + Invocation.method(#getScrollPosition, []), + returnValue: _i5.Future<_i3.Offset>.value( + _FakeOffset_2(this, Invocation.method(#getScrollPosition, [])), + ), + ) + as _i5.Future<_i3.Offset>); + + @override + _i5.Future enableZoom(bool? enabled) => (super.noSuchMethod( - Invocation.method( - #scrollBy, - [ - x, - y, - ], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - - @override - _i5.Future verticalScrollBarEnabled(bool? enabled) => - (super.noSuchMethod( - Invocation.method( - #verticalScrollBarEnabled, - [enabled], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - - @override - _i5.Future horizontalScrollBarEnabled(bool? enabled) => - (super.noSuchMethod( - Invocation.method( - #horizontalScrollBarEnabled, - [enabled], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - - @override - _i5.Future<_i3.Offset> getScrollPosition() => (super.noSuchMethod( - Invocation.method( - #getScrollPosition, - [], - ), - returnValue: _i5.Future<_i3.Offset>.value(_FakeOffset_2( - this, - Invocation.method( - #getScrollPosition, - [], - ), - )), - ) as _i5.Future<_i3.Offset>); - - @override - _i5.Future enableZoom(bool? enabled) => (super.noSuchMethod( - Invocation.method( - #enableZoom, - [enabled], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - - @override - _i5.Future setBackgroundColor(_i3.Color? color) => (super.noSuchMethod( - Invocation.method( - #setBackgroundColor, - [color], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#enableZoom, [enabled]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); + + @override + _i5.Future setBackgroundColor(_i3.Color? color) => + (super.noSuchMethod( + Invocation.method(#setBackgroundColor, [color]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setJavaScriptMode(_i2.JavaScriptMode? javaScriptMode) => (super.noSuchMethod( - Invocation.method( - #setJavaScriptMode, - [javaScriptMode], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setJavaScriptMode, [javaScriptMode]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future setUserAgent(String? userAgent) => (super.noSuchMethod( - Invocation.method( - #setUserAgent, - [userAgent], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future setUserAgent(String? userAgent) => + (super.noSuchMethod( + Invocation.method(#setUserAgent, [userAgent]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setOnPlatformPermissionRequest( - void Function(_i2.PlatformWebViewPermissionRequest)? - onPermissionRequest) => + void Function(_i2.PlatformWebViewPermissionRequest)? onPermissionRequest, + ) => (super.noSuchMethod( - Invocation.method( - #setOnPlatformPermissionRequest, - [onPermissionRequest], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setOnPlatformPermissionRequest, [ + onPermissionRequest, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future getUserAgent() => (super.noSuchMethod( - Invocation.method( - #getUserAgent, - [], - ), - returnValue: _i5.Future.value(), - ) as _i5.Future); + _i5.Future getUserAgent() => + (super.noSuchMethod( + Invocation.method(#getUserAgent, []), + returnValue: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setOnConsoleMessage( - void Function(_i2.JavaScriptConsoleMessage)? onConsoleMessage) => + void Function(_i2.JavaScriptConsoleMessage)? onConsoleMessage, + ) => (super.noSuchMethod( - Invocation.method( - #setOnConsoleMessage, - [onConsoleMessage], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setOnConsoleMessage, [onConsoleMessage]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setOnScrollPositionChange( - void Function(_i2.ScrollPositionChange)? onScrollPositionChange) => + void Function(_i2.ScrollPositionChange)? onScrollPositionChange, + ) => (super.noSuchMethod( - Invocation.method( - #setOnScrollPositionChange, - [onScrollPositionChange], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setOnScrollPositionChange, [ + onScrollPositionChange, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setOnJavaScriptAlertDialog( - _i5.Future Function(_i2.JavaScriptAlertDialogRequest)? - onJavaScriptAlertDialog) => + _i5.Future Function(_i2.JavaScriptAlertDialogRequest)? + onJavaScriptAlertDialog, + ) => (super.noSuchMethod( - Invocation.method( - #setOnJavaScriptAlertDialog, - [onJavaScriptAlertDialog], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setOnJavaScriptAlertDialog, [ + onJavaScriptAlertDialog, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setOnJavaScriptConfirmDialog( - _i5.Future Function(_i2.JavaScriptConfirmDialogRequest)? - onJavaScriptConfirmDialog) => + _i5.Future Function(_i2.JavaScriptConfirmDialogRequest)? + onJavaScriptConfirmDialog, + ) => (super.noSuchMethod( - Invocation.method( - #setOnJavaScriptConfirmDialog, - [onJavaScriptConfirmDialog], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setOnJavaScriptConfirmDialog, [ + onJavaScriptConfirmDialog, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setOnJavaScriptTextInputDialog( - _i5.Future Function(_i2.JavaScriptTextInputDialogRequest)? - onJavaScriptTextInputDialog) => - (super.noSuchMethod( - Invocation.method( - #setOnJavaScriptTextInputDialog, - [onJavaScriptTextInputDialog], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future Function(_i2.JavaScriptTextInputDialogRequest)? + onJavaScriptTextInputDialog, + ) => + (super.noSuchMethod( + Invocation.method(#setOnJavaScriptTextInputDialog, [ + onJavaScriptTextInputDialog, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); } /// A class which mocks [PlatformNavigationDelegate]. @@ -489,101 +423,89 @@ class MockPlatformNavigationDelegate extends _i1.Mock @override _i2.PlatformNavigationDelegateCreationParams get params => (super.noSuchMethod( - Invocation.getter(#params), - returnValue: _FakePlatformNavigationDelegateCreationParams_3( - this, - Invocation.getter(#params), - ), - ) as _i2.PlatformNavigationDelegateCreationParams); + Invocation.getter(#params), + returnValue: _FakePlatformNavigationDelegateCreationParams_3( + this, + Invocation.getter(#params), + ), + ) + as _i2.PlatformNavigationDelegateCreationParams); @override _i5.Future setOnNavigationRequest( - _i6.NavigationRequestCallback? onNavigationRequest) => + _i6.NavigationRequestCallback? onNavigationRequest, + ) => (super.noSuchMethod( - Invocation.method( - #setOnNavigationRequest, - [onNavigationRequest], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setOnNavigationRequest, [onNavigationRequest]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setOnPageStarted(_i6.PageEventCallback? onPageStarted) => (super.noSuchMethod( - Invocation.method( - #setOnPageStarted, - [onPageStarted], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setOnPageStarted, [onPageStarted]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setOnPageFinished(_i6.PageEventCallback? onPageFinished) => (super.noSuchMethod( - Invocation.method( - #setOnPageFinished, - [onPageFinished], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setOnPageFinished, [onPageFinished]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setOnHttpError(_i6.HttpResponseErrorCallback? onHttpError) => (super.noSuchMethod( - Invocation.method( - #setOnHttpError, - [onHttpError], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setOnHttpError, [onHttpError]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setOnProgress(_i6.ProgressCallback? onProgress) => (super.noSuchMethod( - Invocation.method( - #setOnProgress, - [onProgress], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setOnProgress, [onProgress]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setOnWebResourceError( - _i6.WebResourceErrorCallback? onWebResourceError) => + _i6.WebResourceErrorCallback? onWebResourceError, + ) => (super.noSuchMethod( - Invocation.method( - #setOnWebResourceError, - [onWebResourceError], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setOnWebResourceError, [onWebResourceError]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setOnUrlChange(_i6.UrlChangeCallback? onUrlChange) => (super.noSuchMethod( - Invocation.method( - #setOnUrlChange, - [onUrlChange], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setOnUrlChange, [onUrlChange]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setOnHttpAuthRequest( - _i6.HttpAuthRequestCallback? onHttpAuthRequest) => - (super.noSuchMethod( - Invocation.method( - #setOnHttpAuthRequest, - [onHttpAuthRequest], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i6.HttpAuthRequestCallback? onHttpAuthRequest, + ) => + (super.noSuchMethod( + Invocation.method(#setOnHttpAuthRequest, [onHttpAuthRequest]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); } diff --git a/packages/webview_flutter/webview_flutter/test/webview_cookie_manager_test.mocks.dart b/packages/webview_flutter/webview_flutter/test/webview_cookie_manager_test.mocks.dart index 20bf87f4dca..c40d739926a 100644 --- a/packages/webview_flutter/webview_flutter/test/webview_cookie_manager_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter/test/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/test/webview_cookie_manager_test.dart. // Do not manually edit this file. @@ -18,6 +18,7 @@ import 'package:webview_flutter_platform_interface/src/types/types.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 @@ -28,10 +29,7 @@ class _FakePlatformWebViewCookieManagerCreationParams_0 extends _i1.SmartFake _FakePlatformWebViewCookieManagerCreationParams_0( Object parent, Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + ) : super(parent, parentInvocation); } /// A class which mocks [PlatformWebViewCookieManager]. @@ -46,29 +44,28 @@ class MockPlatformWebViewCookieManager extends _i1.Mock @override _i2.PlatformWebViewCookieManagerCreationParams get params => (super.noSuchMethod( - Invocation.getter(#params), - returnValue: _FakePlatformWebViewCookieManagerCreationParams_0( - this, - Invocation.getter(#params), - ), - ) as _i2.PlatformWebViewCookieManagerCreationParams); + Invocation.getter(#params), + returnValue: _FakePlatformWebViewCookieManagerCreationParams_0( + this, + Invocation.getter(#params), + ), + ) + as _i2.PlatformWebViewCookieManagerCreationParams); @override - _i4.Future clearCookies() => (super.noSuchMethod( - Invocation.method( - #clearCookies, - [], - ), - returnValue: _i4.Future.value(false), - ) as _i4.Future); + _i4.Future clearCookies() => + (super.noSuchMethod( + Invocation.method(#clearCookies, []), + returnValue: _i4.Future.value(false), + ) + as _i4.Future); @override - _i4.Future setCookie(_i2.WebViewCookie? cookie) => (super.noSuchMethod( - Invocation.method( - #setCookie, - [cookie], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + _i4.Future setCookie(_i2.WebViewCookie? cookie) => + (super.noSuchMethod( + Invocation.method(#setCookie, [cookie]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); } diff --git a/packages/webview_flutter/webview_flutter/test/webview_widget_test.mocks.dart b/packages/webview_flutter/webview_flutter/test/webview_widget_test.mocks.dart index 3e8471b4a78..c9f1d0f75c5 100644 --- a/packages/webview_flutter/webview_flutter/test/webview_widget_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter/test/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/test/webview_widget_test.dart. // Do not manually edit this file. @@ -25,6 +25,7 @@ import 'package:webview_flutter_platform_interface/src/types/types.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 @@ -35,30 +36,17 @@ class _FakePlatformWebViewControllerCreationParams_0 extends _i1.SmartFake _FakePlatformWebViewControllerCreationParams_0( Object parent, Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + ) : super(parent, parentInvocation); } class _FakeObject_1 extends _i1.SmartFake implements Object { - _FakeObject_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeObject_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeOffset_2 extends _i1.SmartFake implements _i3.Offset { - _FakeOffset_2( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeOffset_2(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakePlatformWebViewWidgetCreationParams_3 extends _i1.SmartFake @@ -66,20 +54,12 @@ class _FakePlatformWebViewWidgetCreationParams_3 extends _i1.SmartFake _FakePlatformWebViewWidgetCreationParams_3( Object parent, Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + ) : super(parent, parentInvocation); } class _FakeWidget_4 extends _i1.SmartFake implements _i4.Widget { - _FakeWidget_4( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWidget_4(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); @override String toString({_i5.DiagnosticLevel? minLevel = _i5.DiagnosticLevel.info}) => @@ -96,403 +76,352 @@ class MockPlatformWebViewController extends _i1.Mock } @override - _i2.PlatformWebViewControllerCreationParams get params => (super.noSuchMethod( - Invocation.getter(#params), - returnValue: _FakePlatformWebViewControllerCreationParams_0( - this, - Invocation.getter(#params), - ), - ) as _i2.PlatformWebViewControllerCreationParams); + _i2.PlatformWebViewControllerCreationParams get params => + (super.noSuchMethod( + Invocation.getter(#params), + returnValue: _FakePlatformWebViewControllerCreationParams_0( + this, + Invocation.getter(#params), + ), + ) + as _i2.PlatformWebViewControllerCreationParams); @override - _i7.Future loadFile(String? absoluteFilePath) => (super.noSuchMethod( - Invocation.method( - #loadFile, - [absoluteFilePath], - ), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); + _i7.Future loadFile(String? absoluteFilePath) => + (super.noSuchMethod( + Invocation.method(#loadFile, [absoluteFilePath]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); @override - _i7.Future loadFlutterAsset(String? key) => (super.noSuchMethod( - Invocation.method( - #loadFlutterAsset, - [key], - ), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); + _i7.Future loadFlutterAsset(String? key) => + (super.noSuchMethod( + Invocation.method(#loadFlutterAsset, [key]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); @override - _i7.Future loadHtmlString( - String? html, { - String? baseUrl, - }) => + _i7.Future loadHtmlString(String? html, {String? baseUrl}) => (super.noSuchMethod( - Invocation.method( - #loadHtmlString, - [html], - {#baseUrl: baseUrl}, - ), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); + Invocation.method(#loadHtmlString, [html], {#baseUrl: baseUrl}), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); @override _i7.Future loadRequest(_i2.LoadRequestParams? params) => (super.noSuchMethod( - Invocation.method( - #loadRequest, - [params], - ), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); - - @override - _i7.Future currentUrl() => (super.noSuchMethod( - Invocation.method( - #currentUrl, - [], - ), - returnValue: _i7.Future.value(), - ) as _i7.Future); - - @override - _i7.Future canGoBack() => (super.noSuchMethod( - Invocation.method( - #canGoBack, - [], - ), - returnValue: _i7.Future.value(false), - ) as _i7.Future); - - @override - _i7.Future canGoForward() => (super.noSuchMethod( - Invocation.method( - #canGoForward, - [], - ), - returnValue: _i7.Future.value(false), - ) as _i7.Future); - - @override - _i7.Future goBack() => (super.noSuchMethod( - Invocation.method( - #goBack, - [], - ), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); - - @override - _i7.Future goForward() => (super.noSuchMethod( - Invocation.method( - #goForward, - [], - ), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); - - @override - _i7.Future reload() => (super.noSuchMethod( - Invocation.method( - #reload, - [], - ), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); - - @override - _i7.Future clearCache() => (super.noSuchMethod( - Invocation.method( - #clearCache, - [], - ), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); - - @override - _i7.Future clearLocalStorage() => (super.noSuchMethod( - Invocation.method( - #clearLocalStorage, - [], - ), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); + Invocation.method(#loadRequest, [params]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); + + @override + _i7.Future currentUrl() => + (super.noSuchMethod( + Invocation.method(#currentUrl, []), + returnValue: _i7.Future.value(), + ) + as _i7.Future); + + @override + _i7.Future canGoBack() => + (super.noSuchMethod( + Invocation.method(#canGoBack, []), + returnValue: _i7.Future.value(false), + ) + as _i7.Future); + + @override + _i7.Future canGoForward() => + (super.noSuchMethod( + Invocation.method(#canGoForward, []), + returnValue: _i7.Future.value(false), + ) + as _i7.Future); + + @override + _i7.Future goBack() => + (super.noSuchMethod( + Invocation.method(#goBack, []), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); + + @override + _i7.Future goForward() => + (super.noSuchMethod( + Invocation.method(#goForward, []), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); + + @override + _i7.Future reload() => + (super.noSuchMethod( + Invocation.method(#reload, []), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); + + @override + _i7.Future clearCache() => + (super.noSuchMethod( + Invocation.method(#clearCache, []), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); + + @override + _i7.Future clearLocalStorage() => + (super.noSuchMethod( + Invocation.method(#clearLocalStorage, []), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); @override _i7.Future setPlatformNavigationDelegate( - _i8.PlatformNavigationDelegate? handler) => + _i8.PlatformNavigationDelegate? handler, + ) => (super.noSuchMethod( - Invocation.method( - #setPlatformNavigationDelegate, - [handler], - ), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); + Invocation.method(#setPlatformNavigationDelegate, [handler]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); @override - _i7.Future runJavaScript(String? javaScript) => (super.noSuchMethod( - Invocation.method( - #runJavaScript, - [javaScript], - ), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); + _i7.Future runJavaScript(String? javaScript) => + (super.noSuchMethod( + Invocation.method(#runJavaScript, [javaScript]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); @override _i7.Future runJavaScriptReturningResult(String? javaScript) => (super.noSuchMethod( - Invocation.method( - #runJavaScriptReturningResult, - [javaScript], - ), - returnValue: _i7.Future.value(_FakeObject_1( - this, - Invocation.method( - #runJavaScriptReturningResult, - [javaScript], - ), - )), - ) as _i7.Future); + Invocation.method(#runJavaScriptReturningResult, [javaScript]), + returnValue: _i7.Future.value( + _FakeObject_1( + this, + Invocation.method(#runJavaScriptReturningResult, [javaScript]), + ), + ), + ) + as _i7.Future); @override _i7.Future addJavaScriptChannel( - _i6.JavaScriptChannelParams? javaScriptChannelParams) => + _i6.JavaScriptChannelParams? javaScriptChannelParams, + ) => (super.noSuchMethod( - Invocation.method( - #addJavaScriptChannel, - [javaScriptChannelParams], - ), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); + Invocation.method(#addJavaScriptChannel, [javaScriptChannelParams]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); @override _i7.Future removeJavaScriptChannel(String? javaScriptChannelName) => (super.noSuchMethod( - Invocation.method( - #removeJavaScriptChannel, - [javaScriptChannelName], - ), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); + Invocation.method(#removeJavaScriptChannel, [ + javaScriptChannelName, + ]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); @override - _i7.Future getTitle() => (super.noSuchMethod( - Invocation.method( - #getTitle, - [], - ), - returnValue: _i7.Future.value(), - ) as _i7.Future); + _i7.Future getTitle() => + (super.noSuchMethod( + Invocation.method(#getTitle, []), + returnValue: _i7.Future.value(), + ) + as _i7.Future); @override - _i7.Future scrollTo( - int? x, - int? y, - ) => + _i7.Future scrollTo(int? x, int? y) => (super.noSuchMethod( - Invocation.method( - #scrollTo, - [ - x, - y, - ], - ), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); - - @override - _i7.Future scrollBy( - int? x, - int? y, - ) => + Invocation.method(#scrollTo, [x, y]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); + + @override + _i7.Future scrollBy(int? x, int? y) => + (super.noSuchMethod( + Invocation.method(#scrollBy, [x, y]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); + + @override + _i7.Future setVerticalScrollBarEnabled(bool? enabled) => + (super.noSuchMethod( + Invocation.method(#setVerticalScrollBarEnabled, [enabled]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); + + @override + _i7.Future setHorizontalScrollBarEnabled(bool? enabled) => + (super.noSuchMethod( + Invocation.method(#setHorizontalScrollBarEnabled, [enabled]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); + + @override + _i7.Future<_i3.Offset> getScrollPosition() => + (super.noSuchMethod( + Invocation.method(#getScrollPosition, []), + returnValue: _i7.Future<_i3.Offset>.value( + _FakeOffset_2(this, Invocation.method(#getScrollPosition, [])), + ), + ) + as _i7.Future<_i3.Offset>); + + @override + _i7.Future enableZoom(bool? enabled) => (super.noSuchMethod( - Invocation.method( - #scrollBy, - [ - x, - y, - ], - ), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); - - @override - _i7.Future verticalScrollBarEnabled(bool? enabled) => - (super.noSuchMethod( - Invocation.method( - #verticalScrollBarEnabled, - [enabled], - ), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); - - @override - _i7.Future horizontalScrollBarEnabled(bool? enabled) => - (super.noSuchMethod( - Invocation.method( - #horizontalScrollBarEnabled, - [enabled], - ), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); - - @override - _i7.Future<_i3.Offset> getScrollPosition() => (super.noSuchMethod( - Invocation.method( - #getScrollPosition, - [], - ), - returnValue: _i7.Future<_i3.Offset>.value(_FakeOffset_2( - this, - Invocation.method( - #getScrollPosition, - [], - ), - )), - ) as _i7.Future<_i3.Offset>); - - @override - _i7.Future enableZoom(bool? enabled) => (super.noSuchMethod( - Invocation.method( - #enableZoom, - [enabled], - ), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); - - @override - _i7.Future setBackgroundColor(_i3.Color? color) => (super.noSuchMethod( - Invocation.method( - #setBackgroundColor, - [color], - ), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); + Invocation.method(#enableZoom, [enabled]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); + + @override + _i7.Future setBackgroundColor(_i3.Color? color) => + (super.noSuchMethod( + Invocation.method(#setBackgroundColor, [color]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); @override _i7.Future setJavaScriptMode(_i2.JavaScriptMode? javaScriptMode) => (super.noSuchMethod( - Invocation.method( - #setJavaScriptMode, - [javaScriptMode], - ), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); + Invocation.method(#setJavaScriptMode, [javaScriptMode]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); @override - _i7.Future setUserAgent(String? userAgent) => (super.noSuchMethod( - Invocation.method( - #setUserAgent, - [userAgent], - ), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); + _i7.Future setUserAgent(String? userAgent) => + (super.noSuchMethod( + Invocation.method(#setUserAgent, [userAgent]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); @override _i7.Future setOnPlatformPermissionRequest( - void Function(_i2.PlatformWebViewPermissionRequest)? - onPermissionRequest) => + void Function(_i2.PlatformWebViewPermissionRequest)? onPermissionRequest, + ) => (super.noSuchMethod( - Invocation.method( - #setOnPlatformPermissionRequest, - [onPermissionRequest], - ), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); + Invocation.method(#setOnPlatformPermissionRequest, [ + onPermissionRequest, + ]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); @override - _i7.Future getUserAgent() => (super.noSuchMethod( - Invocation.method( - #getUserAgent, - [], - ), - returnValue: _i7.Future.value(), - ) as _i7.Future); + _i7.Future getUserAgent() => + (super.noSuchMethod( + Invocation.method(#getUserAgent, []), + returnValue: _i7.Future.value(), + ) + as _i7.Future); @override _i7.Future setOnConsoleMessage( - void Function(_i2.JavaScriptConsoleMessage)? onConsoleMessage) => + void Function(_i2.JavaScriptConsoleMessage)? onConsoleMessage, + ) => (super.noSuchMethod( - Invocation.method( - #setOnConsoleMessage, - [onConsoleMessage], - ), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); + Invocation.method(#setOnConsoleMessage, [onConsoleMessage]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); @override _i7.Future setOnScrollPositionChange( - void Function(_i2.ScrollPositionChange)? onScrollPositionChange) => + void Function(_i2.ScrollPositionChange)? onScrollPositionChange, + ) => (super.noSuchMethod( - Invocation.method( - #setOnScrollPositionChange, - [onScrollPositionChange], - ), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); + Invocation.method(#setOnScrollPositionChange, [ + onScrollPositionChange, + ]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); @override _i7.Future setOnJavaScriptAlertDialog( - _i7.Future Function(_i2.JavaScriptAlertDialogRequest)? - onJavaScriptAlertDialog) => + _i7.Future Function(_i2.JavaScriptAlertDialogRequest)? + onJavaScriptAlertDialog, + ) => (super.noSuchMethod( - Invocation.method( - #setOnJavaScriptAlertDialog, - [onJavaScriptAlertDialog], - ), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); + Invocation.method(#setOnJavaScriptAlertDialog, [ + onJavaScriptAlertDialog, + ]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); @override _i7.Future setOnJavaScriptConfirmDialog( - _i7.Future Function(_i2.JavaScriptConfirmDialogRequest)? - onJavaScriptConfirmDialog) => + _i7.Future Function(_i2.JavaScriptConfirmDialogRequest)? + onJavaScriptConfirmDialog, + ) => (super.noSuchMethod( - Invocation.method( - #setOnJavaScriptConfirmDialog, - [onJavaScriptConfirmDialog], - ), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); + Invocation.method(#setOnJavaScriptConfirmDialog, [ + onJavaScriptConfirmDialog, + ]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); @override _i7.Future setOnJavaScriptTextInputDialog( - _i7.Future Function(_i2.JavaScriptTextInputDialogRequest)? - onJavaScriptTextInputDialog) => - (super.noSuchMethod( - Invocation.method( - #setOnJavaScriptTextInputDialog, - [onJavaScriptTextInputDialog], - ), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); + _i7.Future Function(_i2.JavaScriptTextInputDialogRequest)? + onJavaScriptTextInputDialog, + ) => + (super.noSuchMethod( + Invocation.method(#setOnJavaScriptTextInputDialog, [ + onJavaScriptTextInputDialog, + ]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); } /// A class which mocks [PlatformWebViewWidget]. @@ -505,26 +434,24 @@ class MockPlatformWebViewWidget extends _i1.Mock } @override - _i2.PlatformWebViewWidgetCreationParams get params => (super.noSuchMethod( - Invocation.getter(#params), - returnValue: _FakePlatformWebViewWidgetCreationParams_3( - this, - Invocation.getter(#params), - ), - ) as _i2.PlatformWebViewWidgetCreationParams); - - @override - _i4.Widget build(_i4.BuildContext? context) => (super.noSuchMethod( - Invocation.method( - #build, - [context], - ), - returnValue: _FakeWidget_4( - this, - Invocation.method( - #build, - [context], - ), - ), - ) as _i4.Widget); + _i2.PlatformWebViewWidgetCreationParams get params => + (super.noSuchMethod( + Invocation.getter(#params), + returnValue: _FakePlatformWebViewWidgetCreationParams_3( + this, + Invocation.getter(#params), + ), + ) + as _i2.PlatformWebViewWidgetCreationParams); + + @override + _i4.Widget build(_i4.BuildContext? context) => + (super.noSuchMethod( + Invocation.method(#build, [context]), + returnValue: _FakeWidget_4( + this, + Invocation.method(#build, [context]), + ), + ) + as _i4.Widget); } From 5778e9f8dc16ab170da2131b16051b2c054a2dac Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Mon, 7 Apr 2025 23:25:50 -0400 Subject: [PATCH 12/29] formatting --- .../legacy/webview_flutter_test.mocks.dart | 312 +- .../test/navigation_delegate_test.mocks.dart | 143 +- .../test/webview_controller_test.mocks.dart | 496 +- .../webview_cookie_manager_test.mocks.dart | 35 +- .../test/webview_widget_test.mocks.dart | 445 +- .../webviewflutter/AndroidWebkitLibrary.g.kt | 3007 +++++++---- .../lib/src/android_webkit.g.dart | 167 +- ...ndroid_navigation_delegate_test.mocks.dart | 124 +- ...android_webview_controller_test.mocks.dart | 3536 ++++++------- ...oid_webview_cookie_manager_test.mocks.dart | 576 +- ...iew_android_cookie_manager_test.mocks.dart | 67 +- .../webview_android_widget_test.mocks.dart | 1137 ++-- .../platform_webview_controller_test.dart | 6 +- .../Tests/ScrollViewProxyAPITests.swift | 38 +- .../ScrollViewProxyAPIDelegate.swift | 20 +- .../WebKitLibrary.g.swift | 4707 ++++++++++------- .../lib/src/common/web_kit.g.dart | 301 +- .../web_kit_cookie_manager_test.mocks.dart | 163 +- .../web_kit_webview_widget_test.mocks.dart | 1807 +++---- ...webkit_navigation_delegate_test.mocks.dart | 257 +- .../webkit_webview_controller_test.mocks.dart | 1952 +++---- ...kit_webview_cookie_manager_test.mocks.dart | 163 +- .../webkit_webview_widget_test.mocks.dart | 361 +- 23 files changed, 10260 insertions(+), 9560 deletions(-) diff --git a/packages/webview_flutter/webview_flutter/test/legacy/webview_flutter_test.mocks.dart b/packages/webview_flutter/webview_flutter/test/legacy/webview_flutter_test.mocks.dart index 7954c2f769a..7a3c4d583a9 100644 --- a/packages/webview_flutter/webview_flutter/test/legacy/webview_flutter_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter/test/legacy/webview_flutter_test.mocks.dart @@ -37,7 +37,7 @@ import 'package:webview_flutter_platform_interface/src/legacy/types/types.dart' class _FakeWidget_0 extends _i1.SmartFake implements _i2.Widget { _FakeWidget_0(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); @override String toString({_i3.DiagnosticLevel? minLevel = _i3.DiagnosticLevel.info}) => @@ -57,42 +57,38 @@ class MockWebViewPlatform extends _i1.Mock implements _i4.WebViewPlatform { required _i2.BuildContext? context, required _i5.CreationParams? creationParams, required _i6.WebViewPlatformCallbacksHandler? - webViewPlatformCallbacksHandler, + webViewPlatformCallbacksHandler, required _i7.JavascriptChannelRegistry? javascriptChannelRegistry, _i4.WebViewPlatformCreatedCallback? onWebViewPlatformCreated, Set<_i3.Factory<_i8.OneSequenceGestureRecognizer>>? gestureRecognizers, }) => (super.noSuchMethod( - Invocation.method(#build, [], { - #context: context, - #creationParams: creationParams, - #webViewPlatformCallbacksHandler: webViewPlatformCallbacksHandler, - #javascriptChannelRegistry: javascriptChannelRegistry, - #onWebViewPlatformCreated: onWebViewPlatformCreated, - #gestureRecognizers: gestureRecognizers, - }), - returnValue: _FakeWidget_0( - this, - Invocation.method(#build, [], { - #context: context, - #creationParams: creationParams, - #webViewPlatformCallbacksHandler: - webViewPlatformCallbacksHandler, - #javascriptChannelRegistry: javascriptChannelRegistry, - #onWebViewPlatformCreated: onWebViewPlatformCreated, - #gestureRecognizers: gestureRecognizers, - }), - ), - ) - as _i2.Widget); + Invocation.method(#build, [], { + #context: context, + #creationParams: creationParams, + #webViewPlatformCallbacksHandler: webViewPlatformCallbacksHandler, + #javascriptChannelRegistry: javascriptChannelRegistry, + #onWebViewPlatformCreated: onWebViewPlatformCreated, + #gestureRecognizers: gestureRecognizers, + }), + returnValue: _FakeWidget_0( + this, + Invocation.method(#build, [], { + #context: context, + #creationParams: creationParams, + #webViewPlatformCallbacksHandler: webViewPlatformCallbacksHandler, + #javascriptChannelRegistry: javascriptChannelRegistry, + #onWebViewPlatformCreated: onWebViewPlatformCreated, + #gestureRecognizers: gestureRecognizers, + }), + ), + ) as _i2.Widget); @override - _i9.Future clearCookies() => - (super.noSuchMethod( - Invocation.method(#clearCookies, []), - returnValue: _i9.Future.value(false), - ) - as _i9.Future); + _i9.Future clearCookies() => (super.noSuchMethod( + Invocation.method(#clearCookies, []), + returnValue: _i9.Future.value(false), + ) as _i9.Future); } /// A class which mocks [WebViewPlatformController]. @@ -105,215 +101,177 @@ class MockWebViewPlatformController extends _i1.Mock } @override - _i9.Future loadFile(String? absoluteFilePath) => - (super.noSuchMethod( - Invocation.method(#loadFile, [absoluteFilePath]), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) - as _i9.Future); + _i9.Future loadFile(String? absoluteFilePath) => (super.noSuchMethod( + Invocation.method(#loadFile, [absoluteFilePath]), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) as _i9.Future); @override - _i9.Future loadFlutterAsset(String? key) => - (super.noSuchMethod( - Invocation.method(#loadFlutterAsset, [key]), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) - as _i9.Future); + _i9.Future loadFlutterAsset(String? key) => (super.noSuchMethod( + Invocation.method(#loadFlutterAsset, [key]), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) as _i9.Future); @override _i9.Future loadHtmlString(String? html, {String? baseUrl}) => (super.noSuchMethod( - Invocation.method(#loadHtmlString, [html], {#baseUrl: baseUrl}), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) - as _i9.Future); + Invocation.method(#loadHtmlString, [html], {#baseUrl: baseUrl}), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) as _i9.Future); @override _i9.Future loadUrl(String? url, Map? headers) => (super.noSuchMethod( - Invocation.method(#loadUrl, [url, headers]), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) - as _i9.Future); + Invocation.method(#loadUrl, [url, headers]), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) as _i9.Future); @override _i9.Future loadRequest(_i5.WebViewRequest? request) => (super.noSuchMethod( - Invocation.method(#loadRequest, [request]), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) - as _i9.Future); + Invocation.method(#loadRequest, [request]), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) as _i9.Future); @override _i9.Future updateSettings(_i5.WebSettings? setting) => (super.noSuchMethod( - Invocation.method(#updateSettings, [setting]), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) - as _i9.Future); + Invocation.method(#updateSettings, [setting]), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) as _i9.Future); @override - _i9.Future currentUrl() => - (super.noSuchMethod( - Invocation.method(#currentUrl, []), - returnValue: _i9.Future.value(), - ) - as _i9.Future); + _i9.Future currentUrl() => (super.noSuchMethod( + Invocation.method(#currentUrl, []), + returnValue: _i9.Future.value(), + ) as _i9.Future); @override - _i9.Future canGoBack() => - (super.noSuchMethod( - Invocation.method(#canGoBack, []), - returnValue: _i9.Future.value(false), - ) - as _i9.Future); + _i9.Future canGoBack() => (super.noSuchMethod( + Invocation.method(#canGoBack, []), + returnValue: _i9.Future.value(false), + ) as _i9.Future); @override - _i9.Future canGoForward() => - (super.noSuchMethod( - Invocation.method(#canGoForward, []), - returnValue: _i9.Future.value(false), - ) - as _i9.Future); + _i9.Future canGoForward() => (super.noSuchMethod( + Invocation.method(#canGoForward, []), + returnValue: _i9.Future.value(false), + ) as _i9.Future); @override - _i9.Future goBack() => - (super.noSuchMethod( - Invocation.method(#goBack, []), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) - as _i9.Future); + _i9.Future goBack() => (super.noSuchMethod( + Invocation.method(#goBack, []), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) as _i9.Future); @override - _i9.Future goForward() => - (super.noSuchMethod( - Invocation.method(#goForward, []), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) - as _i9.Future); + _i9.Future goForward() => (super.noSuchMethod( + Invocation.method(#goForward, []), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) as _i9.Future); @override - _i9.Future reload() => - (super.noSuchMethod( - Invocation.method(#reload, []), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) - as _i9.Future); + _i9.Future reload() => (super.noSuchMethod( + Invocation.method(#reload, []), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) as _i9.Future); @override - _i9.Future clearCache() => - (super.noSuchMethod( - Invocation.method(#clearCache, []), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) - as _i9.Future); + _i9.Future clearCache() => (super.noSuchMethod( + Invocation.method(#clearCache, []), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) as _i9.Future); @override _i9.Future evaluateJavascript(String? javascript) => (super.noSuchMethod( + Invocation.method(#evaluateJavascript, [javascript]), + returnValue: _i9.Future.value( + _i11.dummyValue( + this, Invocation.method(#evaluateJavascript, [javascript]), - returnValue: _i9.Future.value( - _i11.dummyValue( - this, - Invocation.method(#evaluateJavascript, [javascript]), - ), - ), - ) - as _i9.Future); + ), + ), + ) as _i9.Future); @override - _i9.Future runJavascript(String? javascript) => - (super.noSuchMethod( - Invocation.method(#runJavascript, [javascript]), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) - as _i9.Future); + _i9.Future runJavascript(String? javascript) => (super.noSuchMethod( + Invocation.method(#runJavascript, [javascript]), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) as _i9.Future); @override _i9.Future runJavascriptReturningResult(String? javascript) => (super.noSuchMethod( + Invocation.method(#runJavascriptReturningResult, [javascript]), + returnValue: _i9.Future.value( + _i11.dummyValue( + this, Invocation.method(#runJavascriptReturningResult, [javascript]), - returnValue: _i9.Future.value( - _i11.dummyValue( - this, - Invocation.method(#runJavascriptReturningResult, [javascript]), - ), - ), - ) - as _i9.Future); + ), + ), + ) as _i9.Future); @override _i9.Future addJavascriptChannels(Set? javascriptChannelNames) => (super.noSuchMethod( - Invocation.method(#addJavascriptChannels, [javascriptChannelNames]), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) - as _i9.Future); + Invocation.method(#addJavascriptChannels, [javascriptChannelNames]), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) as _i9.Future); @override _i9.Future removeJavascriptChannels( Set? javascriptChannelNames, ) => (super.noSuchMethod( - Invocation.method(#removeJavascriptChannels, [ - javascriptChannelNames, - ]), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) - as _i9.Future); + Invocation.method(#removeJavascriptChannels, [ + javascriptChannelNames, + ]), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) as _i9.Future); @override - _i9.Future getTitle() => - (super.noSuchMethod( - Invocation.method(#getTitle, []), - returnValue: _i9.Future.value(), - ) - as _i9.Future); + _i9.Future getTitle() => (super.noSuchMethod( + Invocation.method(#getTitle, []), + returnValue: _i9.Future.value(), + ) as _i9.Future); @override - _i9.Future scrollTo(int? x, int? y) => - (super.noSuchMethod( - Invocation.method(#scrollTo, [x, y]), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) - as _i9.Future); + _i9.Future scrollTo(int? x, int? y) => (super.noSuchMethod( + Invocation.method(#scrollTo, [x, y]), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) as _i9.Future); @override - _i9.Future scrollBy(int? x, int? y) => - (super.noSuchMethod( - Invocation.method(#scrollBy, [x, y]), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) - as _i9.Future); + _i9.Future scrollBy(int? x, int? y) => (super.noSuchMethod( + Invocation.method(#scrollBy, [x, y]), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) as _i9.Future); @override - _i9.Future getScrollX() => - (super.noSuchMethod( - Invocation.method(#getScrollX, []), - returnValue: _i9.Future.value(0), - ) - as _i9.Future); + _i9.Future getScrollX() => (super.noSuchMethod( + Invocation.method(#getScrollX, []), + returnValue: _i9.Future.value(0), + ) as _i9.Future); @override - _i9.Future getScrollY() => - (super.noSuchMethod( - Invocation.method(#getScrollY, []), - returnValue: _i9.Future.value(0), - ) - as _i9.Future); + _i9.Future getScrollY() => (super.noSuchMethod( + Invocation.method(#getScrollY, []), + returnValue: _i9.Future.value(0), + ) as _i9.Future); } diff --git a/packages/webview_flutter/webview_flutter/test/navigation_delegate_test.mocks.dart b/packages/webview_flutter/webview_flutter/test/navigation_delegate_test.mocks.dart index f1e0a343bee..4b02c37ace2 100644 --- a/packages/webview_flutter/webview_flutter/test/navigation_delegate_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter/test/navigation_delegate_test.mocks.dart @@ -43,19 +43,19 @@ class _FakePlatformWebViewCookieManager_0 extends _i1.SmartFake class _FakePlatformNavigationDelegate_1 extends _i1.SmartFake implements _i3.PlatformNavigationDelegate { _FakePlatformNavigationDelegate_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakePlatformWebViewController_2 extends _i1.SmartFake implements _i4.PlatformWebViewController { _FakePlatformWebViewController_2(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakePlatformWebViewWidget_3 extends _i1.SmartFake implements _i5.PlatformWebViewWidget { _FakePlatformWebViewWidget_3(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakePlatformNavigationDelegateCreationParams_4 extends _i1.SmartFake @@ -79,52 +79,48 @@ class MockWebViewPlatform extends _i1.Mock implements _i7.WebViewPlatform { _i6.PlatformWebViewCookieManagerCreationParams? params, ) => (super.noSuchMethod( - Invocation.method(#createPlatformCookieManager, [params]), - returnValue: _FakePlatformWebViewCookieManager_0( - this, - Invocation.method(#createPlatformCookieManager, [params]), - ), - ) - as _i2.PlatformWebViewCookieManager); + Invocation.method(#createPlatformCookieManager, [params]), + returnValue: _FakePlatformWebViewCookieManager_0( + this, + Invocation.method(#createPlatformCookieManager, [params]), + ), + ) as _i2.PlatformWebViewCookieManager); @override _i3.PlatformNavigationDelegate createPlatformNavigationDelegate( _i6.PlatformNavigationDelegateCreationParams? params, ) => (super.noSuchMethod( - Invocation.method(#createPlatformNavigationDelegate, [params]), - returnValue: _FakePlatformNavigationDelegate_1( - this, - Invocation.method(#createPlatformNavigationDelegate, [params]), - ), - ) - as _i3.PlatformNavigationDelegate); + Invocation.method(#createPlatformNavigationDelegate, [params]), + returnValue: _FakePlatformNavigationDelegate_1( + this, + Invocation.method(#createPlatformNavigationDelegate, [params]), + ), + ) as _i3.PlatformNavigationDelegate); @override _i4.PlatformWebViewController createPlatformWebViewController( _i6.PlatformWebViewControllerCreationParams? params, ) => (super.noSuchMethod( - Invocation.method(#createPlatformWebViewController, [params]), - returnValue: _FakePlatformWebViewController_2( - this, - Invocation.method(#createPlatformWebViewController, [params]), - ), - ) - as _i4.PlatformWebViewController); + Invocation.method(#createPlatformWebViewController, [params]), + returnValue: _FakePlatformWebViewController_2( + this, + Invocation.method(#createPlatformWebViewController, [params]), + ), + ) as _i4.PlatformWebViewController); @override _i5.PlatformWebViewWidget createPlatformWebViewWidget( _i6.PlatformWebViewWidgetCreationParams? params, ) => (super.noSuchMethod( - Invocation.method(#createPlatformWebViewWidget, [params]), - returnValue: _FakePlatformWebViewWidget_3( - this, - Invocation.method(#createPlatformWebViewWidget, [params]), - ), - ) - as _i5.PlatformWebViewWidget); + Invocation.method(#createPlatformWebViewWidget, [params]), + returnValue: _FakePlatformWebViewWidget_3( + this, + Invocation.method(#createPlatformWebViewWidget, [params]), + ), + ) as _i5.PlatformWebViewWidget); } /// A class which mocks [PlatformNavigationDelegate]. @@ -139,89 +135,80 @@ class MockPlatformNavigationDelegate extends _i1.Mock @override _i6.PlatformNavigationDelegateCreationParams get params => (super.noSuchMethod( - Invocation.getter(#params), - returnValue: _FakePlatformNavigationDelegateCreationParams_4( - this, - Invocation.getter(#params), - ), - ) - as _i6.PlatformNavigationDelegateCreationParams); + Invocation.getter(#params), + returnValue: _FakePlatformNavigationDelegateCreationParams_4( + this, + Invocation.getter(#params), + ), + ) as _i6.PlatformNavigationDelegateCreationParams); @override _i8.Future setOnNavigationRequest( _i3.NavigationRequestCallback? onNavigationRequest, ) => (super.noSuchMethod( - Invocation.method(#setOnNavigationRequest, [onNavigationRequest]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setOnNavigationRequest, [onNavigationRequest]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setOnPageStarted(_i3.PageEventCallback? onPageStarted) => (super.noSuchMethod( - Invocation.method(#setOnPageStarted, [onPageStarted]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setOnPageStarted, [onPageStarted]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setOnPageFinished(_i3.PageEventCallback? onPageFinished) => (super.noSuchMethod( - Invocation.method(#setOnPageFinished, [onPageFinished]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setOnPageFinished, [onPageFinished]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setOnHttpError(_i3.HttpResponseErrorCallback? onHttpError) => (super.noSuchMethod( - Invocation.method(#setOnHttpError, [onHttpError]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setOnHttpError, [onHttpError]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setOnProgress(_i3.ProgressCallback? onProgress) => (super.noSuchMethod( - Invocation.method(#setOnProgress, [onProgress]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setOnProgress, [onProgress]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setOnWebResourceError( _i3.WebResourceErrorCallback? onWebResourceError, ) => (super.noSuchMethod( - Invocation.method(#setOnWebResourceError, [onWebResourceError]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setOnWebResourceError, [onWebResourceError]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setOnUrlChange(_i3.UrlChangeCallback? onUrlChange) => (super.noSuchMethod( - Invocation.method(#setOnUrlChange, [onUrlChange]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setOnUrlChange, [onUrlChange]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setOnHttpAuthRequest( _i3.HttpAuthRequestCallback? onHttpAuthRequest, ) => (super.noSuchMethod( - Invocation.method(#setOnHttpAuthRequest, [onHttpAuthRequest]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setOnHttpAuthRequest, [onHttpAuthRequest]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); } diff --git a/packages/webview_flutter/webview_flutter/test/webview_controller_test.mocks.dart b/packages/webview_flutter/webview_flutter/test/webview_controller_test.mocks.dart index 6cd93cf31d2..53eb6662057 100644 --- a/packages/webview_flutter/webview_flutter/test/webview_controller_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter/test/webview_controller_test.mocks.dart @@ -37,12 +37,12 @@ class _FakePlatformWebViewControllerCreationParams_0 extends _i1.SmartFake class _FakeObject_1 extends _i1.SmartFake implements Object { _FakeObject_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeOffset_2 extends _i1.SmartFake implements _i3.Offset { _FakeOffset_2(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakePlatformNavigationDelegateCreationParams_3 extends _i1.SmartFake @@ -63,352 +63,297 @@ class MockPlatformWebViewController extends _i1.Mock } @override - _i2.PlatformWebViewControllerCreationParams get params => - (super.noSuchMethod( - Invocation.getter(#params), - returnValue: _FakePlatformWebViewControllerCreationParams_0( - this, - Invocation.getter(#params), - ), - ) - as _i2.PlatformWebViewControllerCreationParams); + _i2.PlatformWebViewControllerCreationParams get params => (super.noSuchMethod( + Invocation.getter(#params), + returnValue: _FakePlatformWebViewControllerCreationParams_0( + this, + Invocation.getter(#params), + ), + ) as _i2.PlatformWebViewControllerCreationParams); @override - _i5.Future loadFile(String? absoluteFilePath) => - (super.noSuchMethod( - Invocation.method(#loadFile, [absoluteFilePath]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future loadFile(String? absoluteFilePath) => (super.noSuchMethod( + Invocation.method(#loadFile, [absoluteFilePath]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future loadFlutterAsset(String? key) => - (super.noSuchMethod( - Invocation.method(#loadFlutterAsset, [key]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future loadFlutterAsset(String? key) => (super.noSuchMethod( + Invocation.method(#loadFlutterAsset, [key]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future loadHtmlString(String? html, {String? baseUrl}) => (super.noSuchMethod( - Invocation.method(#loadHtmlString, [html], {#baseUrl: baseUrl}), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#loadHtmlString, [html], {#baseUrl: baseUrl}), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future loadRequest(_i2.LoadRequestParams? params) => (super.noSuchMethod( - Invocation.method(#loadRequest, [params]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#loadRequest, [params]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future currentUrl() => - (super.noSuchMethod( - Invocation.method(#currentUrl, []), - returnValue: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future currentUrl() => (super.noSuchMethod( + Invocation.method(#currentUrl, []), + returnValue: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future canGoBack() => - (super.noSuchMethod( - Invocation.method(#canGoBack, []), - returnValue: _i5.Future.value(false), - ) - as _i5.Future); + _i5.Future canGoBack() => (super.noSuchMethod( + Invocation.method(#canGoBack, []), + returnValue: _i5.Future.value(false), + ) as _i5.Future); @override - _i5.Future canGoForward() => - (super.noSuchMethod( - Invocation.method(#canGoForward, []), - returnValue: _i5.Future.value(false), - ) - as _i5.Future); + _i5.Future canGoForward() => (super.noSuchMethod( + Invocation.method(#canGoForward, []), + returnValue: _i5.Future.value(false), + ) as _i5.Future); @override - _i5.Future goBack() => - (super.noSuchMethod( - Invocation.method(#goBack, []), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future goBack() => (super.noSuchMethod( + Invocation.method(#goBack, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future goForward() => - (super.noSuchMethod( - Invocation.method(#goForward, []), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future goForward() => (super.noSuchMethod( + Invocation.method(#goForward, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future reload() => - (super.noSuchMethod( - Invocation.method(#reload, []), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future reload() => (super.noSuchMethod( + Invocation.method(#reload, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future clearCache() => - (super.noSuchMethod( - Invocation.method(#clearCache, []), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future clearCache() => (super.noSuchMethod( + Invocation.method(#clearCache, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future clearLocalStorage() => - (super.noSuchMethod( - Invocation.method(#clearLocalStorage, []), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future clearLocalStorage() => (super.noSuchMethod( + Invocation.method(#clearLocalStorage, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setPlatformNavigationDelegate( _i6.PlatformNavigationDelegate? handler, ) => (super.noSuchMethod( - Invocation.method(#setPlatformNavigationDelegate, [handler]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setPlatformNavigationDelegate, [handler]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future runJavaScript(String? javaScript) => - (super.noSuchMethod( - Invocation.method(#runJavaScript, [javaScript]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future runJavaScript(String? javaScript) => (super.noSuchMethod( + Invocation.method(#runJavaScript, [javaScript]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future runJavaScriptReturningResult(String? javaScript) => (super.noSuchMethod( + Invocation.method(#runJavaScriptReturningResult, [javaScript]), + returnValue: _i5.Future.value( + _FakeObject_1( + this, Invocation.method(#runJavaScriptReturningResult, [javaScript]), - returnValue: _i5.Future.value( - _FakeObject_1( - this, - Invocation.method(#runJavaScriptReturningResult, [javaScript]), - ), - ), - ) - as _i5.Future); + ), + ), + ) as _i5.Future); @override _i5.Future addJavaScriptChannel( _i4.JavaScriptChannelParams? javaScriptChannelParams, ) => (super.noSuchMethod( - Invocation.method(#addJavaScriptChannel, [javaScriptChannelParams]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#addJavaScriptChannel, [javaScriptChannelParams]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future removeJavaScriptChannel(String? javaScriptChannelName) => (super.noSuchMethod( - Invocation.method(#removeJavaScriptChannel, [ - javaScriptChannelName, - ]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#removeJavaScriptChannel, [ + javaScriptChannelName, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future getTitle() => - (super.noSuchMethod( - Invocation.method(#getTitle, []), - returnValue: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future getTitle() => (super.noSuchMethod( + Invocation.method(#getTitle, []), + returnValue: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future scrollTo(int? x, int? y) => - (super.noSuchMethod( - Invocation.method(#scrollTo, [x, y]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future scrollTo(int? x, int? y) => (super.noSuchMethod( + Invocation.method(#scrollTo, [x, y]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future scrollBy(int? x, int? y) => - (super.noSuchMethod( - Invocation.method(#scrollBy, [x, y]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future scrollBy(int? x, int? y) => (super.noSuchMethod( + Invocation.method(#scrollBy, [x, y]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setVerticalScrollBarEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setVerticalScrollBarEnabled, [enabled]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setVerticalScrollBarEnabled, [enabled]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setHorizontalScrollBarEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setHorizontalScrollBarEnabled, [enabled]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setHorizontalScrollBarEnabled, [enabled]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future<_i3.Offset> getScrollPosition() => - (super.noSuchMethod( - Invocation.method(#getScrollPosition, []), - returnValue: _i5.Future<_i3.Offset>.value( - _FakeOffset_2(this, Invocation.method(#getScrollPosition, [])), - ), - ) - as _i5.Future<_i3.Offset>); + _i5.Future<_i3.Offset> getScrollPosition() => (super.noSuchMethod( + Invocation.method(#getScrollPosition, []), + returnValue: _i5.Future<_i3.Offset>.value( + _FakeOffset_2(this, Invocation.method(#getScrollPosition, [])), + ), + ) as _i5.Future<_i3.Offset>); @override - _i5.Future enableZoom(bool? enabled) => - (super.noSuchMethod( - Invocation.method(#enableZoom, [enabled]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future enableZoom(bool? enabled) => (super.noSuchMethod( + Invocation.method(#enableZoom, [enabled]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future setBackgroundColor(_i3.Color? color) => - (super.noSuchMethod( - Invocation.method(#setBackgroundColor, [color]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future setBackgroundColor(_i3.Color? color) => (super.noSuchMethod( + Invocation.method(#setBackgroundColor, [color]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setJavaScriptMode(_i2.JavaScriptMode? javaScriptMode) => (super.noSuchMethod( - Invocation.method(#setJavaScriptMode, [javaScriptMode]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setJavaScriptMode, [javaScriptMode]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future setUserAgent(String? userAgent) => - (super.noSuchMethod( - Invocation.method(#setUserAgent, [userAgent]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future setUserAgent(String? userAgent) => (super.noSuchMethod( + Invocation.method(#setUserAgent, [userAgent]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setOnPlatformPermissionRequest( void Function(_i2.PlatformWebViewPermissionRequest)? onPermissionRequest, ) => (super.noSuchMethod( - Invocation.method(#setOnPlatformPermissionRequest, [ - onPermissionRequest, - ]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setOnPlatformPermissionRequest, [ + onPermissionRequest, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future getUserAgent() => - (super.noSuchMethod( - Invocation.method(#getUserAgent, []), - returnValue: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future getUserAgent() => (super.noSuchMethod( + Invocation.method(#getUserAgent, []), + returnValue: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setOnConsoleMessage( void Function(_i2.JavaScriptConsoleMessage)? onConsoleMessage, ) => (super.noSuchMethod( - Invocation.method(#setOnConsoleMessage, [onConsoleMessage]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setOnConsoleMessage, [onConsoleMessage]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setOnScrollPositionChange( void Function(_i2.ScrollPositionChange)? onScrollPositionChange, ) => (super.noSuchMethod( - Invocation.method(#setOnScrollPositionChange, [ - onScrollPositionChange, - ]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setOnScrollPositionChange, [ + onScrollPositionChange, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setOnJavaScriptAlertDialog( _i5.Future Function(_i2.JavaScriptAlertDialogRequest)? - onJavaScriptAlertDialog, + onJavaScriptAlertDialog, ) => (super.noSuchMethod( - Invocation.method(#setOnJavaScriptAlertDialog, [ - onJavaScriptAlertDialog, - ]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setOnJavaScriptAlertDialog, [ + onJavaScriptAlertDialog, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setOnJavaScriptConfirmDialog( _i5.Future Function(_i2.JavaScriptConfirmDialogRequest)? - onJavaScriptConfirmDialog, + onJavaScriptConfirmDialog, ) => (super.noSuchMethod( - Invocation.method(#setOnJavaScriptConfirmDialog, [ - onJavaScriptConfirmDialog, - ]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setOnJavaScriptConfirmDialog, [ + onJavaScriptConfirmDialog, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setOnJavaScriptTextInputDialog( _i5.Future Function(_i2.JavaScriptTextInputDialogRequest)? - onJavaScriptTextInputDialog, + onJavaScriptTextInputDialog, ) => (super.noSuchMethod( - Invocation.method(#setOnJavaScriptTextInputDialog, [ - onJavaScriptTextInputDialog, - ]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setOnJavaScriptTextInputDialog, [ + onJavaScriptTextInputDialog, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); } /// A class which mocks [PlatformNavigationDelegate]. @@ -423,89 +368,80 @@ class MockPlatformNavigationDelegate extends _i1.Mock @override _i2.PlatformNavigationDelegateCreationParams get params => (super.noSuchMethod( - Invocation.getter(#params), - returnValue: _FakePlatformNavigationDelegateCreationParams_3( - this, - Invocation.getter(#params), - ), - ) - as _i2.PlatformNavigationDelegateCreationParams); + Invocation.getter(#params), + returnValue: _FakePlatformNavigationDelegateCreationParams_3( + this, + Invocation.getter(#params), + ), + ) as _i2.PlatformNavigationDelegateCreationParams); @override _i5.Future setOnNavigationRequest( _i6.NavigationRequestCallback? onNavigationRequest, ) => (super.noSuchMethod( - Invocation.method(#setOnNavigationRequest, [onNavigationRequest]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setOnNavigationRequest, [onNavigationRequest]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setOnPageStarted(_i6.PageEventCallback? onPageStarted) => (super.noSuchMethod( - Invocation.method(#setOnPageStarted, [onPageStarted]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setOnPageStarted, [onPageStarted]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setOnPageFinished(_i6.PageEventCallback? onPageFinished) => (super.noSuchMethod( - Invocation.method(#setOnPageFinished, [onPageFinished]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setOnPageFinished, [onPageFinished]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setOnHttpError(_i6.HttpResponseErrorCallback? onHttpError) => (super.noSuchMethod( - Invocation.method(#setOnHttpError, [onHttpError]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setOnHttpError, [onHttpError]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setOnProgress(_i6.ProgressCallback? onProgress) => (super.noSuchMethod( - Invocation.method(#setOnProgress, [onProgress]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setOnProgress, [onProgress]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setOnWebResourceError( _i6.WebResourceErrorCallback? onWebResourceError, ) => (super.noSuchMethod( - Invocation.method(#setOnWebResourceError, [onWebResourceError]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setOnWebResourceError, [onWebResourceError]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setOnUrlChange(_i6.UrlChangeCallback? onUrlChange) => (super.noSuchMethod( - Invocation.method(#setOnUrlChange, [onUrlChange]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setOnUrlChange, [onUrlChange]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setOnHttpAuthRequest( _i6.HttpAuthRequestCallback? onHttpAuthRequest, ) => (super.noSuchMethod( - Invocation.method(#setOnHttpAuthRequest, [onHttpAuthRequest]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setOnHttpAuthRequest, [onHttpAuthRequest]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); } diff --git a/packages/webview_flutter/webview_flutter/test/webview_cookie_manager_test.mocks.dart b/packages/webview_flutter/webview_flutter/test/webview_cookie_manager_test.mocks.dart index c40d739926a..31b11889cb7 100644 --- a/packages/webview_flutter/webview_flutter/test/webview_cookie_manager_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter/test/webview_cookie_manager_test.mocks.dart @@ -44,28 +44,23 @@ class MockPlatformWebViewCookieManager extends _i1.Mock @override _i2.PlatformWebViewCookieManagerCreationParams get params => (super.noSuchMethod( - Invocation.getter(#params), - returnValue: _FakePlatformWebViewCookieManagerCreationParams_0( - this, - Invocation.getter(#params), - ), - ) - as _i2.PlatformWebViewCookieManagerCreationParams); + Invocation.getter(#params), + returnValue: _FakePlatformWebViewCookieManagerCreationParams_0( + this, + Invocation.getter(#params), + ), + ) as _i2.PlatformWebViewCookieManagerCreationParams); @override - _i4.Future clearCookies() => - (super.noSuchMethod( - Invocation.method(#clearCookies, []), - returnValue: _i4.Future.value(false), - ) - as _i4.Future); + _i4.Future clearCookies() => (super.noSuchMethod( + Invocation.method(#clearCookies, []), + returnValue: _i4.Future.value(false), + ) as _i4.Future); @override - _i4.Future setCookie(_i2.WebViewCookie? cookie) => - (super.noSuchMethod( - Invocation.method(#setCookie, [cookie]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future setCookie(_i2.WebViewCookie? cookie) => (super.noSuchMethod( + Invocation.method(#setCookie, [cookie]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); } diff --git a/packages/webview_flutter/webview_flutter/test/webview_widget_test.mocks.dart b/packages/webview_flutter/webview_flutter/test/webview_widget_test.mocks.dart index c9f1d0f75c5..c6f4c73ea39 100644 --- a/packages/webview_flutter/webview_flutter/test/webview_widget_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter/test/webview_widget_test.mocks.dart @@ -41,12 +41,12 @@ class _FakePlatformWebViewControllerCreationParams_0 extends _i1.SmartFake class _FakeObject_1 extends _i1.SmartFake implements Object { _FakeObject_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeOffset_2 extends _i1.SmartFake implements _i3.Offset { _FakeOffset_2(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakePlatformWebViewWidgetCreationParams_3 extends _i1.SmartFake @@ -59,7 +59,7 @@ class _FakePlatformWebViewWidgetCreationParams_3 extends _i1.SmartFake class _FakeWidget_4 extends _i1.SmartFake implements _i4.Widget { _FakeWidget_4(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); @override String toString({_i5.DiagnosticLevel? minLevel = _i5.DiagnosticLevel.info}) => @@ -76,352 +76,297 @@ class MockPlatformWebViewController extends _i1.Mock } @override - _i2.PlatformWebViewControllerCreationParams get params => - (super.noSuchMethod( - Invocation.getter(#params), - returnValue: _FakePlatformWebViewControllerCreationParams_0( - this, - Invocation.getter(#params), - ), - ) - as _i2.PlatformWebViewControllerCreationParams); + _i2.PlatformWebViewControllerCreationParams get params => (super.noSuchMethod( + Invocation.getter(#params), + returnValue: _FakePlatformWebViewControllerCreationParams_0( + this, + Invocation.getter(#params), + ), + ) as _i2.PlatformWebViewControllerCreationParams); @override - _i7.Future loadFile(String? absoluteFilePath) => - (super.noSuchMethod( - Invocation.method(#loadFile, [absoluteFilePath]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + _i7.Future loadFile(String? absoluteFilePath) => (super.noSuchMethod( + Invocation.method(#loadFile, [absoluteFilePath]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override - _i7.Future loadFlutterAsset(String? key) => - (super.noSuchMethod( - Invocation.method(#loadFlutterAsset, [key]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + _i7.Future loadFlutterAsset(String? key) => (super.noSuchMethod( + Invocation.method(#loadFlutterAsset, [key]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override _i7.Future loadHtmlString(String? html, {String? baseUrl}) => (super.noSuchMethod( - Invocation.method(#loadHtmlString, [html], {#baseUrl: baseUrl}), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + Invocation.method(#loadHtmlString, [html], {#baseUrl: baseUrl}), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override _i7.Future loadRequest(_i2.LoadRequestParams? params) => (super.noSuchMethod( - Invocation.method(#loadRequest, [params]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + Invocation.method(#loadRequest, [params]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override - _i7.Future currentUrl() => - (super.noSuchMethod( - Invocation.method(#currentUrl, []), - returnValue: _i7.Future.value(), - ) - as _i7.Future); + _i7.Future currentUrl() => (super.noSuchMethod( + Invocation.method(#currentUrl, []), + returnValue: _i7.Future.value(), + ) as _i7.Future); @override - _i7.Future canGoBack() => - (super.noSuchMethod( - Invocation.method(#canGoBack, []), - returnValue: _i7.Future.value(false), - ) - as _i7.Future); + _i7.Future canGoBack() => (super.noSuchMethod( + Invocation.method(#canGoBack, []), + returnValue: _i7.Future.value(false), + ) as _i7.Future); @override - _i7.Future canGoForward() => - (super.noSuchMethod( - Invocation.method(#canGoForward, []), - returnValue: _i7.Future.value(false), - ) - as _i7.Future); + _i7.Future canGoForward() => (super.noSuchMethod( + Invocation.method(#canGoForward, []), + returnValue: _i7.Future.value(false), + ) as _i7.Future); @override - _i7.Future goBack() => - (super.noSuchMethod( - Invocation.method(#goBack, []), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + _i7.Future goBack() => (super.noSuchMethod( + Invocation.method(#goBack, []), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override - _i7.Future goForward() => - (super.noSuchMethod( - Invocation.method(#goForward, []), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + _i7.Future goForward() => (super.noSuchMethod( + Invocation.method(#goForward, []), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override - _i7.Future reload() => - (super.noSuchMethod( - Invocation.method(#reload, []), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + _i7.Future reload() => (super.noSuchMethod( + Invocation.method(#reload, []), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override - _i7.Future clearCache() => - (super.noSuchMethod( - Invocation.method(#clearCache, []), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + _i7.Future clearCache() => (super.noSuchMethod( + Invocation.method(#clearCache, []), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override - _i7.Future clearLocalStorage() => - (super.noSuchMethod( - Invocation.method(#clearLocalStorage, []), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + _i7.Future clearLocalStorage() => (super.noSuchMethod( + Invocation.method(#clearLocalStorage, []), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override _i7.Future setPlatformNavigationDelegate( _i8.PlatformNavigationDelegate? handler, ) => (super.noSuchMethod( - Invocation.method(#setPlatformNavigationDelegate, [handler]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + Invocation.method(#setPlatformNavigationDelegate, [handler]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override - _i7.Future runJavaScript(String? javaScript) => - (super.noSuchMethod( - Invocation.method(#runJavaScript, [javaScript]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + _i7.Future runJavaScript(String? javaScript) => (super.noSuchMethod( + Invocation.method(#runJavaScript, [javaScript]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override _i7.Future runJavaScriptReturningResult(String? javaScript) => (super.noSuchMethod( + Invocation.method(#runJavaScriptReturningResult, [javaScript]), + returnValue: _i7.Future.value( + _FakeObject_1( + this, Invocation.method(#runJavaScriptReturningResult, [javaScript]), - returnValue: _i7.Future.value( - _FakeObject_1( - this, - Invocation.method(#runJavaScriptReturningResult, [javaScript]), - ), - ), - ) - as _i7.Future); + ), + ), + ) as _i7.Future); @override _i7.Future addJavaScriptChannel( _i6.JavaScriptChannelParams? javaScriptChannelParams, ) => (super.noSuchMethod( - Invocation.method(#addJavaScriptChannel, [javaScriptChannelParams]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + Invocation.method(#addJavaScriptChannel, [javaScriptChannelParams]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override _i7.Future removeJavaScriptChannel(String? javaScriptChannelName) => (super.noSuchMethod( - Invocation.method(#removeJavaScriptChannel, [ - javaScriptChannelName, - ]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + Invocation.method(#removeJavaScriptChannel, [ + javaScriptChannelName, + ]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override - _i7.Future getTitle() => - (super.noSuchMethod( - Invocation.method(#getTitle, []), - returnValue: _i7.Future.value(), - ) - as _i7.Future); + _i7.Future getTitle() => (super.noSuchMethod( + Invocation.method(#getTitle, []), + returnValue: _i7.Future.value(), + ) as _i7.Future); @override - _i7.Future scrollTo(int? x, int? y) => - (super.noSuchMethod( - Invocation.method(#scrollTo, [x, y]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + _i7.Future scrollTo(int? x, int? y) => (super.noSuchMethod( + Invocation.method(#scrollTo, [x, y]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override - _i7.Future scrollBy(int? x, int? y) => - (super.noSuchMethod( - Invocation.method(#scrollBy, [x, y]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + _i7.Future scrollBy(int? x, int? y) => (super.noSuchMethod( + Invocation.method(#scrollBy, [x, y]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override _i7.Future setVerticalScrollBarEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setVerticalScrollBarEnabled, [enabled]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + Invocation.method(#setVerticalScrollBarEnabled, [enabled]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override _i7.Future setHorizontalScrollBarEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setHorizontalScrollBarEnabled, [enabled]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + Invocation.method(#setHorizontalScrollBarEnabled, [enabled]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override - _i7.Future<_i3.Offset> getScrollPosition() => - (super.noSuchMethod( - Invocation.method(#getScrollPosition, []), - returnValue: _i7.Future<_i3.Offset>.value( - _FakeOffset_2(this, Invocation.method(#getScrollPosition, [])), - ), - ) - as _i7.Future<_i3.Offset>); + _i7.Future<_i3.Offset> getScrollPosition() => (super.noSuchMethod( + Invocation.method(#getScrollPosition, []), + returnValue: _i7.Future<_i3.Offset>.value( + _FakeOffset_2(this, Invocation.method(#getScrollPosition, [])), + ), + ) as _i7.Future<_i3.Offset>); @override - _i7.Future enableZoom(bool? enabled) => - (super.noSuchMethod( - Invocation.method(#enableZoom, [enabled]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + _i7.Future enableZoom(bool? enabled) => (super.noSuchMethod( + Invocation.method(#enableZoom, [enabled]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override - _i7.Future setBackgroundColor(_i3.Color? color) => - (super.noSuchMethod( - Invocation.method(#setBackgroundColor, [color]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + _i7.Future setBackgroundColor(_i3.Color? color) => (super.noSuchMethod( + Invocation.method(#setBackgroundColor, [color]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override _i7.Future setJavaScriptMode(_i2.JavaScriptMode? javaScriptMode) => (super.noSuchMethod( - Invocation.method(#setJavaScriptMode, [javaScriptMode]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + Invocation.method(#setJavaScriptMode, [javaScriptMode]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override - _i7.Future setUserAgent(String? userAgent) => - (super.noSuchMethod( - Invocation.method(#setUserAgent, [userAgent]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + _i7.Future setUserAgent(String? userAgent) => (super.noSuchMethod( + Invocation.method(#setUserAgent, [userAgent]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override _i7.Future setOnPlatformPermissionRequest( void Function(_i2.PlatformWebViewPermissionRequest)? onPermissionRequest, ) => (super.noSuchMethod( - Invocation.method(#setOnPlatformPermissionRequest, [ - onPermissionRequest, - ]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + Invocation.method(#setOnPlatformPermissionRequest, [ + onPermissionRequest, + ]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override - _i7.Future getUserAgent() => - (super.noSuchMethod( - Invocation.method(#getUserAgent, []), - returnValue: _i7.Future.value(), - ) - as _i7.Future); + _i7.Future getUserAgent() => (super.noSuchMethod( + Invocation.method(#getUserAgent, []), + returnValue: _i7.Future.value(), + ) as _i7.Future); @override _i7.Future setOnConsoleMessage( void Function(_i2.JavaScriptConsoleMessage)? onConsoleMessage, ) => (super.noSuchMethod( - Invocation.method(#setOnConsoleMessage, [onConsoleMessage]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + Invocation.method(#setOnConsoleMessage, [onConsoleMessage]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override _i7.Future setOnScrollPositionChange( void Function(_i2.ScrollPositionChange)? onScrollPositionChange, ) => (super.noSuchMethod( - Invocation.method(#setOnScrollPositionChange, [ - onScrollPositionChange, - ]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + Invocation.method(#setOnScrollPositionChange, [ + onScrollPositionChange, + ]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override _i7.Future setOnJavaScriptAlertDialog( _i7.Future Function(_i2.JavaScriptAlertDialogRequest)? - onJavaScriptAlertDialog, + onJavaScriptAlertDialog, ) => (super.noSuchMethod( - Invocation.method(#setOnJavaScriptAlertDialog, [ - onJavaScriptAlertDialog, - ]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + Invocation.method(#setOnJavaScriptAlertDialog, [ + onJavaScriptAlertDialog, + ]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override _i7.Future setOnJavaScriptConfirmDialog( _i7.Future Function(_i2.JavaScriptConfirmDialogRequest)? - onJavaScriptConfirmDialog, + onJavaScriptConfirmDialog, ) => (super.noSuchMethod( - Invocation.method(#setOnJavaScriptConfirmDialog, [ - onJavaScriptConfirmDialog, - ]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + Invocation.method(#setOnJavaScriptConfirmDialog, [ + onJavaScriptConfirmDialog, + ]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override _i7.Future setOnJavaScriptTextInputDialog( _i7.Future Function(_i2.JavaScriptTextInputDialogRequest)? - onJavaScriptTextInputDialog, + onJavaScriptTextInputDialog, ) => (super.noSuchMethod( - Invocation.method(#setOnJavaScriptTextInputDialog, [ - onJavaScriptTextInputDialog, - ]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + Invocation.method(#setOnJavaScriptTextInputDialog, [ + onJavaScriptTextInputDialog, + ]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); } /// A class which mocks [PlatformWebViewWidget]. @@ -434,24 +379,20 @@ class MockPlatformWebViewWidget extends _i1.Mock } @override - _i2.PlatformWebViewWidgetCreationParams get params => - (super.noSuchMethod( - Invocation.getter(#params), - returnValue: _FakePlatformWebViewWidgetCreationParams_3( - this, - Invocation.getter(#params), - ), - ) - as _i2.PlatformWebViewWidgetCreationParams); + _i2.PlatformWebViewWidgetCreationParams get params => (super.noSuchMethod( + Invocation.getter(#params), + returnValue: _FakePlatformWebViewWidgetCreationParams_3( + this, + Invocation.getter(#params), + ), + ) as _i2.PlatformWebViewWidgetCreationParams); @override - _i4.Widget build(_i4.BuildContext? context) => - (super.noSuchMethod( - Invocation.method(#build, [context]), - returnValue: _FakeWidget_4( - this, - Invocation.method(#build, [context]), - ), - ) - as _i4.Widget); + _i4.Widget build(_i4.BuildContext? context) => (super.noSuchMethod( + Invocation.method(#build, [context]), + returnValue: _FakeWidget_4( + this, + Invocation.method(#build, [context]), + ), + ) as _i4.Widget); } diff --git a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/AndroidWebkitLibrary.g.kt b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/AndroidWebkitLibrary.g.kt index 2e3845b3805..fae5fc19707 100644 --- a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/AndroidWebkitLibrary.g.kt +++ b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/AndroidWebkitLibrary.g.kt @@ -10,9 +10,7 @@ package io.flutter.plugins.webviewflutter import android.util.Log import io.flutter.plugin.common.BasicMessageChannel import io.flutter.plugin.common.BinaryMessenger -import io.flutter.plugin.common.EventChannel import io.flutter.plugin.common.MessageCodec -import io.flutter.plugin.common.StandardMethodCodec import io.flutter.plugin.common.StandardMessageCodec import java.io.ByteArrayOutputStream import java.nio.ByteBuffer @@ -23,52 +21,52 @@ private fun wrapResult(result: Any?): List { private fun wrapError(exception: Throwable): List { return if (exception is AndroidWebKitError) { - listOf( - exception.code, - exception.message, - exception.details - ) + listOf(exception.code, exception.message, exception.details) } else { listOf( - exception.javaClass.simpleName, - exception.toString(), - "Cause: " + exception.cause + ", Stacktrace: " + Log.getStackTraceString(exception) - ) + exception.javaClass.simpleName, + exception.toString(), + "Cause: " + exception.cause + ", Stacktrace: " + Log.getStackTraceString(exception)) } } private fun createConnectionError(channelName: String): AndroidWebKitError { - return AndroidWebKitError("channel-error", "Unable to establish connection on channel: '$channelName'.", "")} + return AndroidWebKitError( + "channel-error", "Unable to establish connection on channel: '$channelName'.", "") +} /** * Error class for passing custom error details to Flutter via a thrown PlatformException. + * * @property code The error code. * @property message The error message. * @property details The error details. Must be a datatype supported by the api codec. */ -class AndroidWebKitError ( - val code: String, - override val message: String? = null, - val details: Any? = null +class AndroidWebKitError( + val code: String, + override val message: String? = null, + val details: Any? = null ) : Throwable() /** * Maintains instances used to communicate with the corresponding objects in Dart. * - * Objects stored in this container are represented by an object in Dart that is also stored in - * an InstanceManager with the same identifier. + * Objects stored in this container are represented by an object in Dart that is also stored in an + * InstanceManager with the same identifier. * * When an instance is added with an identifier, either can be used to retrieve the other. * - * Added instances are added as a weak reference and a strong reference. When the strong - * reference is removed with [remove] and the weak reference is deallocated, the - * `finalizationListener.onFinalize` is called with the instance's identifier. However, if the strong - * reference is removed and then the identifier is retrieved with the intention to pass the identifier - * to Dart (e.g. calling [getIdentifierForStrongReference]), the strong reference to the instance - * is recreated. The strong reference will then need to be removed manually again. + * Added instances are added as a weak reference and a strong reference. When the strong reference + * is removed with [remove] and the weak reference is deallocated, the + * `finalizationListener.onFinalize` is called with the instance's identifier. However, if the + * strong reference is removed and then the identifier is retrieved with the intention to pass the + * identifier to Dart (e.g. calling [getIdentifierForStrongReference]), the strong reference to the + * instance is recreated. The strong reference will then need to be removed manually again. */ @Suppress("UNCHECKED_CAST", "MemberVisibilityCanBePrivate") -class AndroidWebkitLibraryPigeonInstanceManager(private val finalizationListener: PigeonFinalizationListener) { - /** Interface for listening when a weak reference of an instance is removed from the manager. */ +class AndroidWebkitLibraryPigeonInstanceManager( + private val finalizationListener: PigeonFinalizationListener +) { + /** Interface for listening when a weak reference of an instance is removed from the manager. */ interface PigeonFinalizationListener { fun onFinalize(identifier: Long) } @@ -94,10 +92,7 @@ class AndroidWebkitLibraryPigeonInstanceManager(private val finalizationListener } init { - handler.postDelayed( - { releaseAllFinalizedInstances() }, - clearFinalizedWeakReferencesInterval - ) + handler.postDelayed({ releaseAllFinalizedInstances() }, clearFinalizedWeakReferencesInterval) } companion object { @@ -109,19 +104,20 @@ class AndroidWebkitLibraryPigeonInstanceManager(private val finalizationListener private const val tag = "PigeonInstanceManager" /** - * Instantiate a new manager with a listener for garbage collected weak - * references. + * Instantiate a new manager with a listener for garbage collected weak references. * * When the manager is no longer needed, [stopFinalizationListener] must be called. */ - fun create(finalizationListener: PigeonFinalizationListener): AndroidWebkitLibraryPigeonInstanceManager { + fun create( + finalizationListener: PigeonFinalizationListener + ): AndroidWebkitLibraryPigeonInstanceManager { return AndroidWebkitLibraryPigeonInstanceManager(finalizationListener) } } /** - * Removes `identifier` and return its associated strongly referenced instance, if present, - * from the manager. + * Removes `identifier` and return its associated strongly referenced instance, if present, from + * the manager. */ fun remove(identifier: Long): T? { logWarningIfFinalizationListenerHasStopped() @@ -131,15 +127,13 @@ class AndroidWebkitLibraryPigeonInstanceManager(private val finalizationListener /** * Retrieves the identifier paired with an instance, if present, otherwise `null`. * - * * If the manager contains a strong reference to `instance`, it will return the identifier * associated with `instance`. If the manager contains only a weak reference to `instance`, a new * strong reference to `instance` will be added and will need to be removed again with [remove]. * - * * If this method returns a nonnull identifier, this method also expects the Dart - * `AndroidWebkitLibraryPigeonInstanceManager` to have, or recreate, a weak reference to the Dart instance the - * identifier is associated with. + * `AndroidWebkitLibraryPigeonInstanceManager` to have, or recreate, a weak reference to the Dart + * instance the identifier is associated with. */ fun getIdentifierForStrongReference(instance: Any?): Long? { logWarningIfFinalizationListenerHasStopped() @@ -153,9 +147,9 @@ class AndroidWebkitLibraryPigeonInstanceManager(private val finalizationListener /** * Adds a new instance that was instantiated from Dart. * - * The same instance can be added multiple times, but each identifier must be unique. This - * allows two objects that are equivalent (e.g. the `equals` method returns true and their - * hashcodes are equal) to both be added. + * The same instance can be added multiple times, but each identifier must be unique. This allows + * two objects that are equivalent (e.g. the `equals` method returns true and their hashcodes are + * equal) to both be added. * * [identifier] must be >= 0 and unique. */ @@ -171,7 +165,9 @@ class AndroidWebkitLibraryPigeonInstanceManager(private val finalizationListener */ fun addHostCreatedInstance(instance: Any): Long { logWarningIfFinalizationListenerHasStopped() - require(!containsInstance(instance)) { "Instance of ${instance.javaClass} has already been added." } + require(!containsInstance(instance)) { + "Instance of ${instance.javaClass} has already been added." + } val identifier = nextIdentifier++ addInstance(instance, identifier) return identifier @@ -229,7 +225,8 @@ class AndroidWebkitLibraryPigeonInstanceManager(private val finalizationListener return } var reference: java.lang.ref.WeakReference? - while ((referenceQueue.poll() as java.lang.ref.WeakReference?).also { reference = it } != null) { + while ((referenceQueue.poll() as java.lang.ref.WeakReference?).also { reference = it } != + null) { val identifier = weakReferencesToIdentifiers.remove(reference) if (identifier != null) { weakInstances.remove(identifier) @@ -237,10 +234,7 @@ class AndroidWebkitLibraryPigeonInstanceManager(private val finalizationListener finalizationListener.onFinalize(identifier) } } - handler.postDelayed( - { releaseAllFinalizedInstances() }, - clearFinalizedWeakReferencesInterval - ) + handler.postDelayed({ releaseAllFinalizedInstances() }, clearFinalizedWeakReferencesInterval) } private fun addInstance(instance: Any, identifier: Long) { @@ -258,39 +252,43 @@ class AndroidWebkitLibraryPigeonInstanceManager(private val finalizationListener private fun logWarningIfFinalizationListenerHasStopped() { if (hasFinalizationListenerStopped()) { Log.w( - tag, - "The manager was used after calls to the PigeonFinalizationListener has been stopped." - ) + tag, + "The manager was used after calls to the PigeonFinalizationListener has been stopped.") } } } - /** Generated API for managing the Dart and native `InstanceManager`s. */ private class AndroidWebkitLibraryPigeonInstanceManagerApi(val binaryMessenger: BinaryMessenger) { companion object { /** The codec used by AndroidWebkitLibraryPigeonInstanceManagerApi. */ - val codec: MessageCodec by lazy { - AndroidWebkitLibraryPigeonCodec() - } + val codec: MessageCodec by lazy { AndroidWebkitLibraryPigeonCodec() } /** - * Sets up an instance of `AndroidWebkitLibraryPigeonInstanceManagerApi` to handle messages from the - * `binaryMessenger`. + * Sets up an instance of `AndroidWebkitLibraryPigeonInstanceManagerApi` to handle messages from + * the `binaryMessenger`. */ - fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, instanceManager: AndroidWebkitLibraryPigeonInstanceManager?) { + fun setUpMessageHandlers( + binaryMessenger: BinaryMessenger, + instanceManager: AndroidWebkitLibraryPigeonInstanceManager? + ) { run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.PigeonInternalInstanceManager.removeStrongReference", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.PigeonInternalInstanceManager.removeStrongReference", + codec) if (instanceManager != null) { channel.setMessageHandler { message, reply -> val args = message as List val identifierArg = args[0] as Long - val wrapped: List = try { - instanceManager.remove(identifierArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + instanceManager.remove(identifierArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -298,15 +296,20 @@ private class AndroidWebkitLibraryPigeonInstanceManagerApi(val binaryMessenger: } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.PigeonInternalInstanceManager.clear", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.PigeonInternalInstanceManager.clear", + codec) if (instanceManager != null) { channel.setMessageHandler { _, reply -> - val wrapped: List = try { - instanceManager.clear() - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + instanceManager.clear() + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -316,26 +319,28 @@ private class AndroidWebkitLibraryPigeonInstanceManagerApi(val binaryMessenger: } } - fun removeStrongReference(identifierArg: Long, callback: (Result) -> Unit) -{ - val channelName = "dev.flutter.pigeon.webview_flutter_android.PigeonInternalInstanceManager.removeStrongReference" + fun removeStrongReference(identifierArg: Long, callback: (Result) -> Unit) { + val channelName = + "dev.flutter.pigeon.webview_flutter_android.PigeonInternalInstanceManager.removeStrongReference" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } } /** - * Provides implementations for each ProxyApi implementation and provides access to resources - * needed by any implementation. + * Provides implementations for each ProxyApi implementation and provides access to resources needed + * by any implementation. */ abstract class AndroidWebkitLibraryPigeonProxyApiRegistrar(val binaryMessenger: BinaryMessenger) { /** Whether APIs should ignore calling to Dart. */ @@ -352,20 +357,19 @@ abstract class AndroidWebkitLibraryPigeonProxyApiRegistrar(val binaryMessenger: init { val api = AndroidWebkitLibraryPigeonInstanceManagerApi(binaryMessenger) - instanceManager = AndroidWebkitLibraryPigeonInstanceManager.create( - object : AndroidWebkitLibraryPigeonInstanceManager.PigeonFinalizationListener { - override fun onFinalize(identifier: Long) { - api.removeStrongReference(identifier) { - if (it.isFailure) { - Log.e( - "PigeonProxyApiRegistrar", - "Failed to remove Dart strong reference with identifier: $identifier" - ) - } - } - } - } - ) + instanceManager = + AndroidWebkitLibraryPigeonInstanceManager.create( + object : AndroidWebkitLibraryPigeonInstanceManager.PigeonFinalizationListener { + override fun onFinalize(identifier: Long) { + api.removeStrongReference(identifier) { + if (it.isFailure) { + Log.e( + "PigeonProxyApiRegistrar", + "Failed to remove Dart strong reference with identifier: $identifier") + } + } + } + }) } /** * An implementation of [PigeonApiWebResourceRequest] used to add a new Dart instance of @@ -392,8 +396,8 @@ abstract class AndroidWebkitLibraryPigeonProxyApiRegistrar(val binaryMessenger: abstract fun getPigeonApiWebResourceErrorCompat(): PigeonApiWebResourceErrorCompat /** - * An implementation of [PigeonApiWebViewPoint] used to add a new Dart instance of - * `WebViewPoint` to the Dart `InstanceManager`. + * An implementation of [PigeonApiWebViewPoint] used to add a new Dart instance of `WebViewPoint` + * to the Dart `InstanceManager`. */ abstract fun getPigeonApiWebViewPoint(): PigeonApiWebViewPoint @@ -410,14 +414,14 @@ abstract class AndroidWebkitLibraryPigeonProxyApiRegistrar(val binaryMessenger: abstract fun getPigeonApiCookieManager(): PigeonApiCookieManager /** - * An implementation of [PigeonApiWebView] used to add a new Dart instance of - * `WebView` to the Dart `InstanceManager`. + * An implementation of [PigeonApiWebView] used to add a new Dart instance of `WebView` to the + * Dart `InstanceManager`. */ abstract fun getPigeonApiWebView(): PigeonApiWebView /** - * An implementation of [PigeonApiWebSettings] used to add a new Dart instance of - * `WebSettings` to the Dart `InstanceManager`. + * An implementation of [PigeonApiWebSettings] used to add a new Dart instance of `WebSettings` to + * the Dart `InstanceManager`. */ abstract fun getPigeonApiWebSettings(): PigeonApiWebSettings @@ -452,8 +456,8 @@ abstract class AndroidWebkitLibraryPigeonProxyApiRegistrar(val binaryMessenger: abstract fun getPigeonApiFlutterAssetManager(): PigeonApiFlutterAssetManager /** - * An implementation of [PigeonApiWebStorage] used to add a new Dart instance of - * `WebStorage` to the Dart `InstanceManager`. + * An implementation of [PigeonApiWebStorage] used to add a new Dart instance of `WebStorage` to + * the Dart `InstanceManager`. */ abstract fun getPigeonApiWebStorage(): PigeonApiWebStorage @@ -476,14 +480,14 @@ abstract class AndroidWebkitLibraryPigeonProxyApiRegistrar(val binaryMessenger: abstract fun getPigeonApiCustomViewCallback(): PigeonApiCustomViewCallback /** - * An implementation of [PigeonApiView] used to add a new Dart instance of - * `View` to the Dart `InstanceManager`. + * An implementation of [PigeonApiView] used to add a new Dart instance of `View` to the Dart + * `InstanceManager`. */ abstract fun getPigeonApiView(): PigeonApiView /** - * An implementation of [PigeonApiGeolocationPermissionsCallback] used to add a new Dart instance of - * `GeolocationPermissionsCallback` to the Dart `InstanceManager`. + * An implementation of [PigeonApiGeolocationPermissionsCallback] used to add a new Dart instance + * of `GeolocationPermissionsCallback` to the Dart `InstanceManager`. */ abstract fun getPigeonApiGeolocationPermissionsCallback(): PigeonApiGeolocationPermissionsCallback @@ -494,22 +498,29 @@ abstract class AndroidWebkitLibraryPigeonProxyApiRegistrar(val binaryMessenger: abstract fun getPigeonApiHttpAuthHandler(): PigeonApiHttpAuthHandler fun setUp() { - AndroidWebkitLibraryPigeonInstanceManagerApi.setUpMessageHandlers(binaryMessenger, instanceManager) + AndroidWebkitLibraryPigeonInstanceManagerApi.setUpMessageHandlers( + binaryMessenger, instanceManager) PigeonApiCookieManager.setUpMessageHandlers(binaryMessenger, getPigeonApiCookieManager()) PigeonApiWebView.setUpMessageHandlers(binaryMessenger, getPigeonApiWebView()) PigeonApiWebSettings.setUpMessageHandlers(binaryMessenger, getPigeonApiWebSettings()) - PigeonApiJavaScriptChannel.setUpMessageHandlers(binaryMessenger, getPigeonApiJavaScriptChannel()) + PigeonApiJavaScriptChannel.setUpMessageHandlers( + binaryMessenger, getPigeonApiJavaScriptChannel()) PigeonApiWebViewClient.setUpMessageHandlers(binaryMessenger, getPigeonApiWebViewClient()) PigeonApiDownloadListener.setUpMessageHandlers(binaryMessenger, getPigeonApiDownloadListener()) PigeonApiWebChromeClient.setUpMessageHandlers(binaryMessenger, getPigeonApiWebChromeClient()) - PigeonApiFlutterAssetManager.setUpMessageHandlers(binaryMessenger, getPigeonApiFlutterAssetManager()) + PigeonApiFlutterAssetManager.setUpMessageHandlers( + binaryMessenger, getPigeonApiFlutterAssetManager()) PigeonApiWebStorage.setUpMessageHandlers(binaryMessenger, getPigeonApiWebStorage()) - PigeonApiPermissionRequest.setUpMessageHandlers(binaryMessenger, getPigeonApiPermissionRequest()) - PigeonApiCustomViewCallback.setUpMessageHandlers(binaryMessenger, getPigeonApiCustomViewCallback()) + PigeonApiPermissionRequest.setUpMessageHandlers( + binaryMessenger, getPigeonApiPermissionRequest()) + PigeonApiCustomViewCallback.setUpMessageHandlers( + binaryMessenger, getPigeonApiCustomViewCallback()) PigeonApiView.setUpMessageHandlers(binaryMessenger, getPigeonApiView()) - PigeonApiGeolocationPermissionsCallback.setUpMessageHandlers(binaryMessenger, getPigeonApiGeolocationPermissionsCallback()) + PigeonApiGeolocationPermissionsCallback.setUpMessageHandlers( + binaryMessenger, getPigeonApiGeolocationPermissionsCallback()) PigeonApiHttpAuthHandler.setUpMessageHandlers(binaryMessenger, getPigeonApiHttpAuthHandler()) } + fun tearDown() { AndroidWebkitLibraryPigeonInstanceManagerApi.setUpMessageHandlers(binaryMessenger, null) PigeonApiCookieManager.setUpMessageHandlers(binaryMessenger, null) @@ -528,7 +539,10 @@ abstract class AndroidWebkitLibraryPigeonProxyApiRegistrar(val binaryMessenger: PigeonApiHttpAuthHandler.setUpMessageHandlers(binaryMessenger, null) } } -private class AndroidWebkitLibraryPigeonProxyApiBaseCodec(val registrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) : AndroidWebkitLibraryPigeonCodec() { + +private class AndroidWebkitLibraryPigeonProxyApiBaseCodec( + val registrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) : AndroidWebkitLibraryPigeonCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { 128.toByte() -> { @@ -539,73 +553,68 @@ private class AndroidWebkitLibraryPigeonProxyApiBaseCodec(val registrar: Android } override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { - if (value is Boolean || value is ByteArray || value is Double || value is DoubleArray || value is FloatArray || value is Int || value is IntArray || value is List<*> || value is Long || value is LongArray || value is Map<*, *> || value is String || value is FileChooserMode || value is ConsoleMessageLevel || value == null) { + if (value is Boolean || + value is ByteArray || + value is Double || + value is DoubleArray || + value is FloatArray || + value is Int || + value is IntArray || + value is List<*> || + value is Long || + value is LongArray || + value is Map<*, *> || + value is String || + value is FileChooserMode || + value is ConsoleMessageLevel || + value == null) { super.writeValue(stream, value) return } if (value is android.webkit.WebResourceRequest) { - registrar.getPigeonApiWebResourceRequest().pigeon_newInstance(value) { } - } - else if (value is android.webkit.WebResourceResponse) { - registrar.getPigeonApiWebResourceResponse().pigeon_newInstance(value) { } - } - else if (android.os.Build.VERSION.SDK_INT >= 23 && value is android.webkit.WebResourceError) { - registrar.getPigeonApiWebResourceError().pigeon_newInstance(value) { } - } - else if (value is androidx.webkit.WebResourceErrorCompat) { - registrar.getPigeonApiWebResourceErrorCompat().pigeon_newInstance(value) { } - } - else if (value is WebViewPoint) { - registrar.getPigeonApiWebViewPoint().pigeon_newInstance(value) { } - } - else if (value is android.webkit.ConsoleMessage) { - registrar.getPigeonApiConsoleMessage().pigeon_newInstance(value) { } - } - else if (value is android.webkit.CookieManager) { - registrar.getPigeonApiCookieManager().pigeon_newInstance(value) { } - } - else if (value is android.webkit.WebView) { - registrar.getPigeonApiWebView().pigeon_newInstance(value) { } - } - else if (value is android.webkit.WebSettings) { - registrar.getPigeonApiWebSettings().pigeon_newInstance(value) { } - } - else if (value is JavaScriptChannel) { - registrar.getPigeonApiJavaScriptChannel().pigeon_newInstance(value) { } - } - else if (value is android.webkit.WebViewClient) { - registrar.getPigeonApiWebViewClient().pigeon_newInstance(value) { } - } - else if (value is android.webkit.DownloadListener) { - registrar.getPigeonApiDownloadListener().pigeon_newInstance(value) { } - } - else if (value is io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl) { - registrar.getPigeonApiWebChromeClient().pigeon_newInstance(value) { } - } - else if (value is io.flutter.plugins.webviewflutter.FlutterAssetManager) { - registrar.getPigeonApiFlutterAssetManager().pigeon_newInstance(value) { } - } - else if (value is android.webkit.WebStorage) { - registrar.getPigeonApiWebStorage().pigeon_newInstance(value) { } - } - else if (value is android.webkit.WebChromeClient.FileChooserParams) { - registrar.getPigeonApiFileChooserParams().pigeon_newInstance(value) { } - } - else if (value is android.webkit.PermissionRequest) { - registrar.getPigeonApiPermissionRequest().pigeon_newInstance(value) { } - } - else if (value is android.webkit.WebChromeClient.CustomViewCallback) { - registrar.getPigeonApiCustomViewCallback().pigeon_newInstance(value) { } - } - else if (value is android.view.View) { - registrar.getPigeonApiView().pigeon_newInstance(value) { } - } - else if (value is android.webkit.GeolocationPermissions.Callback) { - registrar.getPigeonApiGeolocationPermissionsCallback().pigeon_newInstance(value) { } - } - else if (value is android.webkit.HttpAuthHandler) { - registrar.getPigeonApiHttpAuthHandler().pigeon_newInstance(value) { } + registrar.getPigeonApiWebResourceRequest().pigeon_newInstance(value) {} + } else if (value is android.webkit.WebResourceResponse) { + registrar.getPigeonApiWebResourceResponse().pigeon_newInstance(value) {} + } else if (android.os.Build.VERSION.SDK_INT >= 23 && value is android.webkit.WebResourceError) { + registrar.getPigeonApiWebResourceError().pigeon_newInstance(value) {} + } else if (value is androidx.webkit.WebResourceErrorCompat) { + registrar.getPigeonApiWebResourceErrorCompat().pigeon_newInstance(value) {} + } else if (value is WebViewPoint) { + registrar.getPigeonApiWebViewPoint().pigeon_newInstance(value) {} + } else if (value is android.webkit.ConsoleMessage) { + registrar.getPigeonApiConsoleMessage().pigeon_newInstance(value) {} + } else if (value is android.webkit.CookieManager) { + registrar.getPigeonApiCookieManager().pigeon_newInstance(value) {} + } else if (value is android.webkit.WebView) { + registrar.getPigeonApiWebView().pigeon_newInstance(value) {} + } else if (value is android.webkit.WebSettings) { + registrar.getPigeonApiWebSettings().pigeon_newInstance(value) {} + } else if (value is JavaScriptChannel) { + registrar.getPigeonApiJavaScriptChannel().pigeon_newInstance(value) {} + } else if (value is android.webkit.WebViewClient) { + registrar.getPigeonApiWebViewClient().pigeon_newInstance(value) {} + } else if (value is android.webkit.DownloadListener) { + registrar.getPigeonApiDownloadListener().pigeon_newInstance(value) {} + } else if (value + is io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl) { + registrar.getPigeonApiWebChromeClient().pigeon_newInstance(value) {} + } else if (value is io.flutter.plugins.webviewflutter.FlutterAssetManager) { + registrar.getPigeonApiFlutterAssetManager().pigeon_newInstance(value) {} + } else if (value is android.webkit.WebStorage) { + registrar.getPigeonApiWebStorage().pigeon_newInstance(value) {} + } else if (value is android.webkit.WebChromeClient.FileChooserParams) { + registrar.getPigeonApiFileChooserParams().pigeon_newInstance(value) {} + } else if (value is android.webkit.PermissionRequest) { + registrar.getPigeonApiPermissionRequest().pigeon_newInstance(value) {} + } else if (value is android.webkit.WebChromeClient.CustomViewCallback) { + registrar.getPigeonApiCustomViewCallback().pigeon_newInstance(value) {} + } else if (value is android.view.View) { + registrar.getPigeonApiView().pigeon_newInstance(value) {} + } else if (value is android.webkit.GeolocationPermissions.Callback) { + registrar.getPigeonApiGeolocationPermissionsCallback().pigeon_newInstance(value) {} + } else if (value is android.webkit.HttpAuthHandler) { + registrar.getPigeonApiHttpAuthHandler().pigeon_newInstance(value) {} } when { @@ -613,7 +622,9 @@ private class AndroidWebkitLibraryPigeonProxyApiBaseCodec(val registrar: Android stream.write(128) writeValue(stream, registrar.instanceManager.getIdentifierForStrongReference(value)) } - else -> throw IllegalArgumentException("Unsupported value: '$value' of type '${value.javaClass.name}'") + else -> + throw IllegalArgumentException( + "Unsupported value: '$value' of type '${value.javaClass.name}'") } } } @@ -625,29 +636,31 @@ private class AndroidWebkitLibraryPigeonProxyApiBaseCodec(val registrar: Android */ enum class FileChooserMode(val raw: Int) { /** - * Open single file and requires that the file exists before allowing the - * user to pick it. + * Open single file and requires that the file exists before allowing the user to pick it. * - * See https://developer.android.com/reference/android/webkit/WebChromeClient.FileChooserParams#MODE_OPEN. + * See + * https://developer.android.com/reference/android/webkit/WebChromeClient.FileChooserParams#MODE_OPEN. */ OPEN(0), /** * Similar to [open] but allows multiple files to be selected. * - * See https://developer.android.com/reference/android/webkit/WebChromeClient.FileChooserParams#MODE_OPEN_MULTIPLE. + * See + * https://developer.android.com/reference/android/webkit/WebChromeClient.FileChooserParams#MODE_OPEN_MULTIPLE. */ OPEN_MULTIPLE(1), /** * Allows picking a nonexistent file and saving it. * - * See https://developer.android.com/reference/android/webkit/WebChromeClient.FileChooserParams#MODE_SAVE. + * See + * https://developer.android.com/reference/android/webkit/WebChromeClient.FileChooserParams#MODE_SAVE. */ SAVE(2), /** * Indicates a `FileChooserMode` with an unknown mode. * - * This does not represent an actual value provided by the platform and only - * indicates a value was provided that isn't currently supported. + * This does not represent an actual value provided by the platform and only indicates a value was + * provided that isn't currently supported. */ UNKNOWN(3); @@ -697,8 +710,8 @@ enum class ConsoleMessageLevel(val raw: Int) { /** * Indicates a message with an unknown level. * - * This does not represent an actual value provided by the platform and only - * indicates a value was provided that isn't currently supported. + * This does not represent an actual value provided by the platform and only indicates a value was + * provided that isn't currently supported. */ UNKNOWN(5); @@ -708,23 +721,21 @@ enum class ConsoleMessageLevel(val raw: Int) { } } } + private open class AndroidWebkitLibraryPigeonCodec : StandardMessageCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { 129.toByte() -> { - return (readValue(buffer) as Long?)?.let { - FileChooserMode.ofRaw(it.toInt()) - } + return (readValue(buffer) as Long?)?.let { FileChooserMode.ofRaw(it.toInt()) } } 130.toByte() -> { - return (readValue(buffer) as Long?)?.let { - ConsoleMessageLevel.ofRaw(it.toInt()) - } + return (readValue(buffer) as Long?)?.let { ConsoleMessageLevel.ofRaw(it.toInt()) } } else -> super.readValueOfType(type, buffer) } } - override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { + + override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { when (value) { is FileChooserMode -> { stream.write(129) @@ -745,7 +756,9 @@ private open class AndroidWebkitLibraryPigeonCodec : StandardMessageCodec() { * See https://developer.android.com/reference/android/webkit/WebResourceRequest. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiWebResourceRequest(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiWebResourceRequest( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { /** The URL for which the resource request was made. */ abstract fun url(pigeon_instance: android.webkit.WebResourceRequest): String @@ -762,12 +775,16 @@ abstract class PigeonApiWebResourceRequest(open val pigeonRegistrar: AndroidWebk abstract fun method(pigeon_instance: android.webkit.WebResourceRequest): String /** The headers associated with the request. */ - abstract fun requestHeaders(pigeon_instance: android.webkit.WebResourceRequest): Map? + abstract fun requestHeaders( + pigeon_instance: android.webkit.WebResourceRequest + ): Map? @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of WebResourceRequest and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.webkit.WebResourceRequest, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.webkit.WebResourceRequest, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -778,7 +795,8 @@ abstract class PigeonApiWebResourceRequest(open val pigeonRegistrar: AndroidWebk Result.success(Unit) return } - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val urlArg = url(pigeon_instanceArg) val isForMainFrameArg = isForMainFrame(pigeon_instanceArg) val isRedirectArg = isRedirect(pigeon_instanceArg) @@ -787,21 +805,31 @@ abstract class PigeonApiWebResourceRequest(open val pigeonRegistrar: AndroidWebk val requestHeadersArg = requestHeaders(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.WebResourceRequest.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.WebResourceRequest.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_identifierArg, urlArg, isForMainFrameArg, isRedirectArg, hasGestureArg, methodArg, requestHeadersArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) - } else { - callback(Result.success(Unit)) + channel.send( + listOf( + pigeon_identifierArg, + urlArg, + isForMainFrameArg, + isRedirectArg, + hasGestureArg, + methodArg, + requestHeadersArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } } - } else { - callback(Result.failure(createConnectionError(channelName))) - } - } } - } /** * Encapsulates a resource response. @@ -809,14 +837,18 @@ abstract class PigeonApiWebResourceRequest(open val pigeonRegistrar: AndroidWebk * See https://developer.android.com/reference/android/webkit/WebResourceResponse. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiWebResourceResponse(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiWebResourceResponse( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { /** The resource response's status code. */ abstract fun statusCode(pigeon_instance: android.webkit.WebResourceResponse): Long @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of WebResourceResponse and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.webkit.WebResourceResponse, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.webkit.WebResourceResponse, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -827,34 +859,38 @@ abstract class PigeonApiWebResourceResponse(open val pigeonRegistrar: AndroidWeb Result.success(Unit) return } - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val statusCodeArg = statusCode(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.WebResourceResponse.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.WebResourceResponse.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg, statusCodeArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - } /** - * Encapsulates information about errors that occurred during loading of web - * resources. + * Encapsulates information about errors that occurred during loading of web resources. * * See https://developer.android.com/reference/android/webkit/WebResourceError. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiWebResourceError(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiWebResourceError( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { /** The error code of the error. */ @androidx.annotation.RequiresApi(api = 23) abstract fun errorCode(pigeon_instance: android.webkit.WebResourceError): Long @@ -866,8 +902,10 @@ abstract class PigeonApiWebResourceError(open val pigeonRegistrar: AndroidWebkit @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of WebResourceError and attaches it to [pigeon_instanceArg]. */ @androidx.annotation.RequiresApi(api = 23) - fun pigeon_newInstance(pigeon_instanceArg: android.webkit.WebResourceError, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.webkit.WebResourceError, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -878,35 +916,39 @@ abstract class PigeonApiWebResourceError(open val pigeonRegistrar: AndroidWebkit Result.success(Unit) return } - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val errorCodeArg = errorCode(pigeon_instanceArg) val descriptionArg = description(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.WebResourceError.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.WebResourceError.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg, errorCodeArg, descriptionArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - } /** - * Encapsulates information about errors that occurred during loading of web - * resources. + * Encapsulates information about errors that occurred during loading of web resources. * * See https://developer.android.com/reference/androidx/webkit/WebResourceErrorCompat. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiWebResourceErrorCompat(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiWebResourceErrorCompat( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { /** The error code of the error. */ abstract fun errorCode(pigeon_instance: androidx.webkit.WebResourceErrorCompat): Long @@ -915,8 +957,10 @@ abstract class PigeonApiWebResourceErrorCompat(open val pigeonRegistrar: Android @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of WebResourceErrorCompat and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: androidx.webkit.WebResourceErrorCompat, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: androidx.webkit.WebResourceErrorCompat, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -927,26 +971,29 @@ abstract class PigeonApiWebResourceErrorCompat(open val pigeonRegistrar: Android Result.success(Unit) return } - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val errorCodeArg = errorCode(pigeon_instanceArg) val descriptionArg = description(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.WebResourceErrorCompat.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.WebResourceErrorCompat.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg, errorCodeArg, descriptionArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - } /** * Represents a position on a web page. @@ -954,15 +1001,16 @@ abstract class PigeonApiWebResourceErrorCompat(open val pigeonRegistrar: Android * This is a custom class created for convenience of the wrapper. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiWebViewPoint(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiWebViewPoint( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { abstract fun x(pigeon_instance: WebViewPoint): Long abstract fun y(pigeon_instance: WebViewPoint): Long @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of WebViewPoint and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: WebViewPoint, callback: (Result) -> Unit) -{ + fun pigeon_newInstance(pigeon_instanceArg: WebViewPoint, callback: (Result) -> Unit) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -973,7 +1021,8 @@ abstract class PigeonApiWebViewPoint(open val pigeonRegistrar: AndroidWebkitLibr Result.success(Unit) return } - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val xArg = x(pigeon_instanceArg) val yArg = y(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger @@ -983,16 +1032,17 @@ abstract class PigeonApiWebViewPoint(open val pigeonRegistrar: AndroidWebkitLibr channel.send(listOf(pigeon_identifierArg, xArg, yArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - } /** * Represents a JavaScript console message from WebCore. @@ -1000,7 +1050,9 @@ abstract class PigeonApiWebViewPoint(open val pigeonRegistrar: AndroidWebkitLibr * See https://developer.android.com/reference/android/webkit/ConsoleMessage */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiConsoleMessage(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiConsoleMessage( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { abstract fun lineNumber(pigeon_instance: android.webkit.ConsoleMessage): Long abstract fun message(pigeon_instance: android.webkit.ConsoleMessage): String @@ -1011,8 +1063,10 @@ abstract class PigeonApiConsoleMessage(open val pigeonRegistrar: AndroidWebkitLi @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of ConsoleMessage and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.webkit.ConsoleMessage, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.webkit.ConsoleMessage, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -1023,7 +1077,8 @@ abstract class PigeonApiConsoleMessage(open val pigeonRegistrar: AndroidWebkitLi Result.success(Unit) return } - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val lineNumberArg = lineNumber(pigeon_instanceArg) val messageArg = message(pigeon_instanceArg) val levelArg = level(pigeon_instanceArg) @@ -1035,16 +1090,17 @@ abstract class PigeonApiConsoleMessage(open val pigeonRegistrar: AndroidWebkitLi channel.send(listOf(pigeon_identifierArg, lineNumberArg, messageArg, levelArg, sourceIdArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - } /** * Manages the cookies used by an application's `WebView` instances. @@ -1052,34 +1108,49 @@ abstract class PigeonApiConsoleMessage(open val pigeonRegistrar: AndroidWebkitLi * See https://developer.android.com/reference/android/webkit/CookieManager. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiCookieManager(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiCookieManager( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { abstract fun instance(): android.webkit.CookieManager /** Sets a single cookie (key-value pair) for the given URL. */ abstract fun setCookie(pigeon_instance: android.webkit.CookieManager, url: String, value: String) /** Removes all cookies. */ - abstract fun removeAllCookies(pigeon_instance: android.webkit.CookieManager, callback: (Result) -> Unit) + abstract fun removeAllCookies( + pigeon_instance: android.webkit.CookieManager, + callback: (Result) -> Unit + ) /** Sets whether the `WebView` should allow third party cookies to be set. */ - abstract fun setAcceptThirdPartyCookies(pigeon_instance: android.webkit.CookieManager, webView: android.webkit.WebView, accept: Boolean) + abstract fun setAcceptThirdPartyCookies( + pigeon_instance: android.webkit.CookieManager, + webView: android.webkit.WebView, + accept: Boolean + ) companion object { @Suppress("LocalVariableName") fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiCookieManager?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.CookieManager.instance", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.CookieManager.instance", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_identifierArg = args[0] as Long - val wrapped: List = try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.instance(), pigeon_identifierArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + api.instance(), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1087,19 +1158,24 @@ abstract class PigeonApiCookieManager(open val pigeonRegistrar: AndroidWebkitLib } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.CookieManager.setCookie", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.CookieManager.setCookie", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.CookieManager val urlArg = args[1] as String val valueArg = args[2] as String - val wrapped: List = try { - api.setCookie(pigeon_instanceArg, urlArg, valueArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.setCookie(pigeon_instanceArg, urlArg, valueArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1107,7 +1183,11 @@ abstract class PigeonApiCookieManager(open val pigeonRegistrar: AndroidWebkitLib } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.CookieManager.removeAllCookies", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.CookieManager.removeAllCookies", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1127,19 +1207,24 @@ abstract class PigeonApiCookieManager(open val pigeonRegistrar: AndroidWebkitLib } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.CookieManager.setAcceptThirdPartyCookies", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.CookieManager.setAcceptThirdPartyCookies", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.CookieManager val webViewArg = args[1] as android.webkit.WebView val acceptArg = args[2] as Boolean - val wrapped: List = try { - api.setAcceptThirdPartyCookies(pigeon_instanceArg, webViewArg, acceptArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.setAcceptThirdPartyCookies(pigeon_instanceArg, webViewArg, acceptArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1151,8 +1236,10 @@ abstract class PigeonApiCookieManager(open val pigeonRegistrar: AndroidWebkitLib @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of CookieManager and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.webkit.CookieManager, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.webkit.CookieManager, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -1163,7 +1250,8 @@ abstract class PigeonApiCookieManager(open val pigeonRegistrar: AndroidWebkitLib Result.success(Unit) return } - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.webview_flutter_android.CookieManager.pigeon_newInstance" @@ -1171,16 +1259,17 @@ abstract class PigeonApiCookieManager(open val pigeonRegistrar: AndroidWebkitLib channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - } /** * A View that displays web pages. @@ -1188,23 +1277,38 @@ abstract class PigeonApiCookieManager(open val pigeonRegistrar: AndroidWebkitLib * See https://developer.android.com/reference/android/webkit/WebView. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiWebView( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { abstract fun pigeon_defaultConstructor(): android.webkit.WebView /** The WebSettings object used to control the settings for this WebView. */ abstract fun settings(pigeon_instance: android.webkit.WebView): android.webkit.WebSettings /** Loads the given data into this WebView using a 'data' scheme URL. */ - abstract fun loadData(pigeon_instance: android.webkit.WebView, data: String, mimeType: String?, encoding: String?) - - /** - * Loads the given data into this WebView, using baseUrl as the base URL for - * the content. - */ - abstract fun loadDataWithBaseUrl(pigeon_instance: android.webkit.WebView, baseUrl: String?, data: String, mimeType: String?, encoding: String?, historyUrl: String?) + abstract fun loadData( + pigeon_instance: android.webkit.WebView, + data: String, + mimeType: String?, + encoding: String? + ) + + /** Loads the given data into this WebView, using baseUrl as the base URL for the content. */ + abstract fun loadDataWithBaseUrl( + pigeon_instance: android.webkit.WebView, + baseUrl: String?, + data: String, + mimeType: String?, + encoding: String?, + historyUrl: String? + ) /** Loads the given URL. */ - abstract fun loadUrl(pigeon_instance: android.webkit.WebView, url: String, headers: Map) + abstract fun loadUrl( + pigeon_instance: android.webkit.WebView, + url: String, + headers: Map + ) /** Loads the URL with postData using "POST" method into this WebView. */ abstract fun postUrl(pigeon_instance: android.webkit.WebView, url: String, data: ByteArray) @@ -1230,41 +1334,51 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi /** Clears the resource cache. */ abstract fun clearCache(pigeon_instance: android.webkit.WebView, includeDiskFiles: Boolean) - /** - * Asynchronously evaluates JavaScript in the context of the currently - * displayed page. - */ - abstract fun evaluateJavascript(pigeon_instance: android.webkit.WebView, javascriptString: String, callback: (Result) -> Unit) + /** Asynchronously evaluates JavaScript in the context of the currently displayed page. */ + abstract fun evaluateJavascript( + pigeon_instance: android.webkit.WebView, + javascriptString: String, + callback: (Result) -> Unit + ) /** Gets the title for the current page. */ abstract fun getTitle(pigeon_instance: android.webkit.WebView): String? /** - * Enables debugging of web contents (HTML / CSS / JavaScript) loaded into - * any WebViews of this application. + * Enables debugging of web contents (HTML / CSS / JavaScript) loaded into any WebViews of this + * application. */ abstract fun setWebContentsDebuggingEnabled(enabled: Boolean) - /** - * Sets the WebViewClient that will receive various notifications and - * requests. - */ - abstract fun setWebViewClient(pigeon_instance: android.webkit.WebView, client: android.webkit.WebViewClient?) + /** Sets the WebViewClient that will receive various notifications and requests. */ + abstract fun setWebViewClient( + pigeon_instance: android.webkit.WebView, + client: android.webkit.WebViewClient? + ) /** Injects the supplied Java object into this WebView. */ - abstract fun addJavaScriptChannel(pigeon_instance: android.webkit.WebView, channel: JavaScriptChannel) + abstract fun addJavaScriptChannel( + pigeon_instance: android.webkit.WebView, + channel: JavaScriptChannel + ) /** Removes a previously injected Java object from this WebView. */ abstract fun removeJavaScriptChannel(pigeon_instance: android.webkit.WebView, name: String) /** - * Registers the interface to be used when content can not be handled by the - * rendering engine, and should be downloaded instead. + * Registers the interface to be used when content can not be handled by the rendering engine, and + * should be downloaded instead. */ - abstract fun setDownloadListener(pigeon_instance: android.webkit.WebView, listener: android.webkit.DownloadListener?) + abstract fun setDownloadListener( + pigeon_instance: android.webkit.WebView, + listener: android.webkit.DownloadListener? + ) /** Sets the chrome handler. */ - abstract fun setWebChromeClient(pigeon_instance: android.webkit.WebView, client: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl?) + abstract fun setWebChromeClient( + pigeon_instance: android.webkit.WebView, + client: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl? + ) /** Sets the background color for this view. */ abstract fun setBackgroundColor(pigeon_instance: android.webkit.WebView, color: Long) @@ -1277,17 +1391,23 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiWebView?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.pigeon_defaultConstructor", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.pigeon_defaultConstructor", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_identifierArg = args[0] as Long - val wrapped: List = try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.pigeon_defaultConstructor(), pigeon_identifierArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + api.pigeon_defaultConstructor(), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1295,18 +1415,24 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.settings", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.settings", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView val pigeon_identifierArg = args[1] as Long - val wrapped: List = try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.settings(pigeon_instanceArg), pigeon_identifierArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + api.settings(pigeon_instanceArg), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1314,7 +1440,11 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.loadData", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.loadData", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1322,12 +1452,13 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi val dataArg = args[1] as String val mimeTypeArg = args[2] as String? val encodingArg = args[3] as String? - val wrapped: List = try { - api.loadData(pigeon_instanceArg, dataArg, mimeTypeArg, encodingArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.loadData(pigeon_instanceArg, dataArg, mimeTypeArg, encodingArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1335,7 +1466,11 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.loadDataWithBaseUrl", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.loadDataWithBaseUrl", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1345,12 +1480,19 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi val mimeTypeArg = args[3] as String? val encodingArg = args[4] as String? val historyUrlArg = args[5] as String? - val wrapped: List = try { - api.loadDataWithBaseUrl(pigeon_instanceArg, baseUrlArg, dataArg, mimeTypeArg, encodingArg, historyUrlArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.loadDataWithBaseUrl( + pigeon_instanceArg, + baseUrlArg, + dataArg, + mimeTypeArg, + encodingArg, + historyUrlArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1358,19 +1500,24 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.loadUrl", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.loadUrl", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView val urlArg = args[1] as String val headersArg = args[2] as Map - val wrapped: List = try { - api.loadUrl(pigeon_instanceArg, urlArg, headersArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.loadUrl(pigeon_instanceArg, urlArg, headersArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1378,19 +1525,24 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.postUrl", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.postUrl", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView val urlArg = args[1] as String val dataArg = args[2] as ByteArray - val wrapped: List = try { - api.postUrl(pigeon_instanceArg, urlArg, dataArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.postUrl(pigeon_instanceArg, urlArg, dataArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1398,16 +1550,19 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.getUrl", codec) + val channel = + BasicMessageChannel( + binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.getUrl", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView - val wrapped: List = try { - listOf(api.getUrl(pigeon_instanceArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.getUrl(pigeon_instanceArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1415,16 +1570,21 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.canGoBack", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.canGoBack", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView - val wrapped: List = try { - listOf(api.canGoBack(pigeon_instanceArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.canGoBack(pigeon_instanceArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1432,16 +1592,21 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.canGoForward", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.canGoForward", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView - val wrapped: List = try { - listOf(api.canGoForward(pigeon_instanceArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.canGoForward(pigeon_instanceArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1449,17 +1614,20 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.goBack", codec) + val channel = + BasicMessageChannel( + binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.goBack", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView - val wrapped: List = try { - api.goBack(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.goBack(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1467,17 +1635,22 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.goForward", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.goForward", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView - val wrapped: List = try { - api.goForward(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.goForward(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1485,17 +1658,20 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.reload", codec) + val channel = + BasicMessageChannel( + binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.reload", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView - val wrapped: List = try { - api.reload(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.reload(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1503,18 +1679,23 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.clearCache", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.clearCache", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView val includeDiskFilesArg = args[1] as Boolean - val wrapped: List = try { - api.clearCache(pigeon_instanceArg, includeDiskFilesArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.clearCache(pigeon_instanceArg, includeDiskFilesArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1522,13 +1703,18 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.evaluateJavascript", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.evaluateJavascript", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView val javascriptStringArg = args[1] as String - api.evaluateJavascript(pigeon_instanceArg, javascriptStringArg) { result: Result -> + api.evaluateJavascript(pigeon_instanceArg, javascriptStringArg) { + result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -1543,16 +1729,21 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.getTitle", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.getTitle", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView - val wrapped: List = try { - listOf(api.getTitle(pigeon_instanceArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.getTitle(pigeon_instanceArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1560,17 +1751,22 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.setWebContentsDebuggingEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.setWebContentsDebuggingEnabled", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val enabledArg = args[0] as Boolean - val wrapped: List = try { - api.setWebContentsDebuggingEnabled(enabledArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.setWebContentsDebuggingEnabled(enabledArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1578,18 +1774,23 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.setWebViewClient", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.setWebViewClient", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView val clientArg = args[1] as android.webkit.WebViewClient? - val wrapped: List = try { - api.setWebViewClient(pigeon_instanceArg, clientArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.setWebViewClient(pigeon_instanceArg, clientArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1597,18 +1798,23 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.addJavaScriptChannel", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.addJavaScriptChannel", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView val channelArg = args[1] as JavaScriptChannel - val wrapped: List = try { - api.addJavaScriptChannel(pigeon_instanceArg, channelArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.addJavaScriptChannel(pigeon_instanceArg, channelArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1616,18 +1822,23 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.removeJavaScriptChannel", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.removeJavaScriptChannel", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView val nameArg = args[1] as String - val wrapped: List = try { - api.removeJavaScriptChannel(pigeon_instanceArg, nameArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.removeJavaScriptChannel(pigeon_instanceArg, nameArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1635,18 +1846,23 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.setDownloadListener", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.setDownloadListener", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView val listenerArg = args[1] as android.webkit.DownloadListener? - val wrapped: List = try { - api.setDownloadListener(pigeon_instanceArg, listenerArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.setDownloadListener(pigeon_instanceArg, listenerArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1654,18 +1870,26 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.setWebChromeClient", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.setWebChromeClient", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView - val clientArg = args[1] as io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl? - val wrapped: List = try { - api.setWebChromeClient(pigeon_instanceArg, clientArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val clientArg = + args[1] + as + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl? + val wrapped: List = + try { + api.setWebChromeClient(pigeon_instanceArg, clientArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1673,18 +1897,23 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.setBackgroundColor", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.setBackgroundColor", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView val colorArg = args[1] as Long - val wrapped: List = try { - api.setBackgroundColor(pigeon_instanceArg, colorArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.setBackgroundColor(pigeon_instanceArg, colorArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1692,17 +1921,22 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.destroy", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.destroy", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView - val wrapped: List = try { - api.destroy(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.destroy(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1714,8 +1948,10 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of WebView and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.webkit.WebView, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.webkit.WebView, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -1726,7 +1962,8 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi Result.success(Unit) return } - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.webview_flutter_android.WebView.pigeon_newInstance" @@ -1734,22 +1971,30 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** - * This is called in response to an internal scroll in this view (i.e., the - * view scrolled its own contents). + * This is called in response to an internal scroll in this view (i.e., the view scrolled its own + * contents). */ - fun onScrollChanged(pigeon_instanceArg: android.webkit.WebView, leftArg: Long, topArg: Long, oldLeftArg: Long, oldTopArg: Long, callback: (Result) -> Unit) -{ + fun onScrollChanged( + pigeon_instanceArg: android.webkit.WebView, + leftArg: Long, + topArg: Long, + oldLeftArg: Long, + oldTopArg: Long, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -1763,23 +2008,23 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi channel.send(listOf(pigeon_instanceArg, leftArg, topArg, oldLeftArg, oldTopArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } @Suppress("FunctionName") /** An implementation of [PigeonApiView] used to access callback methods */ - fun pigeon_getPigeonApiView(): PigeonApiView - { + fun pigeon_getPigeonApiView(): PigeonApiView { return pigeonRegistrar.getPigeonApiView() } - } /** * Manages settings state for a `WebView`. @@ -1787,52 +2032,68 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi * See https://developer.android.com/reference/android/webkit/WebSettings. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiWebSettings( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { /** Sets whether the DOM storage API is enabled. */ abstract fun setDomStorageEnabled(pigeon_instance: android.webkit.WebSettings, flag: Boolean) /** Tells JavaScript to open windows automatically. */ - abstract fun setJavaScriptCanOpenWindowsAutomatically(pigeon_instance: android.webkit.WebSettings, flag: Boolean) + abstract fun setJavaScriptCanOpenWindowsAutomatically( + pigeon_instance: android.webkit.WebSettings, + flag: Boolean + ) /** Sets whether the WebView whether supports multiple windows. */ - abstract fun setSupportMultipleWindows(pigeon_instance: android.webkit.WebSettings, support: Boolean) + abstract fun setSupportMultipleWindows( + pigeon_instance: android.webkit.WebSettings, + support: Boolean + ) /** Tells the WebView to enable JavaScript execution. */ abstract fun setJavaScriptEnabled(pigeon_instance: android.webkit.WebSettings, flag: Boolean) /** Sets the WebView's user-agent string. */ - abstract fun setUserAgentString(pigeon_instance: android.webkit.WebSettings, userAgentString: String?) + abstract fun setUserAgentString( + pigeon_instance: android.webkit.WebSettings, + userAgentString: String? + ) /** Sets whether the WebView requires a user gesture to play media. */ - abstract fun setMediaPlaybackRequiresUserGesture(pigeon_instance: android.webkit.WebSettings, require: Boolean) + abstract fun setMediaPlaybackRequiresUserGesture( + pigeon_instance: android.webkit.WebSettings, + require: Boolean + ) /** - * Sets whether the WebView should support zooming using its on-screen zoom - * controls and gestures. + * Sets whether the WebView should support zooming using its on-screen zoom controls and gestures. */ abstract fun setSupportZoom(pigeon_instance: android.webkit.WebSettings, support: Boolean) /** - * Sets whether the WebView loads pages in overview mode, that is, zooms out - * the content to fit on screen by width. + * Sets whether the WebView loads pages in overview mode, that is, zooms out the content to fit on + * screen by width. */ - abstract fun setLoadWithOverviewMode(pigeon_instance: android.webkit.WebSettings, overview: Boolean) + abstract fun setLoadWithOverviewMode( + pigeon_instance: android.webkit.WebSettings, + overview: Boolean + ) /** - * Sets whether the WebView should enable support for the "viewport" HTML - * meta tag or should use a wide viewport. + * Sets whether the WebView should enable support for the "viewport" HTML meta tag or should use a + * wide viewport. */ abstract fun setUseWideViewPort(pigeon_instance: android.webkit.WebSettings, use: Boolean) /** - * Sets whether the WebView should display on-screen zoom controls when using - * the built-in zoom mechanisms. + * Sets whether the WebView should display on-screen zoom controls when using the built-in zoom + * mechanisms. */ abstract fun setDisplayZoomControls(pigeon_instance: android.webkit.WebSettings, enabled: Boolean) /** - * Sets whether the WebView should display on-screen zoom controls when using - * the built-in zoom mechanisms. + * Sets whether the WebView should display on-screen zoom controls when using the built-in zoom + * mechanisms. */ abstract fun setBuiltInZoomControls(pigeon_instance: android.webkit.WebSettings, enabled: Boolean) @@ -1856,18 +2117,23 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiWebSettings?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setDomStorageEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebSettings.setDomStorageEnabled", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val flagArg = args[1] as Boolean - val wrapped: List = try { - api.setDomStorageEnabled(pigeon_instanceArg, flagArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.setDomStorageEnabled(pigeon_instanceArg, flagArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1875,18 +2141,23 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setJavaScriptCanOpenWindowsAutomatically", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebSettings.setJavaScriptCanOpenWindowsAutomatically", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val flagArg = args[1] as Boolean - val wrapped: List = try { - api.setJavaScriptCanOpenWindowsAutomatically(pigeon_instanceArg, flagArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.setJavaScriptCanOpenWindowsAutomatically(pigeon_instanceArg, flagArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1894,18 +2165,23 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setSupportMultipleWindows", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebSettings.setSupportMultipleWindows", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val supportArg = args[1] as Boolean - val wrapped: List = try { - api.setSupportMultipleWindows(pigeon_instanceArg, supportArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.setSupportMultipleWindows(pigeon_instanceArg, supportArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1913,18 +2189,23 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setJavaScriptEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebSettings.setJavaScriptEnabled", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val flagArg = args[1] as Boolean - val wrapped: List = try { - api.setJavaScriptEnabled(pigeon_instanceArg, flagArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.setJavaScriptEnabled(pigeon_instanceArg, flagArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1932,18 +2213,23 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setUserAgentString", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebSettings.setUserAgentString", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val userAgentStringArg = args[1] as String? - val wrapped: List = try { - api.setUserAgentString(pigeon_instanceArg, userAgentStringArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.setUserAgentString(pigeon_instanceArg, userAgentStringArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1951,18 +2237,23 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setMediaPlaybackRequiresUserGesture", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebSettings.setMediaPlaybackRequiresUserGesture", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val requireArg = args[1] as Boolean - val wrapped: List = try { - api.setMediaPlaybackRequiresUserGesture(pigeon_instanceArg, requireArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.setMediaPlaybackRequiresUserGesture(pigeon_instanceArg, requireArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1970,18 +2261,23 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setSupportZoom", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebSettings.setSupportZoom", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val supportArg = args[1] as Boolean - val wrapped: List = try { - api.setSupportZoom(pigeon_instanceArg, supportArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.setSupportZoom(pigeon_instanceArg, supportArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1989,18 +2285,23 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setLoadWithOverviewMode", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebSettings.setLoadWithOverviewMode", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val overviewArg = args[1] as Boolean - val wrapped: List = try { - api.setLoadWithOverviewMode(pigeon_instanceArg, overviewArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.setLoadWithOverviewMode(pigeon_instanceArg, overviewArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2008,18 +2309,23 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setUseWideViewPort", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebSettings.setUseWideViewPort", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val useArg = args[1] as Boolean - val wrapped: List = try { - api.setUseWideViewPort(pigeon_instanceArg, useArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.setUseWideViewPort(pigeon_instanceArg, useArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2027,18 +2333,23 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setDisplayZoomControls", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebSettings.setDisplayZoomControls", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val enabledArg = args[1] as Boolean - val wrapped: List = try { - api.setDisplayZoomControls(pigeon_instanceArg, enabledArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.setDisplayZoomControls(pigeon_instanceArg, enabledArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2046,18 +2357,23 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setBuiltInZoomControls", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebSettings.setBuiltInZoomControls", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val enabledArg = args[1] as Boolean - val wrapped: List = try { - api.setBuiltInZoomControls(pigeon_instanceArg, enabledArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.setBuiltInZoomControls(pigeon_instanceArg, enabledArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2065,18 +2381,23 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setAllowFileAccess", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebSettings.setAllowFileAccess", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val enabledArg = args[1] as Boolean - val wrapped: List = try { - api.setAllowFileAccess(pigeon_instanceArg, enabledArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.setAllowFileAccess(pigeon_instanceArg, enabledArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2084,18 +2405,23 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setAllowContentAccess", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebSettings.setAllowContentAccess", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val enabledArg = args[1] as Boolean - val wrapped: List = try { - api.setAllowContentAccess(pigeon_instanceArg, enabledArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.setAllowContentAccess(pigeon_instanceArg, enabledArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2103,18 +2429,23 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setGeolocationEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebSettings.setGeolocationEnabled", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val enabledArg = args[1] as Boolean - val wrapped: List = try { - api.setGeolocationEnabled(pigeon_instanceArg, enabledArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.setGeolocationEnabled(pigeon_instanceArg, enabledArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2122,18 +2453,23 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setTextZoom", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebSettings.setTextZoom", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val textZoomArg = args[1] as Long - val wrapped: List = try { - api.setTextZoom(pigeon_instanceArg, textZoomArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.setTextZoom(pigeon_instanceArg, textZoomArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2141,16 +2477,21 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.getUserAgentString", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebSettings.getUserAgentString", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings - val wrapped: List = try { - listOf(api.getUserAgentString(pigeon_instanceArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.getUserAgentString(pigeon_instanceArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2162,8 +2503,10 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of WebSettings and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.webkit.WebSettings, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.webkit.WebSettings, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2174,7 +2517,8 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra Result.success(Unit) return } - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.webview_flutter_android.WebSettings.pigeon_newInstance" @@ -2182,16 +2526,17 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - } /** * A JavaScript interface for exposing Javascript callbacks to Dart. @@ -2200,7 +2545,9 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra * [JavascriptInterface](https://developer.android.com/reference/android/webkit/JavascriptInterface). */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiJavaScriptChannel(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiJavaScriptChannel( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { abstract fun pigeon_defaultConstructor(channelName: String): JavaScriptChannel companion object { @@ -2208,18 +2555,24 @@ abstract class PigeonApiJavaScriptChannel(open val pigeonRegistrar: AndroidWebki fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiJavaScriptChannel?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.JavaScriptChannel.pigeon_defaultConstructor", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.JavaScriptChannel.pigeon_defaultConstructor", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_identifierArg = args[0] as Long val channelNameArg = args[1] as String - val wrapped: List = try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.pigeon_defaultConstructor(channelNameArg), pigeon_identifierArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + api.pigeon_defaultConstructor(channelNameArg), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2231,8 +2584,7 @@ abstract class PigeonApiJavaScriptChannel(open val pigeonRegistrar: AndroidWebki @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of JavaScriptChannel and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: JavaScriptChannel, callback: (Result) -> Unit) -{ + fun pigeon_newInstance(pigeon_instanceArg: JavaScriptChannel, callback: (Result) -> Unit) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2243,12 +2595,16 @@ abstract class PigeonApiJavaScriptChannel(open val pigeonRegistrar: AndroidWebki Result.success(Unit) return } - throw IllegalStateException("Attempting to create a new Dart instance of JavaScriptChannel, but the class has a nonnull callback method.") + throw IllegalStateException( + "Attempting to create a new Dart instance of JavaScriptChannel, but the class has a nonnull callback method.") } /** Handles callbacks messages from JavaScript. */ - fun postMessage(pigeon_instanceArg: JavaScriptChannel, messageArg: String, callback: (Result) -> Unit) -{ + fun postMessage( + pigeon_instanceArg: JavaScriptChannel, + messageArg: String, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2262,16 +2618,17 @@ abstract class PigeonApiJavaScriptChannel(open val pigeonRegistrar: AndroidWebki channel.send(listOf(pigeon_instanceArg, messageArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - } /** * Receives various notifications and requests from a `WebView`. @@ -2279,41 +2636,51 @@ abstract class PigeonApiJavaScriptChannel(open val pigeonRegistrar: AndroidWebki * See https://developer.android.com/reference/android/webkit/WebViewClient. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiWebViewClient( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { abstract fun pigeon_defaultConstructor(): android.webkit.WebViewClient /** * Sets the required synchronous return value for the Java method, * `WebViewClient.shouldOverrideUrlLoading(...)`. * - * The Java method, `WebViewClient.shouldOverrideUrlLoading(...)`, requires - * a boolean to be returned and this method sets the returned value for all - * calls to the Java method. + * The Java method, `WebViewClient.shouldOverrideUrlLoading(...)`, requires a boolean to be + * returned and this method sets the returned value for all calls to the Java method. * - * Setting this to true causes the current [WebView] to abort loading any URL - * received by [requestLoading] or [urlLoading], while setting this to false - * causes the [WebView] to continue loading a URL as usual. + * Setting this to true causes the current [WebView] to abort loading any URL received by + * [requestLoading] or [urlLoading], while setting this to false causes the [WebView] to continue + * loading a URL as usual. * * Defaults to false. */ - abstract fun setSynchronousReturnValueForShouldOverrideUrlLoading(pigeon_instance: android.webkit.WebViewClient, value: Boolean) + abstract fun setSynchronousReturnValueForShouldOverrideUrlLoading( + pigeon_instance: android.webkit.WebViewClient, + value: Boolean + ) companion object { @Suppress("LocalVariableName") fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiWebViewClient?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebViewClient.pigeon_defaultConstructor", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebViewClient.pigeon_defaultConstructor", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_identifierArg = args[0] as Long - val wrapped: List = try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.pigeon_defaultConstructor(), pigeon_identifierArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + api.pigeon_defaultConstructor(), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2321,18 +2688,24 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebViewClient.setSynchronousReturnValueForShouldOverrideUrlLoading", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebViewClient.setSynchronousReturnValueForShouldOverrideUrlLoading", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebViewClient val valueArg = args[1] as Boolean - val wrapped: List = try { - api.setSynchronousReturnValueForShouldOverrideUrlLoading(pigeon_instanceArg, valueArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.setSynchronousReturnValueForShouldOverrideUrlLoading( + pigeon_instanceArg, valueArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2344,8 +2717,10 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of WebViewClient and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.webkit.WebViewClient, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.webkit.WebViewClient, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2356,7 +2731,8 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib Result.success(Unit) return } - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.webview_flutter_android.WebViewClient.pigeon_newInstance" @@ -2364,19 +2740,25 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Notify the host application that a page has started loading. */ - fun onPageStarted(pigeon_instanceArg: android.webkit.WebViewClient, webViewArg: android.webkit.WebView, urlArg: String, callback: (Result) -> Unit) -{ + fun onPageStarted( + pigeon_instanceArg: android.webkit.WebViewClient, + webViewArg: android.webkit.WebView, + urlArg: String, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2390,19 +2772,25 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib channel.send(listOf(pigeon_instanceArg, webViewArg, urlArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Notify the host application that a page has finished loading. */ - fun onPageFinished(pigeon_instanceArg: android.webkit.WebViewClient, webViewArg: android.webkit.WebView, urlArg: String, callback: (Result) -> Unit) -{ + fun onPageFinished( + pigeon_instanceArg: android.webkit.WebViewClient, + webViewArg: android.webkit.WebView, + urlArg: String, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2416,22 +2804,29 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib channel.send(listOf(pigeon_instanceArg, webViewArg, urlArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** - * Notify the host application that an HTTP error has been received from the - * server while loading a resource. + * Notify the host application that an HTTP error has been received from the server while loading + * a resource. */ - fun onReceivedHttpError(pigeon_instanceArg: android.webkit.WebViewClient, webViewArg: android.webkit.WebView, requestArg: android.webkit.WebResourceRequest, responseArg: android.webkit.WebResourceResponse, callback: (Result) -> Unit) -{ + fun onReceivedHttpError( + pigeon_instanceArg: android.webkit.WebViewClient, + webViewArg: android.webkit.WebView, + requestArg: android.webkit.WebResourceRequest, + responseArg: android.webkit.WebResourceResponse, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2445,20 +2840,27 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib channel.send(listOf(pigeon_instanceArg, webViewArg, requestArg, responseArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Report web resource loading error to the host application. */ @androidx.annotation.RequiresApi(api = 23) - fun onReceivedRequestError(pigeon_instanceArg: android.webkit.WebViewClient, webViewArg: android.webkit.WebView, requestArg: android.webkit.WebResourceRequest, errorArg: android.webkit.WebResourceError, callback: (Result) -> Unit) -{ + fun onReceivedRequestError( + pigeon_instanceArg: android.webkit.WebViewClient, + webViewArg: android.webkit.WebView, + requestArg: android.webkit.WebResourceRequest, + errorArg: android.webkit.WebResourceError, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2467,24 +2869,32 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedRequestError" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedRequestError" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, webViewArg, requestArg, errorArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Report web resource loading error to the host application. */ - fun onReceivedRequestErrorCompat(pigeon_instanceArg: android.webkit.WebViewClient, webViewArg: android.webkit.WebView, requestArg: android.webkit.WebResourceRequest, errorArg: androidx.webkit.WebResourceErrorCompat, callback: (Result) -> Unit) -{ + fun onReceivedRequestErrorCompat( + pigeon_instanceArg: android.webkit.WebViewClient, + webViewArg: android.webkit.WebView, + requestArg: android.webkit.WebResourceRequest, + errorArg: androidx.webkit.WebResourceErrorCompat, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2493,24 +2903,33 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedRequestErrorCompat" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedRequestErrorCompat" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, webViewArg, requestArg, errorArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Report an error to the host application. */ - fun onReceivedError(pigeon_instanceArg: android.webkit.WebViewClient, webViewArg: android.webkit.WebView, errorCodeArg: Long, descriptionArg: String, failingUrlArg: String, callback: (Result) -> Unit) -{ + fun onReceivedError( + pigeon_instanceArg: android.webkit.WebViewClient, + webViewArg: android.webkit.WebView, + errorCodeArg: Long, + descriptionArg: String, + failingUrlArg: String, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2521,25 +2940,32 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedError" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_instanceArg, webViewArg, errorCodeArg, descriptionArg, failingUrlArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) - } else { - callback(Result.success(Unit)) + channel.send( + listOf(pigeon_instanceArg, webViewArg, errorCodeArg, descriptionArg, failingUrlArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } } - } else { - callback(Result.failure(createConnectionError(channelName))) - } - } } /** - * Give the host application a chance to take control when a URL is about to - * be loaded in the current WebView. + * Give the host application a chance to take control when a URL is about to be loaded in the + * current WebView. */ - fun requestLoading(pigeon_instanceArg: android.webkit.WebViewClient, webViewArg: android.webkit.WebView, requestArg: android.webkit.WebResourceRequest, callback: (Result) -> Unit) -{ + fun requestLoading( + pigeon_instanceArg: android.webkit.WebViewClient, + webViewArg: android.webkit.WebView, + requestArg: android.webkit.WebResourceRequest, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2553,22 +2979,28 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib channel.send(listOf(pigeon_instanceArg, webViewArg, requestArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** - * Give the host application a chance to take control when a URL is about to - * be loaded in the current WebView. + * Give the host application a chance to take control when a URL is about to be loaded in the + * current WebView. */ - fun urlLoading(pigeon_instanceArg: android.webkit.WebViewClient, webViewArg: android.webkit.WebView, urlArg: String, callback: (Result) -> Unit) -{ + fun urlLoading( + pigeon_instanceArg: android.webkit.WebViewClient, + webViewArg: android.webkit.WebView, + urlArg: String, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2582,19 +3014,26 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib channel.send(listOf(pigeon_instanceArg, webViewArg, urlArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Notify the host application to update its visited links database. */ - fun doUpdateVisitedHistory(pigeon_instanceArg: android.webkit.WebViewClient, webViewArg: android.webkit.WebView, urlArg: String, isReloadArg: Boolean, callback: (Result) -> Unit) -{ + fun doUpdateVisitedHistory( + pigeon_instanceArg: android.webkit.WebViewClient, + webViewArg: android.webkit.WebView, + urlArg: String, + isReloadArg: Boolean, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2603,27 +3042,33 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.WebViewClient.doUpdateVisitedHistory" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.WebViewClient.doUpdateVisitedHistory" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, webViewArg, urlArg, isReloadArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - /** - * Notifies the host application that the WebView received an HTTP - * authentication request. - */ - fun onReceivedHttpAuthRequest(pigeon_instanceArg: android.webkit.WebViewClient, webViewArg: android.webkit.WebView, handlerArg: android.webkit.HttpAuthHandler, hostArg: String, realmArg: String, callback: (Result) -> Unit) -{ + /** Notifies the host application that the WebView received an HTTP authentication request. */ + fun onReceivedHttpAuthRequest( + pigeon_instanceArg: android.webkit.WebViewClient, + webViewArg: android.webkit.WebView, + handlerArg: android.webkit.HttpAuthHandler, + hostArg: String, + realmArg: String, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2632,21 +3077,23 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedHttpAuthRequest" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedHttpAuthRequest" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, webViewArg, handlerArg, hostArg, realmArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - } /** * Handles notifications that a file should be downloaded. @@ -2654,7 +3101,9 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib * See https://developer.android.com/reference/android/webkit/DownloadListener. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiDownloadListener(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiDownloadListener( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { abstract fun pigeon_defaultConstructor(): android.webkit.DownloadListener companion object { @@ -2662,17 +3111,23 @@ abstract class PigeonApiDownloadListener(open val pigeonRegistrar: AndroidWebkit fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiDownloadListener?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.DownloadListener.pigeon_defaultConstructor", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.DownloadListener.pigeon_defaultConstructor", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_identifierArg = args[0] as Long - val wrapped: List = try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.pigeon_defaultConstructor(), pigeon_identifierArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + api.pigeon_defaultConstructor(), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2684,8 +3139,10 @@ abstract class PigeonApiDownloadListener(open val pigeonRegistrar: AndroidWebkit @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of DownloadListener and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.webkit.DownloadListener, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.webkit.DownloadListener, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2696,12 +3153,20 @@ abstract class PigeonApiDownloadListener(open val pigeonRegistrar: AndroidWebkit Result.success(Unit) return } - throw IllegalStateException("Attempting to create a new Dart instance of DownloadListener, but the class has a nonnull callback method.") + throw IllegalStateException( + "Attempting to create a new Dart instance of DownloadListener, but the class has a nonnull callback method.") } /** Notify the host application that a file should be downloaded. */ - fun onDownloadStart(pigeon_instanceArg: android.webkit.DownloadListener, urlArg: String, userAgentArg: String, contentDispositionArg: String, mimetypeArg: String, contentLengthArg: Long, callback: (Result) -> Unit) -{ + fun onDownloadStart( + pigeon_instanceArg: android.webkit.DownloadListener, + urlArg: String, + userAgentArg: String, + contentDispositionArg: String, + mimetypeArg: String, + contentLengthArg: Long, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2712,133 +3177,160 @@ abstract class PigeonApiDownloadListener(open val pigeonRegistrar: AndroidWebkit val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.webview_flutter_android.DownloadListener.onDownloadStart" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_instanceArg, urlArg, userAgentArg, contentDispositionArg, mimetypeArg, contentLengthArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) - } else { - callback(Result.success(Unit)) + channel.send( + listOf( + pigeon_instanceArg, + urlArg, + userAgentArg, + contentDispositionArg, + mimetypeArg, + contentLengthArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } } - } else { - callback(Result.failure(createConnectionError(channelName))) - } - } } - } /** - * Handles notification of JavaScript dialogs, favicons, titles, and the - * progress. + * Handles notification of JavaScript dialogs, favicons, titles, and the progress. * * See https://developer.android.com/reference/android/webkit/WebChromeClient. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { - abstract fun pigeon_defaultConstructor(): io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl +abstract class PigeonApiWebChromeClient( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { + abstract fun pigeon_defaultConstructor(): + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl /** * Sets the required synchronous return value for the Java method, * `WebChromeClient.onShowFileChooser(...)`. * - * The Java method, `WebChromeClient.onShowFileChooser(...)`, requires - * a boolean to be returned and this method sets the returned value for all - * calls to the Java method. + * The Java method, `WebChromeClient.onShowFileChooser(...)`, requires a boolean to be returned + * and this method sets the returned value for all calls to the Java method. * - * Setting this to true indicates that all file chooser requests should be - * handled by `onShowFileChooser` and the returned list of Strings will be - * returned to the WebView. Otherwise, the client will use the default - * handling and the returned value in `onShowFileChooser` will be ignored. + * Setting this to true indicates that all file chooser requests should be handled by + * `onShowFileChooser` and the returned list of Strings will be returned to the WebView. + * Otherwise, the client will use the default handling and the returned value in + * `onShowFileChooser` will be ignored. * * Requires `onShowFileChooser` to be nonnull. * * Defaults to false. */ - abstract fun setSynchronousReturnValueForOnShowFileChooser(pigeon_instance: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, value: Boolean) + abstract fun setSynchronousReturnValueForOnShowFileChooser( + pigeon_instance: + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, + value: Boolean + ) /** * Sets the required synchronous return value for the Java method, * `WebChromeClient.onConsoleMessage(...)`. * - * The Java method, `WebChromeClient.onConsoleMessage(...)`, requires - * a boolean to be returned and this method sets the returned value for all - * calls to the Java method. + * The Java method, `WebChromeClient.onConsoleMessage(...)`, requires a boolean to be returned and + * this method sets the returned value for all calls to the Java method. * - * Setting this to true indicates that the client is handling all console - * messages. + * Setting this to true indicates that the client is handling all console messages. * * Requires `onConsoleMessage` to be nonnull. * * Defaults to false. */ - abstract fun setSynchronousReturnValueForOnConsoleMessage(pigeon_instance: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, value: Boolean) + abstract fun setSynchronousReturnValueForOnConsoleMessage( + pigeon_instance: + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, + value: Boolean + ) /** * Sets the required synchronous return value for the Java method, * `WebChromeClient.onJsAlert(...)`. * - * The Java method, `WebChromeClient.onJsAlert(...)`, requires a boolean to - * be returned and this method sets the returned value for all calls to the - * Java method. + * The Java method, `WebChromeClient.onJsAlert(...)`, requires a boolean to be returned and this + * method sets the returned value for all calls to the Java method. * - * Setting this to true indicates that the client is handling all console - * messages. + * Setting this to true indicates that the client is handling all console messages. * * Requires `onJsAlert` to be nonnull. * * Defaults to false. */ - abstract fun setSynchronousReturnValueForOnJsAlert(pigeon_instance: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, value: Boolean) + abstract fun setSynchronousReturnValueForOnJsAlert( + pigeon_instance: + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, + value: Boolean + ) /** * Sets the required synchronous return value for the Java method, * `WebChromeClient.onJsConfirm(...)`. * - * The Java method, `WebChromeClient.onJsConfirm(...)`, requires a boolean to - * be returned and this method sets the returned value for all calls to the - * Java method. + * The Java method, `WebChromeClient.onJsConfirm(...)`, requires a boolean to be returned and this + * method sets the returned value for all calls to the Java method. * - * Setting this to true indicates that the client is handling all console - * messages. + * Setting this to true indicates that the client is handling all console messages. * * Requires `onJsConfirm` to be nonnull. * * Defaults to false. */ - abstract fun setSynchronousReturnValueForOnJsConfirm(pigeon_instance: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, value: Boolean) + abstract fun setSynchronousReturnValueForOnJsConfirm( + pigeon_instance: + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, + value: Boolean + ) /** * Sets the required synchronous return value for the Java method, * `WebChromeClient.onJsPrompt(...)`. * - * The Java method, `WebChromeClient.onJsPrompt(...)`, requires a boolean to - * be returned and this method sets the returned value for all calls to the - * Java method. + * The Java method, `WebChromeClient.onJsPrompt(...)`, requires a boolean to be returned and this + * method sets the returned value for all calls to the Java method. * - * Setting this to true indicates that the client is handling all console - * messages. + * Setting this to true indicates that the client is handling all console messages. * * Requires `onJsPrompt` to be nonnull. * * Defaults to false. */ - abstract fun setSynchronousReturnValueForOnJsPrompt(pigeon_instance: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, value: Boolean) + abstract fun setSynchronousReturnValueForOnJsPrompt( + pigeon_instance: + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, + value: Boolean + ) companion object { @Suppress("LocalVariableName") fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiWebChromeClient?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.pigeon_defaultConstructor", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.pigeon_defaultConstructor", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_identifierArg = args[0] as Long - val wrapped: List = try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.pigeon_defaultConstructor(), pigeon_identifierArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + api.pigeon_defaultConstructor(), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2846,18 +3338,25 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.setSynchronousReturnValueForOnShowFileChooser", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.setSynchronousReturnValueForOnShowFileChooser", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_instanceArg = args[0] as io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl + val pigeon_instanceArg = + args[0] + as io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl val valueArg = args[1] as Boolean - val wrapped: List = try { - api.setSynchronousReturnValueForOnShowFileChooser(pigeon_instanceArg, valueArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.setSynchronousReturnValueForOnShowFileChooser(pigeon_instanceArg, valueArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2865,18 +3364,25 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.setSynchronousReturnValueForOnConsoleMessage", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.setSynchronousReturnValueForOnConsoleMessage", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_instanceArg = args[0] as io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl + val pigeon_instanceArg = + args[0] + as io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl val valueArg = args[1] as Boolean - val wrapped: List = try { - api.setSynchronousReturnValueForOnConsoleMessage(pigeon_instanceArg, valueArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.setSynchronousReturnValueForOnConsoleMessage(pigeon_instanceArg, valueArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2884,18 +3390,25 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.setSynchronousReturnValueForOnJsAlert", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.setSynchronousReturnValueForOnJsAlert", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_instanceArg = args[0] as io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl + val pigeon_instanceArg = + args[0] + as io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl val valueArg = args[1] as Boolean - val wrapped: List = try { - api.setSynchronousReturnValueForOnJsAlert(pigeon_instanceArg, valueArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.setSynchronousReturnValueForOnJsAlert(pigeon_instanceArg, valueArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2903,18 +3416,25 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.setSynchronousReturnValueForOnJsConfirm", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.setSynchronousReturnValueForOnJsConfirm", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_instanceArg = args[0] as io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl + val pigeon_instanceArg = + args[0] + as io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl val valueArg = args[1] as Boolean - val wrapped: List = try { - api.setSynchronousReturnValueForOnJsConfirm(pigeon_instanceArg, valueArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.setSynchronousReturnValueForOnJsConfirm(pigeon_instanceArg, valueArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2922,18 +3442,25 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.setSynchronousReturnValueForOnJsPrompt", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.setSynchronousReturnValueForOnJsPrompt", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_instanceArg = args[0] as io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl + val pigeon_instanceArg = + args[0] + as io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl val valueArg = args[1] as Boolean - val wrapped: List = try { - api.setSynchronousReturnValueForOnJsPrompt(pigeon_instanceArg, valueArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.setSynchronousReturnValueForOnJsPrompt(pigeon_instanceArg, valueArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2945,8 +3472,11 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of WebChromeClient and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2957,27 +3487,36 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL Result.success(Unit) return } - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Tell the host application the current progress of loading a page. */ - fun onProgressChanged(pigeon_instanceArg: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, webViewArg: android.webkit.WebView, progressArg: Long, callback: (Result) -> Unit) -{ + fun onProgressChanged( + pigeon_instanceArg: + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, + webViewArg: android.webkit.WebView, + progressArg: Long, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2991,19 +3530,26 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL channel.send(listOf(pigeon_instanceArg, webViewArg, progressArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Tell the client to show a file chooser. */ - fun onShowFileChooser(pigeon_instanceArg: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, webViewArg: android.webkit.WebView, paramsArg: android.webkit.WebChromeClient.FileChooserParams, callback: (Result>) -> Unit) -{ + fun onShowFileChooser( + pigeon_instanceArg: + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, + webViewArg: android.webkit.WebView, + paramsArg: android.webkit.WebChromeClient.FileChooserParams, + callback: (Result>) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3017,26 +3563,36 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL channel.send(listOf(pigeon_instanceArg, webViewArg, paramsArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback(Result.failure(AndroidWebKitError("null-error", "Flutter api returned null value for non-null return value.", ""))) + callback( + Result.failure( + AndroidWebKitError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) } else { val output = it[0] as List callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** - * Notify the host application that web content is requesting permission to - * access the specified resources and the permission currently isn't granted - * or denied. + * Notify the host application that web content is requesting permission to access the specified + * resources and the permission currently isn't granted or denied. */ - fun onPermissionRequest(pigeon_instanceArg: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, requestArg: android.webkit.PermissionRequest, callback: (Result) -> Unit) -{ + fun onPermissionRequest( + pigeon_instanceArg: + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, + requestArg: android.webkit.PermissionRequest, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3045,24 +3601,32 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.onPermissionRequest" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.onPermissionRequest" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, requestArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Callback to Dart function `WebChromeClient.onShowCustomView`. */ - fun onShowCustomView(pigeon_instanceArg: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, viewArg: android.view.View, callbackArg: android.webkit.WebChromeClient.CustomViewCallback, callback: (Result) -> Unit) -{ + fun onShowCustomView( + pigeon_instanceArg: + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, + viewArg: android.view.View, + callbackArg: android.webkit.WebChromeClient.CustomViewCallback, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3076,22 +3640,24 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL channel.send(listOf(pigeon_instanceArg, viewArg, callbackArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - /** - * Notify the host application that the current page has entered full screen - * mode. - */ - fun onHideCustomView(pigeon_instanceArg: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, callback: (Result) -> Unit) -{ + /** Notify the host application that the current page has entered full screen mode. */ + fun onHideCustomView( + pigeon_instanceArg: + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3105,23 +3671,29 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL channel.send(listOf(pigeon_instanceArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** - * Notify the host application that web content from the specified origin is - * attempting to use the Geolocation API, but no permission state is - * currently set for that origin. + * Notify the host application that web content from the specified origin is attempting to use the + * Geolocation API, but no permission state is currently set for that origin. */ - fun onGeolocationPermissionsShowPrompt(pigeon_instanceArg: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, originArg: String, callbackArg: android.webkit.GeolocationPermissions.Callback, callback: (Result) -> Unit) -{ + fun onGeolocationPermissionsShowPrompt( + pigeon_instanceArg: + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, + originArg: String, + callbackArg: android.webkit.GeolocationPermissions.Callback, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3130,28 +3702,33 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.onGeolocationPermissionsShowPrompt" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.onGeolocationPermissionsShowPrompt" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, originArg, callbackArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** - * Notify the host application that a request for Geolocation permissions, - * made with a previous call to `onGeolocationPermissionsShowPrompt` has been - * canceled. + * Notify the host application that a request for Geolocation permissions, made with a previous + * call to `onGeolocationPermissionsShowPrompt` has been canceled. */ - fun onGeolocationPermissionsHidePrompt(pigeon_instanceArg: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, callback: (Result) -> Unit) -{ + fun onGeolocationPermissionsHidePrompt( + pigeon_instanceArg: + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3160,24 +3737,31 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.onGeolocationPermissionsHidePrompt" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.onGeolocationPermissionsHidePrompt" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Report a JavaScript console message to the host application. */ - fun onConsoleMessage(pigeon_instanceArg: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, messageArg: android.webkit.ConsoleMessage, callback: (Result) -> Unit) -{ + fun onConsoleMessage( + pigeon_instanceArg: + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, + messageArg: android.webkit.ConsoleMessage, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3191,22 +3775,29 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL channel.send(listOf(pigeon_instanceArg, messageArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** - * Notify the host application that the web page wants to display a - * JavaScript `alert()` dialog. + * Notify the host application that the web page wants to display a JavaScript `alert()` dialog. */ - fun onJsAlert(pigeon_instanceArg: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, webViewArg: android.webkit.WebView, urlArg: String, messageArg: String, callback: (Result) -> Unit) -{ + fun onJsAlert( + pigeon_instanceArg: + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, + webViewArg: android.webkit.WebView, + urlArg: String, + messageArg: String, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3220,22 +3811,29 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL channel.send(listOf(pigeon_instanceArg, webViewArg, urlArg, messageArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** - * Notify the host application that the web page wants to display a - * JavaScript `confirm()` dialog. + * Notify the host application that the web page wants to display a JavaScript `confirm()` dialog. */ - fun onJsConfirm(pigeon_instanceArg: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, webViewArg: android.webkit.WebView, urlArg: String, messageArg: String, callback: (Result) -> Unit) -{ + fun onJsConfirm( + pigeon_instanceArg: + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, + webViewArg: android.webkit.WebView, + urlArg: String, + messageArg: String, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3249,25 +3847,38 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL channel.send(listOf(pigeon_instanceArg, webViewArg, urlArg, messageArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback(Result.failure(AndroidWebKitError("null-error", "Flutter api returned null value for non-null return value.", ""))) + callback( + Result.failure( + AndroidWebKitError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) } else { val output = it[0] as Boolean callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** - * Notify the host application that the web page wants to display a - * JavaScript `prompt()` dialog. + * Notify the host application that the web page wants to display a JavaScript `prompt()` dialog. */ - fun onJsPrompt(pigeon_instanceArg: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, webViewArg: android.webkit.WebView, urlArg: String, messageArg: String, defaultValueArg: String, callback: (Result) -> Unit) -{ + fun onJsPrompt( + pigeon_instanceArg: + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, + webViewArg: android.webkit.WebView, + urlArg: String, + messageArg: String, + defaultValueArg: String, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3281,17 +3892,18 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL channel.send(listOf(pigeon_instanceArg, webViewArg, urlArg, messageArg, defaultValueArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { val output = it[0] as String? callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - } /** * Provides access to the assets registered as part of the App bundle. @@ -3299,7 +3911,9 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL * Convenience class for accessing Flutter asset resources. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiFlutterAssetManager(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiFlutterAssetManager( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { /** The global instance of the `FlutterAssetManager`. */ abstract fun instance(): io.flutter.plugins.webviewflutter.FlutterAssetManager @@ -3308,35 +3922,46 @@ abstract class PigeonApiFlutterAssetManager(open val pigeonRegistrar: AndroidWeb * * Throws an IOException in case I/O operations were interrupted. */ - abstract fun list(pigeon_instance: io.flutter.plugins.webviewflutter.FlutterAssetManager, path: String): List + abstract fun list( + pigeon_instance: io.flutter.plugins.webviewflutter.FlutterAssetManager, + path: String + ): List /** * Gets the relative file path to the Flutter asset with the given name, including the file's * extension, e.g., "myImage.jpg". * - * The returned file path is relative to the Android app's standard asset's - * directory. Therefore, the returned path is appropriate to pass to - * Android's AssetManager, but the path is not appropriate to load as an - * absolute path. + * The returned file path is relative to the Android app's standard asset's directory. Therefore, + * the returned path is appropriate to pass to Android's AssetManager, but the path is not + * appropriate to load as an absolute path. */ - abstract fun getAssetFilePathByName(pigeon_instance: io.flutter.plugins.webviewflutter.FlutterAssetManager, name: String): String + abstract fun getAssetFilePathByName( + pigeon_instance: io.flutter.plugins.webviewflutter.FlutterAssetManager, + name: String + ): String companion object { @Suppress("LocalVariableName") fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiFlutterAssetManager?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.FlutterAssetManager.instance", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.FlutterAssetManager.instance", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_identifierArg = args[0] as Long - val wrapped: List = try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.instance(), pigeon_identifierArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + api.instance(), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3344,17 +3969,23 @@ abstract class PigeonApiFlutterAssetManager(open val pigeonRegistrar: AndroidWeb } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.FlutterAssetManager.list", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.FlutterAssetManager.list", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_instanceArg = args[0] as io.flutter.plugins.webviewflutter.FlutterAssetManager + val pigeon_instanceArg = + args[0] as io.flutter.plugins.webviewflutter.FlutterAssetManager val pathArg = args[1] as String - val wrapped: List = try { - listOf(api.list(pigeon_instanceArg, pathArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.list(pigeon_instanceArg, pathArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3362,17 +3993,23 @@ abstract class PigeonApiFlutterAssetManager(open val pigeonRegistrar: AndroidWeb } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.FlutterAssetManager.getAssetFilePathByName", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.FlutterAssetManager.getAssetFilePathByName", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_instanceArg = args[0] as io.flutter.plugins.webviewflutter.FlutterAssetManager + val pigeon_instanceArg = + args[0] as io.flutter.plugins.webviewflutter.FlutterAssetManager val nameArg = args[1] as String - val wrapped: List = try { - listOf(api.getAssetFilePathByName(pigeon_instanceArg, nameArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.getAssetFilePathByName(pigeon_instanceArg, nameArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3384,8 +4021,10 @@ abstract class PigeonApiFlutterAssetManager(open val pigeonRegistrar: AndroidWeb @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of FlutterAssetManager and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: io.flutter.plugins.webviewflutter.FlutterAssetManager, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: io.flutter.plugins.webviewflutter.FlutterAssetManager, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3396,33 +4035,37 @@ abstract class PigeonApiFlutterAssetManager(open val pigeonRegistrar: AndroidWeb Result.success(Unit) return } - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.FlutterAssetManager.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.FlutterAssetManager.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - } /** - * This class is used to manage the JavaScript storage APIs provided by the - * WebView. + * This class is used to manage the JavaScript storage APIs provided by the WebView. * * See https://developer.android.com/reference/android/webkit/WebStorage. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiWebStorage(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiWebStorage( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { abstract fun instance(): android.webkit.WebStorage /** Clears all storage currently being used by the JavaScript storage APIs. */ @@ -3433,17 +4076,23 @@ abstract class PigeonApiWebStorage(open val pigeonRegistrar: AndroidWebkitLibrar fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiWebStorage?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebStorage.instance", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebStorage.instance", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_identifierArg = args[0] as Long - val wrapped: List = try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.instance(), pigeon_identifierArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + api.instance(), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3451,17 +4100,22 @@ abstract class PigeonApiWebStorage(open val pigeonRegistrar: AndroidWebkitLibrar } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebStorage.deleteAllData", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebStorage.deleteAllData", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebStorage - val wrapped: List = try { - api.deleteAllData(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.deleteAllData(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3473,8 +4127,10 @@ abstract class PigeonApiWebStorage(open val pigeonRegistrar: AndroidWebkitLibrar @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of WebStorage and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.webkit.WebStorage, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.webkit.WebStorage, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3485,7 +4141,8 @@ abstract class PigeonApiWebStorage(open val pigeonRegistrar: AndroidWebkitLibrar Result.success(Unit) return } - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.webview_flutter_android.WebStorage.pigeon_newInstance" @@ -3493,16 +4150,17 @@ abstract class PigeonApiWebStorage(open val pigeonRegistrar: AndroidWebkitLibrar channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - } /** * Parameters used in the `WebChromeClient.onShowFileChooser` method. @@ -3510,23 +4168,35 @@ abstract class PigeonApiWebStorage(open val pigeonRegistrar: AndroidWebkitLibrar * See https://developer.android.com/reference/android/webkit/WebChromeClient.FileChooserParams. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiFileChooserParams(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiFileChooserParams( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { /** Preference for a live media captured value (e.g. Camera, Microphone). */ - abstract fun isCaptureEnabled(pigeon_instance: android.webkit.WebChromeClient.FileChooserParams): Boolean + abstract fun isCaptureEnabled( + pigeon_instance: android.webkit.WebChromeClient.FileChooserParams + ): Boolean /** An array of acceptable MIME types. */ - abstract fun acceptTypes(pigeon_instance: android.webkit.WebChromeClient.FileChooserParams): List + abstract fun acceptTypes( + pigeon_instance: android.webkit.WebChromeClient.FileChooserParams + ): List /** File chooser mode. */ - abstract fun mode(pigeon_instance: android.webkit.WebChromeClient.FileChooserParams): FileChooserMode + abstract fun mode( + pigeon_instance: android.webkit.WebChromeClient.FileChooserParams + ): FileChooserMode /** File name of a default selection if specified, or null. */ - abstract fun filenameHint(pigeon_instance: android.webkit.WebChromeClient.FileChooserParams): String? + abstract fun filenameHint( + pigeon_instance: android.webkit.WebChromeClient.FileChooserParams + ): String? @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of FileChooserParams and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.webkit.WebChromeClient.FileChooserParams, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.webkit.WebChromeClient.FileChooserParams, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3537,43 +4207,47 @@ abstract class PigeonApiFileChooserParams(open val pigeonRegistrar: AndroidWebki Result.success(Unit) return } - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val isCaptureEnabledArg = isCaptureEnabled(pigeon_instanceArg) val acceptTypesArg = acceptTypes(pigeon_instanceArg) val modeArg = mode(pigeon_instanceArg) val filenameHintArg = filenameHint(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.FileChooserParams.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.FileChooserParams.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_identifierArg, isCaptureEnabledArg, acceptTypesArg, modeArg, filenameHintArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) - } else { - callback(Result.success(Unit)) + channel.send( + listOf( + pigeon_identifierArg, isCaptureEnabledArg, acceptTypesArg, modeArg, filenameHintArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } } - } else { - callback(Result.failure(createConnectionError(channelName))) - } - } } - } /** - * This class defines a permission request and is used when web content - * requests access to protected resources. + * This class defines a permission request and is used when web content requests access to protected + * resources. * * See https://developer.android.com/reference/android/webkit/PermissionRequest. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiPermissionRequest(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiPermissionRequest( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { abstract fun resources(pigeon_instance: android.webkit.PermissionRequest): List - /** - * Call this method to grant origin the permission to access the given - * resources. - */ + /** Call this method to grant origin the permission to access the given resources. */ abstract fun grant(pigeon_instance: android.webkit.PermissionRequest, resources: List) /** Call this method to deny the request. */ @@ -3584,18 +4258,23 @@ abstract class PigeonApiPermissionRequest(open val pigeonRegistrar: AndroidWebki fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiPermissionRequest?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.PermissionRequest.grant", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.PermissionRequest.grant", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.PermissionRequest val resourcesArg = args[1] as List - val wrapped: List = try { - api.grant(pigeon_instanceArg, resourcesArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.grant(pigeon_instanceArg, resourcesArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3603,17 +4282,22 @@ abstract class PigeonApiPermissionRequest(open val pigeonRegistrar: AndroidWebki } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.PermissionRequest.deny", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.PermissionRequest.deny", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.PermissionRequest - val wrapped: List = try { - api.deny(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.deny(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3625,8 +4309,10 @@ abstract class PigeonApiPermissionRequest(open val pigeonRegistrar: AndroidWebki @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of PermissionRequest and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.webkit.PermissionRequest, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.webkit.PermissionRequest, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3637,53 +4323,65 @@ abstract class PigeonApiPermissionRequest(open val pigeonRegistrar: AndroidWebki Result.success(Unit) return } - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val resourcesArg = resources(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.PermissionRequest.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.PermissionRequest.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg, resourcesArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - } /** - * A callback interface used by the host application to notify the current page - * that its custom view has been dismissed. + * A callback interface used by the host application to notify the current page that its custom view + * has been dismissed. * * See https://developer.android.com/reference/android/webkit/WebChromeClient.CustomViewCallback. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiCustomViewCallback(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiCustomViewCallback( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { /** Invoked when the host application dismisses the custom view. */ - abstract fun onCustomViewHidden(pigeon_instance: android.webkit.WebChromeClient.CustomViewCallback) + abstract fun onCustomViewHidden( + pigeon_instance: android.webkit.WebChromeClient.CustomViewCallback + ) companion object { @Suppress("LocalVariableName") fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiCustomViewCallback?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.CustomViewCallback.onCustomViewHidden", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.CustomViewCallback.onCustomViewHidden", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebChromeClient.CustomViewCallback - val wrapped: List = try { - api.onCustomViewHidden(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.onCustomViewHidden(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3695,8 +4393,10 @@ abstract class PigeonApiCustomViewCallback(open val pigeonRegistrar: AndroidWebk @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of CustomViewCallback and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.webkit.WebChromeClient.CustomViewCallback, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.webkit.WebChromeClient.CustomViewCallback, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3707,33 +4407,37 @@ abstract class PigeonApiCustomViewCallback(open val pigeonRegistrar: AndroidWebk Result.success(Unit) return } - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.CustomViewCallback.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.CustomViewCallback.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - } /** - * This class represents the basic building block for user interface - * components. + * This class represents the basic building block for user interface components. * * See https://developer.android.com/reference/android/view/View. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiView(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiView( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { /** Set the scrolled position of your view. */ abstract fun scrollTo(pigeon_instance: android.view.View, x: Long, y: Long) @@ -3762,19 +4466,22 @@ abstract class PigeonApiView(open val pigeonRegistrar: AndroidWebkitLibraryPigeo fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiView?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.View.scrollTo", codec) + val channel = + BasicMessageChannel( + binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.View.scrollTo", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.view.View val xArg = args[1] as Long val yArg = args[2] as Long - val wrapped: List = try { - api.scrollTo(pigeon_instanceArg, xArg, yArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.scrollTo(pigeon_instanceArg, xArg, yArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3782,19 +4489,22 @@ abstract class PigeonApiView(open val pigeonRegistrar: AndroidWebkitLibraryPigeo } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.View.scrollBy", codec) + val channel = + BasicMessageChannel( + binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.View.scrollBy", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.view.View val xArg = args[1] as Long val yArg = args[2] as Long - val wrapped: List = try { - api.scrollBy(pigeon_instanceArg, xArg, yArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.scrollBy(pigeon_instanceArg, xArg, yArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3802,16 +4512,21 @@ abstract class PigeonApiView(open val pigeonRegistrar: AndroidWebkitLibraryPigeo } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.View.getScrollPosition", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.View.getScrollPosition", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.view.View - val wrapped: List = try { - listOf(api.getScrollPosition(pigeon_instanceArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.getScrollPosition(pigeon_instanceArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3819,18 +4534,23 @@ abstract class PigeonApiView(open val pigeonRegistrar: AndroidWebkitLibraryPigeo } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.View.setVerticalScrollBarEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.View.setVerticalScrollBarEnabled", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.view.View val enabledArg = args[1] as Boolean - val wrapped: List = try { - api.setVerticalScrollBarEnabled(pigeon_instanceArg, enabledArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.setVerticalScrollBarEnabled(pigeon_instanceArg, enabledArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3838,18 +4558,23 @@ abstract class PigeonApiView(open val pigeonRegistrar: AndroidWebkitLibraryPigeo } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.View.setHorizontalScrollBarEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.View.setHorizontalScrollBarEnabled", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.view.View val enabledArg = args[1] as Boolean - val wrapped: List = try { - api.setHorizontalScrollBarEnabled(pigeon_instanceArg, enabledArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.setHorizontalScrollBarEnabled(pigeon_instanceArg, enabledArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3861,8 +4586,7 @@ abstract class PigeonApiView(open val pigeonRegistrar: AndroidWebkitLibraryPigeo @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of View and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.view.View, callback: (Result) -> Unit) -{ + fun pigeon_newInstance(pigeon_instanceArg: android.view.View, callback: (Result) -> Unit) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3873,7 +4597,8 @@ abstract class PigeonApiView(open val pigeonRegistrar: AndroidWebkitLibraryPigeo Result.success(Unit) return } - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.webview_flutter_android.View.pigeon_newInstance" @@ -3881,34 +4606,49 @@ abstract class PigeonApiView(open val pigeonRegistrar: AndroidWebkitLibraryPigeo channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - } /** - * A callback interface used by the host application to set the Geolocation - * permission state for an origin. + * A callback interface used by the host application to set the Geolocation permission state for an + * origin. * * See https://developer.android.com/reference/android/webkit/GeolocationPermissions.Callback. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiGeolocationPermissionsCallback(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiGeolocationPermissionsCallback( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { /** Sets the Geolocation permission state for the supplied origin. */ - abstract fun invoke(pigeon_instance: android.webkit.GeolocationPermissions.Callback, origin: String, allow: Boolean, retain: Boolean) + abstract fun invoke( + pigeon_instance: android.webkit.GeolocationPermissions.Callback, + origin: String, + allow: Boolean, + retain: Boolean + ) companion object { @Suppress("LocalVariableName") - fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiGeolocationPermissionsCallback?) { + fun setUpMessageHandlers( + binaryMessenger: BinaryMessenger, + api: PigeonApiGeolocationPermissionsCallback? + ) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.GeolocationPermissionsCallback.invoke", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.GeolocationPermissionsCallback.invoke", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3916,12 +4656,13 @@ abstract class PigeonApiGeolocationPermissionsCallback(open val pigeonRegistrar: val originArg = args[1] as String val allowArg = args[2] as Boolean val retainArg = args[3] as Boolean - val wrapped: List = try { - api.invoke(pigeon_instanceArg, originArg, allowArg, retainArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.invoke(pigeon_instanceArg, originArg, allowArg, retainArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3932,9 +4673,14 @@ abstract class PigeonApiGeolocationPermissionsCallback(open val pigeonRegistrar: } @Suppress("LocalVariableName", "FunctionName") - /** Creates a Dart instance of GeolocationPermissionsCallback and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.webkit.GeolocationPermissions.Callback, callback: (Result) -> Unit) -{ + /** + * Creates a Dart instance of GeolocationPermissionsCallback and attaches it to + * [pigeon_instanceArg]. + */ + fun pigeon_newInstance( + pigeon_instanceArg: android.webkit.GeolocationPermissions.Callback, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3945,24 +4691,27 @@ abstract class PigeonApiGeolocationPermissionsCallback(open val pigeonRegistrar: Result.success(Unit) return } - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.GeolocationPermissionsCallback.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.GeolocationPermissionsCallback.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - } /** * Represents a request for HTTP authentication. @@ -3970,38 +4719,45 @@ abstract class PigeonApiGeolocationPermissionsCallback(open val pigeonRegistrar: * See https://developer.android.com/reference/android/webkit/HttpAuthHandler. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiHttpAuthHandler(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiHttpAuthHandler( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { /** - * Gets whether the credentials stored for the current host (i.e. the host - * for which `WebViewClient.onReceivedHttpAuthRequest` was called) are - * suitable for use. + * Gets whether the credentials stored for the current host (i.e. the host for which + * `WebViewClient.onReceivedHttpAuthRequest` was called) are suitable for use. */ abstract fun useHttpAuthUsernamePassword(pigeon_instance: android.webkit.HttpAuthHandler): Boolean /** Instructs the WebView to cancel the authentication request.. */ abstract fun cancel(pigeon_instance: android.webkit.HttpAuthHandler) - /** - * Instructs the WebView to proceed with the authentication with the given - * credentials. - */ - abstract fun proceed(pigeon_instance: android.webkit.HttpAuthHandler, username: String, password: String) + /** Instructs the WebView to proceed with the authentication with the given credentials. */ + abstract fun proceed( + pigeon_instance: android.webkit.HttpAuthHandler, + username: String, + password: String + ) companion object { @Suppress("LocalVariableName") fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiHttpAuthHandler?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.HttpAuthHandler.useHttpAuthUsernamePassword", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.HttpAuthHandler.useHttpAuthUsernamePassword", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.HttpAuthHandler - val wrapped: List = try { - listOf(api.useHttpAuthUsernamePassword(pigeon_instanceArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.useHttpAuthUsernamePassword(pigeon_instanceArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4009,17 +4765,22 @@ abstract class PigeonApiHttpAuthHandler(open val pigeonRegistrar: AndroidWebkitL } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.HttpAuthHandler.cancel", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.HttpAuthHandler.cancel", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.HttpAuthHandler - val wrapped: List = try { - api.cancel(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.cancel(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4027,19 +4788,24 @@ abstract class PigeonApiHttpAuthHandler(open val pigeonRegistrar: AndroidWebkitL } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.HttpAuthHandler.proceed", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.HttpAuthHandler.proceed", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.HttpAuthHandler val usernameArg = args[1] as String val passwordArg = args[2] as String - val wrapped: List = try { - api.proceed(pigeon_instanceArg, usernameArg, passwordArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.proceed(pigeon_instanceArg, usernameArg, passwordArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4051,8 +4817,10 @@ abstract class PigeonApiHttpAuthHandler(open val pigeonRegistrar: AndroidWebkitL @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of HttpAuthHandler and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.webkit.HttpAuthHandler, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.webkit.HttpAuthHandler, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -4063,22 +4831,25 @@ abstract class PigeonApiHttpAuthHandler(open val pigeonRegistrar: AndroidWebkitL Result.success(Unit) return } - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.HttpAuthHandler.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.HttpAuthHandler.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - } diff --git a/packages/webview_flutter/webview_flutter_android/lib/src/android_webkit.g.dart b/packages/webview_flutter/webview_flutter_android/lib/src/android_webkit.g.dart index f3c6db856ba..15fa036cc3e 100644 --- a/packages/webview_flutter/webview_flutter_android/lib/src/android_webkit.g.dart +++ b/packages/webview_flutter/webview_flutter_android/lib/src/android_webkit.g.dart @@ -8,7 +8,8 @@ import 'dart:async'; import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; -import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer, immutable, protected; +import 'package:flutter/foundation.dart' + show ReadBuffer, WriteBuffer, immutable, protected; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart' show WidgetsFlutterBinding; @@ -19,7 +20,8 @@ PlatformException _createConnectionError(String channelName) { ); } -List wrapResponse({Object? result, PlatformException? error, bool empty = false}) { +List wrapResponse( + {Object? result, PlatformException? error, bool empty = false}) { if (empty) { return []; } @@ -28,6 +30,7 @@ List wrapResponse({Object? result, PlatformException? error, bool empty } return [error.code, error.message, error.details]; } + /// An immutable object that serves as the base class for all ProxyApis and /// can provide functional copies of itself. /// @@ -110,9 +113,10 @@ class PigeonInstanceManager { // by calling instanceManager.getIdentifier() inside of `==` while this was a // HashMap). final Expando _identifiers = Expando(); - final Map> _weakInstances = - >{}; - final Map _strongInstances = {}; + final Map> + _weakInstances = >{}; + final Map _strongInstances = + {}; late final Finalizer _finalizer; int _nextIdentifier = 0; @@ -122,7 +126,8 @@ class PigeonInstanceManager { static PigeonInstanceManager _initInstance() { WidgetsFlutterBinding.ensureInitialized(); - final _PigeonInternalInstanceManagerApi api = _PigeonInternalInstanceManagerApi(); + final _PigeonInternalInstanceManagerApi api = + _PigeonInternalInstanceManagerApi(); // Clears the native `PigeonInstanceManager` on the initial use of the Dart one. api.clear(); final PigeonInstanceManager instanceManager = PigeonInstanceManager( @@ -130,28 +135,49 @@ class PigeonInstanceManager { api.removeStrongReference(identifier); }, ); - _PigeonInternalInstanceManagerApi.setUpMessageHandlers(instanceManager: instanceManager); - WebResourceRequest.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WebResourceResponse.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WebResourceError.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WebResourceErrorCompat.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WebViewPoint.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - ConsoleMessage.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - CookieManager.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WebView.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WebSettings.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - JavaScriptChannel.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WebViewClient.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - DownloadListener.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WebChromeClient.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - FlutterAssetManager.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WebStorage.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - FileChooserParams.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - PermissionRequest.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - CustomViewCallback.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + _PigeonInternalInstanceManagerApi.setUpMessageHandlers( + instanceManager: instanceManager); + WebResourceRequest.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WebResourceResponse.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WebResourceError.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WebResourceErrorCompat.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WebViewPoint.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + ConsoleMessage.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + CookieManager.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WebView.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WebSettings.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + JavaScriptChannel.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WebViewClient.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + DownloadListener.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WebChromeClient.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + FlutterAssetManager.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WebStorage.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + FileChooserParams.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + PermissionRequest.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + CustomViewCallback.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); View.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - GeolocationPermissionsCallback.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - HttpAuthHandler.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + GeolocationPermissionsCallback.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + HttpAuthHandler.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); return instanceManager; } @@ -215,15 +241,20 @@ class PigeonInstanceManager { /// /// This method also expects the host `InstanceManager` to have a strong /// reference to the instance the identifier is associated with. - T? getInstanceWithWeakReference(int identifier) { - final PigeonInternalProxyApiBaseClass? weakInstance = _weakInstances[identifier]?.target; + T? getInstanceWithWeakReference( + int identifier) { + final PigeonInternalProxyApiBaseClass? weakInstance = + _weakInstances[identifier]?.target; if (weakInstance == null) { - final PigeonInternalProxyApiBaseClass? strongInstance = _strongInstances[identifier]; + final PigeonInternalProxyApiBaseClass? strongInstance = + _strongInstances[identifier]; if (strongInstance != null) { - final PigeonInternalProxyApiBaseClass copy = strongInstance.pigeon_copy(); + final PigeonInternalProxyApiBaseClass copy = + strongInstance.pigeon_copy(); _identifiers[copy] = identifier; - _weakInstances[identifier] = WeakReference(copy); + _weakInstances[identifier] = + WeakReference(copy); _finalizer.attach(copy, identifier, detach: copy); return copy as T; } @@ -247,17 +278,20 @@ class PigeonInstanceManager { /// added. /// /// Returns unique identifier of the [instance] added. - void addHostCreatedInstance(PigeonInternalProxyApiBaseClass instance, int identifier) { + void addHostCreatedInstance( + PigeonInternalProxyApiBaseClass instance, int identifier) { _addInstanceWithIdentifier(instance, identifier); } - void _addInstanceWithIdentifier(PigeonInternalProxyApiBaseClass instance, int identifier) { + void _addInstanceWithIdentifier( + PigeonInternalProxyApiBaseClass instance, int identifier) { assert(!containsIdentifier(identifier)); assert(getIdentifier(instance) == null); assert(identifier >= 0); _identifiers[instance] = identifier; - _weakInstances[identifier] = WeakReference(instance); + _weakInstances[identifier] = + WeakReference(instance); _finalizer.attach(instance, identifier, detach: instance); final PigeonInternalProxyApiBaseClass copy = instance.pigeon_copy(); @@ -381,29 +415,29 @@ class _PigeonInternalInstanceManagerApi { } class _PigeonInternalProxyApiBaseCodec extends _PigeonCodec { - const _PigeonInternalProxyApiBaseCodec(this.instanceManager); - final PigeonInstanceManager instanceManager; - @override - void writeValue(WriteBuffer buffer, Object? value) { - if (value is PigeonInternalProxyApiBaseClass) { - buffer.putUint8(128); - writeValue(buffer, instanceManager.getIdentifier(value)); - } else { - super.writeValue(buffer, value); - } - } - @override - Object? readValueOfType(int type, ReadBuffer buffer) { - switch (type) { - case 128: - return instanceManager - .getInstanceWithWeakReference(readValue(buffer)! as int); - default: - return super.readValueOfType(type, buffer); - } - } -} + const _PigeonInternalProxyApiBaseCodec(this.instanceManager); + final PigeonInstanceManager instanceManager; + @override + void writeValue(WriteBuffer buffer, Object? value) { + if (value is PigeonInternalProxyApiBaseClass) { + buffer.putUint8(128); + writeValue(buffer, instanceManager.getIdentifier(value)); + } else { + super.writeValue(buffer, value); + } + } + @override + Object? readValueOfType(int type, ReadBuffer buffer) { + switch (type) { + case 128: + return instanceManager + .getInstanceWithWeakReference(readValue(buffer)! as int); + default: + return super.readValueOfType(type, buffer); + } + } +} /// Mode of how to select files for a file chooser. /// @@ -414,14 +448,17 @@ enum FileChooserMode { /// /// See https://developer.android.com/reference/android/webkit/WebChromeClient.FileChooserParams#MODE_OPEN. open, + /// Similar to [open] but allows multiple files to be selected. /// /// See https://developer.android.com/reference/android/webkit/WebChromeClient.FileChooserParams#MODE_OPEN_MULTIPLE. openMultiple, + /// Allows picking a nonexistent file and saving it. /// /// See https://developer.android.com/reference/android/webkit/WebChromeClient.FileChooserParams#MODE_SAVE. save, + /// Indicates a `FileChooserMode` with an unknown mode. /// /// This does not represent an actual value provided by the platform and only @@ -437,22 +474,27 @@ enum ConsoleMessageLevel { /// /// See https://developer.android.com/reference/android/webkit/ConsoleMessage.MessageLevel#DEBUG. debug, + /// Indicates a message is provided as an error. /// /// See https://developer.android.com/reference/android/webkit/ConsoleMessage.MessageLevel#ERROR. error, + /// Indicates a message is provided as a basic log message. /// /// See https://developer.android.com/reference/android/webkit/ConsoleMessage.MessageLevel#LOG. log, + /// Indicates a message is provided as a tip. /// /// See https://developer.android.com/reference/android/webkit/ConsoleMessage.MessageLevel#TIP. tip, + /// Indicates a message is provided as a warning. /// /// See https://developer.android.com/reference/android/webkit/ConsoleMessage.MessageLevel#WARNING. warning, + /// Indicates a message with an unknown level. /// /// This does not represent an actual value provided by the platform and only @@ -460,7 +502,6 @@ enum ConsoleMessageLevel { unknown, } - class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override @@ -468,10 +509,10 @@ class _PigeonCodec extends StandardMessageCodec { if (value is int) { buffer.putUint8(4); buffer.putInt64(value); - } else if (value is FileChooserMode) { + } else if (value is FileChooserMode) { buffer.putUint8(129); writeValue(buffer, value.index); - } else if (value is ConsoleMessageLevel) { + } else if (value is ConsoleMessageLevel) { buffer.putUint8(130); writeValue(buffer, value.index); } else { @@ -482,10 +523,10 @@ class _PigeonCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 129: + case 129: final int? value = readValue(buffer) as int?; return value == null ? null : FileChooserMode.values[value]; - case 130: + case 130: final int? value = readValue(buffer) as int?; return value == null ? null : ConsoleMessageLevel.values[value]; default: @@ -493,6 +534,7 @@ class _PigeonCodec extends StandardMessageCodec { } } } + /// Encompasses parameters to the `WebViewClient.shouldInterceptRequest` method. /// /// See https://developer.android.com/reference/android/webkit/WebResourceRequest. @@ -6222,4 +6264,3 @@ class HttpAuthHandler extends PigeonInternalProxyApiBaseClass { ); } } - diff --git a/packages/webview_flutter/webview_flutter_android/test/android_navigation_delegate_test.mocks.dart b/packages/webview_flutter/webview_flutter_android/test/android_navigation_delegate_test.mocks.dart index 52363b1bd59..7d84c4694a1 100644 --- a/packages/webview_flutter/webview_flutter_android/test/android_navigation_delegate_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_android/test/android_navigation_delegate_test.mocks.dart @@ -25,19 +25,19 @@ import 'package:webview_flutter_android/src/android_webkit.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 _FakeHttpAuthHandler_1 extends _i1.SmartFake implements _i2.HttpAuthHandler { _FakeHttpAuthHandler_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeDownloadListener_2 extends _i1.SmartFake implements _i2.DownloadListener { _FakeDownloadListener_2(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } /// A class which mocks [HttpAuthHandler]. @@ -49,52 +49,43 @@ class MockHttpAuthHandler extends _i1.Mock implements _i2.HttpAuthHandler { } @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 useHttpAuthUsernamePassword() => - (super.noSuchMethod( - Invocation.method(#useHttpAuthUsernamePassword, []), - returnValue: _i3.Future.value(false), - ) - as _i3.Future); + _i3.Future useHttpAuthUsernamePassword() => (super.noSuchMethod( + Invocation.method(#useHttpAuthUsernamePassword, []), + returnValue: _i3.Future.value(false), + ) as _i3.Future); @override - _i3.Future cancel() => - (super.noSuchMethod( - Invocation.method(#cancel, []), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + _i3.Future cancel() => (super.noSuchMethod( + Invocation.method(#cancel, []), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future proceed(String? username, String? password) => (super.noSuchMethod( - Invocation.method(#proceed, [username, password]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#proceed, [username, password]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override - _i2.HttpAuthHandler pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeHttpAuthHandler_1( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.HttpAuthHandler); + _i2.HttpAuthHandler pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeHttpAuthHandler_1( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.HttpAuthHandler); } /// A class which mocks [DownloadListener]. @@ -107,20 +98,17 @@ class MockDownloadListener extends _i1.Mock implements _i2.DownloadListener { @override void Function(_i2.DownloadListener, String, String, String, String, int) - get onDownloadStart => - (super.noSuchMethod( + get onDownloadStart => (super.noSuchMethod( Invocation.getter(#onDownloadStart), - returnValue: - ( - _i2.DownloadListener pigeon_instance, - String url, - String userAgent, - String contentDisposition, - String mimetype, - int contentLength, - ) {}, - ) - as void Function( + returnValue: ( + _i2.DownloadListener pigeon_instance, + String url, + String userAgent, + String contentDisposition, + String mimetype, + int contentLength, + ) {}, + ) as void Function( _i2.DownloadListener, String, String, @@ -130,24 +118,20 @@ class MockDownloadListener extends _i1.Mock implements _i2.DownloadListener { )); @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.DownloadListener pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeDownloadListener_2( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.DownloadListener); + _i2.DownloadListener pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeDownloadListener_2( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.DownloadListener); } diff --git a/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.mocks.dart b/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.mocks.dart index e051b20ddc7..a132fd8097c 100644 --- a/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.mocks.dart @@ -38,18 +38,18 @@ import 'package:webview_flutter_platform_interface/webview_flutter_platform_inte class _FakeWebChromeClient_0 extends _i1.SmartFake implements _i2.WebChromeClient { _FakeWebChromeClient_0(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWebViewClient_1 extends _i1.SmartFake implements _i2.WebViewClient { _FakeWebViewClient_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeDownloadListener_2 extends _i1.SmartFake implements _i2.DownloadListener { _FakeDownloadListener_2(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakePlatformNavigationDelegateCreationParams_3 extends _i1.SmartFake @@ -70,62 +70,62 @@ class _FakePlatformWebViewControllerCreationParams_4 extends _i1.SmartFake class _FakeObject_5 extends _i1.SmartFake implements Object { _FakeObject_5(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeOffset_6 extends _i1.SmartFake implements _i4.Offset { _FakeOffset_6(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWebView_7 extends _i1.SmartFake implements _i2.WebView { _FakeWebView_7(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeJavaScriptChannel_8 extends _i1.SmartFake implements _i2.JavaScriptChannel { _FakeJavaScriptChannel_8(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeCookieManager_9 extends _i1.SmartFake implements _i2.CookieManager { _FakeCookieManager_9(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeFlutterAssetManager_10 extends _i1.SmartFake implements _i2.FlutterAssetManager { _FakeFlutterAssetManager_10(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWebStorage_11 extends _i1.SmartFake implements _i2.WebStorage { _FakeWebStorage_11(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakePigeonInstanceManager_12 extends _i1.SmartFake implements _i2.PigeonInstanceManager { _FakePigeonInstanceManager_12(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakePlatformViewsServiceProxy_13 extends _i1.SmartFake implements _i5.PlatformViewsServiceProxy { _FakePlatformViewsServiceProxy_13(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakePlatformWebViewController_14 extends _i1.SmartFake implements _i3.PlatformWebViewController { _FakePlatformWebViewController_14(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeSize_15 extends _i1.SmartFake implements _i4.Size { _FakeSize_15(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeGeolocationPermissionsCallback_16 extends _i1.SmartFake @@ -139,7 +139,7 @@ class _FakeGeolocationPermissionsCallback_16 extends _i1.SmartFake class _FakePermissionRequest_17 extends _i1.SmartFake implements _i2.PermissionRequest { _FakePermissionRequest_17(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeExpensiveAndroidViewController_18 extends _i1.SmartFake @@ -160,12 +160,12 @@ class _FakeSurfaceAndroidViewController_19 extends _i1.SmartFake class _FakeWebSettings_20 extends _i1.SmartFake implements _i2.WebSettings { _FakeWebSettings_20(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWebViewPoint_21 extends _i1.SmartFake implements _i2.WebViewPoint { _FakeWebViewPoint_21(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } /// A class which mocks [AndroidNavigationDelegate]. @@ -174,152 +174,136 @@ class _FakeWebViewPoint_21 extends _i1.SmartFake implements _i2.WebViewPoint { class MockAndroidNavigationDelegate extends _i1.Mock implements _i7.AndroidNavigationDelegate { @override - _i2.WebChromeClient get androidWebChromeClient => - (super.noSuchMethod( - Invocation.getter(#androidWebChromeClient), - returnValue: _FakeWebChromeClient_0( - this, - Invocation.getter(#androidWebChromeClient), - ), - returnValueForMissingStub: _FakeWebChromeClient_0( - this, - Invocation.getter(#androidWebChromeClient), - ), - ) - as _i2.WebChromeClient); - - @override - _i2.WebViewClient get androidWebViewClient => - (super.noSuchMethod( - Invocation.getter(#androidWebViewClient), - returnValue: _FakeWebViewClient_1( - this, - Invocation.getter(#androidWebViewClient), - ), - returnValueForMissingStub: _FakeWebViewClient_1( - this, - Invocation.getter(#androidWebViewClient), - ), - ) - as _i2.WebViewClient); - - @override - _i2.DownloadListener get androidDownloadListener => - (super.noSuchMethod( - Invocation.getter(#androidDownloadListener), - returnValue: _FakeDownloadListener_2( - this, - Invocation.getter(#androidDownloadListener), - ), - returnValueForMissingStub: _FakeDownloadListener_2( - this, - Invocation.getter(#androidDownloadListener), - ), - ) - as _i2.DownloadListener); + _i2.WebChromeClient get androidWebChromeClient => (super.noSuchMethod( + Invocation.getter(#androidWebChromeClient), + returnValue: _FakeWebChromeClient_0( + this, + Invocation.getter(#androidWebChromeClient), + ), + returnValueForMissingStub: _FakeWebChromeClient_0( + this, + Invocation.getter(#androidWebChromeClient), + ), + ) as _i2.WebChromeClient); + + @override + _i2.WebViewClient get androidWebViewClient => (super.noSuchMethod( + Invocation.getter(#androidWebViewClient), + returnValue: _FakeWebViewClient_1( + this, + Invocation.getter(#androidWebViewClient), + ), + returnValueForMissingStub: _FakeWebViewClient_1( + this, + Invocation.getter(#androidWebViewClient), + ), + ) as _i2.WebViewClient); + + @override + _i2.DownloadListener get androidDownloadListener => (super.noSuchMethod( + Invocation.getter(#androidDownloadListener), + returnValue: _FakeDownloadListener_2( + this, + Invocation.getter(#androidDownloadListener), + ), + returnValueForMissingStub: _FakeDownloadListener_2( + this, + Invocation.getter(#androidDownloadListener), + ), + ) as _i2.DownloadListener); @override _i3.PlatformNavigationDelegateCreationParams get params => (super.noSuchMethod( - Invocation.getter(#params), - returnValue: _FakePlatformNavigationDelegateCreationParams_3( - this, - Invocation.getter(#params), - ), - returnValueForMissingStub: - _FakePlatformNavigationDelegateCreationParams_3( - this, - Invocation.getter(#params), - ), - ) - as _i3.PlatformNavigationDelegateCreationParams); + Invocation.getter(#params), + returnValue: _FakePlatformNavigationDelegateCreationParams_3( + this, + Invocation.getter(#params), + ), + returnValueForMissingStub: + _FakePlatformNavigationDelegateCreationParams_3( + this, + Invocation.getter(#params), + ), + ) as _i3.PlatformNavigationDelegateCreationParams); @override _i8.Future setOnLoadRequest(_i7.LoadRequestCallback? onLoadRequest) => (super.noSuchMethod( - Invocation.method(#setOnLoadRequest, [onLoadRequest]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setOnLoadRequest, [onLoadRequest]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setOnNavigationRequest( _i3.NavigationRequestCallback? onNavigationRequest, ) => (super.noSuchMethod( - Invocation.method(#setOnNavigationRequest, [onNavigationRequest]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setOnNavigationRequest, [onNavigationRequest]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setOnPageStarted(_i3.PageEventCallback? onPageStarted) => (super.noSuchMethod( - Invocation.method(#setOnPageStarted, [onPageStarted]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setOnPageStarted, [onPageStarted]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setOnPageFinished(_i3.PageEventCallback? onPageFinished) => (super.noSuchMethod( - Invocation.method(#setOnPageFinished, [onPageFinished]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setOnPageFinished, [onPageFinished]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setOnHttpError(_i3.HttpResponseErrorCallback? onHttpError) => (super.noSuchMethod( - Invocation.method(#setOnHttpError, [onHttpError]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setOnHttpError, [onHttpError]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setOnProgress(_i3.ProgressCallback? onProgress) => (super.noSuchMethod( - Invocation.method(#setOnProgress, [onProgress]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setOnProgress, [onProgress]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setOnWebResourceError( _i3.WebResourceErrorCallback? onWebResourceError, ) => (super.noSuchMethod( - Invocation.method(#setOnWebResourceError, [onWebResourceError]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setOnWebResourceError, [onWebResourceError]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setOnUrlChange(_i3.UrlChangeCallback? onUrlChange) => (super.noSuchMethod( - Invocation.method(#setOnUrlChange, [onUrlChange]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setOnUrlChange, [onUrlChange]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setOnHttpAuthRequest( _i3.HttpAuthRequestCallback? onHttpAuthRequest, ) => (super.noSuchMethod( - Invocation.method(#setOnHttpAuthRequest, [onHttpAuthRequest]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setOnHttpAuthRequest, [onHttpAuthRequest]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); } /// A class which mocks [AndroidWebViewController]. @@ -328,357 +312,298 @@ class MockAndroidNavigationDelegate extends _i1.Mock class MockAndroidWebViewController extends _i1.Mock implements _i7.AndroidWebViewController { @override - int get webViewIdentifier => - (super.noSuchMethod( - Invocation.getter(#webViewIdentifier), - returnValue: 0, - returnValueForMissingStub: 0, - ) - as int); + int get webViewIdentifier => (super.noSuchMethod( + Invocation.getter(#webViewIdentifier), + returnValue: 0, + returnValueForMissingStub: 0, + ) as int); @override - _i3.PlatformWebViewControllerCreationParams get params => - (super.noSuchMethod( - Invocation.getter(#params), - returnValue: _FakePlatformWebViewControllerCreationParams_4( - this, - Invocation.getter(#params), - ), - returnValueForMissingStub: - _FakePlatformWebViewControllerCreationParams_4( - this, - Invocation.getter(#params), - ), - ) - as _i3.PlatformWebViewControllerCreationParams); + _i3.PlatformWebViewControllerCreationParams get params => (super.noSuchMethod( + Invocation.getter(#params), + returnValue: _FakePlatformWebViewControllerCreationParams_4( + this, + Invocation.getter(#params), + ), + returnValueForMissingStub: + _FakePlatformWebViewControllerCreationParams_4( + this, + Invocation.getter(#params), + ), + ) as _i3.PlatformWebViewControllerCreationParams); @override - _i8.Future setAllowFileAccess(bool? allow) => - (super.noSuchMethod( - Invocation.method(#setAllowFileAccess, [allow]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future setAllowFileAccess(bool? allow) => (super.noSuchMethod( + Invocation.method(#setAllowFileAccess, [allow]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future loadFile(String? absoluteFilePath) => - (super.noSuchMethod( - Invocation.method(#loadFile, [absoluteFilePath]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future loadFile(String? absoluteFilePath) => (super.noSuchMethod( + Invocation.method(#loadFile, [absoluteFilePath]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future loadFlutterAsset(String? key) => - (super.noSuchMethod( - Invocation.method(#loadFlutterAsset, [key]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future loadFlutterAsset(String? key) => (super.noSuchMethod( + Invocation.method(#loadFlutterAsset, [key]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future loadHtmlString(String? html, {String? baseUrl}) => (super.noSuchMethod( - Invocation.method(#loadHtmlString, [html], {#baseUrl: baseUrl}), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#loadHtmlString, [html], {#baseUrl: baseUrl}), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future loadRequest(_i3.LoadRequestParams? params) => (super.noSuchMethod( - Invocation.method(#loadRequest, [params]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#loadRequest, [params]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future currentUrl() => - (super.noSuchMethod( - Invocation.method(#currentUrl, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future currentUrl() => (super.noSuchMethod( + Invocation.method(#currentUrl, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future canGoBack() => - (super.noSuchMethod( - Invocation.method(#canGoBack, []), - returnValue: _i8.Future.value(false), - returnValueForMissingStub: _i8.Future.value(false), - ) - as _i8.Future); + _i8.Future canGoBack() => (super.noSuchMethod( + Invocation.method(#canGoBack, []), + returnValue: _i8.Future.value(false), + returnValueForMissingStub: _i8.Future.value(false), + ) as _i8.Future); @override - _i8.Future canGoForward() => - (super.noSuchMethod( - Invocation.method(#canGoForward, []), - returnValue: _i8.Future.value(false), - returnValueForMissingStub: _i8.Future.value(false), - ) - as _i8.Future); + _i8.Future canGoForward() => (super.noSuchMethod( + Invocation.method(#canGoForward, []), + returnValue: _i8.Future.value(false), + returnValueForMissingStub: _i8.Future.value(false), + ) as _i8.Future); @override - _i8.Future goBack() => - (super.noSuchMethod( - Invocation.method(#goBack, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future goBack() => (super.noSuchMethod( + Invocation.method(#goBack, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future goForward() => - (super.noSuchMethod( - Invocation.method(#goForward, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future goForward() => (super.noSuchMethod( + Invocation.method(#goForward, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future reload() => - (super.noSuchMethod( - Invocation.method(#reload, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future reload() => (super.noSuchMethod( + Invocation.method(#reload, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future clearCache() => - (super.noSuchMethod( - Invocation.method(#clearCache, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future clearCache() => (super.noSuchMethod( + Invocation.method(#clearCache, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future clearLocalStorage() => - (super.noSuchMethod( - Invocation.method(#clearLocalStorage, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future clearLocalStorage() => (super.noSuchMethod( + Invocation.method(#clearLocalStorage, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setPlatformNavigationDelegate( _i3.PlatformNavigationDelegate? handler, ) => (super.noSuchMethod( - Invocation.method(#setPlatformNavigationDelegate, [handler]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setPlatformNavigationDelegate, [handler]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future runJavaScript(String? javaScript) => - (super.noSuchMethod( - Invocation.method(#runJavaScript, [javaScript]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future runJavaScript(String? javaScript) => (super.noSuchMethod( + Invocation.method(#runJavaScript, [javaScript]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future runJavaScriptReturningResult(String? javaScript) => (super.noSuchMethod( + Invocation.method(#runJavaScriptReturningResult, [javaScript]), + returnValue: _i8.Future.value( + _FakeObject_5( + this, Invocation.method(#runJavaScriptReturningResult, [javaScript]), - returnValue: _i8.Future.value( - _FakeObject_5( - this, - Invocation.method(#runJavaScriptReturningResult, [javaScript]), - ), - ), - returnValueForMissingStub: _i8.Future.value( - _FakeObject_5( - this, - Invocation.method(#runJavaScriptReturningResult, [javaScript]), - ), - ), - ) - as _i8.Future); + ), + ), + returnValueForMissingStub: _i8.Future.value( + _FakeObject_5( + this, + Invocation.method(#runJavaScriptReturningResult, [javaScript]), + ), + ), + ) as _i8.Future); @override _i8.Future addJavaScriptChannel( _i3.JavaScriptChannelParams? javaScriptChannelParams, ) => (super.noSuchMethod( - Invocation.method(#addJavaScriptChannel, [javaScriptChannelParams]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#addJavaScriptChannel, [javaScriptChannelParams]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future removeJavaScriptChannel(String? javaScriptChannelName) => (super.noSuchMethod( - Invocation.method(#removeJavaScriptChannel, [ - javaScriptChannelName, - ]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#removeJavaScriptChannel, [ + javaScriptChannelName, + ]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future getTitle() => - (super.noSuchMethod( - Invocation.method(#getTitle, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future getTitle() => (super.noSuchMethod( + Invocation.method(#getTitle, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future scrollTo(int? x, int? y) => - (super.noSuchMethod( - Invocation.method(#scrollTo, [x, y]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future scrollTo(int? x, int? y) => (super.noSuchMethod( + Invocation.method(#scrollTo, [x, y]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future scrollBy(int? x, int? y) => - (super.noSuchMethod( - Invocation.method(#scrollBy, [x, y]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future scrollBy(int? x, int? y) => (super.noSuchMethod( + Invocation.method(#scrollBy, [x, y]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future<_i4.Offset> getScrollPosition() => - (super.noSuchMethod( - Invocation.method(#getScrollPosition, []), - returnValue: _i8.Future<_i4.Offset>.value( - _FakeOffset_6(this, Invocation.method(#getScrollPosition, [])), - ), - returnValueForMissingStub: _i8.Future<_i4.Offset>.value( - _FakeOffset_6(this, Invocation.method(#getScrollPosition, [])), - ), - ) - as _i8.Future<_i4.Offset>); + _i8.Future<_i4.Offset> getScrollPosition() => (super.noSuchMethod( + Invocation.method(#getScrollPosition, []), + returnValue: _i8.Future<_i4.Offset>.value( + _FakeOffset_6(this, Invocation.method(#getScrollPosition, [])), + ), + returnValueForMissingStub: _i8.Future<_i4.Offset>.value( + _FakeOffset_6(this, Invocation.method(#getScrollPosition, [])), + ), + ) as _i8.Future<_i4.Offset>); @override - _i8.Future enableZoom(bool? enabled) => - (super.noSuchMethod( - Invocation.method(#enableZoom, [enabled]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future enableZoom(bool? enabled) => (super.noSuchMethod( + Invocation.method(#enableZoom, [enabled]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future setBackgroundColor(_i4.Color? color) => - (super.noSuchMethod( - Invocation.method(#setBackgroundColor, [color]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future setBackgroundColor(_i4.Color? color) => (super.noSuchMethod( + Invocation.method(#setBackgroundColor, [color]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setJavaScriptMode(_i3.JavaScriptMode? javaScriptMode) => (super.noSuchMethod( - Invocation.method(#setJavaScriptMode, [javaScriptMode]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setJavaScriptMode, [javaScriptMode]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future setUserAgent(String? userAgent) => - (super.noSuchMethod( - Invocation.method(#setUserAgent, [userAgent]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future setUserAgent(String? userAgent) => (super.noSuchMethod( + Invocation.method(#setUserAgent, [userAgent]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setOnScrollPositionChange( void Function(_i3.ScrollPositionChange)? onScrollPositionChange, ) => (super.noSuchMethod( - Invocation.method(#setOnScrollPositionChange, [ - onScrollPositionChange, - ]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setOnScrollPositionChange, [ + onScrollPositionChange, + ]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setMediaPlaybackRequiresUserGesture(bool? require) => (super.noSuchMethod( - Invocation.method(#setMediaPlaybackRequiresUserGesture, [require]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setMediaPlaybackRequiresUserGesture, [require]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future setTextZoom(int? textZoom) => - (super.noSuchMethod( - Invocation.method(#setTextZoom, [textZoom]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future setTextZoom(int? textZoom) => (super.noSuchMethod( + Invocation.method(#setTextZoom, [textZoom]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future setAllowContentAccess(bool? enabled) => - (super.noSuchMethod( - Invocation.method(#setAllowContentAccess, [enabled]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future setAllowContentAccess(bool? enabled) => (super.noSuchMethod( + Invocation.method(#setAllowContentAccess, [enabled]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future setGeolocationEnabled(bool? enabled) => - (super.noSuchMethod( - Invocation.method(#setGeolocationEnabled, [enabled]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future setGeolocationEnabled(bool? enabled) => (super.noSuchMethod( + Invocation.method(#setGeolocationEnabled, [enabled]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setOnShowFileSelector( _i8.Future> Function(_i7.FileSelectorParams)? - onShowFileSelector, + onShowFileSelector, ) => (super.noSuchMethod( - Invocation.method(#setOnShowFileSelector, [onShowFileSelector]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setOnShowFileSelector, [onShowFileSelector]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setOnPlatformPermissionRequest( void Function(_i3.PlatformWebViewPermissionRequest)? onPermissionRequest, ) => (super.noSuchMethod( - Invocation.method(#setOnPlatformPermissionRequest, [ - onPermissionRequest, - ]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setOnPlatformPermissionRequest, [ + onPermissionRequest, + ]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setGeolocationPermissionsPromptCallbacks({ @@ -686,14 +611,13 @@ class MockAndroidWebViewController extends _i1.Mock _i7.OnGeolocationPermissionsHidePrompt? onHidePrompt, }) => (super.noSuchMethod( - Invocation.method(#setGeolocationPermissionsPromptCallbacks, [], { - #onShowPrompt: onShowPrompt, - #onHidePrompt: onHidePrompt, - }), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setGeolocationPermissionsPromptCallbacks, [], { + #onShowPrompt: onShowPrompt, + #onHidePrompt: onHidePrompt, + }), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setCustomWidgetCallbacks({ @@ -701,94 +625,85 @@ class MockAndroidWebViewController extends _i1.Mock required _i7.OnHideCustomWidgetCallback? onHideCustomWidget, }) => (super.noSuchMethod( - Invocation.method(#setCustomWidgetCallbacks, [], { - #onShowCustomWidget: onShowCustomWidget, - #onHideCustomWidget: onHideCustomWidget, - }), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setCustomWidgetCallbacks, [], { + #onShowCustomWidget: onShowCustomWidget, + #onHideCustomWidget: onHideCustomWidget, + }), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setOnConsoleMessage( void Function(_i3.JavaScriptConsoleMessage)? onConsoleMessage, ) => (super.noSuchMethod( - Invocation.method(#setOnConsoleMessage, [onConsoleMessage]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setOnConsoleMessage, [onConsoleMessage]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future getUserAgent() => - (super.noSuchMethod( - Invocation.method(#getUserAgent, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future getUserAgent() => (super.noSuchMethod( + Invocation.method(#getUserAgent, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setOnJavaScriptAlertDialog( _i8.Future Function(_i3.JavaScriptAlertDialogRequest)? - onJavaScriptAlertDialog, + onJavaScriptAlertDialog, ) => (super.noSuchMethod( - Invocation.method(#setOnJavaScriptAlertDialog, [ - onJavaScriptAlertDialog, - ]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setOnJavaScriptAlertDialog, [ + onJavaScriptAlertDialog, + ]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setOnJavaScriptConfirmDialog( _i8.Future Function(_i3.JavaScriptConfirmDialogRequest)? - onJavaScriptConfirmDialog, + onJavaScriptConfirmDialog, ) => (super.noSuchMethod( - Invocation.method(#setOnJavaScriptConfirmDialog, [ - onJavaScriptConfirmDialog, - ]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setOnJavaScriptConfirmDialog, [ + onJavaScriptConfirmDialog, + ]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setOnJavaScriptTextInputDialog( _i8.Future Function(_i3.JavaScriptTextInputDialogRequest)? - onJavaScriptTextInputDialog, + onJavaScriptTextInputDialog, ) => (super.noSuchMethod( - Invocation.method(#setOnJavaScriptTextInputDialog, [ - onJavaScriptTextInputDialog, - ]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setOnJavaScriptTextInputDialog, [ + onJavaScriptTextInputDialog, + ]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setVerticalScrollBarEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setVerticalScrollBarEnabled, [enabled]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setVerticalScrollBarEnabled, [enabled]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setHorizontalScrollBarEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setHorizontalScrollBarEnabled, [enabled]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setHorizontalScrollBarEnabled, [enabled]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); } /// A class which mocks [AndroidWebViewProxy]. @@ -799,262 +714,220 @@ class MockAndroidWebViewProxy extends _i1.Mock @override _i2.WebView Function({ void Function(_i2.WebView, int, int, int, int)? onScrollChanged, - }) - get newWebView => - (super.noSuchMethod( - Invocation.getter(#newWebView), - returnValue: - ({ - void Function(_i2.WebView, int, int, int, int)? - onScrollChanged, - }) => _FakeWebView_7(this, Invocation.getter(#newWebView)), - returnValueForMissingStub: - ({ - void Function(_i2.WebView, int, int, int, int)? - onScrollChanged, - }) => _FakeWebView_7(this, Invocation.getter(#newWebView)), - ) - as _i2.WebView Function({ - void Function(_i2.WebView, int, int, int, int)? onScrollChanged, - })); + }) get newWebView => (super.noSuchMethod( + Invocation.getter(#newWebView), + returnValue: ({ + void Function(_i2.WebView, int, int, int, int)? onScrollChanged, + }) => + _FakeWebView_7(this, Invocation.getter(#newWebView)), + returnValueForMissingStub: ({ + void Function(_i2.WebView, int, int, int, int)? onScrollChanged, + }) => + _FakeWebView_7(this, Invocation.getter(#newWebView)), + ) as _i2.WebView Function({ + void Function(_i2.WebView, int, int, int, int)? onScrollChanged, + })); @override _i2.JavaScriptChannel Function({ required String channelName, required void Function(_i2.JavaScriptChannel, String) postMessage, - }) - get newJavaScriptChannel => - (super.noSuchMethod( - Invocation.getter(#newJavaScriptChannel), - returnValue: - ({ - required String channelName, - required void Function(_i2.JavaScriptChannel, String) - postMessage, - }) => _FakeJavaScriptChannel_8( - this, - Invocation.getter(#newJavaScriptChannel), - ), - returnValueForMissingStub: - ({ - required String channelName, - required void Function(_i2.JavaScriptChannel, String) - postMessage, - }) => _FakeJavaScriptChannel_8( - this, - Invocation.getter(#newJavaScriptChannel), - ), - ) - as _i2.JavaScriptChannel Function({ - required String channelName, - required void Function(_i2.JavaScriptChannel, String) postMessage, - })); + }) get newJavaScriptChannel => (super.noSuchMethod( + Invocation.getter(#newJavaScriptChannel), + returnValue: ({ + required String channelName, + required void Function(_i2.JavaScriptChannel, String) postMessage, + }) => + _FakeJavaScriptChannel_8( + this, + Invocation.getter(#newJavaScriptChannel), + ), + returnValueForMissingStub: ({ + required String channelName, + required void Function(_i2.JavaScriptChannel, String) postMessage, + }) => + _FakeJavaScriptChannel_8( + this, + Invocation.getter(#newJavaScriptChannel), + ), + ) as _i2.JavaScriptChannel Function({ + required String channelName, + required void Function(_i2.JavaScriptChannel, String) postMessage, + })); @override _i2.WebViewClient Function({ void Function(_i2.WebViewClient, _i2.WebView, String, bool)? - doUpdateVisitedHistory, + doUpdateVisitedHistory, void Function(_i2.WebViewClient, _i2.WebView, String)? onPageFinished, void Function(_i2.WebViewClient, _i2.WebView, String)? onPageStarted, void Function(_i2.WebViewClient, _i2.WebView, int, String, String)? - onReceivedError, + onReceivedError, void Function( _i2.WebViewClient, _i2.WebView, _i2.HttpAuthHandler, String, String, - )? - onReceivedHttpAuthRequest, + )? onReceivedHttpAuthRequest, void Function( _i2.WebViewClient, _i2.WebView, _i2.WebResourceRequest, _i2.WebResourceResponse, - )? - onReceivedHttpError, + )? onReceivedHttpError, void Function( _i2.WebViewClient, _i2.WebView, _i2.WebResourceRequest, _i2.WebResourceError, - )? - onReceivedRequestError, + )? onReceivedRequestError, void Function( _i2.WebViewClient, _i2.WebView, _i2.WebResourceRequest, _i2.WebResourceErrorCompat, - )? - onReceivedRequestErrorCompat, + )? onReceivedRequestErrorCompat, void Function(_i2.WebViewClient, _i2.WebView, _i2.WebResourceRequest)? - requestLoading, + requestLoading, void Function(_i2.WebViewClient, _i2.WebView, String)? urlLoading, - }) - get newWebViewClient => - (super.noSuchMethod( - Invocation.getter(#newWebViewClient), - returnValue: - ({ - void Function(_i2.WebViewClient, _i2.WebView, String, bool)? - doUpdateVisitedHistory, - void Function(_i2.WebViewClient, _i2.WebView, String)? - onPageFinished, - void Function(_i2.WebViewClient, _i2.WebView, String)? - onPageStarted, - void Function( - _i2.WebViewClient, - _i2.WebView, - int, - String, - String, - )? - onReceivedError, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.HttpAuthHandler, - String, - String, - )? - onReceivedHttpAuthRequest, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.WebResourceRequest, - _i2.WebResourceResponse, - )? - onReceivedHttpError, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.WebResourceRequest, - _i2.WebResourceError, - )? - onReceivedRequestError, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.WebResourceRequest, - _i2.WebResourceErrorCompat, - )? - onReceivedRequestErrorCompat, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.WebResourceRequest, - )? - requestLoading, - void Function(_i2.WebViewClient, _i2.WebView, String)? - urlLoading, - }) => _FakeWebViewClient_1( - this, - Invocation.getter(#newWebViewClient), - ), - returnValueForMissingStub: - ({ - void Function(_i2.WebViewClient, _i2.WebView, String, bool)? - doUpdateVisitedHistory, - void Function(_i2.WebViewClient, _i2.WebView, String)? - onPageFinished, - void Function(_i2.WebViewClient, _i2.WebView, String)? - onPageStarted, - void Function( - _i2.WebViewClient, - _i2.WebView, - int, - String, - String, - )? - onReceivedError, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.HttpAuthHandler, - String, - String, - )? - onReceivedHttpAuthRequest, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.WebResourceRequest, - _i2.WebResourceResponse, - )? - onReceivedHttpError, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.WebResourceRequest, - _i2.WebResourceError, - )? - onReceivedRequestError, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.WebResourceRequest, - _i2.WebResourceErrorCompat, - )? - onReceivedRequestErrorCompat, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.WebResourceRequest, - )? - requestLoading, - void Function(_i2.WebViewClient, _i2.WebView, String)? - urlLoading, - }) => _FakeWebViewClient_1( - this, - Invocation.getter(#newWebViewClient), - ), - ) - as _i2.WebViewClient Function({ - void Function(_i2.WebViewClient, _i2.WebView, String, bool)? + }) get newWebViewClient => (super.noSuchMethod( + Invocation.getter(#newWebViewClient), + returnValue: ({ + void Function(_i2.WebViewClient, _i2.WebView, String, bool)? + doUpdateVisitedHistory, + void Function(_i2.WebViewClient, _i2.WebView, String)? onPageFinished, + void Function(_i2.WebViewClient, _i2.WebView, String)? onPageStarted, + void Function( + _i2.WebViewClient, + _i2.WebView, + int, + String, + String, + )? onReceivedError, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.HttpAuthHandler, + String, + String, + )? onReceivedHttpAuthRequest, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.WebResourceRequest, + _i2.WebResourceResponse, + )? onReceivedHttpError, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.WebResourceRequest, + _i2.WebResourceError, + )? onReceivedRequestError, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.WebResourceRequest, + _i2.WebResourceErrorCompat, + )? onReceivedRequestErrorCompat, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.WebResourceRequest, + )? requestLoading, + void Function(_i2.WebViewClient, _i2.WebView, String)? urlLoading, + }) => + _FakeWebViewClient_1( + this, + Invocation.getter(#newWebViewClient), + ), + returnValueForMissingStub: ({ + void Function(_i2.WebViewClient, _i2.WebView, String, bool)? + doUpdateVisitedHistory, + void Function(_i2.WebViewClient, _i2.WebView, String)? onPageFinished, + void Function(_i2.WebViewClient, _i2.WebView, String)? onPageStarted, + void Function( + _i2.WebViewClient, + _i2.WebView, + int, + String, + String, + )? onReceivedError, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.HttpAuthHandler, + String, + String, + )? onReceivedHttpAuthRequest, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.WebResourceRequest, + _i2.WebResourceResponse, + )? onReceivedHttpError, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.WebResourceRequest, + _i2.WebResourceError, + )? onReceivedRequestError, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.WebResourceRequest, + _i2.WebResourceErrorCompat, + )? onReceivedRequestErrorCompat, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.WebResourceRequest, + )? requestLoading, + void Function(_i2.WebViewClient, _i2.WebView, String)? urlLoading, + }) => + _FakeWebViewClient_1( + this, + Invocation.getter(#newWebViewClient), + ), + ) as _i2.WebViewClient Function({ + void Function(_i2.WebViewClient, _i2.WebView, String, bool)? doUpdateVisitedHistory, - void Function(_i2.WebViewClient, _i2.WebView, String)? - onPageFinished, - void Function(_i2.WebViewClient, _i2.WebView, String)? - onPageStarted, - void Function(_i2.WebViewClient, _i2.WebView, int, String, String)? + void Function(_i2.WebViewClient, _i2.WebView, String)? onPageFinished, + void Function(_i2.WebViewClient, _i2.WebView, String)? onPageStarted, + void Function(_i2.WebViewClient, _i2.WebView, int, String, String)? onReceivedError, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.HttpAuthHandler, - String, - String, - )? - onReceivedHttpAuthRequest, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.WebResourceRequest, - _i2.WebResourceResponse, - )? - onReceivedHttpError, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.WebResourceRequest, - _i2.WebResourceError, - )? - onReceivedRequestError, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.WebResourceRequest, - _i2.WebResourceErrorCompat, - )? - onReceivedRequestErrorCompat, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.WebResourceRequest, - )? - requestLoading, - void Function(_i2.WebViewClient, _i2.WebView, String)? urlLoading, - })); + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.HttpAuthHandler, + String, + String, + )? onReceivedHttpAuthRequest, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.WebResourceRequest, + _i2.WebResourceResponse, + )? onReceivedHttpError, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.WebResourceRequest, + _i2.WebResourceError, + )? onReceivedRequestError, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.WebResourceRequest, + _i2.WebResourceErrorCompat, + )? onReceivedRequestErrorCompat, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.WebResourceRequest, + )? requestLoading, + void Function(_i2.WebViewClient, _i2.WebView, String)? urlLoading, + })); @override _i2.DownloadListener Function({ @@ -1065,54 +938,47 @@ class MockAndroidWebViewProxy extends _i1.Mock String, String, int, - ) - onDownloadStart, - }) - get newDownloadListener => - (super.noSuchMethod( - Invocation.getter(#newDownloadListener), - returnValue: - ({ - required void Function( - _i2.DownloadListener, - String, - String, - String, - String, - int, - ) - onDownloadStart, - }) => _FakeDownloadListener_2( - this, - Invocation.getter(#newDownloadListener), - ), - returnValueForMissingStub: - ({ - required void Function( - _i2.DownloadListener, - String, - String, - String, - String, - int, - ) - onDownloadStart, - }) => _FakeDownloadListener_2( - this, - Invocation.getter(#newDownloadListener), - ), - ) - as _i2.DownloadListener Function({ - required void Function( - _i2.DownloadListener, - String, - String, - String, - String, - int, - ) - onDownloadStart, - })); + ) onDownloadStart, + }) get newDownloadListener => (super.noSuchMethod( + Invocation.getter(#newDownloadListener), + returnValue: ({ + required void Function( + _i2.DownloadListener, + String, + String, + String, + String, + int, + ) onDownloadStart, + }) => + _FakeDownloadListener_2( + this, + Invocation.getter(#newDownloadListener), + ), + returnValueForMissingStub: ({ + required void Function( + _i2.DownloadListener, + String, + String, + String, + String, + int, + ) onDownloadStart, + }) => + _FakeDownloadListener_2( + this, + Invocation.getter(#newDownloadListener), + ), + ) as _i2.DownloadListener Function({ + required void Function( + _i2.DownloadListener, + String, + String, + String, + String, + int, + ) onDownloadStart, + })); @override _i2.WebChromeClient Function({ @@ -1122,258 +988,220 @@ class MockAndroidWebViewProxy extends _i1.Mock _i2.WebChromeClient, String, _i2.GeolocationPermissionsCallback, - )? - onGeolocationPermissionsShowPrompt, + )? onGeolocationPermissionsShowPrompt, void Function(_i2.WebChromeClient)? onHideCustomView, _i8.Future Function(_i2.WebChromeClient, _i2.WebView, String, String)? - onJsAlert, + onJsAlert, _i8.Future Function(_i2.WebChromeClient, _i2.WebView, String, String)? - onJsConfirm, + onJsConfirm, _i8.Future Function( _i2.WebChromeClient, _i2.WebView, String, String, String, - )? - onJsPrompt, + )? onJsPrompt, void Function(_i2.WebChromeClient, _i2.PermissionRequest)? - onPermissionRequest, + onPermissionRequest, void Function(_i2.WebChromeClient, _i2.WebView, int)? onProgressChanged, void Function(_i2.WebChromeClient, _i2.View, _i2.CustomViewCallback)? - onShowCustomView, + onShowCustomView, _i8.Future> Function( _i2.WebChromeClient, _i2.WebView, _i2.FileChooserParams, - )? - onShowFileChooser, - }) - get newWebChromeClient => - (super.noSuchMethod( - Invocation.getter(#newWebChromeClient), - returnValue: - ({ - void Function(_i2.WebChromeClient, _i2.ConsoleMessage)? - onConsoleMessage, - void Function(_i2.WebChromeClient)? - onGeolocationPermissionsHidePrompt, - void Function( - _i2.WebChromeClient, - String, - _i2.GeolocationPermissionsCallback, - )? - onGeolocationPermissionsShowPrompt, - void Function(_i2.WebChromeClient)? onHideCustomView, - _i8.Future Function( - _i2.WebChromeClient, - _i2.WebView, - String, - String, - )? - onJsAlert, - _i8.Future Function( - _i2.WebChromeClient, - _i2.WebView, - String, - String, - )? - onJsConfirm, - _i8.Future Function( - _i2.WebChromeClient, - _i2.WebView, - String, - String, - String, - )? - onJsPrompt, - void Function(_i2.WebChromeClient, _i2.PermissionRequest)? - onPermissionRequest, - void Function(_i2.WebChromeClient, _i2.WebView, int)? - onProgressChanged, - void Function( - _i2.WebChromeClient, - _i2.View, - _i2.CustomViewCallback, - )? - onShowCustomView, - _i8.Future> Function( - _i2.WebChromeClient, - _i2.WebView, - _i2.FileChooserParams, - )? - onShowFileChooser, - }) => _FakeWebChromeClient_0( - this, - Invocation.getter(#newWebChromeClient), - ), - returnValueForMissingStub: - ({ - void Function(_i2.WebChromeClient, _i2.ConsoleMessage)? - onConsoleMessage, - void Function(_i2.WebChromeClient)? - onGeolocationPermissionsHidePrompt, - void Function( - _i2.WebChromeClient, - String, - _i2.GeolocationPermissionsCallback, - )? - onGeolocationPermissionsShowPrompt, - void Function(_i2.WebChromeClient)? onHideCustomView, - _i8.Future Function( - _i2.WebChromeClient, - _i2.WebView, - String, - String, - )? - onJsAlert, - _i8.Future Function( - _i2.WebChromeClient, - _i2.WebView, - String, - String, - )? - onJsConfirm, - _i8.Future Function( - _i2.WebChromeClient, - _i2.WebView, - String, - String, - String, - )? - onJsPrompt, - void Function(_i2.WebChromeClient, _i2.PermissionRequest)? - onPermissionRequest, - void Function(_i2.WebChromeClient, _i2.WebView, int)? - onProgressChanged, - void Function( - _i2.WebChromeClient, - _i2.View, - _i2.CustomViewCallback, - )? - onShowCustomView, - _i8.Future> Function( - _i2.WebChromeClient, - _i2.WebView, - _i2.FileChooserParams, - )? - onShowFileChooser, - }) => _FakeWebChromeClient_0( - this, - Invocation.getter(#newWebChromeClient), - ), - ) - as _i2.WebChromeClient Function({ - void Function(_i2.WebChromeClient, _i2.ConsoleMessage)? + )? onShowFileChooser, + }) get newWebChromeClient => (super.noSuchMethod( + Invocation.getter(#newWebChromeClient), + returnValue: ({ + void Function(_i2.WebChromeClient, _i2.ConsoleMessage)? + onConsoleMessage, + void Function(_i2.WebChromeClient)? + onGeolocationPermissionsHidePrompt, + void Function( + _i2.WebChromeClient, + String, + _i2.GeolocationPermissionsCallback, + )? onGeolocationPermissionsShowPrompt, + void Function(_i2.WebChromeClient)? onHideCustomView, + _i8.Future Function( + _i2.WebChromeClient, + _i2.WebView, + String, + String, + )? onJsAlert, + _i8.Future Function( + _i2.WebChromeClient, + _i2.WebView, + String, + String, + )? onJsConfirm, + _i8.Future Function( + _i2.WebChromeClient, + _i2.WebView, + String, + String, + String, + )? onJsPrompt, + void Function(_i2.WebChromeClient, _i2.PermissionRequest)? + onPermissionRequest, + void Function(_i2.WebChromeClient, _i2.WebView, int)? + onProgressChanged, + void Function( + _i2.WebChromeClient, + _i2.View, + _i2.CustomViewCallback, + )? onShowCustomView, + _i8.Future> Function( + _i2.WebChromeClient, + _i2.WebView, + _i2.FileChooserParams, + )? onShowFileChooser, + }) => + _FakeWebChromeClient_0( + this, + Invocation.getter(#newWebChromeClient), + ), + returnValueForMissingStub: ({ + void Function(_i2.WebChromeClient, _i2.ConsoleMessage)? + onConsoleMessage, + void Function(_i2.WebChromeClient)? + onGeolocationPermissionsHidePrompt, + void Function( + _i2.WebChromeClient, + String, + _i2.GeolocationPermissionsCallback, + )? onGeolocationPermissionsShowPrompt, + void Function(_i2.WebChromeClient)? onHideCustomView, + _i8.Future Function( + _i2.WebChromeClient, + _i2.WebView, + String, + String, + )? onJsAlert, + _i8.Future Function( + _i2.WebChromeClient, + _i2.WebView, + String, + String, + )? onJsConfirm, + _i8.Future Function( + _i2.WebChromeClient, + _i2.WebView, + String, + String, + String, + )? onJsPrompt, + void Function(_i2.WebChromeClient, _i2.PermissionRequest)? + onPermissionRequest, + void Function(_i2.WebChromeClient, _i2.WebView, int)? + onProgressChanged, + void Function( + _i2.WebChromeClient, + _i2.View, + _i2.CustomViewCallback, + )? onShowCustomView, + _i8.Future> Function( + _i2.WebChromeClient, + _i2.WebView, + _i2.FileChooserParams, + )? onShowFileChooser, + }) => + _FakeWebChromeClient_0( + this, + Invocation.getter(#newWebChromeClient), + ), + ) as _i2.WebChromeClient Function({ + void Function(_i2.WebChromeClient, _i2.ConsoleMessage)? onConsoleMessage, - void Function(_i2.WebChromeClient)? - onGeolocationPermissionsHidePrompt, - void Function( - _i2.WebChromeClient, - String, - _i2.GeolocationPermissionsCallback, - )? - onGeolocationPermissionsShowPrompt, - void Function(_i2.WebChromeClient)? onHideCustomView, - _i8.Future Function( - _i2.WebChromeClient, - _i2.WebView, - String, - String, - )? - onJsAlert, - _i8.Future Function( - _i2.WebChromeClient, - _i2.WebView, - String, - String, - )? - onJsConfirm, - _i8.Future Function( - _i2.WebChromeClient, - _i2.WebView, - String, - String, - String, - )? - onJsPrompt, - void Function(_i2.WebChromeClient, _i2.PermissionRequest)? + void Function(_i2.WebChromeClient)? onGeolocationPermissionsHidePrompt, + void Function( + _i2.WebChromeClient, + String, + _i2.GeolocationPermissionsCallback, + )? onGeolocationPermissionsShowPrompt, + void Function(_i2.WebChromeClient)? onHideCustomView, + _i8.Future Function( + _i2.WebChromeClient, + _i2.WebView, + String, + String, + )? onJsAlert, + _i8.Future Function( + _i2.WebChromeClient, + _i2.WebView, + String, + String, + )? onJsConfirm, + _i8.Future Function( + _i2.WebChromeClient, + _i2.WebView, + String, + String, + String, + )? onJsPrompt, + void Function(_i2.WebChromeClient, _i2.PermissionRequest)? onPermissionRequest, - void Function(_i2.WebChromeClient, _i2.WebView, int)? - onProgressChanged, - void Function( - _i2.WebChromeClient, - _i2.View, - _i2.CustomViewCallback, - )? - onShowCustomView, - _i8.Future> Function( - _i2.WebChromeClient, - _i2.WebView, - _i2.FileChooserParams, - )? - onShowFileChooser, - })); + void Function(_i2.WebChromeClient, _i2.WebView, int)? onProgressChanged, + void Function( + _i2.WebChromeClient, + _i2.View, + _i2.CustomViewCallback, + )? onShowCustomView, + _i8.Future> Function( + _i2.WebChromeClient, + _i2.WebView, + _i2.FileChooserParams, + )? onShowFileChooser, + })); @override _i8.Future Function(bool) get setWebContentsDebuggingEnabledWebView => (super.noSuchMethod( - Invocation.getter(#setWebContentsDebuggingEnabledWebView), - returnValue: (bool __p0) => _i8.Future.value(), - returnValueForMissingStub: (bool __p0) => _i8.Future.value(), - ) - as _i8.Future Function(bool)); + Invocation.getter(#setWebContentsDebuggingEnabledWebView), + returnValue: (bool __p0) => _i8.Future.value(), + returnValueForMissingStub: (bool __p0) => _i8.Future.value(), + ) as _i8.Future Function(bool)); @override - _i2.CookieManager Function() get instanceCookieManager => - (super.noSuchMethod( - Invocation.getter(#instanceCookieManager), - returnValue: - () => _FakeCookieManager_9( - this, - Invocation.getter(#instanceCookieManager), - ), - returnValueForMissingStub: - () => _FakeCookieManager_9( - this, - Invocation.getter(#instanceCookieManager), - ), - ) - as _i2.CookieManager Function()); + _i2.CookieManager Function() get instanceCookieManager => (super.noSuchMethod( + Invocation.getter(#instanceCookieManager), + returnValue: () => _FakeCookieManager_9( + this, + Invocation.getter(#instanceCookieManager), + ), + returnValueForMissingStub: () => _FakeCookieManager_9( + this, + Invocation.getter(#instanceCookieManager), + ), + ) as _i2.CookieManager Function()); @override _i2.FlutterAssetManager Function() get instanceFlutterAssetManager => (super.noSuchMethod( - Invocation.getter(#instanceFlutterAssetManager), - returnValue: - () => _FakeFlutterAssetManager_10( - this, - Invocation.getter(#instanceFlutterAssetManager), - ), - returnValueForMissingStub: - () => _FakeFlutterAssetManager_10( - this, - Invocation.getter(#instanceFlutterAssetManager), - ), - ) - as _i2.FlutterAssetManager Function()); - - @override - _i2.WebStorage Function() get instanceWebStorage => - (super.noSuchMethod( - Invocation.getter(#instanceWebStorage), - returnValue: - () => _FakeWebStorage_11( - this, - Invocation.getter(#instanceWebStorage), - ), - returnValueForMissingStub: - () => _FakeWebStorage_11( - this, - Invocation.getter(#instanceWebStorage), - ), - ) - as _i2.WebStorage Function()); + Invocation.getter(#instanceFlutterAssetManager), + returnValue: () => _FakeFlutterAssetManager_10( + this, + Invocation.getter(#instanceFlutterAssetManager), + ), + returnValueForMissingStub: () => _FakeFlutterAssetManager_10( + this, + Invocation.getter(#instanceFlutterAssetManager), + ), + ) as _i2.FlutterAssetManager Function()); + + @override + _i2.WebStorage Function() get instanceWebStorage => (super.noSuchMethod( + Invocation.getter(#instanceWebStorage), + returnValue: () => _FakeWebStorage_11( + this, + Invocation.getter(#instanceWebStorage), + ), + returnValueForMissingStub: () => _FakeWebStorage_11( + this, + Invocation.getter(#instanceWebStorage), + ), + ) as _i2.WebStorage Function()); } /// A class which mocks [AndroidWebViewWidgetCreationParams]. @@ -1383,77 +1211,67 @@ class MockAndroidWebViewProxy extends _i1.Mock class MockAndroidWebViewWidgetCreationParams extends _i1.Mock implements _i7.AndroidWebViewWidgetCreationParams { @override - _i2.PigeonInstanceManager get instanceManager => - (super.noSuchMethod( - Invocation.getter(#instanceManager), - returnValue: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#instanceManager), - ), - ) - as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get instanceManager => (super.noSuchMethod( + Invocation.getter(#instanceManager), + returnValue: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#instanceManager), + ), + ) as _i2.PigeonInstanceManager); @override _i5.PlatformViewsServiceProxy get platformViewsServiceProxy => (super.noSuchMethod( - Invocation.getter(#platformViewsServiceProxy), - returnValue: _FakePlatformViewsServiceProxy_13( - this, - Invocation.getter(#platformViewsServiceProxy), - ), - returnValueForMissingStub: _FakePlatformViewsServiceProxy_13( - this, - Invocation.getter(#platformViewsServiceProxy), - ), - ) - as _i5.PlatformViewsServiceProxy); - - @override - bool get displayWithHybridComposition => - (super.noSuchMethod( - Invocation.getter(#displayWithHybridComposition), - returnValue: false, - returnValueForMissingStub: false, - ) - as bool); - - @override - _i3.PlatformWebViewController get controller => - (super.noSuchMethod( - Invocation.getter(#controller), - returnValue: _FakePlatformWebViewController_14( - this, - Invocation.getter(#controller), - ), - returnValueForMissingStub: _FakePlatformWebViewController_14( - this, - Invocation.getter(#controller), - ), - ) - as _i3.PlatformWebViewController); - - @override - _i4.TextDirection get layoutDirection => - (super.noSuchMethod( - Invocation.getter(#layoutDirection), - returnValue: _i4.TextDirection.rtl, - returnValueForMissingStub: _i4.TextDirection.rtl, - ) - as _i4.TextDirection); + Invocation.getter(#platformViewsServiceProxy), + returnValue: _FakePlatformViewsServiceProxy_13( + this, + Invocation.getter(#platformViewsServiceProxy), + ), + returnValueForMissingStub: _FakePlatformViewsServiceProxy_13( + this, + Invocation.getter(#platformViewsServiceProxy), + ), + ) as _i5.PlatformViewsServiceProxy); + + @override + bool get displayWithHybridComposition => (super.noSuchMethod( + Invocation.getter(#displayWithHybridComposition), + returnValue: false, + returnValueForMissingStub: false, + ) as bool); + + @override + _i3.PlatformWebViewController get controller => (super.noSuchMethod( + Invocation.getter(#controller), + returnValue: _FakePlatformWebViewController_14( + this, + Invocation.getter(#controller), + ), + returnValueForMissingStub: _FakePlatformWebViewController_14( + this, + Invocation.getter(#controller), + ), + ) as _i3.PlatformWebViewController); + + @override + _i4.TextDirection get layoutDirection => (super.noSuchMethod( + Invocation.getter(#layoutDirection), + returnValue: _i4.TextDirection.rtl, + returnValueForMissingStub: _i4.TextDirection.rtl, + ) as _i4.TextDirection); @override Set<_i10.Factory<_i11.OneSequenceGestureRecognizer>> get gestureRecognizers => (super.noSuchMethod( - Invocation.getter(#gestureRecognizers), - returnValue: <_i10.Factory<_i11.OneSequenceGestureRecognizer>>{}, - returnValueForMissingStub: - <_i10.Factory<_i11.OneSequenceGestureRecognizer>>{}, - ) - as Set<_i10.Factory<_i11.OneSequenceGestureRecognizer>>); + Invocation.getter(#gestureRecognizers), + returnValue: <_i10.Factory<_i11.OneSequenceGestureRecognizer>>{}, + returnValueForMissingStub: <_i10 + .Factory<_i11.OneSequenceGestureRecognizer>>{}, + ) as Set<_i10.Factory<_i11.OneSequenceGestureRecognizer>>); } /// A class which mocks [ExpensiveAndroidViewController]. @@ -1462,160 +1280,137 @@ class MockAndroidWebViewWidgetCreationParams extends _i1.Mock class MockExpensiveAndroidViewController extends _i1.Mock implements _i6.ExpensiveAndroidViewController { @override - bool get requiresViewComposition => - (super.noSuchMethod( - Invocation.getter(#requiresViewComposition), - returnValue: false, - returnValueForMissingStub: false, - ) - as bool); + bool get requiresViewComposition => (super.noSuchMethod( + Invocation.getter(#requiresViewComposition), + returnValue: false, + returnValueForMissingStub: false, + ) as bool); @override - int get viewId => - (super.noSuchMethod( - Invocation.getter(#viewId), - returnValue: 0, - returnValueForMissingStub: 0, - ) - as int); + int get viewId => (super.noSuchMethod( + Invocation.getter(#viewId), + returnValue: 0, + returnValueForMissingStub: 0, + ) as int); @override - bool get awaitingCreation => - (super.noSuchMethod( - Invocation.getter(#awaitingCreation), - returnValue: false, - returnValueForMissingStub: false, - ) - as bool); + bool get awaitingCreation => (super.noSuchMethod( + Invocation.getter(#awaitingCreation), + returnValue: false, + returnValueForMissingStub: false, + ) as bool); @override - _i6.PointTransformer get pointTransformer => - (super.noSuchMethod( - Invocation.getter(#pointTransformer), - returnValue: - (_i4.Offset position) => - _FakeOffset_6(this, Invocation.getter(#pointTransformer)), - returnValueForMissingStub: - (_i4.Offset position) => - _FakeOffset_6(this, Invocation.getter(#pointTransformer)), - ) - as _i6.PointTransformer); + _i6.PointTransformer get pointTransformer => (super.noSuchMethod( + Invocation.getter(#pointTransformer), + returnValue: (_i4.Offset position) => + _FakeOffset_6(this, Invocation.getter(#pointTransformer)), + returnValueForMissingStub: (_i4.Offset position) => + _FakeOffset_6(this, Invocation.getter(#pointTransformer)), + ) as _i6.PointTransformer); @override set pointTransformer(_i6.PointTransformer? transformer) => super.noSuchMethod( - Invocation.setter(#pointTransformer, transformer), - returnValueForMissingStub: null, - ); + Invocation.setter(#pointTransformer, transformer), + returnValueForMissingStub: null, + ); @override - bool get isCreated => - (super.noSuchMethod( - Invocation.getter(#isCreated), - returnValue: false, - returnValueForMissingStub: false, - ) - as bool); + bool get isCreated => (super.noSuchMethod( + Invocation.getter(#isCreated), + returnValue: false, + returnValueForMissingStub: false, + ) as bool); @override List<_i6.PlatformViewCreatedCallback> get createdCallbacks => (super.noSuchMethod( - Invocation.getter(#createdCallbacks), - returnValue: <_i6.PlatformViewCreatedCallback>[], - returnValueForMissingStub: <_i6.PlatformViewCreatedCallback>[], - ) - as List<_i6.PlatformViewCreatedCallback>); + Invocation.getter(#createdCallbacks), + returnValue: <_i6.PlatformViewCreatedCallback>[], + returnValueForMissingStub: <_i6.PlatformViewCreatedCallback>[], + ) as List<_i6.PlatformViewCreatedCallback>); @override - _i8.Future setOffset(_i4.Offset? off) => - (super.noSuchMethod( - Invocation.method(#setOffset, [off]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future setOffset(_i4.Offset? off) => (super.noSuchMethod( + Invocation.method(#setOffset, [off]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future create({_i4.Size? size, _i4.Offset? position}) => (super.noSuchMethod( - Invocation.method(#create, [], {#size: size, #position: position}), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#create, [], {#size: size, #position: position}), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future<_i4.Size> setSize(_i4.Size? size) => - (super.noSuchMethod( - Invocation.method(#setSize, [size]), - returnValue: _i8.Future<_i4.Size>.value( - _FakeSize_15(this, Invocation.method(#setSize, [size])), - ), - returnValueForMissingStub: _i8.Future<_i4.Size>.value( - _FakeSize_15(this, Invocation.method(#setSize, [size])), - ), - ) - as _i8.Future<_i4.Size>); + _i8.Future<_i4.Size> setSize(_i4.Size? size) => (super.noSuchMethod( + Invocation.method(#setSize, [size]), + returnValue: _i8.Future<_i4.Size>.value( + _FakeSize_15(this, Invocation.method(#setSize, [size])), + ), + returnValueForMissingStub: _i8.Future<_i4.Size>.value( + _FakeSize_15(this, Invocation.method(#setSize, [size])), + ), + ) as _i8.Future<_i4.Size>); @override _i8.Future sendMotionEvent(_i6.AndroidMotionEvent? event) => (super.noSuchMethod( - Invocation.method(#sendMotionEvent, [event]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#sendMotionEvent, [event]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override void addOnPlatformViewCreatedListener( _i6.PlatformViewCreatedCallback? listener, - ) => super.noSuchMethod( - Invocation.method(#addOnPlatformViewCreatedListener, [listener]), - returnValueForMissingStub: null, - ); + ) => + super.noSuchMethod( + Invocation.method(#addOnPlatformViewCreatedListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeOnPlatformViewCreatedListener( _i6.PlatformViewCreatedCallback? listener, - ) => super.noSuchMethod( - Invocation.method(#removeOnPlatformViewCreatedListener, [listener]), - returnValueForMissingStub: null, - ); + ) => + super.noSuchMethod( + Invocation.method(#removeOnPlatformViewCreatedListener, [listener]), + returnValueForMissingStub: null, + ); @override _i8.Future setLayoutDirection(_i4.TextDirection? layoutDirection) => (super.noSuchMethod( - Invocation.method(#setLayoutDirection, [layoutDirection]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setLayoutDirection, [layoutDirection]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future dispatchPointerEvent(_i11.PointerEvent? event) => (super.noSuchMethod( - Invocation.method(#dispatchPointerEvent, [event]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#dispatchPointerEvent, [event]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future clearFocus() => - (super.noSuchMethod( - Invocation.method(#clearFocus, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future clearFocus() => (super.noSuchMethod( + Invocation.method(#clearFocus, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future dispose() => - (super.noSuchMethod( - Invocation.method(#dispose, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future dispose() => (super.noSuchMethod( + Invocation.method(#dispose, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); } /// A class which mocks [FlutterAssetManager]. @@ -1624,64 +1419,57 @@ class MockExpensiveAndroidViewController extends _i1.Mock class MockFlutterAssetManager extends _i1.Mock implements _i2.FlutterAssetManager { @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); @override - _i8.Future> list(String? path) => - (super.noSuchMethod( - Invocation.method(#list, [path]), - returnValue: _i8.Future>.value([]), - returnValueForMissingStub: _i8.Future>.value( - [], - ), - ) - as _i8.Future>); + _i8.Future> list(String? path) => (super.noSuchMethod( + Invocation.method(#list, [path]), + returnValue: _i8.Future>.value([]), + returnValueForMissingStub: _i8.Future>.value( + [], + ), + ) as _i8.Future>); @override _i8.Future getAssetFilePathByName(String? name) => (super.noSuchMethod( + Invocation.method(#getAssetFilePathByName, [name]), + returnValue: _i8.Future.value( + _i12.dummyValue( + this, + Invocation.method(#getAssetFilePathByName, [name]), + ), + ), + returnValueForMissingStub: _i8.Future.value( + _i12.dummyValue( + this, Invocation.method(#getAssetFilePathByName, [name]), - returnValue: _i8.Future.value( - _i12.dummyValue( - this, - Invocation.method(#getAssetFilePathByName, [name]), - ), - ), - returnValueForMissingStub: _i8.Future.value( - _i12.dummyValue( - this, - Invocation.method(#getAssetFilePathByName, [name]), - ), - ), - ) - as _i8.Future); - - @override - _i2.FlutterAssetManager pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeFlutterAssetManager_10( - this, - Invocation.method(#pigeon_copy, []), - ), - returnValueForMissingStub: _FakeFlutterAssetManager_10( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.FlutterAssetManager); + ), + ), + ) as _i8.Future); + + @override + _i2.FlutterAssetManager pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeFlutterAssetManager_10( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeFlutterAssetManager_10( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.FlutterAssetManager); } /// A class which mocks [GeolocationPermissionsCallback]. @@ -1690,43 +1478,38 @@ class MockFlutterAssetManager extends _i1.Mock class MockGeolocationPermissionsCallback extends _i1.Mock implements _i2.GeolocationPermissionsCallback { @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); @override _i8.Future invoke(String? origin, bool? allow, bool? retain) => (super.noSuchMethod( - Invocation.method(#invoke, [origin, allow, retain]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); - - @override - _i2.GeolocationPermissionsCallback pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeGeolocationPermissionsCallback_16( - this, - Invocation.method(#pigeon_copy, []), - ), - returnValueForMissingStub: _FakeGeolocationPermissionsCallback_16( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.GeolocationPermissionsCallback); + Invocation.method(#invoke, [origin, allow, retain]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); + + @override + _i2.GeolocationPermissionsCallback pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeGeolocationPermissionsCallback_16( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeGeolocationPermissionsCallback_16( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.GeolocationPermissionsCallback); } /// A class which mocks [JavaScriptChannel]. @@ -1734,60 +1517,52 @@ class MockGeolocationPermissionsCallback extends _i1.Mock /// See the documentation for Mockito's code generation for more information. class MockJavaScriptChannel extends _i1.Mock implements _i2.JavaScriptChannel { @override - String get channelName => - (super.noSuchMethod( - Invocation.getter(#channelName), - returnValue: _i12.dummyValue( - this, - Invocation.getter(#channelName), - ), - returnValueForMissingStub: _i12.dummyValue( - this, - Invocation.getter(#channelName), - ), - ) - as String); + String get channelName => (super.noSuchMethod( + Invocation.getter(#channelName), + returnValue: _i12.dummyValue( + this, + Invocation.getter(#channelName), + ), + returnValueForMissingStub: _i12.dummyValue( + this, + Invocation.getter(#channelName), + ), + ) as String); @override void Function(_i2.JavaScriptChannel, String) get postMessage => (super.noSuchMethod( - Invocation.getter(#postMessage), - returnValue: - (_i2.JavaScriptChannel pigeon_instance, String message) {}, - returnValueForMissingStub: - (_i2.JavaScriptChannel pigeon_instance, String message) {}, - ) - as void Function(_i2.JavaScriptChannel, String)); - - @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); - - @override - _i2.JavaScriptChannel pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeJavaScriptChannel_8( - this, - Invocation.method(#pigeon_copy, []), - ), - returnValueForMissingStub: _FakeJavaScriptChannel_8( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.JavaScriptChannel); + Invocation.getter(#postMessage), + returnValue: (_i2.JavaScriptChannel pigeon_instance, String message) {}, + returnValueForMissingStub: + (_i2.JavaScriptChannel pigeon_instance, String message) {}, + ) as void Function(_i2.JavaScriptChannel, String)); + + @override + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); + + @override + _i2.JavaScriptChannel pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeJavaScriptChannel_8( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeJavaScriptChannel_8( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.JavaScriptChannel); } /// A class which mocks [PermissionRequest]. @@ -1795,61 +1570,51 @@ class MockJavaScriptChannel extends _i1.Mock implements _i2.JavaScriptChannel { /// See the documentation for Mockito's code generation for more information. class MockPermissionRequest extends _i1.Mock implements _i2.PermissionRequest { @override - List get resources => - (super.noSuchMethod( - Invocation.getter(#resources), - returnValue: [], - returnValueForMissingStub: [], - ) - as List); - - @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); - - @override - _i8.Future grant(List? resources) => - (super.noSuchMethod( - Invocation.method(#grant, [resources]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); - - @override - _i8.Future deny() => - (super.noSuchMethod( - Invocation.method(#deny, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); - - @override - _i2.PermissionRequest pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakePermissionRequest_17( - this, - Invocation.method(#pigeon_copy, []), - ), - returnValueForMissingStub: _FakePermissionRequest_17( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.PermissionRequest); + List get resources => (super.noSuchMethod( + Invocation.getter(#resources), + returnValue: [], + returnValueForMissingStub: [], + ) as List); + + @override + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); + + @override + _i8.Future grant(List? resources) => (super.noSuchMethod( + Invocation.method(#grant, [resources]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); + + @override + _i8.Future deny() => (super.noSuchMethod( + Invocation.method(#deny, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); + + @override + _i2.PermissionRequest pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakePermissionRequest_17( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakePermissionRequest_17( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.PermissionRequest); } /// A class which mocks [PlatformViewsServiceProxy]. @@ -1868,38 +1633,37 @@ class MockPlatformViewsServiceProxy extends _i1.Mock _i4.VoidCallback? onFocus, }) => (super.noSuchMethod( - Invocation.method(#initExpensiveAndroidView, [], { - #id: id, - #viewType: viewType, - #layoutDirection: layoutDirection, - #creationParams: creationParams, - #creationParamsCodec: creationParamsCodec, - #onFocus: onFocus, - }), - returnValue: _FakeExpensiveAndroidViewController_18( - this, - Invocation.method(#initExpensiveAndroidView, [], { - #id: id, - #viewType: viewType, - #layoutDirection: layoutDirection, - #creationParams: creationParams, - #creationParamsCodec: creationParamsCodec, - #onFocus: onFocus, - }), - ), - returnValueForMissingStub: _FakeExpensiveAndroidViewController_18( - this, - Invocation.method(#initExpensiveAndroidView, [], { - #id: id, - #viewType: viewType, - #layoutDirection: layoutDirection, - #creationParams: creationParams, - #creationParamsCodec: creationParamsCodec, - #onFocus: onFocus, - }), - ), - ) - as _i6.ExpensiveAndroidViewController); + Invocation.method(#initExpensiveAndroidView, [], { + #id: id, + #viewType: viewType, + #layoutDirection: layoutDirection, + #creationParams: creationParams, + #creationParamsCodec: creationParamsCodec, + #onFocus: onFocus, + }), + returnValue: _FakeExpensiveAndroidViewController_18( + this, + Invocation.method(#initExpensiveAndroidView, [], { + #id: id, + #viewType: viewType, + #layoutDirection: layoutDirection, + #creationParams: creationParams, + #creationParamsCodec: creationParamsCodec, + #onFocus: onFocus, + }), + ), + returnValueForMissingStub: _FakeExpensiveAndroidViewController_18( + this, + Invocation.method(#initExpensiveAndroidView, [], { + #id: id, + #viewType: viewType, + #layoutDirection: layoutDirection, + #creationParams: creationParams, + #creationParamsCodec: creationParamsCodec, + #onFocus: onFocus, + }), + ), + ) as _i6.ExpensiveAndroidViewController); @override _i6.SurfaceAndroidViewController initSurfaceAndroidView({ @@ -1911,38 +1675,37 @@ class MockPlatformViewsServiceProxy extends _i1.Mock _i4.VoidCallback? onFocus, }) => (super.noSuchMethod( - Invocation.method(#initSurfaceAndroidView, [], { - #id: id, - #viewType: viewType, - #layoutDirection: layoutDirection, - #creationParams: creationParams, - #creationParamsCodec: creationParamsCodec, - #onFocus: onFocus, - }), - returnValue: _FakeSurfaceAndroidViewController_19( - this, - Invocation.method(#initSurfaceAndroidView, [], { - #id: id, - #viewType: viewType, - #layoutDirection: layoutDirection, - #creationParams: creationParams, - #creationParamsCodec: creationParamsCodec, - #onFocus: onFocus, - }), - ), - returnValueForMissingStub: _FakeSurfaceAndroidViewController_19( - this, - Invocation.method(#initSurfaceAndroidView, [], { - #id: id, - #viewType: viewType, - #layoutDirection: layoutDirection, - #creationParams: creationParams, - #creationParamsCodec: creationParamsCodec, - #onFocus: onFocus, - }), - ), - ) - as _i6.SurfaceAndroidViewController); + Invocation.method(#initSurfaceAndroidView, [], { + #id: id, + #viewType: viewType, + #layoutDirection: layoutDirection, + #creationParams: creationParams, + #creationParamsCodec: creationParamsCodec, + #onFocus: onFocus, + }), + returnValue: _FakeSurfaceAndroidViewController_19( + this, + Invocation.method(#initSurfaceAndroidView, [], { + #id: id, + #viewType: viewType, + #layoutDirection: layoutDirection, + #creationParams: creationParams, + #creationParamsCodec: creationParamsCodec, + #onFocus: onFocus, + }), + ), + returnValueForMissingStub: _FakeSurfaceAndroidViewController_19( + this, + Invocation.method(#initSurfaceAndroidView, [], { + #id: id, + #viewType: viewType, + #layoutDirection: layoutDirection, + #creationParams: creationParams, + #creationParamsCodec: creationParamsCodec, + #onFocus: onFocus, + }), + ), + ) as _i6.SurfaceAndroidViewController); } /// A class which mocks [SurfaceAndroidViewController]. @@ -1951,160 +1714,137 @@ class MockPlatformViewsServiceProxy extends _i1.Mock class MockSurfaceAndroidViewController extends _i1.Mock implements _i6.SurfaceAndroidViewController { @override - bool get requiresViewComposition => - (super.noSuchMethod( - Invocation.getter(#requiresViewComposition), - returnValue: false, - returnValueForMissingStub: false, - ) - as bool); + bool get requiresViewComposition => (super.noSuchMethod( + Invocation.getter(#requiresViewComposition), + returnValue: false, + returnValueForMissingStub: false, + ) as bool); @override - int get viewId => - (super.noSuchMethod( - Invocation.getter(#viewId), - returnValue: 0, - returnValueForMissingStub: 0, - ) - as int); + int get viewId => (super.noSuchMethod( + Invocation.getter(#viewId), + returnValue: 0, + returnValueForMissingStub: 0, + ) as int); @override - bool get awaitingCreation => - (super.noSuchMethod( - Invocation.getter(#awaitingCreation), - returnValue: false, - returnValueForMissingStub: false, - ) - as bool); + bool get awaitingCreation => (super.noSuchMethod( + Invocation.getter(#awaitingCreation), + returnValue: false, + returnValueForMissingStub: false, + ) as bool); @override - _i6.PointTransformer get pointTransformer => - (super.noSuchMethod( - Invocation.getter(#pointTransformer), - returnValue: - (_i4.Offset position) => - _FakeOffset_6(this, Invocation.getter(#pointTransformer)), - returnValueForMissingStub: - (_i4.Offset position) => - _FakeOffset_6(this, Invocation.getter(#pointTransformer)), - ) - as _i6.PointTransformer); + _i6.PointTransformer get pointTransformer => (super.noSuchMethod( + Invocation.getter(#pointTransformer), + returnValue: (_i4.Offset position) => + _FakeOffset_6(this, Invocation.getter(#pointTransformer)), + returnValueForMissingStub: (_i4.Offset position) => + _FakeOffset_6(this, Invocation.getter(#pointTransformer)), + ) as _i6.PointTransformer); @override set pointTransformer(_i6.PointTransformer? transformer) => super.noSuchMethod( - Invocation.setter(#pointTransformer, transformer), - returnValueForMissingStub: null, - ); + Invocation.setter(#pointTransformer, transformer), + returnValueForMissingStub: null, + ); @override - bool get isCreated => - (super.noSuchMethod( - Invocation.getter(#isCreated), - returnValue: false, - returnValueForMissingStub: false, - ) - as bool); + bool get isCreated => (super.noSuchMethod( + Invocation.getter(#isCreated), + returnValue: false, + returnValueForMissingStub: false, + ) as bool); @override List<_i6.PlatformViewCreatedCallback> get createdCallbacks => (super.noSuchMethod( - Invocation.getter(#createdCallbacks), - returnValue: <_i6.PlatformViewCreatedCallback>[], - returnValueForMissingStub: <_i6.PlatformViewCreatedCallback>[], - ) - as List<_i6.PlatformViewCreatedCallback>); + Invocation.getter(#createdCallbacks), + returnValue: <_i6.PlatformViewCreatedCallback>[], + returnValueForMissingStub: <_i6.PlatformViewCreatedCallback>[], + ) as List<_i6.PlatformViewCreatedCallback>); @override - _i8.Future setOffset(_i4.Offset? off) => - (super.noSuchMethod( - Invocation.method(#setOffset, [off]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future setOffset(_i4.Offset? off) => (super.noSuchMethod( + Invocation.method(#setOffset, [off]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future create({_i4.Size? size, _i4.Offset? position}) => (super.noSuchMethod( - Invocation.method(#create, [], {#size: size, #position: position}), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#create, [], {#size: size, #position: position}), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future<_i4.Size> setSize(_i4.Size? size) => - (super.noSuchMethod( - Invocation.method(#setSize, [size]), - returnValue: _i8.Future<_i4.Size>.value( - _FakeSize_15(this, Invocation.method(#setSize, [size])), - ), - returnValueForMissingStub: _i8.Future<_i4.Size>.value( - _FakeSize_15(this, Invocation.method(#setSize, [size])), - ), - ) - as _i8.Future<_i4.Size>); + _i8.Future<_i4.Size> setSize(_i4.Size? size) => (super.noSuchMethod( + Invocation.method(#setSize, [size]), + returnValue: _i8.Future<_i4.Size>.value( + _FakeSize_15(this, Invocation.method(#setSize, [size])), + ), + returnValueForMissingStub: _i8.Future<_i4.Size>.value( + _FakeSize_15(this, Invocation.method(#setSize, [size])), + ), + ) as _i8.Future<_i4.Size>); @override _i8.Future sendMotionEvent(_i6.AndroidMotionEvent? event) => (super.noSuchMethod( - Invocation.method(#sendMotionEvent, [event]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#sendMotionEvent, [event]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override void addOnPlatformViewCreatedListener( _i6.PlatformViewCreatedCallback? listener, - ) => super.noSuchMethod( - Invocation.method(#addOnPlatformViewCreatedListener, [listener]), - returnValueForMissingStub: null, - ); + ) => + super.noSuchMethod( + Invocation.method(#addOnPlatformViewCreatedListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeOnPlatformViewCreatedListener( _i6.PlatformViewCreatedCallback? listener, - ) => super.noSuchMethod( - Invocation.method(#removeOnPlatformViewCreatedListener, [listener]), - returnValueForMissingStub: null, - ); + ) => + super.noSuchMethod( + Invocation.method(#removeOnPlatformViewCreatedListener, [listener]), + returnValueForMissingStub: null, + ); @override _i8.Future setLayoutDirection(_i4.TextDirection? layoutDirection) => (super.noSuchMethod( - Invocation.method(#setLayoutDirection, [layoutDirection]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setLayoutDirection, [layoutDirection]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future dispatchPointerEvent(_i11.PointerEvent? event) => (super.noSuchMethod( - Invocation.method(#dispatchPointerEvent, [event]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#dispatchPointerEvent, [event]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future clearFocus() => - (super.noSuchMethod( - Invocation.method(#clearFocus, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future clearFocus() => (super.noSuchMethod( + Invocation.method(#clearFocus, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future dispose() => - (super.noSuchMethod( - Invocation.method(#dispose, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future dispose() => (super.noSuchMethod( + Invocation.method(#dispose, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); } /// A class which mocks [WebChromeClient]. @@ -2112,85 +1852,76 @@ class MockSurfaceAndroidViewController extends _i1.Mock /// See the documentation for Mockito's code generation for more information. class MockWebChromeClient extends _i1.Mock implements _i2.WebChromeClient { @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); @override _i8.Future setSynchronousReturnValueForOnShowFileChooser(bool? value) => (super.noSuchMethod( - Invocation.method(#setSynchronousReturnValueForOnShowFileChooser, [ - value, - ]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setSynchronousReturnValueForOnShowFileChooser, [ + value, + ]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setSynchronousReturnValueForOnConsoleMessage(bool? value) => (super.noSuchMethod( - Invocation.method(#setSynchronousReturnValueForOnConsoleMessage, [ - value, - ]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setSynchronousReturnValueForOnConsoleMessage, [ + value, + ]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setSynchronousReturnValueForOnJsAlert(bool? value) => (super.noSuchMethod( - Invocation.method(#setSynchronousReturnValueForOnJsAlert, [value]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setSynchronousReturnValueForOnJsAlert, [value]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setSynchronousReturnValueForOnJsConfirm(bool? value) => (super.noSuchMethod( - Invocation.method(#setSynchronousReturnValueForOnJsConfirm, [ - value, - ]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setSynchronousReturnValueForOnJsConfirm, [ + value, + ]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setSynchronousReturnValueForOnJsPrompt(bool? value) => (super.noSuchMethod( - Invocation.method(#setSynchronousReturnValueForOnJsPrompt, [value]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); - - @override - _i2.WebChromeClient pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWebChromeClient_0( - this, - Invocation.method(#pigeon_copy, []), - ), - returnValueForMissingStub: _FakeWebChromeClient_0( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WebChromeClient); + Invocation.method(#setSynchronousReturnValueForOnJsPrompt, [value]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); + + @override + _i2.WebChromeClient pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWebChromeClient_0( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeWebChromeClient_0( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WebChromeClient); } /// A class which mocks [WebSettings]. @@ -2198,190 +1929,159 @@ class MockWebChromeClient extends _i1.Mock implements _i2.WebChromeClient { /// See the documentation for Mockito's code generation for more information. class MockWebSettings extends _i1.Mock implements _i2.WebSettings { @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); @override - _i8.Future setDomStorageEnabled(bool? flag) => - (super.noSuchMethod( - Invocation.method(#setDomStorageEnabled, [flag]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future setDomStorageEnabled(bool? flag) => (super.noSuchMethod( + Invocation.method(#setDomStorageEnabled, [flag]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setJavaScriptCanOpenWindowsAutomatically(bool? flag) => (super.noSuchMethod( - Invocation.method(#setJavaScriptCanOpenWindowsAutomatically, [ - flag, - ]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setJavaScriptCanOpenWindowsAutomatically, [ + flag, + ]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setSupportMultipleWindows(bool? support) => (super.noSuchMethod( - Invocation.method(#setSupportMultipleWindows, [support]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setSupportMultipleWindows, [support]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future setJavaScriptEnabled(bool? flag) => - (super.noSuchMethod( - Invocation.method(#setJavaScriptEnabled, [flag]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future setJavaScriptEnabled(bool? flag) => (super.noSuchMethod( + Invocation.method(#setJavaScriptEnabled, [flag]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setUserAgentString(String? userAgentString) => (super.noSuchMethod( - Invocation.method(#setUserAgentString, [userAgentString]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setUserAgentString, [userAgentString]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setMediaPlaybackRequiresUserGesture(bool? require) => (super.noSuchMethod( - Invocation.method(#setMediaPlaybackRequiresUserGesture, [require]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setMediaPlaybackRequiresUserGesture, [require]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future setSupportZoom(bool? support) => - (super.noSuchMethod( - Invocation.method(#setSupportZoom, [support]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future setSupportZoom(bool? support) => (super.noSuchMethod( + Invocation.method(#setSupportZoom, [support]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setLoadWithOverviewMode(bool? overview) => (super.noSuchMethod( - Invocation.method(#setLoadWithOverviewMode, [overview]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setLoadWithOverviewMode, [overview]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future setUseWideViewPort(bool? use) => - (super.noSuchMethod( - Invocation.method(#setUseWideViewPort, [use]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future setUseWideViewPort(bool? use) => (super.noSuchMethod( + Invocation.method(#setUseWideViewPort, [use]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future setDisplayZoomControls(bool? enabled) => - (super.noSuchMethod( - Invocation.method(#setDisplayZoomControls, [enabled]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future setDisplayZoomControls(bool? enabled) => (super.noSuchMethod( + Invocation.method(#setDisplayZoomControls, [enabled]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future setBuiltInZoomControls(bool? enabled) => - (super.noSuchMethod( - Invocation.method(#setBuiltInZoomControls, [enabled]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future setBuiltInZoomControls(bool? enabled) => (super.noSuchMethod( + Invocation.method(#setBuiltInZoomControls, [enabled]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future setAllowFileAccess(bool? enabled) => - (super.noSuchMethod( - Invocation.method(#setAllowFileAccess, [enabled]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future setAllowFileAccess(bool? enabled) => (super.noSuchMethod( + Invocation.method(#setAllowFileAccess, [enabled]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future setAllowContentAccess(bool? enabled) => - (super.noSuchMethod( - Invocation.method(#setAllowContentAccess, [enabled]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future setAllowContentAccess(bool? enabled) => (super.noSuchMethod( + Invocation.method(#setAllowContentAccess, [enabled]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future setGeolocationEnabled(bool? enabled) => - (super.noSuchMethod( - Invocation.method(#setGeolocationEnabled, [enabled]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future setGeolocationEnabled(bool? enabled) => (super.noSuchMethod( + Invocation.method(#setGeolocationEnabled, [enabled]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future setTextZoom(int? textZoom) => - (super.noSuchMethod( - Invocation.method(#setTextZoom, [textZoom]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future setTextZoom(int? textZoom) => (super.noSuchMethod( + Invocation.method(#setTextZoom, [textZoom]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future getUserAgentString() => - (super.noSuchMethod( + _i8.Future getUserAgentString() => (super.noSuchMethod( + Invocation.method(#getUserAgentString, []), + returnValue: _i8.Future.value( + _i12.dummyValue( + this, + Invocation.method(#getUserAgentString, []), + ), + ), + returnValueForMissingStub: _i8.Future.value( + _i12.dummyValue( + this, Invocation.method(#getUserAgentString, []), - returnValue: _i8.Future.value( - _i12.dummyValue( - this, - Invocation.method(#getUserAgentString, []), - ), - ), - returnValueForMissingStub: _i8.Future.value( - _i12.dummyValue( - this, - Invocation.method(#getUserAgentString, []), - ), - ), - ) - as _i8.Future); - - @override - _i2.WebSettings pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWebSettings_20( - this, - Invocation.method(#pigeon_copy, []), - ), - returnValueForMissingStub: _FakeWebSettings_20( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WebSettings); + ), + ), + ) as _i8.Future); + + @override + _i2.WebSettings pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWebSettings_20( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeWebSettings_20( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WebSettings); } /// A class which mocks [WebView]. @@ -2389,58 +2089,51 @@ class MockWebSettings extends _i1.Mock implements _i2.WebSettings { /// See the documentation for Mockito's code generation for more information. class MockWebView extends _i1.Mock implements _i2.WebView { @override - _i2.WebSettings get settings => - (super.noSuchMethod( - Invocation.getter(#settings), - returnValue: _FakeWebSettings_20( - this, - Invocation.getter(#settings), - ), - returnValueForMissingStub: _FakeWebSettings_20( - this, - Invocation.getter(#settings), - ), - ) - as _i2.WebSettings); - - @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); - - @override - _i2.WebSettings pigeonVar_settings() => - (super.noSuchMethod( - Invocation.method(#pigeonVar_settings, []), - returnValue: _FakeWebSettings_20( - this, - Invocation.method(#pigeonVar_settings, []), - ), - returnValueForMissingStub: _FakeWebSettings_20( - this, - Invocation.method(#pigeonVar_settings, []), - ), - ) - as _i2.WebSettings); + _i2.WebSettings get settings => (super.noSuchMethod( + Invocation.getter(#settings), + returnValue: _FakeWebSettings_20( + this, + Invocation.getter(#settings), + ), + returnValueForMissingStub: _FakeWebSettings_20( + this, + Invocation.getter(#settings), + ), + ) as _i2.WebSettings); + + @override + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); + + @override + _i2.WebSettings pigeonVar_settings() => (super.noSuchMethod( + Invocation.method(#pigeonVar_settings, []), + returnValue: _FakeWebSettings_20( + this, + Invocation.method(#pigeonVar_settings, []), + ), + returnValueForMissingStub: _FakeWebSettings_20( + this, + Invocation.method(#pigeonVar_settings, []), + ), + ) as _i2.WebSettings); @override _i8.Future loadData(String? data, String? mimeType, String? encoding) => (super.noSuchMethod( - Invocation.method(#loadData, [data, mimeType, encoding]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#loadData, [data, mimeType, encoding]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future loadDataWithBaseUrl( @@ -2451,249 +2144,209 @@ class MockWebView extends _i1.Mock implements _i2.WebView { String? historyUrl, ) => (super.noSuchMethod( - Invocation.method(#loadDataWithBaseUrl, [ - baseUrl, - data, - mimeType, - encoding, - historyUrl, - ]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#loadDataWithBaseUrl, [ + baseUrl, + data, + mimeType, + encoding, + historyUrl, + ]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future loadUrl(String? url, Map? headers) => (super.noSuchMethod( - Invocation.method(#loadUrl, [url, headers]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#loadUrl, [url, headers]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future postUrl(String? url, _i13.Uint8List? data) => (super.noSuchMethod( - Invocation.method(#postUrl, [url, data]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#postUrl, [url, data]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future getUrl() => - (super.noSuchMethod( - Invocation.method(#getUrl, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future getUrl() => (super.noSuchMethod( + Invocation.method(#getUrl, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future canGoBack() => - (super.noSuchMethod( - Invocation.method(#canGoBack, []), - returnValue: _i8.Future.value(false), - returnValueForMissingStub: _i8.Future.value(false), - ) - as _i8.Future); + _i8.Future canGoBack() => (super.noSuchMethod( + Invocation.method(#canGoBack, []), + returnValue: _i8.Future.value(false), + returnValueForMissingStub: _i8.Future.value(false), + ) as _i8.Future); @override - _i8.Future canGoForward() => - (super.noSuchMethod( - Invocation.method(#canGoForward, []), - returnValue: _i8.Future.value(false), - returnValueForMissingStub: _i8.Future.value(false), - ) - as _i8.Future); + _i8.Future canGoForward() => (super.noSuchMethod( + Invocation.method(#canGoForward, []), + returnValue: _i8.Future.value(false), + returnValueForMissingStub: _i8.Future.value(false), + ) as _i8.Future); @override - _i8.Future goBack() => - (super.noSuchMethod( - Invocation.method(#goBack, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future goBack() => (super.noSuchMethod( + Invocation.method(#goBack, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future goForward() => - (super.noSuchMethod( - Invocation.method(#goForward, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future goForward() => (super.noSuchMethod( + Invocation.method(#goForward, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future reload() => - (super.noSuchMethod( - Invocation.method(#reload, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future reload() => (super.noSuchMethod( + Invocation.method(#reload, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future clearCache(bool? includeDiskFiles) => - (super.noSuchMethod( - Invocation.method(#clearCache, [includeDiskFiles]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future clearCache(bool? includeDiskFiles) => (super.noSuchMethod( + Invocation.method(#clearCache, [includeDiskFiles]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future evaluateJavascript(String? javascriptString) => (super.noSuchMethod( - Invocation.method(#evaluateJavascript, [javascriptString]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#evaluateJavascript, [javascriptString]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future getTitle() => - (super.noSuchMethod( - Invocation.method(#getTitle, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future getTitle() => (super.noSuchMethod( + Invocation.method(#getTitle, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setWebViewClient(_i2.WebViewClient? client) => (super.noSuchMethod( - Invocation.method(#setWebViewClient, [client]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setWebViewClient, [client]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future addJavaScriptChannel(_i2.JavaScriptChannel? channel) => (super.noSuchMethod( - Invocation.method(#addJavaScriptChannel, [channel]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#addJavaScriptChannel, [channel]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future removeJavaScriptChannel(String? name) => - (super.noSuchMethod( - Invocation.method(#removeJavaScriptChannel, [name]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future removeJavaScriptChannel(String? name) => (super.noSuchMethod( + Invocation.method(#removeJavaScriptChannel, [name]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setDownloadListener(_i2.DownloadListener? listener) => (super.noSuchMethod( - Invocation.method(#setDownloadListener, [listener]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setDownloadListener, [listener]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setWebChromeClient(_i2.WebChromeClient? client) => (super.noSuchMethod( - Invocation.method(#setWebChromeClient, [client]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setWebChromeClient, [client]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future setBackgroundColor(int? color) => - (super.noSuchMethod( - Invocation.method(#setBackgroundColor, [color]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future setBackgroundColor(int? color) => (super.noSuchMethod( + Invocation.method(#setBackgroundColor, [color]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future destroy() => - (super.noSuchMethod( - Invocation.method(#destroy, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future destroy() => (super.noSuchMethod( + Invocation.method(#destroy, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i2.WebView pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWebView_7( - this, - Invocation.method(#pigeon_copy, []), - ), - returnValueForMissingStub: _FakeWebView_7( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WebView); + _i2.WebView pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWebView_7( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeWebView_7( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WebView); @override - _i8.Future scrollTo(int? x, int? y) => - (super.noSuchMethod( - Invocation.method(#scrollTo, [x, y]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future scrollTo(int? x, int? y) => (super.noSuchMethod( + Invocation.method(#scrollTo, [x, y]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future scrollBy(int? x, int? y) => - (super.noSuchMethod( - Invocation.method(#scrollBy, [x, y]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future scrollBy(int? x, int? y) => (super.noSuchMethod( + Invocation.method(#scrollBy, [x, y]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future<_i2.WebViewPoint> getScrollPosition() => - (super.noSuchMethod( + _i8.Future<_i2.WebViewPoint> getScrollPosition() => (super.noSuchMethod( + Invocation.method(#getScrollPosition, []), + returnValue: _i8.Future<_i2.WebViewPoint>.value( + _FakeWebViewPoint_21( + this, + Invocation.method(#getScrollPosition, []), + ), + ), + returnValueForMissingStub: _i8.Future<_i2.WebViewPoint>.value( + _FakeWebViewPoint_21( + this, Invocation.method(#getScrollPosition, []), - returnValue: _i8.Future<_i2.WebViewPoint>.value( - _FakeWebViewPoint_21( - this, - Invocation.method(#getScrollPosition, []), - ), - ), - returnValueForMissingStub: _i8.Future<_i2.WebViewPoint>.value( - _FakeWebViewPoint_21( - this, - Invocation.method(#getScrollPosition, []), - ), - ), - ) - as _i8.Future<_i2.WebViewPoint>); + ), + ), + ) as _i8.Future<_i2.WebViewPoint>); @override _i8.Future setVerticalScrollBarEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setVerticalScrollBarEnabled, [enabled]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setVerticalScrollBarEnabled, [enabled]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setHorizontalScrollBarEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setHorizontalScrollBarEnabled, [enabled]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setHorizontalScrollBarEnabled, [enabled]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); } /// A class which mocks [WebViewClient]. @@ -2701,48 +2354,43 @@ class MockWebView extends _i1.Mock implements _i2.WebView { /// See the documentation for Mockito's code generation for more information. class MockWebViewClient extends _i1.Mock implements _i2.WebViewClient { @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); @override _i8.Future setSynchronousReturnValueForShouldOverrideUrlLoading( bool? value, ) => (super.noSuchMethod( - Invocation.method( - #setSynchronousReturnValueForShouldOverrideUrlLoading, - [value], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); - - @override - _i2.WebViewClient pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWebViewClient_1( - this, - Invocation.method(#pigeon_copy, []), - ), - returnValueForMissingStub: _FakeWebViewClient_1( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WebViewClient); + Invocation.method( + #setSynchronousReturnValueForShouldOverrideUrlLoading, + [value], + ), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); + + @override + _i2.WebViewClient pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWebViewClient_1( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeWebViewClient_1( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WebViewClient); } /// A class which mocks [WebStorage]. @@ -2750,41 +2398,35 @@ class MockWebViewClient extends _i1.Mock implements _i2.WebViewClient { /// See the documentation for Mockito's code generation for more information. class MockWebStorage extends _i1.Mock implements _i2.WebStorage { @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); - - @override - _i8.Future deleteAllData() => - (super.noSuchMethod( - Invocation.method(#deleteAllData, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); - - @override - _i2.WebStorage pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWebStorage_11( - this, - Invocation.method(#pigeon_copy, []), - ), - returnValueForMissingStub: _FakeWebStorage_11( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WebStorage); + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); + + @override + _i8.Future deleteAllData() => (super.noSuchMethod( + Invocation.method(#deleteAllData, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); + + @override + _i2.WebStorage pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWebStorage_11( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeWebStorage_11( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WebStorage); } diff --git a/packages/webview_flutter/webview_flutter_android/test/android_webview_cookie_manager_test.mocks.dart b/packages/webview_flutter/webview_flutter_android/test/android_webview_cookie_manager_test.mocks.dart index 4d7cfb875e5..05c877e8232 100644 --- a/packages/webview_flutter/webview_flutter_android/test/android_webview_cookie_manager_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_android/test/android_webview_cookie_manager_test.mocks.dart @@ -30,12 +30,12 @@ import 'package:webview_flutter_platform_interface/webview_flutter_platform_inte class _FakePigeonInstanceManager_0 extends _i1.SmartFake implements _i2.PigeonInstanceManager { _FakePigeonInstanceManager_0(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeCookieManager_1 extends _i1.SmartFake implements _i2.CookieManager { _FakeCookieManager_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakePlatformWebViewControllerCreationParams_2 extends _i1.SmartFake @@ -48,12 +48,12 @@ class _FakePlatformWebViewControllerCreationParams_2 extends _i1.SmartFake class _FakeObject_3 extends _i1.SmartFake implements Object { _FakeObject_3(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeOffset_4 extends _i1.SmartFake implements _i4.Offset { _FakeOffset_4(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } /// A class which mocks [CookieManager]. @@ -65,32 +65,26 @@ class MockCookieManager extends _i1.Mock implements _i2.CookieManager { } @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 - _i5.Future setCookie(String? url, String? value) => - (super.noSuchMethod( - Invocation.method(#setCookie, [url, value]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future setCookie(String? url, String? value) => (super.noSuchMethod( + Invocation.method(#setCookie, [url, value]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future removeAllCookies() => - (super.noSuchMethod( - Invocation.method(#removeAllCookies, []), - returnValue: _i5.Future.value(false), - ) - as _i5.Future); + _i5.Future removeAllCookies() => (super.noSuchMethod( + Invocation.method(#removeAllCookies, []), + returnValue: _i5.Future.value(false), + ) as _i5.Future); @override _i5.Future setAcceptThirdPartyCookies( @@ -98,22 +92,19 @@ class MockCookieManager extends _i1.Mock implements _i2.CookieManager { bool? accept, ) => (super.noSuchMethod( - Invocation.method(#setAcceptThirdPartyCookies, [webView, accept]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setAcceptThirdPartyCookies, [webView, accept]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i2.CookieManager pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeCookieManager_1( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.CookieManager); + _i2.CookieManager pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeCookieManager_1( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.CookieManager); } /// A class which mocks [AndroidWebViewController]. @@ -131,330 +122,273 @@ class MockAndroidWebViewController extends _i1.Mock as int); @override - _i3.PlatformWebViewControllerCreationParams get params => - (super.noSuchMethod( - Invocation.getter(#params), - returnValue: _FakePlatformWebViewControllerCreationParams_2( - this, - Invocation.getter(#params), - ), - ) - as _i3.PlatformWebViewControllerCreationParams); + _i3.PlatformWebViewControllerCreationParams get params => (super.noSuchMethod( + Invocation.getter(#params), + returnValue: _FakePlatformWebViewControllerCreationParams_2( + this, + Invocation.getter(#params), + ), + ) as _i3.PlatformWebViewControllerCreationParams); @override - _i5.Future setAllowFileAccess(bool? allow) => - (super.noSuchMethod( - Invocation.method(#setAllowFileAccess, [allow]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future setAllowFileAccess(bool? allow) => (super.noSuchMethod( + Invocation.method(#setAllowFileAccess, [allow]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future loadFile(String? absoluteFilePath) => - (super.noSuchMethod( - Invocation.method(#loadFile, [absoluteFilePath]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future loadFile(String? absoluteFilePath) => (super.noSuchMethod( + Invocation.method(#loadFile, [absoluteFilePath]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future loadFlutterAsset(String? key) => - (super.noSuchMethod( - Invocation.method(#loadFlutterAsset, [key]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future loadFlutterAsset(String? key) => (super.noSuchMethod( + Invocation.method(#loadFlutterAsset, [key]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future loadHtmlString(String? html, {String? baseUrl}) => (super.noSuchMethod( - Invocation.method(#loadHtmlString, [html], {#baseUrl: baseUrl}), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#loadHtmlString, [html], {#baseUrl: baseUrl}), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future loadRequest(_i3.LoadRequestParams? params) => (super.noSuchMethod( - Invocation.method(#loadRequest, [params]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#loadRequest, [params]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future currentUrl() => - (super.noSuchMethod( - Invocation.method(#currentUrl, []), - returnValue: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future currentUrl() => (super.noSuchMethod( + Invocation.method(#currentUrl, []), + returnValue: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future canGoBack() => - (super.noSuchMethod( - Invocation.method(#canGoBack, []), - returnValue: _i5.Future.value(false), - ) - as _i5.Future); + _i5.Future canGoBack() => (super.noSuchMethod( + Invocation.method(#canGoBack, []), + returnValue: _i5.Future.value(false), + ) as _i5.Future); @override - _i5.Future canGoForward() => - (super.noSuchMethod( - Invocation.method(#canGoForward, []), - returnValue: _i5.Future.value(false), - ) - as _i5.Future); + _i5.Future canGoForward() => (super.noSuchMethod( + Invocation.method(#canGoForward, []), + returnValue: _i5.Future.value(false), + ) as _i5.Future); @override - _i5.Future goBack() => - (super.noSuchMethod( - Invocation.method(#goBack, []), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future goBack() => (super.noSuchMethod( + Invocation.method(#goBack, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future goForward() => - (super.noSuchMethod( - Invocation.method(#goForward, []), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future goForward() => (super.noSuchMethod( + Invocation.method(#goForward, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future reload() => - (super.noSuchMethod( - Invocation.method(#reload, []), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future reload() => (super.noSuchMethod( + Invocation.method(#reload, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future clearCache() => - (super.noSuchMethod( - Invocation.method(#clearCache, []), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future clearCache() => (super.noSuchMethod( + Invocation.method(#clearCache, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future clearLocalStorage() => - (super.noSuchMethod( - Invocation.method(#clearLocalStorage, []), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future clearLocalStorage() => (super.noSuchMethod( + Invocation.method(#clearLocalStorage, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setPlatformNavigationDelegate( _i3.PlatformNavigationDelegate? handler, ) => (super.noSuchMethod( - Invocation.method(#setPlatformNavigationDelegate, [handler]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setPlatformNavigationDelegate, [handler]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future runJavaScript(String? javaScript) => - (super.noSuchMethod( - Invocation.method(#runJavaScript, [javaScript]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future runJavaScript(String? javaScript) => (super.noSuchMethod( + Invocation.method(#runJavaScript, [javaScript]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future runJavaScriptReturningResult(String? javaScript) => (super.noSuchMethod( + Invocation.method(#runJavaScriptReturningResult, [javaScript]), + returnValue: _i5.Future.value( + _FakeObject_3( + this, Invocation.method(#runJavaScriptReturningResult, [javaScript]), - returnValue: _i5.Future.value( - _FakeObject_3( - this, - Invocation.method(#runJavaScriptReturningResult, [javaScript]), - ), - ), - ) - as _i5.Future); + ), + ), + ) as _i5.Future); @override _i5.Future addJavaScriptChannel( _i3.JavaScriptChannelParams? javaScriptChannelParams, ) => (super.noSuchMethod( - Invocation.method(#addJavaScriptChannel, [javaScriptChannelParams]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#addJavaScriptChannel, [javaScriptChannelParams]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future removeJavaScriptChannel(String? javaScriptChannelName) => (super.noSuchMethod( - Invocation.method(#removeJavaScriptChannel, [ - javaScriptChannelName, - ]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#removeJavaScriptChannel, [ + javaScriptChannelName, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future getTitle() => - (super.noSuchMethod( - Invocation.method(#getTitle, []), - returnValue: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future getTitle() => (super.noSuchMethod( + Invocation.method(#getTitle, []), + returnValue: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future scrollTo(int? x, int? y) => - (super.noSuchMethod( - Invocation.method(#scrollTo, [x, y]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future scrollTo(int? x, int? y) => (super.noSuchMethod( + Invocation.method(#scrollTo, [x, y]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future scrollBy(int? x, int? y) => - (super.noSuchMethod( - Invocation.method(#scrollBy, [x, y]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future scrollBy(int? x, int? y) => (super.noSuchMethod( + Invocation.method(#scrollBy, [x, y]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future<_i4.Offset> getScrollPosition() => - (super.noSuchMethod( - Invocation.method(#getScrollPosition, []), - returnValue: _i5.Future<_i4.Offset>.value( - _FakeOffset_4(this, Invocation.method(#getScrollPosition, [])), - ), - ) - as _i5.Future<_i4.Offset>); + _i5.Future<_i4.Offset> getScrollPosition() => (super.noSuchMethod( + Invocation.method(#getScrollPosition, []), + returnValue: _i5.Future<_i4.Offset>.value( + _FakeOffset_4(this, Invocation.method(#getScrollPosition, [])), + ), + ) as _i5.Future<_i4.Offset>); @override - _i5.Future enableZoom(bool? enabled) => - (super.noSuchMethod( - Invocation.method(#enableZoom, [enabled]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future enableZoom(bool? enabled) => (super.noSuchMethod( + Invocation.method(#enableZoom, [enabled]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future setBackgroundColor(_i4.Color? color) => - (super.noSuchMethod( - Invocation.method(#setBackgroundColor, [color]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future setBackgroundColor(_i4.Color? color) => (super.noSuchMethod( + Invocation.method(#setBackgroundColor, [color]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setJavaScriptMode(_i3.JavaScriptMode? javaScriptMode) => (super.noSuchMethod( - Invocation.method(#setJavaScriptMode, [javaScriptMode]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setJavaScriptMode, [javaScriptMode]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future setUserAgent(String? userAgent) => - (super.noSuchMethod( - Invocation.method(#setUserAgent, [userAgent]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future setUserAgent(String? userAgent) => (super.noSuchMethod( + Invocation.method(#setUserAgent, [userAgent]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setOnScrollPositionChange( void Function(_i3.ScrollPositionChange)? onScrollPositionChange, ) => (super.noSuchMethod( - Invocation.method(#setOnScrollPositionChange, [ - onScrollPositionChange, - ]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setOnScrollPositionChange, [ + onScrollPositionChange, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setMediaPlaybackRequiresUserGesture(bool? require) => (super.noSuchMethod( - Invocation.method(#setMediaPlaybackRequiresUserGesture, [require]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setMediaPlaybackRequiresUserGesture, [require]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future setTextZoom(int? textZoom) => - (super.noSuchMethod( - Invocation.method(#setTextZoom, [textZoom]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future setTextZoom(int? textZoom) => (super.noSuchMethod( + Invocation.method(#setTextZoom, [textZoom]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future setAllowContentAccess(bool? enabled) => - (super.noSuchMethod( - Invocation.method(#setAllowContentAccess, [enabled]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future setAllowContentAccess(bool? enabled) => (super.noSuchMethod( + Invocation.method(#setAllowContentAccess, [enabled]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future setGeolocationEnabled(bool? enabled) => - (super.noSuchMethod( - Invocation.method(#setGeolocationEnabled, [enabled]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future setGeolocationEnabled(bool? enabled) => (super.noSuchMethod( + Invocation.method(#setGeolocationEnabled, [enabled]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setOnShowFileSelector( _i5.Future> Function(_i6.FileSelectorParams)? - onShowFileSelector, + onShowFileSelector, ) => (super.noSuchMethod( - Invocation.method(#setOnShowFileSelector, [onShowFileSelector]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setOnShowFileSelector, [onShowFileSelector]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setOnPlatformPermissionRequest( void Function(_i3.PlatformWebViewPermissionRequest)? onPermissionRequest, ) => (super.noSuchMethod( - Invocation.method(#setOnPlatformPermissionRequest, [ - onPermissionRequest, - ]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setOnPlatformPermissionRequest, [ + onPermissionRequest, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setGeolocationPermissionsPromptCallbacks({ @@ -462,14 +396,13 @@ class MockAndroidWebViewController extends _i1.Mock _i6.OnGeolocationPermissionsHidePrompt? onHidePrompt, }) => (super.noSuchMethod( - Invocation.method(#setGeolocationPermissionsPromptCallbacks, [], { - #onShowPrompt: onShowPrompt, - #onHidePrompt: onHidePrompt, - }), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setGeolocationPermissionsPromptCallbacks, [], { + #onShowPrompt: onShowPrompt, + #onHidePrompt: onHidePrompt, + }), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setCustomWidgetCallbacks({ @@ -477,91 +410,82 @@ class MockAndroidWebViewController extends _i1.Mock required _i6.OnHideCustomWidgetCallback? onHideCustomWidget, }) => (super.noSuchMethod( - Invocation.method(#setCustomWidgetCallbacks, [], { - #onShowCustomWidget: onShowCustomWidget, - #onHideCustomWidget: onHideCustomWidget, - }), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setCustomWidgetCallbacks, [], { + #onShowCustomWidget: onShowCustomWidget, + #onHideCustomWidget: onHideCustomWidget, + }), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setOnConsoleMessage( void Function(_i3.JavaScriptConsoleMessage)? onConsoleMessage, ) => (super.noSuchMethod( - Invocation.method(#setOnConsoleMessage, [onConsoleMessage]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setOnConsoleMessage, [onConsoleMessage]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future getUserAgent() => - (super.noSuchMethod( - Invocation.method(#getUserAgent, []), - returnValue: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future getUserAgent() => (super.noSuchMethod( + Invocation.method(#getUserAgent, []), + returnValue: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setOnJavaScriptAlertDialog( _i5.Future Function(_i3.JavaScriptAlertDialogRequest)? - onJavaScriptAlertDialog, + onJavaScriptAlertDialog, ) => (super.noSuchMethod( - Invocation.method(#setOnJavaScriptAlertDialog, [ - onJavaScriptAlertDialog, - ]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setOnJavaScriptAlertDialog, [ + onJavaScriptAlertDialog, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setOnJavaScriptConfirmDialog( _i5.Future Function(_i3.JavaScriptConfirmDialogRequest)? - onJavaScriptConfirmDialog, + onJavaScriptConfirmDialog, ) => (super.noSuchMethod( - Invocation.method(#setOnJavaScriptConfirmDialog, [ - onJavaScriptConfirmDialog, - ]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setOnJavaScriptConfirmDialog, [ + onJavaScriptConfirmDialog, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setOnJavaScriptTextInputDialog( _i5.Future Function(_i3.JavaScriptTextInputDialogRequest)? - onJavaScriptTextInputDialog, + onJavaScriptTextInputDialog, ) => (super.noSuchMethod( - Invocation.method(#setOnJavaScriptTextInputDialog, [ - onJavaScriptTextInputDialog, - ]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setOnJavaScriptTextInputDialog, [ + onJavaScriptTextInputDialog, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setVerticalScrollBarEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setVerticalScrollBarEnabled, [enabled]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setVerticalScrollBarEnabled, [enabled]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setHorizontalScrollBarEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setHorizontalScrollBarEnabled, [enabled]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setHorizontalScrollBarEnabled, [enabled]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); } diff --git a/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_cookie_manager_test.mocks.dart b/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_cookie_manager_test.mocks.dart index 74d4075c1b5..68d1d82b29c 100644 --- a/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_cookie_manager_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_cookie_manager_test.mocks.dart @@ -25,12 +25,12 @@ import 'package:webview_flutter_android/src/android_webkit.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 _FakeCookieManager_1 extends _i1.SmartFake implements _i2.CookieManager { _FakeCookieManager_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } /// A class which mocks [CookieManager]. @@ -42,32 +42,26 @@ class MockCookieManager extends _i1.Mock implements _i2.CookieManager { } @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(String? url, String? value) => - (super.noSuchMethod( - Invocation.method(#setCookie, [url, value]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + _i3.Future setCookie(String? url, String? value) => (super.noSuchMethod( + Invocation.method(#setCookie, [url, value]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override - _i3.Future removeAllCookies() => - (super.noSuchMethod( - Invocation.method(#removeAllCookies, []), - returnValue: _i3.Future.value(false), - ) - as _i3.Future); + _i3.Future removeAllCookies() => (super.noSuchMethod( + Invocation.method(#removeAllCookies, []), + returnValue: _i3.Future.value(false), + ) as _i3.Future); @override _i3.Future setAcceptThirdPartyCookies( @@ -75,20 +69,17 @@ class MockCookieManager extends _i1.Mock implements _i2.CookieManager { bool? accept, ) => (super.noSuchMethod( - Invocation.method(#setAcceptThirdPartyCookies, [webView, accept]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#setAcceptThirdPartyCookies, [webView, accept]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override - _i2.CookieManager pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeCookieManager_1( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.CookieManager); + _i2.CookieManager pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeCookieManager_1( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.CookieManager); } diff --git a/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_widget_test.mocks.dart b/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_widget_test.mocks.dart index d6d61dc4844..60a79167af7 100644 --- a/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_widget_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_widget_test.mocks.dart @@ -31,68 +31,68 @@ import 'package:webview_flutter_platform_interface/src/webview_flutter_platform_ class _FakePigeonInstanceManager_0 extends _i1.SmartFake implements _i2.PigeonInstanceManager { _FakePigeonInstanceManager_0(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeFlutterAssetManager_1 extends _i1.SmartFake implements _i2.FlutterAssetManager { _FakeFlutterAssetManager_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWebSettings_2 extends _i1.SmartFake implements _i2.WebSettings { _FakeWebSettings_2(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWebStorage_3 extends _i1.SmartFake implements _i2.WebStorage { _FakeWebStorage_3(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWebView_4 extends _i1.SmartFake implements _i2.WebView { _FakeWebView_4(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWebViewPoint_5 extends _i1.SmartFake implements _i2.WebViewPoint { _FakeWebViewPoint_5(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWebResourceRequest_6 extends _i1.SmartFake implements _i2.WebResourceRequest { _FakeWebResourceRequest_6(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeDownloadListener_7 extends _i1.SmartFake implements _i2.DownloadListener { _FakeDownloadListener_7(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeJavascriptChannelRegistry_8 extends _i1.SmartFake implements _i3.JavascriptChannelRegistry { _FakeJavascriptChannelRegistry_8(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeJavaScriptChannel_9 extends _i1.SmartFake implements _i2.JavaScriptChannel { _FakeJavaScriptChannel_9(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWebChromeClient_10 extends _i1.SmartFake implements _i2.WebChromeClient { _FakeWebChromeClient_10(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWebViewClient_11 extends _i1.SmartFake implements _i2.WebViewClient { _FakeWebViewClient_11(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } /// A class which mocks [FlutterAssetManager]. @@ -105,47 +105,40 @@ class MockFlutterAssetManager 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> list(String? path) => - (super.noSuchMethod( - Invocation.method(#list, [path]), - returnValue: _i4.Future>.value([]), - ) - as _i4.Future>); + _i4.Future> list(String? path) => (super.noSuchMethod( + Invocation.method(#list, [path]), + returnValue: _i4.Future>.value([]), + ) as _i4.Future>); @override _i4.Future getAssetFilePathByName(String? name) => (super.noSuchMethod( + Invocation.method(#getAssetFilePathByName, [name]), + returnValue: _i4.Future.value( + _i5.dummyValue( + this, Invocation.method(#getAssetFilePathByName, [name]), - returnValue: _i4.Future.value( - _i5.dummyValue( - this, - Invocation.method(#getAssetFilePathByName, [name]), - ), - ), - ) - as _i4.Future); - - @override - _i2.FlutterAssetManager pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeFlutterAssetManager_1( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.FlutterAssetManager); + ), + ), + ) as _i4.Future); + + @override + _i2.FlutterAssetManager pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeFlutterAssetManager_1( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.FlutterAssetManager); } /// A class which mocks [WebSettings]. @@ -157,176 +150,145 @@ class MockWebSettings extends _i1.Mock implements _i2.WebSettings { } @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 setDomStorageEnabled(bool? flag) => - (super.noSuchMethod( - Invocation.method(#setDomStorageEnabled, [flag]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future setDomStorageEnabled(bool? flag) => (super.noSuchMethod( + Invocation.method(#setDomStorageEnabled, [flag]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future setJavaScriptCanOpenWindowsAutomatically(bool? flag) => (super.noSuchMethod( - Invocation.method(#setJavaScriptCanOpenWindowsAutomatically, [ - flag, - ]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#setJavaScriptCanOpenWindowsAutomatically, [ + flag, + ]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future setSupportMultipleWindows(bool? support) => (super.noSuchMethod( - Invocation.method(#setSupportMultipleWindows, [support]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#setSupportMultipleWindows, [support]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future setJavaScriptEnabled(bool? flag) => - (super.noSuchMethod( - Invocation.method(#setJavaScriptEnabled, [flag]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future setJavaScriptEnabled(bool? flag) => (super.noSuchMethod( + Invocation.method(#setJavaScriptEnabled, [flag]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future setUserAgentString(String? userAgentString) => (super.noSuchMethod( - Invocation.method(#setUserAgentString, [userAgentString]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#setUserAgentString, [userAgentString]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future setMediaPlaybackRequiresUserGesture(bool? require) => (super.noSuchMethod( - Invocation.method(#setMediaPlaybackRequiresUserGesture, [require]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#setMediaPlaybackRequiresUserGesture, [require]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future setSupportZoom(bool? support) => - (super.noSuchMethod( - Invocation.method(#setSupportZoom, [support]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future setSupportZoom(bool? support) => (super.noSuchMethod( + Invocation.method(#setSupportZoom, [support]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future setLoadWithOverviewMode(bool? overview) => (super.noSuchMethod( - Invocation.method(#setLoadWithOverviewMode, [overview]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#setLoadWithOverviewMode, [overview]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future setUseWideViewPort(bool? use) => - (super.noSuchMethod( - Invocation.method(#setUseWideViewPort, [use]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future setUseWideViewPort(bool? use) => (super.noSuchMethod( + Invocation.method(#setUseWideViewPort, [use]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future setDisplayZoomControls(bool? enabled) => - (super.noSuchMethod( - Invocation.method(#setDisplayZoomControls, [enabled]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future setDisplayZoomControls(bool? enabled) => (super.noSuchMethod( + Invocation.method(#setDisplayZoomControls, [enabled]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future setBuiltInZoomControls(bool? enabled) => - (super.noSuchMethod( - Invocation.method(#setBuiltInZoomControls, [enabled]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future setBuiltInZoomControls(bool? enabled) => (super.noSuchMethod( + Invocation.method(#setBuiltInZoomControls, [enabled]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future setAllowFileAccess(bool? enabled) => - (super.noSuchMethod( - Invocation.method(#setAllowFileAccess, [enabled]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future setAllowFileAccess(bool? enabled) => (super.noSuchMethod( + Invocation.method(#setAllowFileAccess, [enabled]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future setAllowContentAccess(bool? enabled) => - (super.noSuchMethod( - Invocation.method(#setAllowContentAccess, [enabled]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future setAllowContentAccess(bool? enabled) => (super.noSuchMethod( + Invocation.method(#setAllowContentAccess, [enabled]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future setGeolocationEnabled(bool? enabled) => - (super.noSuchMethod( - Invocation.method(#setGeolocationEnabled, [enabled]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future setGeolocationEnabled(bool? enabled) => (super.noSuchMethod( + Invocation.method(#setGeolocationEnabled, [enabled]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future setTextZoom(int? textZoom) => - (super.noSuchMethod( - Invocation.method(#setTextZoom, [textZoom]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future setTextZoom(int? textZoom) => (super.noSuchMethod( + Invocation.method(#setTextZoom, [textZoom]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future getUserAgentString() => - (super.noSuchMethod( + _i4.Future getUserAgentString() => (super.noSuchMethod( + Invocation.method(#getUserAgentString, []), + returnValue: _i4.Future.value( + _i5.dummyValue( + this, Invocation.method(#getUserAgentString, []), - returnValue: _i4.Future.value( - _i5.dummyValue( - this, - Invocation.method(#getUserAgentString, []), - ), - ), - ) - as _i4.Future); - - @override - _i2.WebSettings pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWebSettings_2( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WebSettings); + ), + ), + ) as _i4.Future); + + @override + _i2.WebSettings pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWebSettings_2( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WebSettings); } /// A class which mocks [WebStorage]. @@ -338,35 +300,29 @@ class MockWebStorage extends _i1.Mock implements _i2.WebStorage { } @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 deleteAllData() => - (super.noSuchMethod( - Invocation.method(#deleteAllData, []), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future deleteAllData() => (super.noSuchMethod( + Invocation.method(#deleteAllData, []), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i2.WebStorage pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWebStorage_3( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WebStorage); + _i2.WebStorage pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWebStorage_3( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WebStorage); } /// A class which mocks [WebView]. @@ -378,43 +334,36 @@ class MockWebView extends _i1.Mock implements _i2.WebView { } @override - _i2.WebSettings get settings => - (super.noSuchMethod( - Invocation.getter(#settings), - returnValue: _FakeWebSettings_2(this, Invocation.getter(#settings)), - ) - as _i2.WebSettings); + _i2.WebSettings get settings => (super.noSuchMethod( + Invocation.getter(#settings), + returnValue: _FakeWebSettings_2(this, Invocation.getter(#settings)), + ) as _i2.WebSettings); @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.WebSettings pigeonVar_settings() => - (super.noSuchMethod( - Invocation.method(#pigeonVar_settings, []), - returnValue: _FakeWebSettings_2( - this, - Invocation.method(#pigeonVar_settings, []), - ), - ) - as _i2.WebSettings); + _i2.WebSettings pigeonVar_settings() => (super.noSuchMethod( + Invocation.method(#pigeonVar_settings, []), + returnValue: _FakeWebSettings_2( + this, + Invocation.method(#pigeonVar_settings, []), + ), + ) as _i2.WebSettings); @override _i4.Future loadData(String? data, String? mimeType, String? encoding) => (super.noSuchMethod( - Invocation.method(#loadData, [data, mimeType, encoding]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#loadData, [data, mimeType, encoding]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future loadDataWithBaseUrl( @@ -425,234 +374,194 @@ class MockWebView extends _i1.Mock implements _i2.WebView { String? historyUrl, ) => (super.noSuchMethod( - Invocation.method(#loadDataWithBaseUrl, [ - baseUrl, - data, - mimeType, - encoding, - historyUrl, - ]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#loadDataWithBaseUrl, [ + baseUrl, + data, + mimeType, + encoding, + historyUrl, + ]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future loadUrl(String? url, Map? headers) => (super.noSuchMethod( - Invocation.method(#loadUrl, [url, headers]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#loadUrl, [url, headers]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future postUrl(String? url, _i6.Uint8List? data) => (super.noSuchMethod( - Invocation.method(#postUrl, [url, data]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#postUrl, [url, data]), + 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 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 clearCache(bool? includeDiskFiles) => - (super.noSuchMethod( - Invocation.method(#clearCache, [includeDiskFiles]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future clearCache(bool? includeDiskFiles) => (super.noSuchMethod( + Invocation.method(#clearCache, [includeDiskFiles]), + 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 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 setWebViewClient(_i2.WebViewClient? client) => (super.noSuchMethod( - Invocation.method(#setWebViewClient, [client]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#setWebViewClient, [client]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future addJavaScriptChannel(_i2.JavaScriptChannel? channel) => (super.noSuchMethod( - Invocation.method(#addJavaScriptChannel, [channel]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#addJavaScriptChannel, [channel]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future removeJavaScriptChannel(String? name) => - (super.noSuchMethod( - Invocation.method(#removeJavaScriptChannel, [name]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future removeJavaScriptChannel(String? name) => (super.noSuchMethod( + Invocation.method(#removeJavaScriptChannel, [name]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future setDownloadListener(_i2.DownloadListener? listener) => (super.noSuchMethod( - Invocation.method(#setDownloadListener, [listener]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#setDownloadListener, [listener]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future setWebChromeClient(_i2.WebChromeClient? client) => (super.noSuchMethod( - Invocation.method(#setWebChromeClient, [client]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#setWebChromeClient, [client]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future setBackgroundColor(int? color) => - (super.noSuchMethod( - Invocation.method(#setBackgroundColor, [color]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future setBackgroundColor(int? color) => (super.noSuchMethod( + Invocation.method(#setBackgroundColor, [color]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future destroy() => - (super.noSuchMethod( - Invocation.method(#destroy, []), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future destroy() => (super.noSuchMethod( + Invocation.method(#destroy, []), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i2.WebView pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWebView_4( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WebView); + _i2.WebView pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWebView_4( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WebView); @override - _i4.Future scrollTo(int? x, int? y) => - (super.noSuchMethod( - Invocation.method(#scrollTo, [x, y]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future scrollTo(int? x, int? y) => (super.noSuchMethod( + Invocation.method(#scrollTo, [x, y]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future scrollBy(int? x, int? y) => - (super.noSuchMethod( - Invocation.method(#scrollBy, [x, y]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future scrollBy(int? x, int? y) => (super.noSuchMethod( + Invocation.method(#scrollBy, [x, y]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future<_i2.WebViewPoint> getScrollPosition() => - (super.noSuchMethod( + _i4.Future<_i2.WebViewPoint> getScrollPosition() => (super.noSuchMethod( + Invocation.method(#getScrollPosition, []), + returnValue: _i4.Future<_i2.WebViewPoint>.value( + _FakeWebViewPoint_5( + this, Invocation.method(#getScrollPosition, []), - returnValue: _i4.Future<_i2.WebViewPoint>.value( - _FakeWebViewPoint_5( - this, - Invocation.method(#getScrollPosition, []), - ), - ), - ) - as _i4.Future<_i2.WebViewPoint>); + ), + ), + ) as _i4.Future<_i2.WebViewPoint>); @override _i4.Future setVerticalScrollBarEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setVerticalScrollBarEnabled, [enabled]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#setVerticalScrollBarEnabled, [enabled]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future setHorizontalScrollBarEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setHorizontalScrollBarEnabled, [enabled]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#setHorizontalScrollBarEnabled, [enabled]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); } /// A class which mocks [WebResourceRequest]. @@ -665,20 +574,16 @@ class MockWebResourceRequest extends _i1.Mock } @override - String get url => - (super.noSuchMethod( - Invocation.getter(#url), - returnValue: _i5.dummyValue(this, Invocation.getter(#url)), - ) - as String); + String get url => (super.noSuchMethod( + Invocation.getter(#url), + returnValue: _i5.dummyValue(this, Invocation.getter(#url)), + ) as String); @override - bool get isForMainFrame => - (super.noSuchMethod( - Invocation.getter(#isForMainFrame), - returnValue: false, - ) - as bool); + bool get isForMainFrame => (super.noSuchMethod( + Invocation.getter(#isForMainFrame), + returnValue: false, + ) as bool); @override bool get hasGesture => @@ -686,37 +591,31 @@ class MockWebResourceRequest extends _i1.Mock as bool); @override - String get method => - (super.noSuchMethod( - Invocation.getter(#method), - returnValue: _i5.dummyValue( - this, - Invocation.getter(#method), - ), - ) - as String); + String get method => (super.noSuchMethod( + Invocation.getter(#method), + returnValue: _i5.dummyValue( + this, + Invocation.getter(#method), + ), + ) as String); @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.WebResourceRequest pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWebResourceRequest_6( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WebResourceRequest); + _i2.WebResourceRequest pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWebResourceRequest_6( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WebResourceRequest); } /// A class which mocks [DownloadListener]. @@ -729,20 +628,17 @@ class MockDownloadListener extends _i1.Mock implements _i2.DownloadListener { @override void Function(_i2.DownloadListener, String, String, String, String, int) - get onDownloadStart => - (super.noSuchMethod( + get onDownloadStart => (super.noSuchMethod( Invocation.getter(#onDownloadStart), - returnValue: - ( - _i2.DownloadListener pigeon_instance, - String url, - String userAgent, - String contentDisposition, - String mimetype, - int contentLength, - ) {}, - ) - as void Function( + returnValue: ( + _i2.DownloadListener pigeon_instance, + String url, + String userAgent, + String contentDisposition, + String mimetype, + int contentLength, + ) {}, + ) as void Function( _i2.DownloadListener, String, String, @@ -752,26 +648,22 @@ class MockDownloadListener extends _i1.Mock implements _i2.DownloadListener { )); @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.DownloadListener pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeDownloadListener_7( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.DownloadListener); + _i2.DownloadListener pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeDownloadListener_7( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.DownloadListener); } /// A class which mocks [WebViewAndroidJavaScriptChannel]. @@ -786,55 +678,46 @@ class MockWebViewAndroidJavaScriptChannel extends _i1.Mock @override _i3.JavascriptChannelRegistry get javascriptChannelRegistry => (super.noSuchMethod( - Invocation.getter(#javascriptChannelRegistry), - returnValue: _FakeJavascriptChannelRegistry_8( - this, - Invocation.getter(#javascriptChannelRegistry), - ), - ) - as _i3.JavascriptChannelRegistry); + Invocation.getter(#javascriptChannelRegistry), + returnValue: _FakeJavascriptChannelRegistry_8( + this, + Invocation.getter(#javascriptChannelRegistry), + ), + ) as _i3.JavascriptChannelRegistry); @override - String get channelName => - (super.noSuchMethod( - Invocation.getter(#channelName), - returnValue: _i5.dummyValue( - this, - Invocation.getter(#channelName), - ), - ) - as String); + String get channelName => (super.noSuchMethod( + Invocation.getter(#channelName), + returnValue: _i5.dummyValue( + this, + Invocation.getter(#channelName), + ), + ) as String); @override void Function(_i2.JavaScriptChannel, String) get postMessage => (super.noSuchMethod( - Invocation.getter(#postMessage), - returnValue: - (_i2.JavaScriptChannel pigeon_instance, String message) {}, - ) - as void Function(_i2.JavaScriptChannel, String)); + Invocation.getter(#postMessage), + returnValue: (_i2.JavaScriptChannel pigeon_instance, String message) {}, + ) as void Function(_i2.JavaScriptChannel, String)); @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.JavaScriptChannel pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeJavaScriptChannel_9( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.JavaScriptChannel); + _i2.JavaScriptChannel pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeJavaScriptChannel_9( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.JavaScriptChannel); } /// A class which mocks [WebChromeClient]. @@ -846,77 +729,68 @@ class MockWebChromeClient extends _i1.Mock implements _i2.WebChromeClient { } @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 setSynchronousReturnValueForOnShowFileChooser(bool? value) => (super.noSuchMethod( - Invocation.method(#setSynchronousReturnValueForOnShowFileChooser, [ - value, - ]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#setSynchronousReturnValueForOnShowFileChooser, [ + value, + ]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future setSynchronousReturnValueForOnConsoleMessage(bool? value) => (super.noSuchMethod( - Invocation.method(#setSynchronousReturnValueForOnConsoleMessage, [ - value, - ]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#setSynchronousReturnValueForOnConsoleMessage, [ + value, + ]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future setSynchronousReturnValueForOnJsAlert(bool? value) => (super.noSuchMethod( - Invocation.method(#setSynchronousReturnValueForOnJsAlert, [value]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#setSynchronousReturnValueForOnJsAlert, [value]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future setSynchronousReturnValueForOnJsConfirm(bool? value) => (super.noSuchMethod( - Invocation.method(#setSynchronousReturnValueForOnJsConfirm, [ - value, - ]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#setSynchronousReturnValueForOnJsConfirm, [ + value, + ]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future setSynchronousReturnValueForOnJsPrompt(bool? value) => (super.noSuchMethod( - Invocation.method(#setSynchronousReturnValueForOnJsPrompt, [value]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#setSynchronousReturnValueForOnJsPrompt, [value]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i2.WebChromeClient pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWebChromeClient_10( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WebChromeClient); + _i2.WebChromeClient pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWebChromeClient_10( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WebChromeClient); } /// A class which mocks [WebViewClient]. @@ -928,40 +802,35 @@ class MockWebViewClient extends _i1.Mock implements _i2.WebViewClient { } @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 setSynchronousReturnValueForShouldOverrideUrlLoading( bool? value, ) => (super.noSuchMethod( - Invocation.method( - #setSynchronousReturnValueForShouldOverrideUrlLoading, - [value], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); - - @override - _i2.WebViewClient pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWebViewClient_11( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WebViewClient); + Invocation.method( + #setSynchronousReturnValueForShouldOverrideUrlLoading, + [value], + ), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); + + @override + _i2.WebViewClient pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWebViewClient_11( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WebViewClient); } /// A class which mocks [JavascriptChannelRegistry]. @@ -974,12 +843,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) => @@ -1011,37 +878,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(_i3.WebResourceError? error) => super.noSuchMethod( - Invocation.method(#onWebResourceError, [error]), - returnValueForMissingStub: null, - ); + Invocation.method(#onWebResourceError, [error]), + returnValueForMissingStub: null, + ); } /// A class which mocks [WebViewProxy]. @@ -1053,15 +919,13 @@ class MockWebViewProxy extends _i1.Mock implements _i7.WebViewProxy { } @override - _i2.WebView createWebView() => - (super.noSuchMethod( - Invocation.method(#createWebView, []), - returnValue: _FakeWebView_4( - this, - Invocation.method(#createWebView, []), - ), - ) - as _i2.WebView); + _i2.WebView createWebView() => (super.noSuchMethod( + Invocation.method(#createWebView, []), + returnValue: _FakeWebView_4( + this, + Invocation.method(#createWebView, []), + ), + ) as _i2.WebView); @override _i2.WebViewClient createWebViewClient({ @@ -1072,43 +936,40 @@ class MockWebViewProxy extends _i1.Mock implements _i7.WebViewProxy { _i2.WebView, _i2.WebResourceRequest, _i2.WebResourceError, - )? - onReceivedRequestError, + )? onReceivedRequestError, void Function(_i2.WebViewClient, _i2.WebView, int, String, String)? - onReceivedError, + onReceivedError, void Function(_i2.WebViewClient, _i2.WebView, _i2.WebResourceRequest)? - requestLoading, + requestLoading, void Function(_i2.WebViewClient, _i2.WebView, String)? urlLoading, }) => (super.noSuchMethod( - Invocation.method(#createWebViewClient, [], { - #onPageStarted: onPageStarted, - #onPageFinished: onPageFinished, - #onReceivedRequestError: onReceivedRequestError, - #onReceivedError: onReceivedError, - #requestLoading: requestLoading, - #urlLoading: urlLoading, - }), - returnValue: _FakeWebViewClient_11( - this, - Invocation.method(#createWebViewClient, [], { - #onPageStarted: onPageStarted, - #onPageFinished: onPageFinished, - #onReceivedRequestError: onReceivedRequestError, - #onReceivedError: onReceivedError, - #requestLoading: requestLoading, - #urlLoading: urlLoading, - }), - ), - ) - as _i2.WebViewClient); + Invocation.method(#createWebViewClient, [], { + #onPageStarted: onPageStarted, + #onPageFinished: onPageFinished, + #onReceivedRequestError: onReceivedRequestError, + #onReceivedError: onReceivedError, + #requestLoading: requestLoading, + #urlLoading: urlLoading, + }), + returnValue: _FakeWebViewClient_11( + this, + Invocation.method(#createWebViewClient, [], { + #onPageStarted: onPageStarted, + #onPageFinished: onPageFinished, + #onReceivedRequestError: onReceivedRequestError, + #onReceivedError: onReceivedError, + #requestLoading: requestLoading, + #urlLoading: urlLoading, + }), + ), + ) as _i2.WebViewClient); @override _i4.Future setWebContentsDebuggingEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setWebContentsDebuggingEnabled, [enabled]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#setWebContentsDebuggingEnabled, [enabled]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); } diff --git a/packages/webview_flutter/webview_flutter_platform_interface/test/platform_webview_controller_test.dart b/packages/webview_flutter/webview_flutter_platform_interface/test/platform_webview_controller_test.dart index 56643d8601b..bccd7918464 100644 --- a/packages/webview_flutter/webview_flutter_platform_interface/test/platform_webview_controller_test.dart +++ b/packages/webview_flutter/webview_flutter_platform_interface/test/platform_webview_controller_test.dart @@ -311,7 +311,8 @@ void main() { ); }); - test('Default implementation of setVerticalScrollBarEnabled should throw unimplemented error', + test( + 'Default implementation of setVerticalScrollBarEnabled should throw unimplemented error', () { final PlatformWebViewController controller = ExtendsPlatformWebViewController( @@ -323,7 +324,8 @@ void main() { ); }); - test('Default implementation of setHorizontalScrollBarEnabled should throw unimplemented error', + test( + 'Default implementation of setHorizontalScrollBarEnabled should throw unimplemented error', () { final PlatformWebViewController controller = ExtendsPlatformWebViewController( diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/ScrollViewProxyAPITests.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/ScrollViewProxyAPITests.swift index 707b2e87c89..e991cdf3747 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/ScrollViewProxyAPITests.swift +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/ScrollViewProxyAPITests.swift @@ -125,28 +125,30 @@ class ScrollViewProxyAPITests: XCTestCase { XCTAssertEqual(instance.alwaysBounceHorizontal, value) } - - @MainActor func testSetShowsVerticalScrollIndicator() { - let registrar = TestProxyApiRegistrar() - let api = registrar.apiDelegate.pigeonApiUIScrollView(registrar) - let instance = TestScrollView() - let value = true - try? api.pigeonDelegate.setShowsVerticalScrollIndicator(pigeonApi: api, pigeonInstance: instance, value: value) + @MainActor func testSetShowsVerticalScrollIndicator() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiUIScrollView(registrar) - XCTAssertEqual(instance.showsVerticalScrollIndicator, value) - } - - @MainActor func testSetShowsHorizontalScrollIndicator() { - let registrar = TestProxyApiRegistrar() - let api = registrar.apiDelegate.pigeonApiUIScrollView(registrar) + let instance = TestScrollView() + let value = true + try? api.pigeonDelegate.setShowsVerticalScrollIndicator( + pigeonApi: api, pigeonInstance: instance, value: value) - let instance = TestScrollView() - let value = true - try? api.pigeonDelegate.setShowsHorizontalScrollIndicator(pigeonApi: api, pigeonInstance: instance, value: value) + XCTAssertEqual(instance.showsVerticalScrollIndicator, value) + } - XCTAssertEqual(instance.showsHorizontalScrollIndicator, value) - } + @MainActor func testSetShowsHorizontalScrollIndicator() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiUIScrollView(registrar) + + let instance = TestScrollView() + let value = true + try? api.pigeonDelegate.setShowsHorizontalScrollIndicator( + pigeonApi: api, pigeonInstance: instance, value: value) + + XCTAssertEqual(instance.showsHorizontalScrollIndicator, value) + } #endif } diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/ScrollViewProxyAPIDelegate.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/ScrollViewProxyAPIDelegate.swift index 7e89286124e..09084b1d10e 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/ScrollViewProxyAPIDelegate.swift +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/ScrollViewProxyAPIDelegate.swift @@ -88,13 +88,17 @@ class ScrollViewProxyAPIDelegate: PigeonApiDelegateUIScrollView { ) throws { pigeonInstance.alwaysBounceHorizontal = value } - - func setShowsVerticalScrollIndicator(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws { - pigeonInstance.showsVerticalScrollIndicator = value - } - - func setShowsHorizontalScrollIndicator(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws { - pigeonInstance.showsHorizontalScrollIndicator = value - } + + func setShowsVerticalScrollIndicator( + pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool + ) throws { + pigeonInstance.showsVerticalScrollIndicator = value + } + + func setShowsHorizontalScrollIndicator( + pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool + ) throws { + pigeonInstance.showsHorizontalScrollIndicator = value + } #endif } 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 c48599ef7cf..f759ee612ee 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 @@ -6,8 +6,9 @@ import Foundation import WebKit + #if !os(macOS) -import UIKit + import UIKit #endif #if os(iOS) @@ -33,7 +34,7 @@ final class PigeonError: Error { var localizedDescription: String { return "PigeonError(code: \(code), message: \(message ?? ""), details: \(details ?? "")" - } + } } private func wrapResult(_ result: Any?) -> [Any?] { @@ -63,7 +64,9 @@ private func wrapError(_ error: Any) -> [Any?] { } private func createConnectionError(withChannelName channelName: String) -> PigeonError { - return PigeonError(code: "channel-error", message: "Unable to establish connection on channel: '\(channelName)'.", details: "") + return PigeonError( + code: "channel-error", message: "Unable to establish connection on channel: '\(channelName)'.", + details: "") } private func isNullish(_ value: Any?) -> Bool { @@ -80,7 +83,6 @@ protocol WebKitLibraryPigeonInternalFinalizerDelegate: AnyObject { func onDeinit(identifier: Int64) } - // Attaches to an object to receive a callback when the object is deallocated. internal final class WebKitLibraryPigeonInternalFinalizer { private static let associatedObjectKey = malloc(1)! @@ -96,7 +98,8 @@ internal final class WebKitLibraryPigeonInternalFinalizer { } internal static func attach( - to instance: AnyObject, identifier: Int64, delegate: WebKitLibraryPigeonInternalFinalizerDelegate + to instance: AnyObject, identifier: Int64, + delegate: WebKitLibraryPigeonInternalFinalizerDelegate ) { let finalizer = WebKitLibraryPigeonInternalFinalizer(identifier: identifier, delegate: delegate) objc_setAssociatedObject(instance, associatedObjectKey, finalizer, .OBJC_ASSOCIATION_RETAIN) @@ -111,7 +114,6 @@ internal final class WebKitLibraryPigeonInternalFinalizer { } } - /// Maintains instances used to communicate with the corresponding objects in Dart. /// /// Objects stored in this container are represented by an object in Dart that is also stored in @@ -215,7 +217,8 @@ final class WebKitLibraryPigeonInstanceManager { identifiers.setObject(NSNumber(value: identifier), forKey: instance) weakInstances.setObject(instance, forKey: NSNumber(value: identifier)) strongInstances.setObject(instance, forKey: NSNumber(value: identifier)) - WebKitLibraryPigeonInternalFinalizer.attach(to: instance, identifier: identifier, delegate: finalizerDelegate) + WebKitLibraryPigeonInternalFinalizer.attach( + to: instance, identifier: identifier, delegate: finalizerDelegate) } /// Retrieves the identifier paired with an instance. @@ -292,7 +295,6 @@ final class WebKitLibraryPigeonInstanceManager { } } - private class WebKitLibraryPigeonInstanceManagerApi { /// The codec used for serializing messages. var codec: FlutterStandardMessageCodec { WebKitLibraryPigeonCodec.shared } @@ -305,9 +307,14 @@ private class WebKitLibraryPigeonInstanceManagerApi { } /// Sets up an instance of `WebKitLibraryPigeonInstanceManagerApi` to handle messages through the `binaryMessenger`. - static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, instanceManager: WebKitLibraryPigeonInstanceManager?) { + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, instanceManager: WebKitLibraryPigeonInstanceManager? + ) { let codec = WebKitLibraryPigeonCodec.shared - let removeStrongReferenceChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.PigeonInternalInstanceManager.removeStrongReference", binaryMessenger: binaryMessenger, codec: codec) + let removeStrongReferenceChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.PigeonInternalInstanceManager.removeStrongReference", + binaryMessenger: binaryMessenger, codec: codec) if let instanceManager = instanceManager { removeStrongReferenceChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -322,7 +329,9 @@ private class WebKitLibraryPigeonInstanceManagerApi { } else { removeStrongReferenceChannel.setMessageHandler(nil) } - let clearChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.PigeonInternalInstanceManager.clear", binaryMessenger: binaryMessenger, codec: codec) + let clearChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.PigeonInternalInstanceManager.clear", + binaryMessenger: binaryMessenger, codec: codec) if let instanceManager = instanceManager { clearChannel.setMessageHandler { _, reply in do { @@ -338,9 +347,13 @@ private class WebKitLibraryPigeonInstanceManagerApi { } /// Sends a message to the Dart `InstanceManager` to remove the strong reference of the instance associated with `identifier`. - func removeStrongReference(identifier identifierArg: Int64, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.PigeonInternalInstanceManager.removeStrongReference" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func removeStrongReference( + identifier identifierArg: Int64, completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.PigeonInternalInstanceManager.removeStrongReference" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([identifierArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -363,102 +376,130 @@ protocol WebKitLibraryPigeonProxyApiDelegate { func pigeonApiURLRequest(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiURLRequest /// An implementation of [PigeonApiHTTPURLResponse] used to add a new Dart instance of /// `HTTPURLResponse` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiHTTPURLResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiHTTPURLResponse + func pigeonApiHTTPURLResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiHTTPURLResponse /// An implementation of [PigeonApiURLResponse] used to add a new Dart instance of /// `URLResponse` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiURLResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiURLResponse + func pigeonApiURLResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiURLResponse /// An implementation of [PigeonApiWKUserScript] used to add a new Dart instance of /// `WKUserScript` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKUserScript(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKUserScript + func pigeonApiWKUserScript(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKUserScript /// An implementation of [PigeonApiWKNavigationAction] used to add a new Dart instance of /// `WKNavigationAction` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKNavigationAction(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKNavigationAction + func pigeonApiWKNavigationAction(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKNavigationAction /// An implementation of [PigeonApiWKNavigationResponse] used to add a new Dart instance of /// `WKNavigationResponse` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKNavigationResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKNavigationResponse + func pigeonApiWKNavigationResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKNavigationResponse /// An implementation of [PigeonApiWKFrameInfo] used to add a new Dart instance of /// `WKFrameInfo` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKFrameInfo(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKFrameInfo + func pigeonApiWKFrameInfo(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKFrameInfo /// An implementation of [PigeonApiNSError] used to add a new Dart instance of /// `NSError` to the Dart `InstanceManager` and make calls to Dart. func pigeonApiNSError(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiNSError /// An implementation of [PigeonApiWKScriptMessage] used to add a new Dart instance of /// `WKScriptMessage` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKScriptMessage(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKScriptMessage + func pigeonApiWKScriptMessage(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKScriptMessage /// An implementation of [PigeonApiWKSecurityOrigin] used to add a new Dart instance of /// `WKSecurityOrigin` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKSecurityOrigin(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKSecurityOrigin + func pigeonApiWKSecurityOrigin(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKSecurityOrigin /// An implementation of [PigeonApiHTTPCookie] used to add a new Dart instance of /// `HTTPCookie` to the Dart `InstanceManager` and make calls to Dart. func pigeonApiHTTPCookie(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiHTTPCookie /// An implementation of [PigeonApiAuthenticationChallengeResponse] used to add a new Dart instance of /// `AuthenticationChallengeResponse` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiAuthenticationChallengeResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiAuthenticationChallengeResponse + func pigeonApiAuthenticationChallengeResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiAuthenticationChallengeResponse /// An implementation of [PigeonApiWKWebsiteDataStore] used to add a new Dart instance of /// `WKWebsiteDataStore` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKWebsiteDataStore(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKWebsiteDataStore + func pigeonApiWKWebsiteDataStore(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKWebsiteDataStore /// An implementation of [PigeonApiUIView] used to add a new Dart instance of /// `UIView` to the Dart `InstanceManager` and make calls to Dart. func pigeonApiUIView(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiUIView /// An implementation of [PigeonApiUIScrollView] used to add a new Dart instance of /// `UIScrollView` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiUIScrollView(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiUIScrollView + func pigeonApiUIScrollView(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiUIScrollView /// An implementation of [PigeonApiWKWebViewConfiguration] used to add a new Dart instance of /// `WKWebViewConfiguration` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKWebViewConfiguration(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKWebViewConfiguration + func pigeonApiWKWebViewConfiguration(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKWebViewConfiguration /// An implementation of [PigeonApiWKUserContentController] used to add a new Dart instance of /// `WKUserContentController` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKUserContentController(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKUserContentController + func pigeonApiWKUserContentController(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKUserContentController /// An implementation of [PigeonApiWKPreferences] used to add a new Dart instance of /// `WKPreferences` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKPreferences(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKPreferences + func pigeonApiWKPreferences(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKPreferences /// An implementation of [PigeonApiWKScriptMessageHandler] used to add a new Dart instance of /// `WKScriptMessageHandler` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKScriptMessageHandler(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKScriptMessageHandler + func pigeonApiWKScriptMessageHandler(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKScriptMessageHandler /// An implementation of [PigeonApiWKNavigationDelegate] used to add a new Dart instance of /// `WKNavigationDelegate` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKNavigationDelegate(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKNavigationDelegate + func pigeonApiWKNavigationDelegate(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKNavigationDelegate /// An implementation of [PigeonApiNSObject] used to add a new Dart instance of /// `NSObject` to the Dart `InstanceManager` and make calls to Dart. func pigeonApiNSObject(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiNSObject /// An implementation of [PigeonApiUIViewWKWebView] used to add a new Dart instance of /// `UIViewWKWebView` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiUIViewWKWebView(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiUIViewWKWebView + func pigeonApiUIViewWKWebView(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiUIViewWKWebView /// An implementation of [PigeonApiNSViewWKWebView] used to add a new Dart instance of /// `NSViewWKWebView` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiNSViewWKWebView(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiNSViewWKWebView + func pigeonApiNSViewWKWebView(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiNSViewWKWebView /// An implementation of [PigeonApiWKWebView] used to add a new Dart instance of /// `WKWebView` to the Dart `InstanceManager` and make calls to Dart. func pigeonApiWKWebView(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKWebView /// An implementation of [PigeonApiWKUIDelegate] used to add a new Dart instance of /// `WKUIDelegate` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKUIDelegate(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKUIDelegate + func pigeonApiWKUIDelegate(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKUIDelegate /// An implementation of [PigeonApiWKHTTPCookieStore] used to add a new Dart instance of /// `WKHTTPCookieStore` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKHTTPCookieStore(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKHTTPCookieStore + func pigeonApiWKHTTPCookieStore(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKHTTPCookieStore /// An implementation of [PigeonApiUIScrollViewDelegate] used to add a new Dart instance of /// `UIScrollViewDelegate` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiUIScrollViewDelegate(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiUIScrollViewDelegate + func pigeonApiUIScrollViewDelegate(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiUIScrollViewDelegate /// An implementation of [PigeonApiURLCredential] used to add a new Dart instance of /// `URLCredential` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiURLCredential(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiURLCredential + func pigeonApiURLCredential(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiURLCredential /// An implementation of [PigeonApiURLProtectionSpace] used to add a new Dart instance of /// `URLProtectionSpace` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiURLProtectionSpace(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiURLProtectionSpace + func pigeonApiURLProtectionSpace(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiURLProtectionSpace /// An implementation of [PigeonApiURLAuthenticationChallenge] used to add a new Dart instance of /// `URLAuthenticationChallenge` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiURLAuthenticationChallenge(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiURLAuthenticationChallenge + func pigeonApiURLAuthenticationChallenge(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiURLAuthenticationChallenge /// 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 + func pigeonApiWKWebpagePreferences(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKWebpagePreferences } extension WebKitLibraryPigeonProxyApiDelegate { - func pigeonApiURLResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiURLResponse { - return PigeonApiURLResponse(pigeonRegistrar: registrar, delegate: PigeonApiDelegateURLResponse()) + func pigeonApiURLResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiURLResponse + { + return PigeonApiURLResponse( + pigeonRegistrar: registrar, delegate: PigeonApiDelegateURLResponse()) } func pigeonApiWKWebView(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKWebView { return PigeonApiWKWebView(pigeonRegistrar: registrar, delegate: PigeonApiDelegateWKWebView()) @@ -503,41 +544,68 @@ open class WebKitLibraryPigeonProxyApiRegistrar { } func setUp() { - WebKitLibraryPigeonInstanceManagerApi.setUpMessageHandlers(binaryMessenger: binaryMessenger, instanceManager: instanceManager) - PigeonApiURLRequest.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiURLRequest(self)) - PigeonApiWKUserScript.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKUserScript(self)) - PigeonApiHTTPCookie.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiHTTPCookie(self)) - PigeonApiAuthenticationChallengeResponse.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiAuthenticationChallengeResponse(self)) - PigeonApiWKWebsiteDataStore.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKWebsiteDataStore(self)) - PigeonApiUIView.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiUIView(self)) - PigeonApiUIScrollView.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiUIScrollView(self)) - PigeonApiWKWebViewConfiguration.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKWebViewConfiguration(self)) - PigeonApiWKUserContentController.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKUserContentController(self)) - PigeonApiWKPreferences.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKPreferences(self)) - PigeonApiWKScriptMessageHandler.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKScriptMessageHandler(self)) - PigeonApiWKNavigationDelegate.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKNavigationDelegate(self)) - PigeonApiNSObject.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiNSObject(self)) - PigeonApiUIViewWKWebView.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiUIViewWKWebView(self)) - PigeonApiNSViewWKWebView.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiNSViewWKWebView(self)) - PigeonApiWKUIDelegate.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKUIDelegate(self)) - PigeonApiWKHTTPCookieStore.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKHTTPCookieStore(self)) - PigeonApiUIScrollViewDelegate.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiUIScrollViewDelegate(self)) - PigeonApiURLCredential.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiURLCredential(self)) - PigeonApiURLAuthenticationChallenge.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiURLAuthenticationChallenge(self)) - PigeonApiURL.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiURL(self)) - PigeonApiWKWebpagePreferences.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKWebpagePreferences(self)) + WebKitLibraryPigeonInstanceManagerApi.setUpMessageHandlers( + binaryMessenger: binaryMessenger, instanceManager: instanceManager) + PigeonApiURLRequest.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiURLRequest(self)) + PigeonApiWKUserScript.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKUserScript(self)) + PigeonApiHTTPCookie.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiHTTPCookie(self)) + PigeonApiAuthenticationChallengeResponse.setUpMessageHandlers( + binaryMessenger: binaryMessenger, + api: apiDelegate.pigeonApiAuthenticationChallengeResponse(self)) + PigeonApiWKWebsiteDataStore.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKWebsiteDataStore(self)) + PigeonApiUIView.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiUIView(self)) + PigeonApiUIScrollView.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiUIScrollView(self)) + PigeonApiWKWebViewConfiguration.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKWebViewConfiguration(self)) + PigeonApiWKUserContentController.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKUserContentController(self)) + PigeonApiWKPreferences.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKPreferences(self)) + PigeonApiWKScriptMessageHandler.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKScriptMessageHandler(self)) + PigeonApiWKNavigationDelegate.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKNavigationDelegate(self)) + PigeonApiNSObject.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiNSObject(self)) + PigeonApiUIViewWKWebView.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiUIViewWKWebView(self)) + PigeonApiNSViewWKWebView.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiNSViewWKWebView(self)) + PigeonApiWKUIDelegate.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKUIDelegate(self)) + PigeonApiWKHTTPCookieStore.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKHTTPCookieStore(self)) + PigeonApiUIScrollViewDelegate.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiUIScrollViewDelegate(self)) + PigeonApiURLCredential.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiURLCredential(self)) + PigeonApiURLAuthenticationChallenge.setUpMessageHandlers( + 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(binaryMessenger: binaryMessenger, instanceManager: nil) + WebKitLibraryPigeonInstanceManagerApi.setUpMessageHandlers( + binaryMessenger: binaryMessenger, instanceManager: nil) PigeonApiURLRequest.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiWKUserScript.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiHTTPCookie.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) - PigeonApiAuthenticationChallengeResponse.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) + PigeonApiAuthenticationChallengeResponse.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: nil) PigeonApiWKWebsiteDataStore.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiUIView.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiUIScrollView.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiWKWebViewConfiguration.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) - PigeonApiWKUserContentController.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) + PigeonApiWKUserContentController.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: nil) PigeonApiWKPreferences.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiWKScriptMessageHandler.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiWKNavigationDelegate.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) @@ -548,7 +616,8 @@ open class WebKitLibraryPigeonProxyApiRegistrar { PigeonApiWKHTTPCookieStore.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiUIScrollViewDelegate.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiURLCredential.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) - PigeonApiURLAuthenticationChallenge.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) + PigeonApiURLAuthenticationChallenge.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: nil) PigeonApiURL.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiWKWebpagePreferences.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) } @@ -589,252 +658,272 @@ private class WebKitLibraryPigeonInternalProxyApiCodecReaderWriter: FlutterStand } override func writeValue(_ value: Any) { - if value is [Any] || value is Bool || value is Data || value is [AnyHashable: Any] || value is Double || value is FlutterStandardTypedData || value is Int64 || value is String || value is KeyValueObservingOptions || value is KeyValueChange || value is KeyValueChangeKey || value is UserScriptInjectionTime || value is AudiovisualMediaType || value is WebsiteDataType || value is NavigationActionPolicy || value is NavigationResponsePolicy || value is HttpCookiePropertyKey || value is NavigationType || value is PermissionDecision || value is MediaCaptureType || value is UrlSessionAuthChallengeDisposition || value is UrlCredentialPersistence { + if value is [Any] || value is Bool || value is Data || value is [AnyHashable: Any] + || value is Double || value is FlutterStandardTypedData || value is Int64 || value is String + || value is KeyValueObservingOptions || value is KeyValueChange + || value is KeyValueChangeKey || value is UserScriptInjectionTime + || value is AudiovisualMediaType || value is WebsiteDataType + || value is NavigationActionPolicy || value is NavigationResponsePolicy + || value is HttpCookiePropertyKey || value is NavigationType || value is PermissionDecision + || value is MediaCaptureType || value is UrlSessionAuthChallengeDisposition + || value is UrlCredentialPersistence + { super.writeValue(value) return } - if let instance = value as? URLRequestWrapper { pigeonRegistrar.apiDelegate.pigeonApiURLRequest(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } - if let instance = value as? HTTPURLResponse { pigeonRegistrar.apiDelegate.pigeonApiHTTPURLResponse(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } - if let instance = value as? URLResponse { pigeonRegistrar.apiDelegate.pigeonApiURLResponse(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } - if let instance = value as? WKUserScript { pigeonRegistrar.apiDelegate.pigeonApiWKUserScript(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } - if let instance = value as? WKNavigationAction { pigeonRegistrar.apiDelegate.pigeonApiWKNavigationAction(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } - if let instance = value as? WKNavigationResponse { - pigeonRegistrar.apiDelegate.pigeonApiWKNavigationResponse(pigeonRegistrar).pigeonNewInstance( - pigeonInstance: instance - ) { _ in } + pigeonRegistrar.apiDelegate.pigeonApiWKNavigationResponse(pigeonRegistrar) + .pigeonNewInstance( + pigeonInstance: instance + ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } - if let instance = value as? WKFrameInfo { pigeonRegistrar.apiDelegate.pigeonApiWKFrameInfo(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } - if let instance = value as? NSError { pigeonRegistrar.apiDelegate.pigeonApiNSError(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } - if let instance = value as? WKScriptMessage { pigeonRegistrar.apiDelegate.pigeonApiWKScriptMessage(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } - if let instance = value as? WKSecurityOrigin { pigeonRegistrar.apiDelegate.pigeonApiWKSecurityOrigin(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } - if let instance = value as? HTTPCookie { pigeonRegistrar.apiDelegate.pigeonApiHTTPCookie(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } - if let instance = value as? AuthenticationChallengeResponse { - pigeonRegistrar.apiDelegate.pigeonApiAuthenticationChallengeResponse(pigeonRegistrar).pigeonNewInstance( - pigeonInstance: instance - ) { _ in } + pigeonRegistrar.apiDelegate.pigeonApiAuthenticationChallengeResponse(pigeonRegistrar) + .pigeonNewInstance( + pigeonInstance: instance + ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } - if let instance = value as? WKWebsiteDataStore { pigeonRegistrar.apiDelegate.pigeonApiWKWebsiteDataStore(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } #if !os(macOS) - if let instance = value as? UIScrollView { - pigeonRegistrar.apiDelegate.pigeonApiUIScrollView(pigeonRegistrar).pigeonNewInstance( - pigeonInstance: instance - ) { _ in } - super.writeByte(128) - super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) - return - } + if let instance = value as? UIScrollView { + pigeonRegistrar.apiDelegate.pigeonApiUIScrollView(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + return + } #endif if let instance = value as? WKWebViewConfiguration { - pigeonRegistrar.apiDelegate.pigeonApiWKWebViewConfiguration(pigeonRegistrar).pigeonNewInstance( - pigeonInstance: instance - ) { _ in } + pigeonRegistrar.apiDelegate.pigeonApiWKWebViewConfiguration(pigeonRegistrar) + .pigeonNewInstance( + pigeonInstance: instance + ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } - if let instance = value as? WKUserContentController { - pigeonRegistrar.apiDelegate.pigeonApiWKUserContentController(pigeonRegistrar).pigeonNewInstance( - pigeonInstance: instance - ) { _ in } + pigeonRegistrar.apiDelegate.pigeonApiWKUserContentController(pigeonRegistrar) + .pigeonNewInstance( + pigeonInstance: instance + ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } - if let instance = value as? WKPreferences { pigeonRegistrar.apiDelegate.pigeonApiWKPreferences(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } - if let instance = value as? WKScriptMessageHandler { - pigeonRegistrar.apiDelegate.pigeonApiWKScriptMessageHandler(pigeonRegistrar).pigeonNewInstance( - pigeonInstance: instance - ) { _ in } + pigeonRegistrar.apiDelegate.pigeonApiWKScriptMessageHandler(pigeonRegistrar) + .pigeonNewInstance( + pigeonInstance: instance + ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } - if let instance = value as? WKNavigationDelegate { - pigeonRegistrar.apiDelegate.pigeonApiWKNavigationDelegate(pigeonRegistrar).pigeonNewInstance( - pigeonInstance: instance - ) { _ in } + pigeonRegistrar.apiDelegate.pigeonApiWKNavigationDelegate(pigeonRegistrar) + .pigeonNewInstance( + pigeonInstance: instance + ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } #if !os(macOS) - if let instance = value as? WKWebView { - pigeonRegistrar.apiDelegate.pigeonApiUIViewWKWebView(pigeonRegistrar).pigeonNewInstance( - pigeonInstance: instance - ) { _ in } - super.writeByte(128) - super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) - return - } + if let instance = value as? WKWebView { + pigeonRegistrar.apiDelegate.pigeonApiUIViewWKWebView(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + return + } #endif #if !os(macOS) - if let instance = value as? UIView { - pigeonRegistrar.apiDelegate.pigeonApiUIView(pigeonRegistrar).pigeonNewInstance( - pigeonInstance: instance - ) { _ in } - super.writeByte(128) - super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) - return - } + if let instance = value as? UIView { + pigeonRegistrar.apiDelegate.pigeonApiUIView(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + return + } #endif #if !os(iOS) - if let instance = value as? WKWebView { - pigeonRegistrar.apiDelegate.pigeonApiNSViewWKWebView(pigeonRegistrar).pigeonNewInstance( - pigeonInstance: instance - ) { _ in } - super.writeByte(128) - super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) - return - } + if let instance = value as? WKWebView { + pigeonRegistrar.apiDelegate.pigeonApiNSViewWKWebView(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + return + } #endif if let instance = value as? WKWebView { @@ -843,42 +932,45 @@ private class WebKitLibraryPigeonInternalProxyApiCodecReaderWriter: FlutterStand ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } - if let instance = value as? WKUIDelegate { pigeonRegistrar.apiDelegate.pigeonApiWKUIDelegate(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } - if let instance = value as? WKHTTPCookieStore { pigeonRegistrar.apiDelegate.pigeonApiWKHTTPCookieStore(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } #if !os(macOS) - if let instance = value as? UIScrollViewDelegate { - pigeonRegistrar.apiDelegate.pigeonApiUIScrollViewDelegate(pigeonRegistrar).pigeonNewInstance( - pigeonInstance: instance - ) { _ in } - super.writeByte(128) - super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) - return - } + if let instance = value as? UIScrollViewDelegate { + pigeonRegistrar.apiDelegate.pigeonApiUIScrollViewDelegate(pigeonRegistrar) + .pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + return + } #endif if let instance = value as? URLCredential { @@ -887,67 +979,70 @@ private class WebKitLibraryPigeonInternalProxyApiCodecReaderWriter: FlutterStand ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } - if let instance = value as? URLProtectionSpace { pigeonRegistrar.apiDelegate.pigeonApiURLProtectionSpace(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } - if let instance = value as? URLAuthenticationChallenge { - pigeonRegistrar.apiDelegate.pigeonApiURLAuthenticationChallenge(pigeonRegistrar).pigeonNewInstance( - pigeonInstance: instance - ) { _ in } + pigeonRegistrar.apiDelegate.pigeonApiURLAuthenticationChallenge(pigeonRegistrar) + .pigeonNewInstance( + pigeonInstance: instance + ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } - if let instance = value as? URL { pigeonRegistrar.apiDelegate.pigeonApiURL(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } - if #available(iOS 13.0.0, macOS 10.15.0, *), let instance = value as? WKWebpagePreferences { - pigeonRegistrar.apiDelegate.pigeonApiWKWebpagePreferences(pigeonRegistrar).pigeonNewInstance( - pigeonInstance: instance - ) { _ in } + pigeonRegistrar.apiDelegate.pigeonApiWKWebpagePreferences(pigeonRegistrar) + .pigeonNewInstance( + pigeonInstance: instance + ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } - if let instance = value as? NSObject { pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } - - if let instance = value as AnyObject?, pigeonRegistrar.instanceManager.containsInstance(instance) + if let instance = value as AnyObject?, + pigeonRegistrar.instanceManager.containsInstance(instance) { super.writeByte(128) super.writeValue( @@ -965,11 +1060,13 @@ private class WebKitLibraryPigeonInternalProxyApiCodecReaderWriter: FlutterStand } override func reader(with data: Data) -> FlutterStandardReader { - return WebKitLibraryPigeonInternalProxyApiCodecReader(data: data, pigeonRegistrar: pigeonRegistrar) + return WebKitLibraryPigeonInternalProxyApiCodecReader( + data: data, pigeonRegistrar: pigeonRegistrar) } override func writer(with data: NSMutableData) -> FlutterStandardWriter { - return WebKitLibraryPigeonInternalProxyApiCodecWriter(data: data, pigeonRegistrar: pigeonRegistrar) + return WebKitLibraryPigeonInternalProxyApiCodecWriter( + data: data, pigeonRegistrar: pigeonRegistrar) } } @@ -1396,27 +1493,36 @@ class WebKitLibraryPigeonCodec: FlutterStandardMessageCodec, @unchecked Sendable } protocol PigeonApiDelegateURLRequest { - func pigeonDefaultConstructor(pigeonApi: PigeonApiURLRequest, url: String) throws -> URLRequestWrapper + func pigeonDefaultConstructor(pigeonApi: PigeonApiURLRequest, url: String) throws + -> URLRequestWrapper /// The URL being requested. func getUrl(pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper) throws -> String? /// The HTTP request method. - func setHttpMethod(pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper, method: String?) throws + func setHttpMethod( + pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper, method: String?) throws /// The HTTP request method. - func getHttpMethod(pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper) throws -> String? + func getHttpMethod(pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper) throws + -> String? /// The request body. - func setHttpBody(pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper, body: FlutterStandardTypedData?) throws + func setHttpBody( + pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper, + body: FlutterStandardTypedData?) throws /// The request body. - func getHttpBody(pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper) throws -> FlutterStandardTypedData? + func getHttpBody(pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper) throws + -> FlutterStandardTypedData? /// A dictionary containing all of the HTTP header fields for a request. - func setAllHttpHeaderFields(pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper, fields: [String: String]?) throws + func setAllHttpHeaderFields( + pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper, fields: [String: String]?) + throws /// A dictionary containing all of the HTTP header fields for a request. - func getAllHttpHeaderFields(pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper) throws -> [String: String]? + func getAllHttpHeaderFields(pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper) + throws -> [String: String]? } protocol PigeonApiProtocolURLRequest { } -final class PigeonApiURLRequest: PigeonApiProtocolURLRequest { +final class PigeonApiURLRequest: PigeonApiProtocolURLRequest { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateURLRequest ///An implementation of [NSObject] used to access callback methods @@ -1424,17 +1530,23 @@ final class PigeonApiURLRequest: PigeonApiProtocolURLRequest { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateURLRequest) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateURLRequest) + { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiURLRequest?) { + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiURLRequest? + ) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.pigeon_defaultConstructor", binaryMessenger: binaryMessenger, codec: codec) + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.pigeon_defaultConstructor", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { pigeonDefaultConstructorChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1442,8 +1554,8 @@ final class PigeonApiURLRequest: PigeonApiProtocolURLRequest { let urlArg = args[1] as! String do { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( -try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api, url: urlArg), -withIdentifier: pigeonIdentifierArg) + try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api, url: urlArg), + withIdentifier: pigeonIdentifierArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -1452,13 +1564,16 @@ withIdentifier: pigeonIdentifierArg) } else { pigeonDefaultConstructorChannel.setMessageHandler(nil) } - let getUrlChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.getUrl", binaryMessenger: binaryMessenger, codec: codec) + let getUrlChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.getUrl", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { getUrlChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! URLRequestWrapper do { - let result = try api.pigeonDelegate.getUrl(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + let result = try api.pigeonDelegate.getUrl( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -1467,14 +1582,17 @@ withIdentifier: pigeonIdentifierArg) } else { getUrlChannel.setMessageHandler(nil) } - let setHttpMethodChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.setHttpMethod", binaryMessenger: binaryMessenger, codec: codec) + let setHttpMethodChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.setHttpMethod", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { setHttpMethodChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! URLRequestWrapper let methodArg: String? = nilOrValue(args[1]) do { - try api.pigeonDelegate.setHttpMethod(pigeonApi: api, pigeonInstance: pigeonInstanceArg, method: methodArg) + try api.pigeonDelegate.setHttpMethod( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, method: methodArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -1483,13 +1601,16 @@ withIdentifier: pigeonIdentifierArg) } else { setHttpMethodChannel.setMessageHandler(nil) } - let getHttpMethodChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.getHttpMethod", binaryMessenger: binaryMessenger, codec: codec) + let getHttpMethodChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.getHttpMethod", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { getHttpMethodChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! URLRequestWrapper do { - let result = try api.pigeonDelegate.getHttpMethod(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + let result = try api.pigeonDelegate.getHttpMethod( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -1498,14 +1619,17 @@ withIdentifier: pigeonIdentifierArg) } else { getHttpMethodChannel.setMessageHandler(nil) } - let setHttpBodyChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.setHttpBody", binaryMessenger: binaryMessenger, codec: codec) + let setHttpBodyChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.setHttpBody", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { setHttpBodyChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! URLRequestWrapper let bodyArg: FlutterStandardTypedData? = nilOrValue(args[1]) do { - try api.pigeonDelegate.setHttpBody(pigeonApi: api, pigeonInstance: pigeonInstanceArg, body: bodyArg) + try api.pigeonDelegate.setHttpBody( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, body: bodyArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -1514,13 +1638,16 @@ withIdentifier: pigeonIdentifierArg) } else { setHttpBodyChannel.setMessageHandler(nil) } - let getHttpBodyChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.getHttpBody", binaryMessenger: binaryMessenger, codec: codec) + let getHttpBodyChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.getHttpBody", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { getHttpBodyChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! URLRequestWrapper do { - let result = try api.pigeonDelegate.getHttpBody(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + let result = try api.pigeonDelegate.getHttpBody( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -1529,14 +1656,17 @@ withIdentifier: pigeonIdentifierArg) } else { getHttpBodyChannel.setMessageHandler(nil) } - let setAllHttpHeaderFieldsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.setAllHttpHeaderFields", binaryMessenger: binaryMessenger, codec: codec) + let setAllHttpHeaderFieldsChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.setAllHttpHeaderFields", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { setAllHttpHeaderFieldsChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! URLRequestWrapper let fieldsArg: [String: String]? = nilOrValue(args[1]) do { - try api.pigeonDelegate.setAllHttpHeaderFields(pigeonApi: api, pigeonInstance: pigeonInstanceArg, fields: fieldsArg) + try api.pigeonDelegate.setAllHttpHeaderFields( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, fields: fieldsArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -1545,13 +1675,16 @@ withIdentifier: pigeonIdentifierArg) } else { setAllHttpHeaderFieldsChannel.setMessageHandler(nil) } - let getAllHttpHeaderFieldsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.getAllHttpHeaderFields", binaryMessenger: binaryMessenger, codec: codec) + let getAllHttpHeaderFieldsChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.getAllHttpHeaderFields", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { getAllHttpHeaderFieldsChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! URLRequestWrapper do { - let result = try api.pigeonDelegate.getAllHttpHeaderFields(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + let result = try api.pigeonDelegate.getAllHttpHeaderFields( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -1563,21 +1696,26 @@ withIdentifier: pigeonIdentifierArg) } ///Creates a Dart instance of URLRequest and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: URLRequestWrapper, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: URLRequestWrapper, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeonInstance as AnyObject) + } 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) + 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))) @@ -1597,13 +1735,14 @@ withIdentifier: pigeonIdentifierArg) } protocol PigeonApiDelegateHTTPURLResponse { /// The response’s HTTP status code. - func statusCode(pigeonApi: PigeonApiHTTPURLResponse, pigeonInstance: HTTPURLResponse) throws -> Int64 + func statusCode(pigeonApi: PigeonApiHTTPURLResponse, pigeonInstance: HTTPURLResponse) throws + -> Int64 } protocol PigeonApiProtocolHTTPURLResponse { } -final class PigeonApiHTTPURLResponse: PigeonApiProtocolHTTPURLResponse { +final class PigeonApiHTTPURLResponse: PigeonApiProtocolHTTPURLResponse { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateHTTPURLResponse ///An implementation of [URLResponse] used to access callback methods @@ -1611,27 +1750,36 @@ final class PigeonApiHTTPURLResponse: PigeonApiProtocolHTTPURLResponse { return pigeonRegistrar.apiDelegate.pigeonApiURLResponse(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateHTTPURLResponse) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateHTTPURLResponse + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } ///Creates a Dart instance of HTTPURLResponse and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: HTTPURLResponse, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: HTTPURLResponse, 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) { + } 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) + } 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) + 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))) @@ -1655,7 +1803,7 @@ open class PigeonApiDelegateURLResponse { protocol PigeonApiProtocolURLResponse { } -final class PigeonApiURLResponse: PigeonApiProtocolURLResponse { +final class PigeonApiURLResponse: PigeonApiProtocolURLResponse { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateURLResponse ///An implementation of [NSObject] used to access callback methods @@ -1663,26 +1811,33 @@ final class PigeonApiURLResponse: PigeonApiProtocolURLResponse { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateURLResponse) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateURLResponse + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } ///Creates a Dart instance of URLResponse and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: URLResponse, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: URLResponse, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeonInstance as AnyObject) + } 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) + 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))) @@ -1703,20 +1858,25 @@ final class PigeonApiURLResponse: PigeonApiProtocolURLResponse { protocol PigeonApiDelegateWKUserScript { /// Creates a user script object that contains the specified source code and /// attributes. - func pigeonDefaultConstructor(pigeonApi: PigeonApiWKUserScript, source: String, injectionTime: UserScriptInjectionTime, isForMainFrameOnly: Bool) throws -> WKUserScript + func pigeonDefaultConstructor( + pigeonApi: PigeonApiWKUserScript, source: String, injectionTime: UserScriptInjectionTime, + isForMainFrameOnly: Bool + ) throws -> WKUserScript /// The script’s source code. func source(pigeonApi: PigeonApiWKUserScript, pigeonInstance: WKUserScript) throws -> String /// The time at which to inject the script into the webpage. - func injectionTime(pigeonApi: PigeonApiWKUserScript, pigeonInstance: WKUserScript) throws -> UserScriptInjectionTime + func injectionTime(pigeonApi: PigeonApiWKUserScript, pigeonInstance: WKUserScript) throws + -> UserScriptInjectionTime /// A Boolean value that indicates whether to inject the script into the main /// frame or all frames. - func isForMainFrameOnly(pigeonApi: PigeonApiWKUserScript, pigeonInstance: WKUserScript) throws -> Bool + func isForMainFrameOnly(pigeonApi: PigeonApiWKUserScript, pigeonInstance: WKUserScript) throws + -> Bool } protocol PigeonApiProtocolWKUserScript { } -final class PigeonApiWKUserScript: PigeonApiProtocolWKUserScript { +final class PigeonApiWKUserScript: PigeonApiProtocolWKUserScript { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKUserScript ///An implementation of [NSObject] used to access callback methods @@ -1724,17 +1884,24 @@ final class PigeonApiWKUserScript: PigeonApiProtocolWKUserScript { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKUserScript) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKUserScript + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKUserScript?) { + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKUserScript? + ) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserScript.pigeon_defaultConstructor", binaryMessenger: binaryMessenger, codec: codec) + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserScript.pigeon_defaultConstructor", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { pigeonDefaultConstructorChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1744,8 +1911,10 @@ final class PigeonApiWKUserScript: PigeonApiProtocolWKUserScript { let isForMainFrameOnlyArg = args[3] as! Bool do { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( -try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api, source: sourceArg, injectionTime: injectionTimeArg, isForMainFrameOnly: isForMainFrameOnlyArg), -withIdentifier: pigeonIdentifierArg) + try api.pigeonDelegate.pigeonDefaultConstructor( + pigeonApi: api, source: sourceArg, injectionTime: injectionTimeArg, + isForMainFrameOnly: isForMainFrameOnlyArg), + withIdentifier: pigeonIdentifierArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -1757,25 +1926,34 @@ withIdentifier: pigeonIdentifierArg) } ///Creates a Dart instance of WKUserScript and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: WKUserScript, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: WKUserScript, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeonInstance as AnyObject) + } 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 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 + 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 @@ -1794,19 +1972,22 @@ withIdentifier: pigeonIdentifierArg) } protocol PigeonApiDelegateWKNavigationAction { /// The URL request object associated with the navigation action. - func request(pigeonApi: PigeonApiWKNavigationAction, pigeonInstance: WKNavigationAction) throws -> URLRequestWrapper + func request(pigeonApi: PigeonApiWKNavigationAction, pigeonInstance: WKNavigationAction) throws + -> URLRequestWrapper /// The frame in which to display the new content. /// /// If the target of the navigation is a new window, this property is nil. - func targetFrame(pigeonApi: PigeonApiWKNavigationAction, pigeonInstance: WKNavigationAction) throws -> WKFrameInfo? + func targetFrame(pigeonApi: PigeonApiWKNavigationAction, pigeonInstance: WKNavigationAction) + throws -> WKFrameInfo? /// The type of action that triggered the navigation. - func navigationType(pigeonApi: PigeonApiWKNavigationAction, pigeonInstance: WKNavigationAction) throws -> NavigationType + func navigationType(pigeonApi: PigeonApiWKNavigationAction, pigeonInstance: WKNavigationAction) + throws -> NavigationType } protocol PigeonApiProtocolWKNavigationAction { } -final class PigeonApiWKNavigationAction: PigeonApiProtocolWKNavigationAction { +final class PigeonApiWKNavigationAction: PigeonApiProtocolWKNavigationAction { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKNavigationAction ///An implementation of [NSObject] used to access callback methods @@ -1814,30 +1995,42 @@ final class PigeonApiWKNavigationAction: PigeonApiProtocolWKNavigationAction { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKNavigationAction) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateWKNavigationAction + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } ///Creates a Dart instance of WKNavigationAction and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: WKNavigationAction, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: WKNavigationAction, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeonInstance as AnyObject) + } 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 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 + 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 @@ -1856,16 +2049,19 @@ final class PigeonApiWKNavigationAction: PigeonApiProtocolWKNavigationAction { } protocol PigeonApiDelegateWKNavigationResponse { /// The frame’s response. - func response(pigeonApi: PigeonApiWKNavigationResponse, pigeonInstance: WKNavigationResponse) throws -> URLResponse + func response(pigeonApi: PigeonApiWKNavigationResponse, pigeonInstance: WKNavigationResponse) + throws -> URLResponse /// A Boolean value that indicates whether the response targets the web view’s /// main frame. - func isForMainFrame(pigeonApi: PigeonApiWKNavigationResponse, pigeonInstance: WKNavigationResponse) throws -> Bool + func isForMainFrame( + pigeonApi: PigeonApiWKNavigationResponse, pigeonInstance: WKNavigationResponse + ) throws -> Bool } protocol PigeonApiProtocolWKNavigationResponse { } -final class PigeonApiWKNavigationResponse: PigeonApiProtocolWKNavigationResponse { +final class PigeonApiWKNavigationResponse: PigeonApiProtocolWKNavigationResponse { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKNavigationResponse ///An implementation of [NSObject] used to access callback methods @@ -1873,29 +2069,40 @@ final class PigeonApiWKNavigationResponse: PigeonApiProtocolWKNavigationResponse return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKNavigationResponse) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateWKNavigationResponse + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } ///Creates a Dart instance of WKNavigationResponse and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: WKNavigationResponse, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: WKNavigationResponse, 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) { + } 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) + } 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 + 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 @@ -1917,13 +2124,14 @@ protocol PigeonApiDelegateWKFrameInfo { /// or a subframe. func isMainFrame(pigeonApi: PigeonApiWKFrameInfo, pigeonInstance: WKFrameInfo) throws -> Bool /// The frame’s current request. - func request(pigeonApi: PigeonApiWKFrameInfo, pigeonInstance: WKFrameInfo) throws -> URLRequestWrapper? + func request(pigeonApi: PigeonApiWKFrameInfo, pigeonInstance: WKFrameInfo) throws + -> URLRequestWrapper? } protocol PigeonApiProtocolWKFrameInfo { } -final class PigeonApiWKFrameInfo: PigeonApiProtocolWKFrameInfo { +final class PigeonApiWKFrameInfo: PigeonApiProtocolWKFrameInfo { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKFrameInfo ///An implementation of [NSObject] used to access callback methods @@ -1931,28 +2139,36 @@ final class PigeonApiWKFrameInfo: PigeonApiProtocolWKFrameInfo { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKFrameInfo) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKFrameInfo + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } ///Creates a Dart instance of WKFrameInfo and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: WKFrameInfo, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: WKFrameInfo, 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) { + } 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) + } 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) + 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))) @@ -1982,7 +2198,7 @@ protocol PigeonApiDelegateNSError { protocol PigeonApiProtocolNSError { } -final class PigeonApiNSError: PigeonApiProtocolNSError { +final class PigeonApiNSError: PigeonApiProtocolNSError { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateNSError ///An implementation of [NSObject] used to access callback methods @@ -1995,25 +2211,32 @@ final class PigeonApiNSError: PigeonApiProtocolNSError { self.pigeonDelegate = delegate } ///Creates a Dart instance of NSError and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: NSError, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: NSError, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeonInstance as AnyObject) + } 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 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 + 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 @@ -2040,7 +2263,7 @@ protocol PigeonApiDelegateWKScriptMessage { protocol PigeonApiProtocolWKScriptMessage { } -final class PigeonApiWKScriptMessage: PigeonApiProtocolWKScriptMessage { +final class PigeonApiWKScriptMessage: PigeonApiProtocolWKScriptMessage { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKScriptMessage ///An implementation of [NSObject] used to access callback methods @@ -2048,28 +2271,36 @@ final class PigeonApiWKScriptMessage: PigeonApiProtocolWKScriptMessage { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKScriptMessage) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateWKScriptMessage + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } ///Creates a Dart instance of WKScriptMessage and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: WKScriptMessage, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: WKScriptMessage, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeonInstance as AnyObject) + } 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) + 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))) @@ -2093,13 +2324,14 @@ protocol PigeonApiDelegateWKSecurityOrigin { /// The security origin's port. func port(pigeonApi: PigeonApiWKSecurityOrigin, pigeonInstance: WKSecurityOrigin) throws -> Int64 /// The security origin's protocol. - func securityProtocol(pigeonApi: PigeonApiWKSecurityOrigin, pigeonInstance: WKSecurityOrigin) throws -> String + func securityProtocol(pigeonApi: PigeonApiWKSecurityOrigin, pigeonInstance: WKSecurityOrigin) + throws -> String } protocol PigeonApiProtocolWKSecurityOrigin { } -final class PigeonApiWKSecurityOrigin: PigeonApiProtocolWKSecurityOrigin { +final class PigeonApiWKSecurityOrigin: PigeonApiProtocolWKSecurityOrigin { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKSecurityOrigin ///An implementation of [NSObject] used to access callback methods @@ -2107,30 +2339,40 @@ final class PigeonApiWKSecurityOrigin: PigeonApiProtocolWKSecurityOrigin { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKSecurityOrigin) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateWKSecurityOrigin + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } ///Creates a Dart instance of WKSecurityOrigin and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: WKSecurityOrigin, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: WKSecurityOrigin, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeonInstance as AnyObject) + } 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 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 + 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 @@ -2148,15 +2390,18 @@ final class PigeonApiWKSecurityOrigin: PigeonApiProtocolWKSecurityOrigin { } } protocol PigeonApiDelegateHTTPCookie { - func pigeonDefaultConstructor(pigeonApi: PigeonApiHTTPCookie, properties: [HttpCookiePropertyKey: Any]) throws -> HTTPCookie + func pigeonDefaultConstructor( + pigeonApi: PigeonApiHTTPCookie, properties: [HttpCookiePropertyKey: Any] + ) throws -> HTTPCookie /// The cookie’s properties. - func getProperties(pigeonApi: PigeonApiHTTPCookie, pigeonInstance: HTTPCookie) throws -> [HttpCookiePropertyKey: Any]? + func getProperties(pigeonApi: PigeonApiHTTPCookie, pigeonInstance: HTTPCookie) throws + -> [HttpCookiePropertyKey: Any]? } protocol PigeonApiProtocolHTTPCookie { } -final class PigeonApiHTTPCookie: PigeonApiProtocolHTTPCookie { +final class PigeonApiHTTPCookie: PigeonApiProtocolHTTPCookie { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateHTTPCookie ///An implementation of [NSObject] used to access callback methods @@ -2164,17 +2409,23 @@ final class PigeonApiHTTPCookie: PigeonApiProtocolHTTPCookie { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateHTTPCookie) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateHTTPCookie) + { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiHTTPCookie?) { + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiHTTPCookie? + ) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.HTTPCookie.pigeon_defaultConstructor", binaryMessenger: binaryMessenger, codec: codec) + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.HTTPCookie.pigeon_defaultConstructor", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { pigeonDefaultConstructorChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2182,8 +2433,9 @@ final class PigeonApiHTTPCookie: PigeonApiProtocolHTTPCookie { let propertiesArg = args[1] as? [HttpCookiePropertyKey: Any] do { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( -try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api, properties: propertiesArg!), -withIdentifier: pigeonIdentifierArg) + try api.pigeonDelegate.pigeonDefaultConstructor( + pigeonApi: api, properties: propertiesArg!), + withIdentifier: pigeonIdentifierArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -2192,13 +2444,16 @@ withIdentifier: pigeonIdentifierArg) } else { pigeonDefaultConstructorChannel.setMessageHandler(nil) } - let getPropertiesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.HTTPCookie.getProperties", binaryMessenger: binaryMessenger, codec: codec) + let getPropertiesChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.HTTPCookie.getProperties", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { getPropertiesChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! HTTPCookie do { - let result = try api.pigeonDelegate.getProperties(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + let result = try api.pigeonDelegate.getProperties( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -2210,21 +2465,26 @@ withIdentifier: pigeonIdentifierArg) } ///Creates a Dart instance of HTTPCookie and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: HTTPCookie, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: HTTPCookie, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeonInstance as AnyObject) + } 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) + 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))) @@ -2243,31 +2503,51 @@ withIdentifier: pigeonIdentifierArg) } } protocol PigeonApiDelegateAuthenticationChallengeResponse { - func pigeonDefaultConstructor(pigeonApi: PigeonApiAuthenticationChallengeResponse, disposition: UrlSessionAuthChallengeDisposition, credential: URLCredential?) throws -> AuthenticationChallengeResponse + func pigeonDefaultConstructor( + pigeonApi: PigeonApiAuthenticationChallengeResponse, + disposition: UrlSessionAuthChallengeDisposition, credential: URLCredential? + ) throws -> AuthenticationChallengeResponse /// The option to use to handle the challenge. - func disposition(pigeonApi: PigeonApiAuthenticationChallengeResponse, pigeonInstance: AuthenticationChallengeResponse) throws -> UrlSessionAuthChallengeDisposition + func disposition( + pigeonApi: PigeonApiAuthenticationChallengeResponse, + pigeonInstance: AuthenticationChallengeResponse + ) throws -> UrlSessionAuthChallengeDisposition /// The credential to use for authentication when the disposition parameter /// contains the value URLSession.AuthChallengeDisposition.useCredential. - func credential(pigeonApi: PigeonApiAuthenticationChallengeResponse, pigeonInstance: AuthenticationChallengeResponse) throws -> URLCredential? + func credential( + pigeonApi: PigeonApiAuthenticationChallengeResponse, + pigeonInstance: AuthenticationChallengeResponse + ) throws -> URLCredential? } protocol PigeonApiProtocolAuthenticationChallengeResponse { } -final class PigeonApiAuthenticationChallengeResponse: PigeonApiProtocolAuthenticationChallengeResponse { +final class PigeonApiAuthenticationChallengeResponse: + PigeonApiProtocolAuthenticationChallengeResponse +{ unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateAuthenticationChallengeResponse - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateAuthenticationChallengeResponse) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateAuthenticationChallengeResponse + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiAuthenticationChallengeResponse?) { + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiAuthenticationChallengeResponse? + ) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.AuthenticationChallengeResponse.pigeon_defaultConstructor", binaryMessenger: binaryMessenger, codec: codec) + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.AuthenticationChallengeResponse.pigeon_defaultConstructor", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { pigeonDefaultConstructorChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2276,8 +2556,9 @@ final class PigeonApiAuthenticationChallengeResponse: PigeonApiProtocolAuthentic let credentialArg: URLCredential? = nilOrValue(args[2]) do { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( -try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api, disposition: dispositionArg, credential: credentialArg), -withIdentifier: pigeonIdentifierArg) + try api.pigeonDelegate.pigeonDefaultConstructor( + pigeonApi: api, disposition: dispositionArg, credential: credentialArg), + withIdentifier: pigeonIdentifierArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -2289,24 +2570,33 @@ withIdentifier: pigeonIdentifierArg) } ///Creates a Dart instance of AuthenticationChallengeResponse and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: AuthenticationChallengeResponse, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: AuthenticationChallengeResponse, + 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) { + } 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) + } 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 + 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 @@ -2327,15 +2617,19 @@ protocol PigeonApiDelegateWKWebsiteDataStore { /// The default data store, which stores data persistently to disk. func defaultDataStore(pigeonApi: PigeonApiWKWebsiteDataStore) throws -> WKWebsiteDataStore /// The object that manages the HTTP cookies for your website. - func httpCookieStore(pigeonApi: PigeonApiWKWebsiteDataStore, pigeonInstance: WKWebsiteDataStore) throws -> WKHTTPCookieStore + func httpCookieStore(pigeonApi: PigeonApiWKWebsiteDataStore, pigeonInstance: WKWebsiteDataStore) + throws -> WKHTTPCookieStore /// Removes the specified types of website data from one or more data records. - func removeDataOfTypes(pigeonApi: PigeonApiWKWebsiteDataStore, pigeonInstance: WKWebsiteDataStore, dataTypes: [WebsiteDataType], modificationTimeInSecondsSinceEpoch: Double, completion: @escaping (Result) -> Void) + func removeDataOfTypes( + pigeonApi: PigeonApiWKWebsiteDataStore, pigeonInstance: WKWebsiteDataStore, + dataTypes: [WebsiteDataType], modificationTimeInSecondsSinceEpoch: Double, + completion: @escaping (Result) -> Void) } protocol PigeonApiProtocolWKWebsiteDataStore { } -final class PigeonApiWKWebsiteDataStore: PigeonApiProtocolWKWebsiteDataStore { +final class PigeonApiWKWebsiteDataStore: PigeonApiProtocolWKWebsiteDataStore { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKWebsiteDataStore ///An implementation of [NSObject] used to access callback methods @@ -2343,23 +2637,33 @@ final class PigeonApiWKWebsiteDataStore: PigeonApiProtocolWKWebsiteDataStore { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKWebsiteDataStore) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateWKWebsiteDataStore + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKWebsiteDataStore?) { + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKWebsiteDataStore? + ) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let defaultDataStoreChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStore.defaultDataStore", binaryMessenger: binaryMessenger, codec: codec) + let defaultDataStoreChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStore.defaultDataStore", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { defaultDataStoreChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonIdentifierArg = args[0] as! Int64 do { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance(try api.pigeonDelegate.defaultDataStore(pigeonApi: api), withIdentifier: pigeonIdentifierArg) + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + try api.pigeonDelegate.defaultDataStore(pigeonApi: api), + withIdentifier: pigeonIdentifierArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -2368,14 +2672,19 @@ final class PigeonApiWKWebsiteDataStore: PigeonApiProtocolWKWebsiteDataStore { } else { defaultDataStoreChannel.setMessageHandler(nil) } - let httpCookieStoreChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStore.httpCookieStore", binaryMessenger: binaryMessenger, codec: codec) + let httpCookieStoreChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStore.httpCookieStore", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { httpCookieStoreChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKWebsiteDataStore let pigeonIdentifierArg = args[1] as! Int64 do { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance(try api.pigeonDelegate.httpCookieStore(pigeonApi: api, pigeonInstance: pigeonInstanceArg), withIdentifier: pigeonIdentifierArg) + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + try api.pigeonDelegate.httpCookieStore( + pigeonApi: api, pigeonInstance: pigeonInstanceArg), + withIdentifier: pigeonIdentifierArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -2384,14 +2693,19 @@ final class PigeonApiWKWebsiteDataStore: PigeonApiProtocolWKWebsiteDataStore { } else { httpCookieStoreChannel.setMessageHandler(nil) } - let removeDataOfTypesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStore.removeDataOfTypes", binaryMessenger: binaryMessenger, codec: codec) + let removeDataOfTypesChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStore.removeDataOfTypes", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { removeDataOfTypesChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKWebsiteDataStore let dataTypesArg = args[1] as! [WebsiteDataType] let modificationTimeInSecondsSinceEpochArg = args[2] as! Double - api.pigeonDelegate.removeDataOfTypes(pigeonApi: api, pigeonInstance: pigeonInstanceArg, dataTypes: dataTypesArg, modificationTimeInSecondsSinceEpoch: modificationTimeInSecondsSinceEpochArg) { result in + api.pigeonDelegate.removeDataOfTypes( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, dataTypes: dataTypesArg, + modificationTimeInSecondsSinceEpoch: modificationTimeInSecondsSinceEpochArg + ) { result in switch result { case .success(let res): reply(wrapResult(res)) @@ -2406,21 +2720,26 @@ final class PigeonApiWKWebsiteDataStore: PigeonApiProtocolWKWebsiteDataStore { } ///Creates a Dart instance of WKWebsiteDataStore and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: WKWebsiteDataStore, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: WKWebsiteDataStore, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeonInstance as AnyObject) + } 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) + 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))) @@ -2440,19 +2759,20 @@ final class PigeonApiWKWebsiteDataStore: PigeonApiProtocolWKWebsiteDataStore { } protocol PigeonApiDelegateUIView { #if !os(macOS) - /// The view’s background color. - func setBackgroundColor(pigeonApi: PigeonApiUIView, pigeonInstance: UIView, value: Int64?) throws + /// The view’s background color. + func setBackgroundColor(pigeonApi: PigeonApiUIView, pigeonInstance: UIView, value: Int64?) + throws #endif #if !os(macOS) - /// A Boolean value that determines whether the view is opaque. - func setOpaque(pigeonApi: PigeonApiUIView, pigeonInstance: UIView, opaque: Bool) throws + /// A Boolean value that determines whether the view is opaque. + func setOpaque(pigeonApi: PigeonApiUIView, pigeonInstance: UIView, opaque: Bool) throws #endif } protocol PigeonApiProtocolUIView { } -final class PigeonApiUIView: PigeonApiProtocolUIView { +final class PigeonApiUIView: PigeonApiProtocolUIView { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateUIView ///An implementation of [NSObject] used to access callback methods @@ -2468,152 +2788,176 @@ final class PigeonApiUIView: PigeonApiProtocolUIView { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() #if !os(macOS) - let setBackgroundColorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIView.setBackgroundColor", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setBackgroundColorChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! UIView - let valueArg: Int64? = nilOrValue(args[1]) - do { - try api.pigeonDelegate.setBackgroundColor(pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let setBackgroundColorChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIView.setBackgroundColor", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setBackgroundColorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIView + let valueArg: Int64? = nilOrValue(args[1]) + do { + try api.pigeonDelegate.setBackgroundColor( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + setBackgroundColorChannel.setMessageHandler(nil) } - } else { - setBackgroundColorChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let setOpaqueChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIView.setOpaque", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setOpaqueChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! UIView - let opaqueArg = args[1] as! Bool - do { - try api.pigeonDelegate.setOpaque(pigeonApi: api, pigeonInstance: pigeonInstanceArg, opaque: opaqueArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let setOpaqueChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIView.setOpaque", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setOpaqueChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIView + let opaqueArg = args[1] as! Bool + do { + try api.pigeonDelegate.setOpaque( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, opaque: opaqueArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + setOpaqueChannel.setMessageHandler(nil) } - } else { - setOpaqueChannel.setMessageHandler(nil) - } #endif } #if !os(macOS) - ///Creates a Dart instance of UIView and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: UIView, 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.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(())) + ///Creates a Dart instance of UIView and attaches it to [pigeonInstance]. + func pigeonNewInstance( + pigeonInstance: UIView, 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.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(())) + } } } } - } #endif } protocol PigeonApiDelegateUIScrollView { #if !os(macOS) - /// The point at which the origin of the content view is offset from the - /// origin of the scroll view. - func getContentOffset(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView) throws -> [Double] + /// The point at which the origin of the content view is offset from the + /// origin of the scroll view. + func getContentOffset(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView) throws + -> [Double] #endif #if !os(macOS) - /// Move the scrolled position of your view. - /// - /// Convenience method to synchronize change to the x and y scroll position. - func scrollBy(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, x: Double, y: Double) throws + /// Move the scrolled position of your view. + /// + /// Convenience method to synchronize change to the x and y scroll position. + func scrollBy( + pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, x: Double, y: Double) throws #endif #if !os(macOS) - /// The point at which the origin of the content view is offset from the - /// origin of the scroll view. - func setContentOffset(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, x: Double, y: Double) throws + /// The point at which the origin of the content view is offset from the + /// origin of the scroll view. + func setContentOffset( + pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, x: Double, y: Double) throws #endif #if !os(macOS) - /// The delegate of the scroll view. - func setDelegate(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, delegate: UIScrollViewDelegate?) throws + /// The delegate of the scroll view. + func setDelegate( + pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, + delegate: UIScrollViewDelegate?) throws #endif #if !os(macOS) - /// Whether the scroll view bounces past the edge of content and back again. - func setBounces(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws + /// Whether the scroll view bounces past the edge of content and back again. + func setBounces(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) + throws #endif #if !os(macOS) - /// Whether the scroll view bounces when it reaches the ends of its horizontal - /// axis. - func setBouncesHorizontally(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws + /// Whether the scroll view bounces when it reaches the ends of its horizontal + /// axis. + func setBouncesHorizontally( + pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws #endif #if !os(macOS) - /// Whether the scroll view bounces when it reaches the ends of its vertical - /// axis. - func setBouncesVertically(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws + /// Whether the scroll view bounces when it reaches the ends of its vertical + /// axis. + func setBouncesVertically( + pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws #endif #if !os(macOS) - /// Whether bouncing always occurs when vertical scrolling reaches the end of - /// the content. - /// - /// If the value of this property is true and `bouncesVertically` is true, the - /// scroll view allows vertical dragging even if the content is smaller than - /// the bounds of the scroll view. - func setAlwaysBounceVertical(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws + /// Whether bouncing always occurs when vertical scrolling reaches the end of + /// the content. + /// + /// If the value of this property is true and `bouncesVertically` is true, the + /// scroll view allows vertical dragging even if the content is smaller than + /// the bounds of the scroll view. + func setAlwaysBounceVertical( + pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws #endif #if !os(macOS) - /// Whether bouncing always occurs when horizontal scrolling reaches the end - /// of the content view. - /// - /// If the value of this property is true and `bouncesHorizontally` is true, - /// the scroll view allows horizontal dragging even if the content is smaller - /// than the bounds of the scroll view. - func setAlwaysBounceHorizontal(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws + /// Whether bouncing always occurs when horizontal scrolling reaches the end + /// of the content view. + /// + /// If the value of this property is true and `bouncesHorizontally` is true, + /// the scroll view allows horizontal dragging even if the content is smaller + /// than the bounds of the scroll view. + func setAlwaysBounceHorizontal( + pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws #endif #if !os(macOS) - /// Whether the vertical scroll indicator is visible. - /// - /// The default value is true. - func setShowsVerticalScrollIndicator(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws + /// Whether the vertical scroll indicator is visible. + /// + /// The default value is true. + func setShowsVerticalScrollIndicator( + pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws #endif #if !os(macOS) - /// Whether the horizontal scroll indicator is visible. - /// - /// The default value is true. - func setShowsHorizontalScrollIndicator(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws + /// Whether the horizontal scroll indicator is visible. + /// + /// The default value is true. + func setShowsHorizontalScrollIndicator( + pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws #endif } protocol PigeonApiProtocolUIScrollView { } -final class PigeonApiUIScrollView: PigeonApiProtocolUIScrollView { +final class PigeonApiUIScrollView: PigeonApiProtocolUIScrollView { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateUIScrollView ///An implementation of [UIView] used to access callback methods @@ -2621,287 +2965,353 @@ final class PigeonApiUIScrollView: PigeonApiProtocolUIScrollView { return pigeonRegistrar.apiDelegate.pigeonApiUIView(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateUIScrollView) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateUIScrollView + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiUIScrollView?) { + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiUIScrollView? + ) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() #if !os(macOS) - let getContentOffsetChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.getContentOffset", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - getContentOffsetChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! UIScrollView - do { - let result = try api.pigeonDelegate.getContentOffset(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) + let getContentOffsetChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.getContentOffset", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getContentOffsetChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + do { + let result = try api.pigeonDelegate.getContentOffset( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } } + } else { + getContentOffsetChannel.setMessageHandler(nil) } - } else { - getContentOffsetChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let scrollByChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.scrollBy", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - scrollByChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! UIScrollView - let xArg = args[1] as! Double - let yArg = args[2] as! Double - do { - try api.pigeonDelegate.scrollBy(pigeonApi: api, pigeonInstance: pigeonInstanceArg, x: xArg, y: yArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let scrollByChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.scrollBy", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + scrollByChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + let xArg = args[1] as! Double + let yArg = args[2] as! Double + do { + try api.pigeonDelegate.scrollBy( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, x: xArg, y: yArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + scrollByChannel.setMessageHandler(nil) } - } else { - scrollByChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let setContentOffsetChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setContentOffset", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setContentOffsetChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! UIScrollView - let xArg = args[1] as! Double - let yArg = args[2] as! Double - do { - try api.pigeonDelegate.setContentOffset(pigeonApi: api, pigeonInstance: pigeonInstanceArg, x: xArg, y: yArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let setContentOffsetChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setContentOffset", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setContentOffsetChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + let xArg = args[1] as! Double + let yArg = args[2] as! Double + do { + try api.pigeonDelegate.setContentOffset( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, x: xArg, y: yArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + setContentOffsetChannel.setMessageHandler(nil) } - } else { - setContentOffsetChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let setDelegateChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setDelegate", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setDelegateChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! UIScrollView - let delegateArg: UIScrollViewDelegate? = nilOrValue(args[1]) - do { - try api.pigeonDelegate.setDelegate(pigeonApi: api, pigeonInstance: pigeonInstanceArg, delegate: delegateArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let setDelegateChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setDelegate", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setDelegateChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + let delegateArg: UIScrollViewDelegate? = nilOrValue(args[1]) + do { + try api.pigeonDelegate.setDelegate( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, delegate: delegateArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + setDelegateChannel.setMessageHandler(nil) } - } else { - setDelegateChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let setBouncesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setBounces", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setBouncesChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! UIScrollView - let valueArg = args[1] as! Bool - do { - try api.pigeonDelegate.setBounces(pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let setBouncesChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setBounces", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setBouncesChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + let valueArg = args[1] as! Bool + do { + try api.pigeonDelegate.setBounces( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + setBouncesChannel.setMessageHandler(nil) } - } else { - setBouncesChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let setBouncesHorizontallyChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setBouncesHorizontally", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setBouncesHorizontallyChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! UIScrollView - let valueArg = args[1] as! Bool - do { - try api.pigeonDelegate.setBouncesHorizontally(pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let setBouncesHorizontallyChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setBouncesHorizontally", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setBouncesHorizontallyChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + let valueArg = args[1] as! Bool + do { + try api.pigeonDelegate.setBouncesHorizontally( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + setBouncesHorizontallyChannel.setMessageHandler(nil) } - } else { - setBouncesHorizontallyChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let setBouncesVerticallyChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setBouncesVertically", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setBouncesVerticallyChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! UIScrollView - let valueArg = args[1] as! Bool - do { - try api.pigeonDelegate.setBouncesVertically(pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let setBouncesVerticallyChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setBouncesVertically", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setBouncesVerticallyChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + let valueArg = args[1] as! Bool + do { + try api.pigeonDelegate.setBouncesVertically( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + setBouncesVerticallyChannel.setMessageHandler(nil) } - } else { - setBouncesVerticallyChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let setAlwaysBounceVerticalChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setAlwaysBounceVertical", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setAlwaysBounceVerticalChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! UIScrollView - let valueArg = args[1] as! Bool - do { - try api.pigeonDelegate.setAlwaysBounceVertical(pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let setAlwaysBounceVerticalChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setAlwaysBounceVertical", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setAlwaysBounceVerticalChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + let valueArg = args[1] as! Bool + do { + try api.pigeonDelegate.setAlwaysBounceVertical( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + setAlwaysBounceVerticalChannel.setMessageHandler(nil) } - } else { - setAlwaysBounceVerticalChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let setAlwaysBounceHorizontalChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setAlwaysBounceHorizontal", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setAlwaysBounceHorizontalChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! UIScrollView - let valueArg = args[1] as! Bool - do { - try api.pigeonDelegate.setAlwaysBounceHorizontal(pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let setAlwaysBounceHorizontalChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setAlwaysBounceHorizontal", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setAlwaysBounceHorizontalChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + let valueArg = args[1] as! Bool + do { + try api.pigeonDelegate.setAlwaysBounceHorizontal( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + setAlwaysBounceHorizontalChannel.setMessageHandler(nil) } - } else { - setAlwaysBounceHorizontalChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let setShowsVerticalScrollIndicatorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setShowsVerticalScrollIndicator", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setShowsVerticalScrollIndicatorChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! UIScrollView - let valueArg = args[1] as! Bool - do { - try api.pigeonDelegate.setShowsVerticalScrollIndicator(pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let setShowsVerticalScrollIndicatorChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setShowsVerticalScrollIndicator", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setShowsVerticalScrollIndicatorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + let valueArg = args[1] as! Bool + do { + try api.pigeonDelegate.setShowsVerticalScrollIndicator( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + setShowsVerticalScrollIndicatorChannel.setMessageHandler(nil) } - } else { - setShowsVerticalScrollIndicatorChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let setShowsHorizontalScrollIndicatorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setShowsHorizontalScrollIndicator", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setShowsHorizontalScrollIndicatorChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! UIScrollView - let valueArg = args[1] as! Bool - do { - try api.pigeonDelegate.setShowsHorizontalScrollIndicator(pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let setShowsHorizontalScrollIndicatorChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setShowsHorizontalScrollIndicator", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setShowsHorizontalScrollIndicatorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + let valueArg = args[1] as! Bool + do { + try api.pigeonDelegate.setShowsHorizontalScrollIndicator( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + setShowsHorizontalScrollIndicatorChannel.setMessageHandler(nil) } - } else { - setShowsHorizontalScrollIndicatorChannel.setMessageHandler(nil) - } #endif } #if !os(macOS) - ///Creates a Dart instance of UIScrollView and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: UIScrollView, 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.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(())) + ///Creates a Dart instance of UIScrollView and attaches it to [pigeonInstance]. + func pigeonNewInstance( + pigeonInstance: UIScrollView, 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.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(())) + } } } } - } #endif } protocol PigeonApiDelegateWKWebViewConfiguration { - func pigeonDefaultConstructor(pigeonApi: PigeonApiWKWebViewConfiguration) throws -> WKWebViewConfiguration + func pigeonDefaultConstructor(pigeonApi: PigeonApiWKWebViewConfiguration) throws + -> WKWebViewConfiguration /// The object that coordinates interactions between your app’s native code /// and the webpage’s scripts and other content. - func setUserContentController(pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, controller: WKUserContentController) throws + func setUserContentController( + pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, + controller: WKUserContentController) throws /// The object that coordinates interactions between your app’s native code /// and the webpage’s scripts and other content. - func getUserContentController(pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration) throws -> WKUserContentController + func getUserContentController( + pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration + ) throws -> WKUserContentController /// The object you use to get and set the site’s cookies and to track the /// cached data objects. - func setWebsiteDataStore(pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, dataStore: WKWebsiteDataStore) throws + func setWebsiteDataStore( + pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, + dataStore: WKWebsiteDataStore) throws /// The object you use to get and set the site’s cookies and to track the /// cached data objects. - func getWebsiteDataStore(pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration) throws -> WKWebsiteDataStore + func getWebsiteDataStore( + pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration + ) throws -> WKWebsiteDataStore /// The object that manages the preference-related settings for the web view. - func setPreferences(pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, preferences: WKPreferences) throws + func setPreferences( + pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, + preferences: WKPreferences) throws /// The object that manages the preference-related settings for the web view. - func getPreferences(pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration) throws -> WKPreferences + func getPreferences( + pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration + ) throws -> WKPreferences /// A Boolean value that indicates whether HTML5 videos play inline or use the /// native full-screen controller. - func setAllowsInlineMediaPlayback(pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, allow: Bool) throws + func setAllowsInlineMediaPlayback( + pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, allow: Bool) + throws /// A Boolean value that indicates whether the web view limits navigation to /// pages within the app’s domain. - func setLimitsNavigationsToAppBoundDomains(pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, limit: Bool) throws + func setLimitsNavigationsToAppBoundDomains( + pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, limit: Bool) + throws /// The media types that require a user gesture to begin playing. - func setMediaTypesRequiringUserActionForPlayback(pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, type: AudiovisualMediaType) throws + 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 + func getDefaultWebpagePreferences( + pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration + ) throws -> WKWebpagePreferences } protocol PigeonApiProtocolWKWebViewConfiguration { } -final class PigeonApiWKWebViewConfiguration: PigeonApiProtocolWKWebViewConfiguration { +final class PigeonApiWKWebViewConfiguration: PigeonApiProtocolWKWebViewConfiguration { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKWebViewConfiguration ///An implementation of [NSObject] used to access callback methods @@ -2909,25 +3319,34 @@ final class PigeonApiWKWebViewConfiguration: PigeonApiProtocolWKWebViewConfigura return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKWebViewConfiguration) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateWKWebViewConfiguration + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKWebViewConfiguration?) { + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKWebViewConfiguration? + ) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.pigeon_defaultConstructor", binaryMessenger: binaryMessenger, codec: codec) + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.pigeon_defaultConstructor", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { pigeonDefaultConstructorChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonIdentifierArg = args[0] as! Int64 do { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( -try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), -withIdentifier: pigeonIdentifierArg) + try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), + withIdentifier: pigeonIdentifierArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -2936,14 +3355,18 @@ withIdentifier: pigeonIdentifierArg) } else { pigeonDefaultConstructorChannel.setMessageHandler(nil) } - let setUserContentControllerChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setUserContentController", binaryMessenger: binaryMessenger, codec: codec) + let setUserContentControllerChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setUserContentController", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { setUserContentControllerChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKWebViewConfiguration let controllerArg = args[1] as! WKUserContentController do { - try api.pigeonDelegate.setUserContentController(pigeonApi: api, pigeonInstance: pigeonInstanceArg, controller: controllerArg) + try api.pigeonDelegate.setUserContentController( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, controller: controllerArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -2952,13 +3375,17 @@ withIdentifier: pigeonIdentifierArg) } else { setUserContentControllerChannel.setMessageHandler(nil) } - let getUserContentControllerChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.getUserContentController", binaryMessenger: binaryMessenger, codec: codec) + let getUserContentControllerChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.getUserContentController", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { getUserContentControllerChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKWebViewConfiguration do { - let result = try api.pigeonDelegate.getUserContentController(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + let result = try api.pigeonDelegate.getUserContentController( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -2967,14 +3394,18 @@ withIdentifier: pigeonIdentifierArg) } else { getUserContentControllerChannel.setMessageHandler(nil) } - let setWebsiteDataStoreChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setWebsiteDataStore", binaryMessenger: binaryMessenger, codec: codec) + let setWebsiteDataStoreChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setWebsiteDataStore", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { setWebsiteDataStoreChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKWebViewConfiguration let dataStoreArg = args[1] as! WKWebsiteDataStore do { - try api.pigeonDelegate.setWebsiteDataStore(pigeonApi: api, pigeonInstance: pigeonInstanceArg, dataStore: dataStoreArg) + try api.pigeonDelegate.setWebsiteDataStore( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, dataStore: dataStoreArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -2983,13 +3414,17 @@ withIdentifier: pigeonIdentifierArg) } else { setWebsiteDataStoreChannel.setMessageHandler(nil) } - let getWebsiteDataStoreChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.getWebsiteDataStore", binaryMessenger: binaryMessenger, codec: codec) + let getWebsiteDataStoreChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.getWebsiteDataStore", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { getWebsiteDataStoreChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKWebViewConfiguration do { - let result = try api.pigeonDelegate.getWebsiteDataStore(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + let result = try api.pigeonDelegate.getWebsiteDataStore( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -2998,14 +3433,17 @@ withIdentifier: pigeonIdentifierArg) } else { getWebsiteDataStoreChannel.setMessageHandler(nil) } - let setPreferencesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setPreferences", binaryMessenger: binaryMessenger, codec: codec) + let setPreferencesChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setPreferences", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { setPreferencesChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKWebViewConfiguration let preferencesArg = args[1] as! WKPreferences do { - try api.pigeonDelegate.setPreferences(pigeonApi: api, pigeonInstance: pigeonInstanceArg, preferences: preferencesArg) + try api.pigeonDelegate.setPreferences( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, preferences: preferencesArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3014,13 +3452,16 @@ withIdentifier: pigeonIdentifierArg) } else { setPreferencesChannel.setMessageHandler(nil) } - let getPreferencesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.getPreferences", binaryMessenger: binaryMessenger, codec: codec) + let getPreferencesChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.getPreferences", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { getPreferencesChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKWebViewConfiguration do { - let result = try api.pigeonDelegate.getPreferences(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + let result = try api.pigeonDelegate.getPreferences( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -3029,14 +3470,18 @@ withIdentifier: pigeonIdentifierArg) } else { getPreferencesChannel.setMessageHandler(nil) } - let setAllowsInlineMediaPlaybackChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setAllowsInlineMediaPlayback", binaryMessenger: binaryMessenger, codec: codec) + let setAllowsInlineMediaPlaybackChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setAllowsInlineMediaPlayback", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { setAllowsInlineMediaPlaybackChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKWebViewConfiguration let allowArg = args[1] as! Bool do { - try api.pigeonDelegate.setAllowsInlineMediaPlayback(pigeonApi: api, pigeonInstance: pigeonInstanceArg, allow: allowArg) + try api.pigeonDelegate.setAllowsInlineMediaPlayback( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, allow: allowArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3045,14 +3490,18 @@ withIdentifier: pigeonIdentifierArg) } else { setAllowsInlineMediaPlaybackChannel.setMessageHandler(nil) } - let setLimitsNavigationsToAppBoundDomainsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setLimitsNavigationsToAppBoundDomains", binaryMessenger: binaryMessenger, codec: codec) + let setLimitsNavigationsToAppBoundDomainsChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setLimitsNavigationsToAppBoundDomains", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { setLimitsNavigationsToAppBoundDomainsChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKWebViewConfiguration let limitArg = args[1] as! Bool do { - try api.pigeonDelegate.setLimitsNavigationsToAppBoundDomains(pigeonApi: api, pigeonInstance: pigeonInstanceArg, limit: limitArg) + try api.pigeonDelegate.setLimitsNavigationsToAppBoundDomains( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, limit: limitArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3061,14 +3510,18 @@ withIdentifier: pigeonIdentifierArg) } else { setLimitsNavigationsToAppBoundDomainsChannel.setMessageHandler(nil) } - let setMediaTypesRequiringUserActionForPlaybackChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setMediaTypesRequiringUserActionForPlayback", binaryMessenger: binaryMessenger, codec: codec) + let setMediaTypesRequiringUserActionForPlaybackChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setMediaTypesRequiringUserActionForPlayback", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { setMediaTypesRequiringUserActionForPlaybackChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKWebViewConfiguration let typeArg = args[1] as! AudiovisualMediaType do { - try api.pigeonDelegate.setMediaTypesRequiringUserActionForPlayback(pigeonApi: api, pigeonInstance: pigeonInstanceArg, type: typeArg) + try api.pigeonDelegate.setMediaTypesRequiringUserActionForPlayback( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, type: typeArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3078,13 +3531,17 @@ withIdentifier: pigeonIdentifierArg) 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) + 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) + let result = try api.pigeonDelegate.getDefaultWebpagePreferences( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -3093,16 +3550,21 @@ withIdentifier: pigeonIdentifierArg) } else { getDefaultWebpagePreferencesChannel.setMessageHandler(nil) } - } else { + } else { let getDefaultWebpagePreferencesChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.getDefaultWebpagePreferences", + 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 - ))) + 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) @@ -3111,21 +3573,27 @@ withIdentifier: pigeonIdentifierArg) } ///Creates a Dart instance of WKWebViewConfiguration and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: WKWebViewConfiguration, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: WKWebViewConfiguration, + 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeonInstance as AnyObject) + } 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) + 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))) @@ -3145,23 +3613,31 @@ withIdentifier: pigeonIdentifierArg) } protocol PigeonApiDelegateWKUserContentController { /// Installs a message handler that you can call from your JavaScript code. - func addScriptMessageHandler(pigeonApi: PigeonApiWKUserContentController, pigeonInstance: WKUserContentController, handler: WKScriptMessageHandler, name: String) throws + func addScriptMessageHandler( + pigeonApi: PigeonApiWKUserContentController, pigeonInstance: WKUserContentController, + handler: WKScriptMessageHandler, name: String) throws /// Uninstalls the custom message handler with the specified name from your /// JavaScript code. - func removeScriptMessageHandler(pigeonApi: PigeonApiWKUserContentController, pigeonInstance: WKUserContentController, name: String) throws + func removeScriptMessageHandler( + pigeonApi: PigeonApiWKUserContentController, pigeonInstance: WKUserContentController, + name: String) throws /// Uninstalls all custom message handlers associated with the user content /// controller. - func removeAllScriptMessageHandlers(pigeonApi: PigeonApiWKUserContentController, pigeonInstance: WKUserContentController) throws + func removeAllScriptMessageHandlers( + pigeonApi: PigeonApiWKUserContentController, pigeonInstance: WKUserContentController) throws /// Injects the specified script into the webpage’s content. - func addUserScript(pigeonApi: PigeonApiWKUserContentController, pigeonInstance: WKUserContentController, userScript: WKUserScript) throws + func addUserScript( + pigeonApi: PigeonApiWKUserContentController, pigeonInstance: WKUserContentController, + userScript: WKUserScript) throws /// Removes all user scripts from the web view. - func removeAllUserScripts(pigeonApi: PigeonApiWKUserContentController, pigeonInstance: WKUserContentController) throws + func removeAllUserScripts( + pigeonApi: PigeonApiWKUserContentController, pigeonInstance: WKUserContentController) throws } protocol PigeonApiProtocolWKUserContentController { } -final class PigeonApiWKUserContentController: PigeonApiProtocolWKUserContentController { +final class PigeonApiWKUserContentController: PigeonApiProtocolWKUserContentController { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKUserContentController ///An implementation of [NSObject] used to access callback methods @@ -3169,17 +3645,26 @@ final class PigeonApiWKUserContentController: PigeonApiProtocolWKUserContentCont return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKUserContentController) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateWKUserContentController + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKUserContentController?) { + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKUserContentController? + ) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let addScriptMessageHandlerChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.addScriptMessageHandler", binaryMessenger: binaryMessenger, codec: codec) + let addScriptMessageHandlerChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.addScriptMessageHandler", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { addScriptMessageHandlerChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -3187,7 +3672,8 @@ final class PigeonApiWKUserContentController: PigeonApiProtocolWKUserContentCont let handlerArg = args[1] as! WKScriptMessageHandler let nameArg = args[2] as! String do { - try api.pigeonDelegate.addScriptMessageHandler(pigeonApi: api, pigeonInstance: pigeonInstanceArg, handler: handlerArg, name: nameArg) + try api.pigeonDelegate.addScriptMessageHandler( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, handler: handlerArg, name: nameArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3196,14 +3682,18 @@ final class PigeonApiWKUserContentController: PigeonApiProtocolWKUserContentCont } else { addScriptMessageHandlerChannel.setMessageHandler(nil) } - let removeScriptMessageHandlerChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.removeScriptMessageHandler", binaryMessenger: binaryMessenger, codec: codec) + let removeScriptMessageHandlerChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.removeScriptMessageHandler", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { removeScriptMessageHandlerChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKUserContentController let nameArg = args[1] as! String do { - try api.pigeonDelegate.removeScriptMessageHandler(pigeonApi: api, pigeonInstance: pigeonInstanceArg, name: nameArg) + try api.pigeonDelegate.removeScriptMessageHandler( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, name: nameArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3212,13 +3702,17 @@ final class PigeonApiWKUserContentController: PigeonApiProtocolWKUserContentCont } else { removeScriptMessageHandlerChannel.setMessageHandler(nil) } - let removeAllScriptMessageHandlersChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.removeAllScriptMessageHandlers", binaryMessenger: binaryMessenger, codec: codec) + let removeAllScriptMessageHandlersChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.removeAllScriptMessageHandlers", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { removeAllScriptMessageHandlersChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKUserContentController do { - try api.pigeonDelegate.removeAllScriptMessageHandlers(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + try api.pigeonDelegate.removeAllScriptMessageHandlers( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3227,14 +3721,17 @@ final class PigeonApiWKUserContentController: PigeonApiProtocolWKUserContentCont } else { removeAllScriptMessageHandlersChannel.setMessageHandler(nil) } - let addUserScriptChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.addUserScript", binaryMessenger: binaryMessenger, codec: codec) + let addUserScriptChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.addUserScript", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { addUserScriptChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKUserContentController let userScriptArg = args[1] as! WKUserScript do { - try api.pigeonDelegate.addUserScript(pigeonApi: api, pigeonInstance: pigeonInstanceArg, userScript: userScriptArg) + try api.pigeonDelegate.addUserScript( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, userScript: userScriptArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3243,13 +3740,17 @@ final class PigeonApiWKUserContentController: PigeonApiProtocolWKUserContentCont } else { addUserScriptChannel.setMessageHandler(nil) } - let removeAllUserScriptsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.removeAllUserScripts", binaryMessenger: binaryMessenger, codec: codec) + let removeAllUserScriptsChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.removeAllUserScripts", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { removeAllUserScriptsChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKUserContentController do { - try api.pigeonDelegate.removeAllUserScripts(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + try api.pigeonDelegate.removeAllUserScripts( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3261,21 +3762,27 @@ final class PigeonApiWKUserContentController: PigeonApiProtocolWKUserContentCont } ///Creates a Dart instance of WKUserContentController and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: WKUserContentController, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: WKUserContentController, + 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeonInstance as AnyObject) + } 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) + 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))) @@ -3295,13 +3802,14 @@ final class PigeonApiWKUserContentController: PigeonApiProtocolWKUserContentCont } protocol PigeonApiDelegateWKPreferences { /// A Boolean value that indicates whether JavaScript is enabled. - func setJavaScriptEnabled(pigeonApi: PigeonApiWKPreferences, pigeonInstance: WKPreferences, enabled: Bool) throws + func setJavaScriptEnabled( + pigeonApi: PigeonApiWKPreferences, pigeonInstance: WKPreferences, enabled: Bool) throws } protocol PigeonApiProtocolWKPreferences { } -final class PigeonApiWKPreferences: PigeonApiProtocolWKPreferences { +final class PigeonApiWKPreferences: PigeonApiProtocolWKPreferences { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKPreferences ///An implementation of [NSObject] used to access callback methods @@ -3309,24 +3817,32 @@ final class PigeonApiWKPreferences: PigeonApiProtocolWKPreferences { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKPreferences) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKPreferences + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKPreferences?) { + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKPreferences? + ) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let setJavaScriptEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKPreferences.setJavaScriptEnabled", binaryMessenger: binaryMessenger, codec: codec) + let setJavaScriptEnabledChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKPreferences.setJavaScriptEnabled", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { setJavaScriptEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKPreferences let enabledArg = args[1] as! Bool do { - try api.pigeonDelegate.setJavaScriptEnabled(pigeonApi: api, pigeonInstance: pigeonInstanceArg, enabled: enabledArg) + try api.pigeonDelegate.setJavaScriptEnabled( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, enabled: enabledArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3338,21 +3854,26 @@ final class PigeonApiWKPreferences: PigeonApiProtocolWKPreferences { } ///Creates a Dart instance of WKPreferences and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: WKPreferences, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: WKPreferences, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeonInstance as AnyObject) + } 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) + 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))) @@ -3371,15 +3892,19 @@ final class PigeonApiWKPreferences: PigeonApiProtocolWKPreferences { } } protocol PigeonApiDelegateWKScriptMessageHandler { - func pigeonDefaultConstructor(pigeonApi: PigeonApiWKScriptMessageHandler) throws -> WKScriptMessageHandler + func pigeonDefaultConstructor(pigeonApi: PigeonApiWKScriptMessageHandler) throws + -> WKScriptMessageHandler } protocol PigeonApiProtocolWKScriptMessageHandler { /// Tells the handler that a webpage sent a script message. - func didReceiveScriptMessage(pigeonInstance pigeonInstanceArg: WKScriptMessageHandler, controller controllerArg: WKUserContentController, message messageArg: WKScriptMessage, completion: @escaping (Result) -> Void) + func didReceiveScriptMessage( + pigeonInstance pigeonInstanceArg: WKScriptMessageHandler, + controller controllerArg: WKUserContentController, message messageArg: WKScriptMessage, + completion: @escaping (Result) -> Void) } -final class PigeonApiWKScriptMessageHandler: PigeonApiProtocolWKScriptMessageHandler { +final class PigeonApiWKScriptMessageHandler: PigeonApiProtocolWKScriptMessageHandler { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKScriptMessageHandler ///An implementation of [NSObject] used to access callback methods @@ -3387,25 +3912,34 @@ final class PigeonApiWKScriptMessageHandler: PigeonApiProtocolWKScriptMessageHan return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKScriptMessageHandler) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateWKScriptMessageHandler + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKScriptMessageHandler?) { + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKScriptMessageHandler? + ) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKScriptMessageHandler.pigeon_defaultConstructor", binaryMessenger: binaryMessenger, codec: codec) + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.WKScriptMessageHandler.pigeon_defaultConstructor", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { pigeonDefaultConstructorChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonIdentifierArg = args[0] as! Int64 do { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( -try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), -withIdentifier: pigeonIdentifierArg) + try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), + withIdentifier: pigeonIdentifierArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3417,25 +3951,34 @@ withIdentifier: pigeonIdentifierArg) } ///Creates a Dart instance of WKScriptMessageHandler and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: WKScriptMessageHandler, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: WKScriptMessageHandler, + 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { + } 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: ""))) + message: + "Error: Attempting to create a new Dart instance of WKScriptMessageHandler, but the class has a nonnull callback method.", + details: ""))) } } /// Tells the handler that a webpage sent a script message. - func didReceiveScriptMessage(pigeonInstance pigeonInstanceArg: WKScriptMessageHandler, controller controllerArg: WKUserContentController, message messageArg: WKScriptMessage, completion: @escaping (Result) -> Void) { + func didReceiveScriptMessage( + pigeonInstance pigeonInstanceArg: WKScriptMessageHandler, + controller controllerArg: WKUserContentController, message messageArg: WKScriptMessage, + completion: @escaping (Result) -> Void + ) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -3446,8 +3989,10 @@ withIdentifier: pigeonIdentifierArg) } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKScriptMessageHandler.didReceiveScriptMessage" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKScriptMessageHandler.didReceiveScriptMessage" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([pigeonInstanceArg, controllerArg, messageArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -3466,27 +4011,44 @@ withIdentifier: pigeonIdentifierArg) } protocol PigeonApiDelegateWKNavigationDelegate { - func pigeonDefaultConstructor(pigeonApi: PigeonApiWKNavigationDelegate) throws -> WKNavigationDelegate + func pigeonDefaultConstructor(pigeonApi: PigeonApiWKNavigationDelegate) throws + -> WKNavigationDelegate } protocol PigeonApiProtocolWKNavigationDelegate { /// Tells the delegate that navigation is complete. - func didFinishNavigation(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, url urlArg: String?, completion: @escaping (Result) -> Void) + func didFinishNavigation( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + url urlArg: String?, completion: @escaping (Result) -> Void) /// Tells the delegate that navigation from the main frame has started. - func didStartProvisionalNavigation(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, url urlArg: String?, completion: @escaping (Result) -> Void) + func didStartProvisionalNavigation( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + url urlArg: String?, completion: @escaping (Result) -> Void) /// Asks the delegate for permission to navigate to new content based on the /// specified action information. - func decidePolicyForNavigationAction(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, navigationAction navigationActionArg: WKNavigationAction, completion: @escaping (Result) -> Void) + func decidePolicyForNavigationAction( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + navigationAction navigationActionArg: WKNavigationAction, + completion: @escaping (Result) -> Void) /// Asks the delegate for permission to navigate to new content after the /// response to the navigation request is known. - func decidePolicyForNavigationResponse(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, navigationResponse navigationResponseArg: WKNavigationResponse, completion: @escaping (Result) -> Void) + func decidePolicyForNavigationResponse( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + navigationResponse navigationResponseArg: WKNavigationResponse, + completion: @escaping (Result) -> Void) /// Tells the delegate that an error occurred during navigation. - func didFailNavigation(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, error errorArg: NSError, completion: @escaping (Result) -> Void) + func didFailNavigation( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + error errorArg: NSError, completion: @escaping (Result) -> Void) /// Tells the delegate that an error occurred during the early navigation /// process. - func didFailProvisionalNavigation(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, error errorArg: NSError, completion: @escaping (Result) -> Void) + func didFailProvisionalNavigation( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + error errorArg: NSError, completion: @escaping (Result) -> Void) /// Tells the delegate that the web view’s content process was terminated. - func webViewWebContentProcessDidTerminate(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, completion: @escaping (Result) -> Void) + func webViewWebContentProcessDidTerminate( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + completion: @escaping (Result) -> Void) /// Asks the delegate to respond to an authentication challenge. /// /// This return value expects a List with: @@ -3498,10 +4060,13 @@ protocol PigeonApiProtocolWKNavigationDelegate { /// "password": "", /// "persistence": , /// ] - func didReceiveAuthenticationChallenge(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, challenge challengeArg: URLAuthenticationChallenge, completion: @escaping (Result<[Any?], PigeonError>) -> Void) + func didReceiveAuthenticationChallenge( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + challenge challengeArg: URLAuthenticationChallenge, + completion: @escaping (Result<[Any?], PigeonError>) -> Void) } -final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate { +final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKNavigationDelegate ///An implementation of [NSObject] used to access callback methods @@ -3509,25 +4074,34 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKNavigationDelegate) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateWKNavigationDelegate + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKNavigationDelegate?) { + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKNavigationDelegate? + ) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.pigeon_defaultConstructor", binaryMessenger: binaryMessenger, codec: codec) + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.pigeon_defaultConstructor", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { pigeonDefaultConstructorChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonIdentifierArg = args[0] as! Int64 do { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( -try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), -withIdentifier: pigeonIdentifierArg) + try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), + withIdentifier: pigeonIdentifierArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3539,25 +4113,32 @@ withIdentifier: pigeonIdentifierArg) } ///Creates a Dart instance of WKNavigationDelegate and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: WKNavigationDelegate, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: WKNavigationDelegate, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { + } 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: ""))) + message: + "Error: Attempting to create a new Dart instance of WKNavigationDelegate, but the class has a nonnull callback method.", + details: ""))) } } /// Tells the delegate that navigation is complete. - func didFinishNavigation(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, url urlArg: String?, completion: @escaping (Result) -> Void) { + func didFinishNavigation( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + url urlArg: String?, completion: @escaping (Result) -> Void + ) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -3568,8 +4149,10 @@ withIdentifier: pigeonIdentifierArg) } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didFinishNavigation" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didFinishNavigation" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([pigeonInstanceArg, webViewArg, urlArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -3587,7 +4170,10 @@ withIdentifier: pigeonIdentifierArg) } /// Tells the delegate that navigation from the main frame has started. - func didStartProvisionalNavigation(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, url urlArg: String?, completion: @escaping (Result) -> Void) { + func didStartProvisionalNavigation( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + url urlArg: String?, completion: @escaping (Result) -> Void + ) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -3598,8 +4184,10 @@ withIdentifier: pigeonIdentifierArg) } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didStartProvisionalNavigation" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didStartProvisionalNavigation" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([pigeonInstanceArg, webViewArg, urlArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -3618,7 +4206,11 @@ withIdentifier: pigeonIdentifierArg) /// Asks the delegate for permission to navigate to new content based on the /// specified action information. - func decidePolicyForNavigationAction(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, navigationAction navigationActionArg: WKNavigationAction, completion: @escaping (Result) -> Void) { + func decidePolicyForNavigationAction( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + navigationAction navigationActionArg: WKNavigationAction, + completion: @escaping (Result) -> Void + ) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -3629,9 +4221,12 @@ withIdentifier: pigeonIdentifierArg) } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.decidePolicyForNavigationAction" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, webViewArg, navigationActionArg] as [Any?]) { response in + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.decidePolicyForNavigationAction" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, webViewArg, navigationActionArg] as [Any?]) { + response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -3642,7 +4237,11 @@ withIdentifier: pigeonIdentifierArg) let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! NavigationActionPolicy completion(.success(result)) @@ -3652,7 +4251,11 @@ withIdentifier: pigeonIdentifierArg) /// Asks the delegate for permission to navigate to new content after the /// response to the navigation request is known. - func decidePolicyForNavigationResponse(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, navigationResponse navigationResponseArg: WKNavigationResponse, completion: @escaping (Result) -> Void) { + func decidePolicyForNavigationResponse( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + navigationResponse navigationResponseArg: WKNavigationResponse, + completion: @escaping (Result) -> Void + ) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -3663,9 +4266,12 @@ withIdentifier: pigeonIdentifierArg) } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.decidePolicyForNavigationResponse" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, webViewArg, navigationResponseArg] as [Any?]) { response in + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.decidePolicyForNavigationResponse" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, webViewArg, navigationResponseArg] as [Any?]) { + response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -3676,7 +4282,11 @@ withIdentifier: pigeonIdentifierArg) let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! NavigationResponsePolicy completion(.success(result)) @@ -3685,7 +4295,10 @@ withIdentifier: pigeonIdentifierArg) } /// Tells the delegate that an error occurred during navigation. - func didFailNavigation(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, error errorArg: NSError, completion: @escaping (Result) -> Void) { + func didFailNavigation( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + error errorArg: NSError, completion: @escaping (Result) -> Void + ) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -3696,8 +4309,10 @@ withIdentifier: pigeonIdentifierArg) } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didFailNavigation" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didFailNavigation" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([pigeonInstanceArg, webViewArg, errorArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -3716,7 +4331,10 @@ withIdentifier: pigeonIdentifierArg) /// Tells the delegate that an error occurred during the early navigation /// process. - func didFailProvisionalNavigation(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, error errorArg: NSError, completion: @escaping (Result) -> Void) { + func didFailProvisionalNavigation( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + error errorArg: NSError, completion: @escaping (Result) -> Void + ) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -3727,8 +4345,10 @@ withIdentifier: pigeonIdentifierArg) } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didFailProvisionalNavigation" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didFailProvisionalNavigation" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([pigeonInstanceArg, webViewArg, errorArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -3746,7 +4366,10 @@ withIdentifier: pigeonIdentifierArg) } /// Tells the delegate that the web view’s content process was terminated. - func webViewWebContentProcessDidTerminate(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, completion: @escaping (Result) -> Void) { + func webViewWebContentProcessDidTerminate( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + completion: @escaping (Result) -> Void + ) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -3757,8 +4380,10 @@ withIdentifier: pigeonIdentifierArg) } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.webViewWebContentProcessDidTerminate" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.webViewWebContentProcessDidTerminate" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([pigeonInstanceArg, webViewArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -3786,7 +4411,11 @@ withIdentifier: pigeonIdentifierArg) /// "password": "", /// "persistence": , /// ] - func didReceiveAuthenticationChallenge(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, challenge challengeArg: URLAuthenticationChallenge, completion: @escaping (Result<[Any?], PigeonError>) -> Void) { + func didReceiveAuthenticationChallenge( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + challenge challengeArg: URLAuthenticationChallenge, + completion: @escaping (Result<[Any?], PigeonError>) -> Void + ) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -3797,8 +4426,10 @@ withIdentifier: pigeonIdentifierArg) } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didReceiveAuthenticationChallenge" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didReceiveAuthenticationChallenge" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([pigeonInstanceArg, webViewArg, challengeArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -3810,7 +4441,11 @@ withIdentifier: pigeonIdentifierArg) let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! [Any?] completion(.success(result)) @@ -3823,41 +4458,52 @@ protocol PigeonApiDelegateNSObject { func pigeonDefaultConstructor(pigeonApi: PigeonApiNSObject) throws -> NSObject /// Registers the observer object to receive KVO notifications for the key /// path relative to the object receiving this message. - func addObserver(pigeonApi: PigeonApiNSObject, pigeonInstance: NSObject, observer: NSObject, keyPath: String, options: [KeyValueObservingOptions]) throws + func addObserver( + pigeonApi: PigeonApiNSObject, pigeonInstance: NSObject, observer: NSObject, keyPath: String, + options: [KeyValueObservingOptions]) throws /// Stops the observer object from receiving change notifications for the /// property specified by the key path relative to the object receiving this /// message. - func removeObserver(pigeonApi: PigeonApiNSObject, pigeonInstance: NSObject, observer: NSObject, keyPath: String) throws + func removeObserver( + pigeonApi: PigeonApiNSObject, pigeonInstance: NSObject, observer: NSObject, keyPath: String) + throws } protocol PigeonApiProtocolNSObject { /// Informs the observing object when the value at the specified key path /// relative to the observed object has changed. - func observeValue(pigeonInstance pigeonInstanceArg: NSObject, keyPath keyPathArg: String?, object objectArg: NSObject?, change changeArg: [KeyValueChangeKey: Any?]?, completion: @escaping (Result) -> Void) + func observeValue( + pigeonInstance pigeonInstanceArg: NSObject, keyPath keyPathArg: String?, + object objectArg: NSObject?, change changeArg: [KeyValueChangeKey: Any?]?, + completion: @escaping (Result) -> Void) } -final class PigeonApiNSObject: PigeonApiProtocolNSObject { +final class PigeonApiNSObject: PigeonApiProtocolNSObject { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateNSObject init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateNSObject) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiNSObject?) { + static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiNSObject?) + { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSObject.pigeon_defaultConstructor", binaryMessenger: binaryMessenger, codec: codec) + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSObject.pigeon_defaultConstructor", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { pigeonDefaultConstructorChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonIdentifierArg = args[0] as! Int64 do { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( -try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), -withIdentifier: pigeonIdentifierArg) + try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), + withIdentifier: pigeonIdentifierArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3866,7 +4512,9 @@ withIdentifier: pigeonIdentifierArg) } else { pigeonDefaultConstructorChannel.setMessageHandler(nil) } - let addObserverChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSObject.addObserver", binaryMessenger: binaryMessenger, codec: codec) + let addObserverChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSObject.addObserver", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { addObserverChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -3875,7 +4523,9 @@ withIdentifier: pigeonIdentifierArg) let keyPathArg = args[2] as! String let optionsArg = args[3] as! [KeyValueObservingOptions] do { - try api.pigeonDelegate.addObserver(pigeonApi: api, pigeonInstance: pigeonInstanceArg, observer: observerArg, keyPath: keyPathArg, options: optionsArg) + try api.pigeonDelegate.addObserver( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, observer: observerArg, + keyPath: keyPathArg, options: optionsArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3884,7 +4534,9 @@ withIdentifier: pigeonIdentifierArg) } else { addObserverChannel.setMessageHandler(nil) } - let removeObserverChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSObject.removeObserver", binaryMessenger: binaryMessenger, codec: codec) + let removeObserverChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSObject.removeObserver", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { removeObserverChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -3892,7 +4544,9 @@ withIdentifier: pigeonIdentifierArg) let observerArg = args[1] as! NSObject let keyPathArg = args[2] as! String do { - try api.pigeonDelegate.removeObserver(pigeonApi: api, pigeonInstance: pigeonInstanceArg, observer: observerArg, keyPath: keyPathArg) + try api.pigeonDelegate.removeObserver( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, observer: observerArg, + keyPath: keyPathArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3904,21 +4558,26 @@ withIdentifier: pigeonIdentifierArg) } ///Creates a Dart instance of NSObject and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: NSObject, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: NSObject, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeonInstance as AnyObject) + } 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) + 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))) @@ -3937,7 +4596,11 @@ withIdentifier: pigeonIdentifierArg) } /// Informs the observing object when the value at the specified key path /// relative to the observed object has changed. - func observeValue(pigeonInstance pigeonInstanceArg: NSObject, keyPath keyPathArg: String?, object objectArg: NSObject?, change changeArg: [KeyValueChangeKey: Any?]?, completion: @escaping (Result) -> Void) { + func observeValue( + pigeonInstance pigeonInstanceArg: NSObject, keyPath keyPathArg: String?, + object objectArg: NSObject?, change changeArg: [KeyValueChangeKey: Any?]?, + completion: @escaping (Result) -> Void + ) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -3949,8 +4612,10 @@ withIdentifier: pigeonIdentifierArg) let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.NSObject.observeValue" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, keyPathArg, objectArg, changeArg] as [Any?]) { response in + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, keyPathArg, objectArg, changeArg] as [Any?]) { + response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -3969,104 +4634,125 @@ withIdentifier: pigeonIdentifierArg) } protocol PigeonApiDelegateUIViewWKWebView { #if !os(macOS) - func pigeonDefaultConstructor(pigeonApi: PigeonApiUIViewWKWebView, initialConfiguration: WKWebViewConfiguration) throws -> WKWebView + func pigeonDefaultConstructor( + pigeonApi: PigeonApiUIViewWKWebView, initialConfiguration: WKWebViewConfiguration + ) throws -> WKWebView #endif #if !os(macOS) - /// The object that contains the configuration details for the web view. - func configuration(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> WKWebViewConfiguration + /// The object that contains the configuration details for the web view. + func configuration(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws + -> WKWebViewConfiguration #endif #if !os(macOS) - /// The scroll view associated with the web view. - func scrollView(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> UIScrollView + /// The scroll view associated with the web view. + func scrollView(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws + -> UIScrollView #endif #if !os(macOS) - /// The object you use to integrate custom user interface elements, such as - /// contextual menus or panels, into web view interactions. - func setUIDelegate(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, delegate: WKUIDelegate) throws + /// The object you use to integrate custom user interface elements, such as + /// contextual menus or panels, into web view interactions. + func setUIDelegate( + pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, delegate: WKUIDelegate) throws #endif #if !os(macOS) - /// The object you use to manage navigation behavior for the web view. - func setNavigationDelegate(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, delegate: WKNavigationDelegate) throws + /// The object you use to manage navigation behavior for the web view. + func setNavigationDelegate( + pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, delegate: WKNavigationDelegate + ) throws #endif #if !os(macOS) - /// The URL for the current webpage. - func getUrl(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> String? + /// The URL for the current webpage. + func getUrl(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> String? #endif #if !os(macOS) - /// An estimate of what fraction of the current navigation has been loaded. - func getEstimatedProgress(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> Double + /// An estimate of what fraction of the current navigation has been loaded. + func getEstimatedProgress(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws + -> Double #endif #if !os(macOS) - /// Loads the web content that the specified URL request object references and - /// navigates to that content. - func load(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, request: URLRequestWrapper) throws + /// Loads the web content that the specified URL request object references and + /// navigates to that content. + func load( + pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, request: URLRequestWrapper) + throws #endif #if !os(macOS) - /// Loads the contents of the specified HTML string and navigates to it. - func loadHtmlString(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, string: String, baseUrl: String?) throws + /// Loads the contents of the specified HTML string and navigates to it. + func loadHtmlString( + pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, string: String, + baseUrl: String?) throws #endif #if !os(macOS) - /// Loads the web content from the specified file and navigates to it. - func loadFileUrl(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, url: String, readAccessUrl: String) throws + /// Loads the web content from the specified file and navigates to it. + func loadFileUrl( + pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, url: String, + readAccessUrl: String) throws #endif #if !os(macOS) - /// Convenience method to load a Flutter asset. - func loadFlutterAsset(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, key: String) throws + /// Convenience method to load a Flutter asset. + func loadFlutterAsset( + pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, key: String) throws #endif #if !os(macOS) - /// A Boolean value that indicates whether there is a valid back item in the - /// back-forward list. - func canGoBack(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> Bool + /// A Boolean value that indicates whether there is a valid back item in the + /// back-forward list. + func canGoBack(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> Bool #endif #if !os(macOS) - /// A Boolean value that indicates whether there is a valid forward item in - /// the back-forward list. - func canGoForward(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> Bool + /// A Boolean value that indicates whether there is a valid forward item in + /// the back-forward list. + func canGoForward(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> Bool #endif #if !os(macOS) - /// Navigates to the back item in the back-forward list. - func goBack(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws + /// Navigates to the back item in the back-forward list. + func goBack(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws #endif #if !os(macOS) - /// Navigates to the forward item in the back-forward list. - func goForward(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws + /// Navigates to the forward item in the back-forward list. + func goForward(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws #endif #if !os(macOS) - /// Reloads the current webpage. - func reload(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws + /// Reloads the current webpage. + func reload(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws #endif #if !os(macOS) - /// The page title. - func getTitle(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> String? + /// The page title. + func getTitle(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> String? #endif #if !os(macOS) - /// A Boolean value that indicates whether horizontal swipe gestures trigger - /// backward and forward page navigation. - func setAllowsBackForwardNavigationGestures(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, allow: Bool) throws + /// A Boolean value that indicates whether horizontal swipe gestures trigger + /// backward and forward page navigation. + func setAllowsBackForwardNavigationGestures( + pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, allow: Bool) throws #endif #if !os(macOS) - /// The custom user agent string. - func setCustomUserAgent(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, userAgent: String?) throws + /// The custom user agent string. + func setCustomUserAgent( + pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, userAgent: String?) throws #endif #if !os(macOS) - /// Evaluates the specified JavaScript string. - func evaluateJavaScript(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, javaScriptString: String, completion: @escaping (Result) -> Void) + /// Evaluates the specified JavaScript string. + func evaluateJavaScript( + pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, javaScriptString: String, + completion: @escaping (Result) -> Void) #endif #if !os(macOS) - /// A Boolean value that indicates whether you can inspect the view with - /// Safari Web Inspector. - func setInspectable(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, inspectable: Bool) throws + /// A Boolean value that indicates whether you can inspect the view with + /// Safari Web Inspector. + func setInspectable( + pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, inspectable: Bool) throws #endif #if !os(macOS) - /// The custom user agent string. - func getCustomUserAgent(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> String? + /// The custom user agent string. + func getCustomUserAgent(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws + -> String? #endif } protocol PigeonApiProtocolUIViewWKWebView { } -final class PigeonApiUIViewWKWebView: PigeonApiProtocolUIViewWKWebView { +final class PigeonApiUIViewWKWebView: PigeonApiProtocolUIViewWKWebView { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateUIViewWKWebView ///An implementation of [UIView] used to access callback methods @@ -4079,542 +4765,644 @@ final class PigeonApiUIViewWKWebView: PigeonApiProtocolUIViewWKWebView { return pigeonRegistrar.apiDelegate.pigeonApiWKWebView(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateUIViewWKWebView) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateUIViewWKWebView + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiUIViewWKWebView?) { + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiUIViewWKWebView? + ) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() #if !os(macOS) - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.pigeon_defaultConstructor", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - pigeonDefaultConstructorChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonIdentifierArg = args[0] as! Int64 - let initialConfigurationArg = args[1] as! WKWebViewConfiguration - do { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance( -try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api, initialConfiguration: initialConfigurationArg), -withIdentifier: pigeonIdentifierArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.pigeon_defaultConstructor", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + pigeonDefaultConstructorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonIdentifierArg = args[0] as! Int64 + let initialConfigurationArg = args[1] as! WKWebViewConfiguration + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + try api.pigeonDelegate.pigeonDefaultConstructor( + pigeonApi: api, initialConfiguration: initialConfigurationArg), + withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + pigeonDefaultConstructorChannel.setMessageHandler(nil) } - } else { - pigeonDefaultConstructorChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let configurationChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.configuration", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - configurationChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let pigeonIdentifierArg = args[1] as! Int64 - do { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance(try api.pigeonDelegate.configuration(pigeonApi: api, pigeonInstance: pigeonInstanceArg), withIdentifier: pigeonIdentifierArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let configurationChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.configuration", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + configurationChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let pigeonIdentifierArg = args[1] as! Int64 + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + try api.pigeonDelegate.configuration( + pigeonApi: api, pigeonInstance: pigeonInstanceArg), + withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + configurationChannel.setMessageHandler(nil) } - } else { - configurationChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let scrollViewChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.scrollView", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - scrollViewChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let pigeonIdentifierArg = args[1] as! Int64 - do { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance(try api.pigeonDelegate.scrollView(pigeonApi: api, pigeonInstance: pigeonInstanceArg), withIdentifier: pigeonIdentifierArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let scrollViewChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.scrollView", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + scrollViewChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let pigeonIdentifierArg = args[1] as! Int64 + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + try api.pigeonDelegate.scrollView(pigeonApi: api, pigeonInstance: pigeonInstanceArg), + withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + scrollViewChannel.setMessageHandler(nil) } - } else { - scrollViewChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let setUIDelegateChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setUIDelegate", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setUIDelegateChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let delegateArg = args[1] as! WKUIDelegate - do { - try api.pigeonDelegate.setUIDelegate(pigeonApi: api, pigeonInstance: pigeonInstanceArg, delegate: delegateArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let setUIDelegateChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setUIDelegate", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setUIDelegateChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let delegateArg = args[1] as! WKUIDelegate + do { + try api.pigeonDelegate.setUIDelegate( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, delegate: delegateArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + setUIDelegateChannel.setMessageHandler(nil) } - } else { - setUIDelegateChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let setNavigationDelegateChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setNavigationDelegate", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setNavigationDelegateChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let delegateArg = args[1] as! WKNavigationDelegate - do { - try api.pigeonDelegate.setNavigationDelegate(pigeonApi: api, pigeonInstance: pigeonInstanceArg, delegate: delegateArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let setNavigationDelegateChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setNavigationDelegate", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setNavigationDelegateChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let delegateArg = args[1] as! WKNavigationDelegate + do { + try api.pigeonDelegate.setNavigationDelegate( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, delegate: delegateArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + setNavigationDelegateChannel.setMessageHandler(nil) } - } else { - setNavigationDelegateChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let getUrlChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.getUrl", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - getUrlChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - let result = try api.pigeonDelegate.getUrl(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - getUrlChannel.setMessageHandler(nil) - } - #endif - #if !os(macOS) - let getEstimatedProgressChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.getEstimatedProgress", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - getEstimatedProgressChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - let result = try api.pigeonDelegate.getEstimatedProgress(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) + let getUrlChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.getUrl", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getUrlChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.getUrl( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } } + } else { + getUrlChannel.setMessageHandler(nil) } - } else { - getEstimatedProgressChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let loadChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.load", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - loadChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let requestArg = args[1] as! URLRequestWrapper - do { - try api.pigeonDelegate.load(pigeonApi: api, pigeonInstance: pigeonInstanceArg, request: requestArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let getEstimatedProgressChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.getEstimatedProgress", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getEstimatedProgressChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.getEstimatedProgress( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } } + } else { + getEstimatedProgressChannel.setMessageHandler(nil) } - } else { - loadChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let loadHtmlStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.loadHtmlString", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - loadHtmlStringChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let stringArg = args[1] as! String - let baseUrlArg: String? = nilOrValue(args[2]) - do { - try api.pigeonDelegate.loadHtmlString(pigeonApi: api, pigeonInstance: pigeonInstanceArg, string: stringArg, baseUrl: baseUrlArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let loadChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.load", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + loadChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let requestArg = args[1] as! URLRequestWrapper + do { + try api.pigeonDelegate.load( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, request: requestArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + loadChannel.setMessageHandler(nil) } - } else { - loadHtmlStringChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let loadFileUrlChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.loadFileUrl", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - loadFileUrlChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let urlArg = args[1] as! String - let readAccessUrlArg = args[2] as! String - do { - try api.pigeonDelegate.loadFileUrl(pigeonApi: api, pigeonInstance: pigeonInstanceArg, url: urlArg, readAccessUrl: readAccessUrlArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let loadHtmlStringChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.loadHtmlString", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + loadHtmlStringChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let stringArg = args[1] as! String + let baseUrlArg: String? = nilOrValue(args[2]) + do { + try api.pigeonDelegate.loadHtmlString( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, string: stringArg, + baseUrl: baseUrlArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + loadHtmlStringChannel.setMessageHandler(nil) } - } else { - loadFileUrlChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let loadFlutterAssetChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.loadFlutterAsset", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - loadFlutterAssetChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let keyArg = args[1] as! String - do { - try api.pigeonDelegate.loadFlutterAsset(pigeonApi: api, pigeonInstance: pigeonInstanceArg, key: keyArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let loadFileUrlChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.loadFileUrl", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + loadFileUrlChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let urlArg = args[1] as! String + let readAccessUrlArg = args[2] as! String + do { + try api.pigeonDelegate.loadFileUrl( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, url: urlArg, + readAccessUrl: readAccessUrlArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + loadFileUrlChannel.setMessageHandler(nil) } - } else { - loadFlutterAssetChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let canGoBackChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.canGoBack", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - canGoBackChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - let result = try api.pigeonDelegate.canGoBack(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) + let loadFlutterAssetChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.loadFlutterAsset", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + loadFlutterAssetChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let keyArg = args[1] as! String + do { + try api.pigeonDelegate.loadFlutterAsset( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, key: keyArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + loadFlutterAssetChannel.setMessageHandler(nil) } - } else { - canGoBackChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let canGoForwardChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.canGoForward", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - canGoForwardChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - let result = try api.pigeonDelegate.canGoForward(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) + let canGoBackChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.canGoBack", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + canGoBackChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.canGoBack( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } } + } else { + canGoBackChannel.setMessageHandler(nil) } - } else { - canGoForwardChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let goBackChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.goBack", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - goBackChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - try api.pigeonDelegate.goBack(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let canGoForwardChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.canGoForward", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + canGoForwardChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.canGoForward( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } } + } else { + canGoForwardChannel.setMessageHandler(nil) } - } else { - goBackChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let goForwardChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.goForward", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - goForwardChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - try api.pigeonDelegate.goForward(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let goBackChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.goBack", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + goBackChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + try api.pigeonDelegate.goBack(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + goBackChannel.setMessageHandler(nil) } - } else { - goForwardChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let reloadChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.reload", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - reloadChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - try api.pigeonDelegate.reload(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let goForwardChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.goForward", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + goForwardChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + try api.pigeonDelegate.goForward(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + goForwardChannel.setMessageHandler(nil) } - } else { - reloadChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let getTitleChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.getTitle", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - getTitleChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - let result = try api.pigeonDelegate.getTitle(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) + let reloadChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.reload", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + reloadChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + try api.pigeonDelegate.reload(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + reloadChannel.setMessageHandler(nil) } - } else { - getTitleChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let setAllowsBackForwardNavigationGesturesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setAllowsBackForwardNavigationGestures", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setAllowsBackForwardNavigationGesturesChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let allowArg = args[1] as! Bool - do { - try api.pigeonDelegate.setAllowsBackForwardNavigationGestures(pigeonApi: api, pigeonInstance: pigeonInstanceArg, allow: allowArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let getTitleChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.getTitle", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getTitleChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.getTitle( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } } + } else { + getTitleChannel.setMessageHandler(nil) } - } else { - setAllowsBackForwardNavigationGesturesChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let setCustomUserAgentChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setCustomUserAgent", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setCustomUserAgentChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let userAgentArg: String? = nilOrValue(args[1]) - do { - try api.pigeonDelegate.setCustomUserAgent(pigeonApi: api, pigeonInstance: pigeonInstanceArg, userAgent: userAgentArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let setAllowsBackForwardNavigationGesturesChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setAllowsBackForwardNavigationGestures", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setAllowsBackForwardNavigationGesturesChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let allowArg = args[1] as! Bool + do { + try api.pigeonDelegate.setAllowsBackForwardNavigationGestures( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, allow: allowArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + setAllowsBackForwardNavigationGesturesChannel.setMessageHandler(nil) } - } else { - setCustomUserAgentChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let evaluateJavaScriptChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.evaluateJavaScript", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - evaluateJavaScriptChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let javaScriptStringArg = args[1] as! String - api.pigeonDelegate.evaluateJavaScript(pigeonApi: api, pigeonInstance: pigeonInstanceArg, javaScriptString: javaScriptStringArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): + let setCustomUserAgentChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setCustomUserAgent", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setCustomUserAgentChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let userAgentArg: String? = nilOrValue(args[1]) + do { + try api.pigeonDelegate.setCustomUserAgent( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, userAgent: userAgentArg) + reply(wrapResult(nil)) + } catch { reply(wrapError(error)) } } + } else { + setCustomUserAgentChannel.setMessageHandler(nil) } - } else { - evaluateJavaScriptChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let setInspectableChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setInspectable", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setInspectableChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let inspectableArg = args[1] as! Bool - do { - try api.pigeonDelegate.setInspectable(pigeonApi: api, pigeonInstance: pigeonInstanceArg, inspectable: inspectableArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let evaluateJavaScriptChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.evaluateJavaScript", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + evaluateJavaScriptChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let javaScriptStringArg = args[1] as! String + api.pigeonDelegate.evaluateJavaScript( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, javaScriptString: javaScriptStringArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } } + } else { + evaluateJavaScriptChannel.setMessageHandler(nil) } - } else { - setInspectableChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let getCustomUserAgentChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.getCustomUserAgent", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - getCustomUserAgentChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - let result = try api.pigeonDelegate.getCustomUserAgent(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) + let setInspectableChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setInspectable", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setInspectableChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let inspectableArg = args[1] as! Bool + do { + try api.pigeonDelegate.setInspectable( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, inspectable: inspectableArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + setInspectableChannel.setMessageHandler(nil) } - } else { - getCustomUserAgentChannel.setMessageHandler(nil) - } #endif - } - - #if !os(macOS) - ///Creates a Dart instance of UIViewWKWebView 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: ""))) - } 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(())) + #if !os(macOS) + let getCustomUserAgentChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.getCustomUserAgent", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getCustomUserAgentChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.getCustomUserAgent( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } } + } else { + getCustomUserAgentChannel.setMessageHandler(nil) } - } + #endif } + + #if !os(macOS) + ///Creates a Dart instance of UIViewWKWebView 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: ""))) + } 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(())) + } + } + } + } #endif } protocol PigeonApiDelegateNSViewWKWebView { #if !os(iOS) - func pigeonDefaultConstructor(pigeonApi: PigeonApiNSViewWKWebView, initialConfiguration: WKWebViewConfiguration) throws -> WKWebView + func pigeonDefaultConstructor( + pigeonApi: PigeonApiNSViewWKWebView, initialConfiguration: WKWebViewConfiguration + ) throws -> WKWebView #endif #if !os(iOS) - /// The object that contains the configuration details for the web view. - func configuration(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> WKWebViewConfiguration + /// The object that contains the configuration details for the web view. + func configuration(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws + -> WKWebViewConfiguration #endif #if !os(iOS) - /// The object you use to integrate custom user interface elements, such as - /// contextual menus or panels, into web view interactions. - func setUIDelegate(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, delegate: WKUIDelegate) throws + /// The object you use to integrate custom user interface elements, such as + /// contextual menus or panels, into web view interactions. + func setUIDelegate( + pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, delegate: WKUIDelegate) throws #endif #if !os(iOS) - /// The object you use to manage navigation behavior for the web view. - func setNavigationDelegate(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, delegate: WKNavigationDelegate) throws + /// The object you use to manage navigation behavior for the web view. + func setNavigationDelegate( + pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, delegate: WKNavigationDelegate + ) throws #endif #if !os(iOS) - /// The URL for the current webpage. - func getUrl(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> String? + /// The URL for the current webpage. + func getUrl(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> String? #endif #if !os(iOS) - /// An estimate of what fraction of the current navigation has been loaded. - func getEstimatedProgress(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> Double + /// An estimate of what fraction of the current navigation has been loaded. + func getEstimatedProgress(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws + -> Double #endif #if !os(iOS) - /// Loads the web content that the specified URL request object references and - /// navigates to that content. - func load(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, request: URLRequestWrapper) throws + /// Loads the web content that the specified URL request object references and + /// navigates to that content. + func load( + pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, request: URLRequestWrapper) + throws #endif #if !os(iOS) - /// Loads the contents of the specified HTML string and navigates to it. - func loadHtmlString(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, string: String, baseUrl: String?) throws + /// Loads the contents of the specified HTML string and navigates to it. + func loadHtmlString( + pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, string: String, + baseUrl: String?) throws #endif #if !os(iOS) - /// Loads the web content from the specified file and navigates to it. - func loadFileUrl(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, url: String, readAccessUrl: String) throws + /// Loads the web content from the specified file and navigates to it. + func loadFileUrl( + pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, url: String, + readAccessUrl: String) throws #endif #if !os(iOS) - /// Convenience method to load a Flutter asset. - func loadFlutterAsset(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, key: String) throws + /// Convenience method to load a Flutter asset. + func loadFlutterAsset( + pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, key: String) throws #endif #if !os(iOS) - /// A Boolean value that indicates whether there is a valid back item in the - /// back-forward list. - func canGoBack(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> Bool + /// A Boolean value that indicates whether there is a valid back item in the + /// back-forward list. + func canGoBack(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> Bool #endif #if !os(iOS) - /// A Boolean value that indicates whether there is a valid forward item in - /// the back-forward list. - func canGoForward(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> Bool + /// A Boolean value that indicates whether there is a valid forward item in + /// the back-forward list. + func canGoForward(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> Bool #endif #if !os(iOS) - /// Navigates to the back item in the back-forward list. - func goBack(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws + /// Navigates to the back item in the back-forward list. + func goBack(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws #endif #if !os(iOS) - /// Navigates to the forward item in the back-forward list. - func goForward(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws + /// Navigates to the forward item in the back-forward list. + func goForward(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws #endif #if !os(iOS) - /// Reloads the current webpage. - func reload(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws + /// Reloads the current webpage. + func reload(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws #endif #if !os(iOS) - /// The page title. - func getTitle(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> String? + /// The page title. + func getTitle(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> String? #endif #if !os(iOS) - /// A Boolean value that indicates whether horizontal swipe gestures trigger - /// backward and forward page navigation. - func setAllowsBackForwardNavigationGestures(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, allow: Bool) throws + /// A Boolean value that indicates whether horizontal swipe gestures trigger + /// backward and forward page navigation. + func setAllowsBackForwardNavigationGestures( + pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, allow: Bool) throws #endif #if !os(iOS) - /// The custom user agent string. - func setCustomUserAgent(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, userAgent: String?) throws + /// The custom user agent string. + func setCustomUserAgent( + pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, userAgent: String?) throws #endif #if !os(iOS) - /// Evaluates the specified JavaScript string. - func evaluateJavaScript(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, javaScriptString: String, completion: @escaping (Result) -> Void) + /// Evaluates the specified JavaScript string. + func evaluateJavaScript( + pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, javaScriptString: String, + completion: @escaping (Result) -> Void) #endif #if !os(iOS) - /// A Boolean value that indicates whether you can inspect the view with - /// Safari Web Inspector. - func setInspectable(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, inspectable: Bool) throws + /// A Boolean value that indicates whether you can inspect the view with + /// Safari Web Inspector. + func setInspectable( + pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, inspectable: Bool) throws #endif #if !os(iOS) - /// The custom user agent string. - func getCustomUserAgent(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> String? + /// The custom user agent string. + func getCustomUserAgent(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws + -> String? #endif } protocol PigeonApiProtocolNSViewWKWebView { } -final class PigeonApiNSViewWKWebView: PigeonApiProtocolNSViewWKWebView { +final class PigeonApiNSViewWKWebView: PigeonApiProtocolNSViewWKWebView { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateNSViewWKWebView ///An implementation of [NSObject] used to access callback methods @@ -4627,426 +5415,504 @@ final class PigeonApiNSViewWKWebView: PigeonApiProtocolNSViewWKWebView { return pigeonRegistrar.apiDelegate.pigeonApiWKWebView(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateNSViewWKWebView) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateNSViewWKWebView + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiNSViewWKWebView?) { + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiNSViewWKWebView? + ) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() #if !os(iOS) - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.pigeon_defaultConstructor", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - pigeonDefaultConstructorChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonIdentifierArg = args[0] as! Int64 - let initialConfigurationArg = args[1] as! WKWebViewConfiguration - do { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance( -try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api, initialConfiguration: initialConfigurationArg), -withIdentifier: pigeonIdentifierArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.pigeon_defaultConstructor", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + pigeonDefaultConstructorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonIdentifierArg = args[0] as! Int64 + let initialConfigurationArg = args[1] as! WKWebViewConfiguration + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + try api.pigeonDelegate.pigeonDefaultConstructor( + pigeonApi: api, initialConfiguration: initialConfigurationArg), + withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + pigeonDefaultConstructorChannel.setMessageHandler(nil) } - } else { - pigeonDefaultConstructorChannel.setMessageHandler(nil) - } #endif #if !os(iOS) - let configurationChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.configuration", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - configurationChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let pigeonIdentifierArg = args[1] as! Int64 - do { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance(try api.pigeonDelegate.configuration(pigeonApi: api, pigeonInstance: pigeonInstanceArg), withIdentifier: pigeonIdentifierArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let configurationChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.configuration", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + configurationChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let pigeonIdentifierArg = args[1] as! Int64 + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + try api.pigeonDelegate.configuration( + pigeonApi: api, pigeonInstance: pigeonInstanceArg), + withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + configurationChannel.setMessageHandler(nil) } - } else { - configurationChannel.setMessageHandler(nil) - } #endif #if !os(iOS) - let setUIDelegateChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setUIDelegate", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setUIDelegateChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let delegateArg = args[1] as! WKUIDelegate - do { - try api.pigeonDelegate.setUIDelegate(pigeonApi: api, pigeonInstance: pigeonInstanceArg, delegate: delegateArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let setUIDelegateChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setUIDelegate", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setUIDelegateChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let delegateArg = args[1] as! WKUIDelegate + do { + try api.pigeonDelegate.setUIDelegate( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, delegate: delegateArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + setUIDelegateChannel.setMessageHandler(nil) } - } else { - setUIDelegateChannel.setMessageHandler(nil) - } #endif #if !os(iOS) - let setNavigationDelegateChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setNavigationDelegate", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setNavigationDelegateChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let delegateArg = args[1] as! WKNavigationDelegate - do { - try api.pigeonDelegate.setNavigationDelegate(pigeonApi: api, pigeonInstance: pigeonInstanceArg, delegate: delegateArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let setNavigationDelegateChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setNavigationDelegate", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setNavigationDelegateChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let delegateArg = args[1] as! WKNavigationDelegate + do { + try api.pigeonDelegate.setNavigationDelegate( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, delegate: delegateArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + setNavigationDelegateChannel.setMessageHandler(nil) } - } else { - setNavigationDelegateChannel.setMessageHandler(nil) - } #endif #if !os(iOS) - let getUrlChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.getUrl", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - getUrlChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - let result = try api.pigeonDelegate.getUrl(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) + let getUrlChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.getUrl", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getUrlChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.getUrl( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } } + } else { + getUrlChannel.setMessageHandler(nil) } - } else { - getUrlChannel.setMessageHandler(nil) - } #endif #if !os(iOS) - let getEstimatedProgressChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.getEstimatedProgress", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - getEstimatedProgressChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - let result = try api.pigeonDelegate.getEstimatedProgress(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) + let getEstimatedProgressChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.getEstimatedProgress", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getEstimatedProgressChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.getEstimatedProgress( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } } + } else { + getEstimatedProgressChannel.setMessageHandler(nil) } - } else { - getEstimatedProgressChannel.setMessageHandler(nil) - } #endif #if !os(iOS) - let loadChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.load", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - loadChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let requestArg = args[1] as! URLRequestWrapper - do { - try api.pigeonDelegate.load(pigeonApi: api, pigeonInstance: pigeonInstanceArg, request: requestArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let loadChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.load", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + loadChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let requestArg = args[1] as! URLRequestWrapper + do { + try api.pigeonDelegate.load( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, request: requestArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + loadChannel.setMessageHandler(nil) } - } else { - loadChannel.setMessageHandler(nil) - } #endif #if !os(iOS) - let loadHtmlStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.loadHtmlString", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - loadHtmlStringChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let stringArg = args[1] as! String - let baseUrlArg: String? = nilOrValue(args[2]) - do { - try api.pigeonDelegate.loadHtmlString(pigeonApi: api, pigeonInstance: pigeonInstanceArg, string: stringArg, baseUrl: baseUrlArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let loadHtmlStringChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.loadHtmlString", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + loadHtmlStringChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let stringArg = args[1] as! String + let baseUrlArg: String? = nilOrValue(args[2]) + do { + try api.pigeonDelegate.loadHtmlString( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, string: stringArg, + baseUrl: baseUrlArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + loadHtmlStringChannel.setMessageHandler(nil) } - } else { - loadHtmlStringChannel.setMessageHandler(nil) - } #endif #if !os(iOS) - let loadFileUrlChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.loadFileUrl", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - loadFileUrlChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let urlArg = args[1] as! String - let readAccessUrlArg = args[2] as! String - do { - try api.pigeonDelegate.loadFileUrl(pigeonApi: api, pigeonInstance: pigeonInstanceArg, url: urlArg, readAccessUrl: readAccessUrlArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let loadFileUrlChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.loadFileUrl", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + loadFileUrlChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let urlArg = args[1] as! String + let readAccessUrlArg = args[2] as! String + do { + try api.pigeonDelegate.loadFileUrl( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, url: urlArg, + readAccessUrl: readAccessUrlArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + loadFileUrlChannel.setMessageHandler(nil) } - } else { - loadFileUrlChannel.setMessageHandler(nil) - } #endif #if !os(iOS) - let loadFlutterAssetChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.loadFlutterAsset", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - loadFlutterAssetChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let keyArg = args[1] as! String - do { - try api.pigeonDelegate.loadFlutterAsset(pigeonApi: api, pigeonInstance: pigeonInstanceArg, key: keyArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let loadFlutterAssetChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.loadFlutterAsset", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + loadFlutterAssetChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let keyArg = args[1] as! String + do { + try api.pigeonDelegate.loadFlutterAsset( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, key: keyArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + loadFlutterAssetChannel.setMessageHandler(nil) } - } else { - loadFlutterAssetChannel.setMessageHandler(nil) - } #endif #if !os(iOS) - let canGoBackChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.canGoBack", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - canGoBackChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - let result = try api.pigeonDelegate.canGoBack(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) + let canGoBackChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.canGoBack", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + canGoBackChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.canGoBack( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } } + } else { + canGoBackChannel.setMessageHandler(nil) } - } else { - canGoBackChannel.setMessageHandler(nil) - } #endif #if !os(iOS) - let canGoForwardChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.canGoForward", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - canGoForwardChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - let result = try api.pigeonDelegate.canGoForward(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) + let canGoForwardChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.canGoForward", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + canGoForwardChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.canGoForward( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } } + } else { + canGoForwardChannel.setMessageHandler(nil) } - } else { - canGoForwardChannel.setMessageHandler(nil) - } #endif #if !os(iOS) - let goBackChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.goBack", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - goBackChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - try api.pigeonDelegate.goBack(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let goBackChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.goBack", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + goBackChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + try api.pigeonDelegate.goBack(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + goBackChannel.setMessageHandler(nil) } - } else { - goBackChannel.setMessageHandler(nil) - } #endif #if !os(iOS) - let goForwardChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.goForward", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - goForwardChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - try api.pigeonDelegate.goForward(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let goForwardChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.goForward", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + goForwardChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + try api.pigeonDelegate.goForward(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + goForwardChannel.setMessageHandler(nil) } - } else { - goForwardChannel.setMessageHandler(nil) - } #endif #if !os(iOS) - let reloadChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.reload", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - reloadChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - try api.pigeonDelegate.reload(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let reloadChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.reload", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + reloadChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + try api.pigeonDelegate.reload(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + reloadChannel.setMessageHandler(nil) } - } else { - reloadChannel.setMessageHandler(nil) - } #endif #if !os(iOS) - let getTitleChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.getTitle", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - getTitleChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - let result = try api.pigeonDelegate.getTitle(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) + let getTitleChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.getTitle", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getTitleChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.getTitle( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } } + } else { + getTitleChannel.setMessageHandler(nil) } - } else { - getTitleChannel.setMessageHandler(nil) - } #endif #if !os(iOS) - let setAllowsBackForwardNavigationGesturesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setAllowsBackForwardNavigationGestures", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setAllowsBackForwardNavigationGesturesChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let allowArg = args[1] as! Bool - do { - try api.pigeonDelegate.setAllowsBackForwardNavigationGestures(pigeonApi: api, pigeonInstance: pigeonInstanceArg, allow: allowArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let setAllowsBackForwardNavigationGesturesChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setAllowsBackForwardNavigationGestures", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setAllowsBackForwardNavigationGesturesChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let allowArg = args[1] as! Bool + do { + try api.pigeonDelegate.setAllowsBackForwardNavigationGestures( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, allow: allowArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + setAllowsBackForwardNavigationGesturesChannel.setMessageHandler(nil) } - } else { - setAllowsBackForwardNavigationGesturesChannel.setMessageHandler(nil) - } #endif #if !os(iOS) - let setCustomUserAgentChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setCustomUserAgent", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setCustomUserAgentChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let userAgentArg: String? = nilOrValue(args[1]) - do { - try api.pigeonDelegate.setCustomUserAgent(pigeonApi: api, pigeonInstance: pigeonInstanceArg, userAgent: userAgentArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let setCustomUserAgentChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setCustomUserAgent", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setCustomUserAgentChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let userAgentArg: String? = nilOrValue(args[1]) + do { + try api.pigeonDelegate.setCustomUserAgent( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, userAgent: userAgentArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + setCustomUserAgentChannel.setMessageHandler(nil) } - } else { - setCustomUserAgentChannel.setMessageHandler(nil) - } #endif #if !os(iOS) - let evaluateJavaScriptChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.evaluateJavaScript", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - evaluateJavaScriptChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let javaScriptStringArg = args[1] as! String - api.pigeonDelegate.evaluateJavaScript(pigeonApi: api, pigeonInstance: pigeonInstanceArg, javaScriptString: javaScriptStringArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) + let evaluateJavaScriptChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.evaluateJavaScript", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + evaluateJavaScriptChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let javaScriptStringArg = args[1] as! String + api.pigeonDelegate.evaluateJavaScript( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, javaScriptString: javaScriptStringArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } } } + } else { + evaluateJavaScriptChannel.setMessageHandler(nil) } - } else { - evaluateJavaScriptChannel.setMessageHandler(nil) - } #endif #if !os(iOS) - let setInspectableChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setInspectable", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setInspectableChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let inspectableArg = args[1] as! Bool - do { - try api.pigeonDelegate.setInspectable(pigeonApi: api, pigeonInstance: pigeonInstanceArg, inspectable: inspectableArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let setInspectableChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setInspectable", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setInspectableChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let inspectableArg = args[1] as! Bool + do { + try api.pigeonDelegate.setInspectable( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, inspectable: inspectableArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + setInspectableChannel.setMessageHandler(nil) } - } else { - setInspectableChannel.setMessageHandler(nil) - } #endif #if !os(iOS) - let getCustomUserAgentChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.getCustomUserAgent", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - getCustomUserAgentChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - let result = try api.pigeonDelegate.getCustomUserAgent(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) + let getCustomUserAgentChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.getCustomUserAgent", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getCustomUserAgentChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.getCustomUserAgent( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } } + } else { + getCustomUserAgentChannel.setMessageHandler(nil) } - } else { - getCustomUserAgentChannel.setMessageHandler(nil) - } #endif } #if !os(iOS) - ///Creates a Dart instance of NSViewWKWebView 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: ""))) - } 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(())) + ///Creates a Dart instance of NSViewWKWebView 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: ""))) + } 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(())) + } } } } - } #endif } open class PigeonApiDelegateWKWebView { @@ -5055,7 +5921,7 @@ open class PigeonApiDelegateWKWebView { protocol PigeonApiProtocolWKWebView { } -final class PigeonApiWKWebView: PigeonApiProtocolWKWebView { +final class PigeonApiWKWebView: PigeonApiProtocolWKWebView { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKWebView ///An implementation of [NSObject] used to access callback methods @@ -5063,26 +5929,32 @@ final class PigeonApiWKWebView: PigeonApiProtocolWKWebView { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKWebView) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKWebView) + { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } ///Creates a Dart instance of WKWebView and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: WKWebView, completion: @escaping (Result) -> 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeonInstance as AnyObject) + } 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) + 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))) @@ -5106,19 +5978,35 @@ protocol PigeonApiDelegateWKUIDelegate { protocol PigeonApiProtocolWKUIDelegate { /// Creates a new web view. - func onCreateWebView(pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, configuration configurationArg: WKWebViewConfiguration, navigationAction navigationActionArg: WKNavigationAction, completion: @escaping (Result) -> Void) + func onCreateWebView( + pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, + configuration configurationArg: WKWebViewConfiguration, + navigationAction navigationActionArg: WKNavigationAction, + completion: @escaping (Result) -> Void) /// Determines whether a web resource, which the security origin object /// describes, can access to the device’s microphone audio and camera video. - func requestMediaCapturePermission(pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, origin originArg: WKSecurityOrigin, frame frameArg: WKFrameInfo, type typeArg: MediaCaptureType, completion: @escaping (Result) -> Void) + func requestMediaCapturePermission( + pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, + origin originArg: WKSecurityOrigin, frame frameArg: WKFrameInfo, type typeArg: MediaCaptureType, + completion: @escaping (Result) -> Void) /// Displays a JavaScript alert panel. - func runJavaScriptAlertPanel(pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, message messageArg: String, frame frameArg: WKFrameInfo, completion: @escaping (Result) -> Void) + func runJavaScriptAlertPanel( + pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, + message messageArg: String, frame frameArg: WKFrameInfo, + completion: @escaping (Result) -> Void) /// Displays a JavaScript confirm panel. - func runJavaScriptConfirmPanel(pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, message messageArg: String, frame frameArg: WKFrameInfo, completion: @escaping (Result) -> Void) + func runJavaScriptConfirmPanel( + pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, + message messageArg: String, frame frameArg: WKFrameInfo, + completion: @escaping (Result) -> Void) /// Displays a JavaScript text input panel. - func runJavaScriptTextInputPanel(pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, prompt promptArg: String, defaultText defaultTextArg: String?, frame frameArg: WKFrameInfo, completion: @escaping (Result) -> Void) + func runJavaScriptTextInputPanel( + pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, + prompt promptArg: String, defaultText defaultTextArg: String?, frame frameArg: WKFrameInfo, + completion: @escaping (Result) -> Void) } -final class PigeonApiWKUIDelegate: PigeonApiProtocolWKUIDelegate { +final class PigeonApiWKUIDelegate: PigeonApiProtocolWKUIDelegate { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKUIDelegate ///An implementation of [NSObject] used to access callback methods @@ -5126,25 +6014,32 @@ final class PigeonApiWKUIDelegate: PigeonApiProtocolWKUIDelegate { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKUIDelegate) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKUIDelegate + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKUIDelegate?) { + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKUIDelegate? + ) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.pigeon_defaultConstructor", binaryMessenger: binaryMessenger, codec: codec) + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.pigeon_defaultConstructor", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { pigeonDefaultConstructorChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonIdentifierArg = args[0] as! Int64 do { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( -try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), -withIdentifier: pigeonIdentifierArg) + try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), + withIdentifier: pigeonIdentifierArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -5156,25 +6051,34 @@ withIdentifier: pigeonIdentifierArg) } ///Creates a Dart instance of WKUIDelegate and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: WKUIDelegate, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: WKUIDelegate, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { + } 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: ""))) + message: + "Error: Attempting to create a new Dart instance of WKUIDelegate, but the class has a nonnull callback method.", + details: ""))) } } /// Creates a new web view. - func onCreateWebView(pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, configuration configurationArg: WKWebViewConfiguration, navigationAction navigationActionArg: WKNavigationAction, completion: @escaping (Result) -> Void) { + func onCreateWebView( + pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, + configuration configurationArg: WKWebViewConfiguration, + navigationAction navigationActionArg: WKNavigationAction, + completion: @escaping (Result) -> Void + ) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -5185,9 +6089,13 @@ withIdentifier: pigeonIdentifierArg) } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.onCreateWebView" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, webViewArg, configurationArg, navigationActionArg] as [Any?]) { response in + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.onCreateWebView" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage( + [pigeonInstanceArg, webViewArg, configurationArg, navigationActionArg] as [Any?] + ) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -5205,7 +6113,11 @@ withIdentifier: pigeonIdentifierArg) /// Determines whether a web resource, which the security origin object /// describes, can access to the device’s microphone audio and camera video. - func requestMediaCapturePermission(pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, origin originArg: WKSecurityOrigin, frame frameArg: WKFrameInfo, type typeArg: MediaCaptureType, completion: @escaping (Result) -> Void) { + func requestMediaCapturePermission( + pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, + origin originArg: WKSecurityOrigin, frame frameArg: WKFrameInfo, type typeArg: MediaCaptureType, + completion: @escaping (Result) -> Void + ) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -5216,9 +6128,12 @@ withIdentifier: pigeonIdentifierArg) } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.requestMediaCapturePermission" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, webViewArg, originArg, frameArg, typeArg] as [Any?]) { response in + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.requestMediaCapturePermission" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, webViewArg, originArg, frameArg, typeArg] as [Any?]) { + response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -5229,7 +6144,11 @@ withIdentifier: pigeonIdentifierArg) let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! PermissionDecision completion(.success(result)) @@ -5238,7 +6157,11 @@ withIdentifier: pigeonIdentifierArg) } /// Displays a JavaScript alert panel. - func runJavaScriptAlertPanel(pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, message messageArg: String, frame frameArg: WKFrameInfo, completion: @escaping (Result) -> Void) { + func runJavaScriptAlertPanel( + pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, + message messageArg: String, frame frameArg: WKFrameInfo, + completion: @escaping (Result) -> Void + ) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -5249,9 +6172,12 @@ withIdentifier: pigeonIdentifierArg) } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.runJavaScriptAlertPanel" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, webViewArg, messageArg, frameArg] as [Any?]) { response in + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.runJavaScriptAlertPanel" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, webViewArg, messageArg, frameArg] as [Any?]) { + response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -5268,7 +6194,11 @@ withIdentifier: pigeonIdentifierArg) } /// Displays a JavaScript confirm panel. - func runJavaScriptConfirmPanel(pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, message messageArg: String, frame frameArg: WKFrameInfo, completion: @escaping (Result) -> Void) { + func runJavaScriptConfirmPanel( + pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, + message messageArg: String, frame frameArg: WKFrameInfo, + completion: @escaping (Result) -> Void + ) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -5279,9 +6209,12 @@ withIdentifier: pigeonIdentifierArg) } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.runJavaScriptConfirmPanel" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, webViewArg, messageArg, frameArg] as [Any?]) { response in + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.runJavaScriptConfirmPanel" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, webViewArg, messageArg, frameArg] as [Any?]) { + response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -5292,7 +6225,11 @@ withIdentifier: pigeonIdentifierArg) let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! Bool completion(.success(result)) @@ -5301,7 +6238,11 @@ withIdentifier: pigeonIdentifierArg) } /// Displays a JavaScript text input panel. - func runJavaScriptTextInputPanel(pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, prompt promptArg: String, defaultText defaultTextArg: String?, frame frameArg: WKFrameInfo, completion: @escaping (Result) -> Void) { + func runJavaScriptTextInputPanel( + pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, + prompt promptArg: String, defaultText defaultTextArg: String?, frame frameArg: WKFrameInfo, + completion: @escaping (Result) -> Void + ) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -5312,9 +6253,13 @@ withIdentifier: pigeonIdentifierArg) } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.runJavaScriptTextInputPanel" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, webViewArg, promptArg, defaultTextArg, frameArg] as [Any?]) { response in + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.runJavaScriptTextInputPanel" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage( + [pigeonInstanceArg, webViewArg, promptArg, defaultTextArg, frameArg] as [Any?] + ) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -5335,13 +6280,15 @@ withIdentifier: pigeonIdentifierArg) protocol PigeonApiDelegateWKHTTPCookieStore { /// Sets a cookie policy that indicates whether the cookie store allows cookie /// storage. - func setCookie(pigeonApi: PigeonApiWKHTTPCookieStore, pigeonInstance: WKHTTPCookieStore, cookie: HTTPCookie, completion: @escaping (Result) -> Void) + func setCookie( + pigeonApi: PigeonApiWKHTTPCookieStore, pigeonInstance: WKHTTPCookieStore, cookie: HTTPCookie, + completion: @escaping (Result) -> Void) } protocol PigeonApiProtocolWKHTTPCookieStore { } -final class PigeonApiWKHTTPCookieStore: PigeonApiProtocolWKHTTPCookieStore { +final class PigeonApiWKHTTPCookieStore: PigeonApiProtocolWKHTTPCookieStore { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKHTTPCookieStore ///An implementation of [NSObject] used to access callback methods @@ -5349,23 +6296,33 @@ final class PigeonApiWKHTTPCookieStore: PigeonApiProtocolWKHTTPCookieStore { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKHTTPCookieStore) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateWKHTTPCookieStore + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKHTTPCookieStore?) { + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKHTTPCookieStore? + ) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let setCookieChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKHTTPCookieStore.setCookie", binaryMessenger: binaryMessenger, codec: codec) + let setCookieChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKHTTPCookieStore.setCookie", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { setCookieChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKHTTPCookieStore let cookieArg = args[1] as! HTTPCookie - api.pigeonDelegate.setCookie(pigeonApi: api, pigeonInstance: pigeonInstanceArg, cookie: cookieArg) { result in + api.pigeonDelegate.setCookie( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, cookie: cookieArg + ) { result in switch result { case .success: reply(wrapResult(nil)) @@ -5380,21 +6337,26 @@ final class PigeonApiWKHTTPCookieStore: PigeonApiProtocolWKHTTPCookieStore { } ///Creates a Dart instance of WKHTTPCookieStore and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: WKHTTPCookieStore, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: WKHTTPCookieStore, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeonInstance as AnyObject) + } 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) + 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))) @@ -5414,22 +6376,27 @@ final class PigeonApiWKHTTPCookieStore: PigeonApiProtocolWKHTTPCookieStore { } protocol PigeonApiDelegateUIScrollViewDelegate { #if !os(macOS) - func pigeonDefaultConstructor(pigeonApi: PigeonApiUIScrollViewDelegate) throws -> UIScrollViewDelegate + func pigeonDefaultConstructor(pigeonApi: PigeonApiUIScrollViewDelegate) throws + -> UIScrollViewDelegate #endif } protocol PigeonApiProtocolUIScrollViewDelegate { #if !os(macOS) - /// Tells the delegate when the user scrolls the content view within the - /// scroll view. - /// - /// Note that this is a convenient method that includes the `contentOffset` of - /// the `scrollView`. - func scrollViewDidScroll(pigeonInstance pigeonInstanceArg: UIScrollViewDelegate, scrollView scrollViewArg: UIScrollView, x xArg: Double, y yArg: Double, completion: @escaping (Result) -> Void) #endif + /// Tells the delegate when the user scrolls the content view within the + /// scroll view. + /// + /// Note that this is a convenient method that includes the `contentOffset` of + /// the `scrollView`. + func scrollViewDidScroll( + pigeonInstance pigeonInstanceArg: UIScrollViewDelegate, + scrollView scrollViewArg: UIScrollView, x xArg: Double, y yArg: Double, + completion: @escaping (Result) -> Void) + #endif } -final class PigeonApiUIScrollViewDelegate: PigeonApiProtocolUIScrollViewDelegate { +final class PigeonApiUIScrollViewDelegate: PigeonApiProtocolUIScrollViewDelegate { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateUIScrollViewDelegate ///An implementation of [NSObject] used to access callback methods @@ -5437,55 +6404,112 @@ final class PigeonApiUIScrollViewDelegate: PigeonApiProtocolUIScrollViewDelegate return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateUIScrollViewDelegate) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateUIScrollViewDelegate + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiUIScrollViewDelegate?) { + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiUIScrollViewDelegate? + ) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() #if !os(macOS) - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewDelegate.pigeon_defaultConstructor", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - pigeonDefaultConstructorChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonIdentifierArg = args[0] as! Int64 - do { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance( -try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), -withIdentifier: pigeonIdentifierArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewDelegate.pigeon_defaultConstructor", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + pigeonDefaultConstructorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonIdentifierArg = args[0] as! Int64 + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), + withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + pigeonDefaultConstructorChannel.setMessageHandler(nil) } - } else { - pigeonDefaultConstructorChannel.setMessageHandler(nil) - } #endif } #if !os(macOS) - ///Creates a Dart instance of UIScrollViewDelegate and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: UIScrollViewDelegate, 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) + ///Creates a Dart instance of UIScrollViewDelegate and attaches it to [pigeonInstance]. + func pigeonNewInstance( + pigeonInstance: UIScrollViewDelegate, + 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.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(())) + } + } + } + } + #endif + #if !os(macOS) + /// Tells the delegate when the user scrolls the content view within the + /// scroll view. + /// + /// Note that this is a convenient method that includes the `contentOffset` of + /// the `scrollView`. + func scrollViewDidScroll( + pigeonInstance pigeonInstanceArg: UIScrollViewDelegate, + scrollView scrollViewArg: UIScrollView, x xArg: Double, y yArg: Double, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + PigeonError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } 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 + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewDelegate.scrollViewDidScroll" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, scrollViewArg, xArg, yArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -5500,55 +6524,22 @@ withIdentifier: pigeonIdentifierArg) } } } - } - #endif - #if !os(macOS) - /// Tells the delegate when the user scrolls the content view within the - /// scroll view. - /// - /// Note that this is a convenient method that includes the `contentOffset` of - /// the `scrollView`. - func scrollViewDidScroll(pigeonInstance pigeonInstanceArg: UIScrollViewDelegate, scrollView scrollViewArg: UIScrollView, x xArg: Double, y yArg: Double, completion: @escaping (Result) -> Void) { - if pigeonRegistrar.ignoreCallsToDart { - completion( - .failure( - PigeonError( - code: "ignore-calls-error", - message: "Calls to Dart are being ignored.", details: ""))) - return - } - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewDelegate.scrollViewDidScroll" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, scrollViewArg, xArg, yArg] 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(())) - } - } - } #endif } protocol PigeonApiDelegateURLCredential { /// Creates a URL credential instance for internet password authentication /// with a given user name and password, using a given persistence setting. - func withUser(pigeonApi: PigeonApiURLCredential, user: String, password: String, persistence: UrlCredentialPersistence) throws -> URLCredential + func withUser( + pigeonApi: PigeonApiURLCredential, user: String, password: String, + persistence: UrlCredentialPersistence + ) throws -> URLCredential } protocol PigeonApiProtocolURLCredential { } -final class PigeonApiURLCredential: PigeonApiProtocolURLCredential { +final class PigeonApiURLCredential: PigeonApiProtocolURLCredential { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateURLCredential ///An implementation of [NSObject] used to access callback methods @@ -5556,17 +6547,24 @@ final class PigeonApiURLCredential: PigeonApiProtocolURLCredential { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateURLCredential) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateURLCredential + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiURLCredential?) { + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiURLCredential? + ) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let withUserChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLCredential.withUser", binaryMessenger: binaryMessenger, codec: codec) + let withUserChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLCredential.withUser", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { withUserChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -5576,8 +6574,9 @@ final class PigeonApiURLCredential: PigeonApiProtocolURLCredential { let persistenceArg = args[3] as! UrlCredentialPersistence do { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( -try api.pigeonDelegate.withUser(pigeonApi: api, user: userArg, password: passwordArg, persistence: persistenceArg), -withIdentifier: pigeonIdentifierArg) + try api.pigeonDelegate.withUser( + pigeonApi: api, user: userArg, password: passwordArg, persistence: persistenceArg), + withIdentifier: pigeonIdentifierArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -5589,21 +6588,26 @@ withIdentifier: pigeonIdentifierArg) } ///Creates a Dart instance of URLCredential and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: URLCredential, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: URLCredential, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeonInstance as AnyObject) + } 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) + 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))) @@ -5623,19 +6627,24 @@ withIdentifier: pigeonIdentifierArg) } protocol PigeonApiDelegateURLProtectionSpace { /// The receiver’s host. - func host(pigeonApi: PigeonApiURLProtectionSpace, pigeonInstance: URLProtectionSpace) throws -> String + func host(pigeonApi: PigeonApiURLProtectionSpace, pigeonInstance: URLProtectionSpace) throws + -> String /// The receiver’s port. - func port(pigeonApi: PigeonApiURLProtectionSpace, pigeonInstance: URLProtectionSpace) throws -> Int64 + func port(pigeonApi: PigeonApiURLProtectionSpace, pigeonInstance: URLProtectionSpace) throws + -> Int64 /// The receiver’s authentication realm. - func realm(pigeonApi: PigeonApiURLProtectionSpace, pigeonInstance: URLProtectionSpace) throws -> String? + func realm(pigeonApi: PigeonApiURLProtectionSpace, pigeonInstance: URLProtectionSpace) throws + -> String? /// The authentication method used by the receiver. - func authenticationMethod(pigeonApi: PigeonApiURLProtectionSpace, pigeonInstance: URLProtectionSpace) throws -> String? + func authenticationMethod( + pigeonApi: PigeonApiURLProtectionSpace, pigeonInstance: URLProtectionSpace + ) throws -> String? } protocol PigeonApiProtocolURLProtectionSpace { } -final class PigeonApiURLProtectionSpace: PigeonApiProtocolURLProtectionSpace { +final class PigeonApiURLProtectionSpace: PigeonApiProtocolURLProtectionSpace { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateURLProtectionSpace ///An implementation of [NSObject] used to access callback methods @@ -5643,31 +6652,42 @@ final class PigeonApiURLProtectionSpace: PigeonApiProtocolURLProtectionSpace { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateURLProtectionSpace) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateURLProtectionSpace + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } ///Creates a Dart instance of URLProtectionSpace and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: URLProtectionSpace, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: URLProtectionSpace, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeonInstance as AnyObject) + } 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 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 + 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 @@ -5686,13 +6706,15 @@ final class PigeonApiURLProtectionSpace: PigeonApiProtocolURLProtectionSpace { } protocol PigeonApiDelegateURLAuthenticationChallenge { /// The receiver’s protection space. - func getProtectionSpace(pigeonApi: PigeonApiURLAuthenticationChallenge, pigeonInstance: URLAuthenticationChallenge) throws -> URLProtectionSpace + func getProtectionSpace( + pigeonApi: PigeonApiURLAuthenticationChallenge, pigeonInstance: URLAuthenticationChallenge + ) throws -> URLProtectionSpace } protocol PigeonApiProtocolURLAuthenticationChallenge { } -final class PigeonApiURLAuthenticationChallenge: PigeonApiProtocolURLAuthenticationChallenge { +final class PigeonApiURLAuthenticationChallenge: PigeonApiProtocolURLAuthenticationChallenge { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateURLAuthenticationChallenge ///An implementation of [NSObject] used to access callback methods @@ -5700,23 +6722,33 @@ final class PigeonApiURLAuthenticationChallenge: PigeonApiProtocolURLAuthenticat return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateURLAuthenticationChallenge) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateURLAuthenticationChallenge + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiURLAuthenticationChallenge?) { + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiURLAuthenticationChallenge? + ) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let getProtectionSpaceChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLAuthenticationChallenge.getProtectionSpace", binaryMessenger: binaryMessenger, codec: codec) + let getProtectionSpaceChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.URLAuthenticationChallenge.getProtectionSpace", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { getProtectionSpaceChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! URLAuthenticationChallenge do { - let result = try api.pigeonDelegate.getProtectionSpace(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + let result = try api.pigeonDelegate.getProtectionSpace( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -5728,21 +6760,27 @@ final class PigeonApiURLAuthenticationChallenge: PigeonApiProtocolURLAuthenticat } ///Creates a Dart instance of URLAuthenticationChallenge and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: URLAuthenticationChallenge, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: URLAuthenticationChallenge, + 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeonInstance as AnyObject) + } 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) + 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))) @@ -5768,7 +6806,7 @@ protocol PigeonApiDelegateURL { protocol PigeonApiProtocolURL { } -final class PigeonApiURL: PigeonApiProtocolURL { +final class PigeonApiURL: PigeonApiProtocolURL { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateURL ///An implementation of [NSObject] used to access callback methods @@ -5784,15 +6822,19 @@ final class PigeonApiURL: PigeonApiProtocolURL { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let getAbsoluteStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.URL.getAbsoluteString", binaryMessenger: binaryMessenger, codec: codec) + let getAbsoluteStringChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.URL.getAbsoluteString", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { getAbsoluteStringChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! URL do { - let result = try api.pigeonDelegate.getAbsoluteString(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + let result = try api.pigeonDelegate.getAbsoluteString( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -5804,21 +6846,26 @@ final class PigeonApiURL: PigeonApiProtocolURL { } ///Creates a Dart instance of URL and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: URL, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: URL, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeonInstance as AnyObject) + } 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) + 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))) @@ -5840,13 +6887,15 @@ 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 + func setAllowsContentJavaScript( + pigeonApi: PigeonApiWKWebpagePreferences, pigeonInstance: WKWebpagePreferences, allow: Bool) + throws } protocol PigeonApiProtocolWKWebpagePreferences { } -final class PigeonApiWKWebpagePreferences: PigeonApiProtocolWKWebpagePreferences { +final class PigeonApiWKWebpagePreferences: PigeonApiProtocolWKWebpagePreferences { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKWebpagePreferences ///An implementation of [NSObject] used to access callback methods @@ -5854,25 +6903,35 @@ final class PigeonApiWKWebpagePreferences: PigeonApiProtocolWKWebpagePreferences return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKWebpagePreferences) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateWKWebpagePreferences + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKWebpagePreferences?) { + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKWebpagePreferences? + ) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) + 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) + 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) + try api.pigeonDelegate.setAllowsContentJavaScript( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, allow: allowArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -5881,16 +6940,21 @@ final class PigeonApiWKWebpagePreferences: PigeonApiProtocolWKWebpagePreferences } else { setAllowsContentJavaScriptChannel.setMessageHandler(nil) } - } else { + } else { let setAllowsContentJavaScriptChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebpagePreferences.setAllowsContentJavaScript", + 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 - ))) + 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) @@ -5900,21 +6964,26 @@ final class PigeonApiWKWebpagePreferences: PigeonApiProtocolWKWebpagePreferences ///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) { + 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeonInstance as AnyObject) + } 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) + 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))) 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 ddd96153026..e9e3e80e5da 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 @@ -8,7 +8,8 @@ import 'dart:async'; import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; -import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer, immutable, protected; +import 'package:flutter/foundation.dart' + show ReadBuffer, WriteBuffer, immutable, protected; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart' show WidgetsFlutterBinding; @@ -19,7 +20,8 @@ PlatformException _createConnectionError(String channelName) { ); } -List wrapResponse({Object? result, PlatformException? error, bool empty = false}) { +List wrapResponse( + {Object? result, PlatformException? error, bool empty = false}) { if (empty) { return []; } @@ -28,6 +30,7 @@ List wrapResponse({Object? result, PlatformException? error, bool empty } return [error.code, error.message, error.details]; } + /// An immutable object that serves as the base class for all ProxyApis and /// can provide functional copies of itself. /// @@ -110,9 +113,10 @@ class PigeonInstanceManager { // by calling instanceManager.getIdentifier() inside of `==` while this was a // HashMap). final Expando _identifiers = Expando(); - final Map> _weakInstances = - >{}; - final Map _strongInstances = {}; + final Map> + _weakInstances = >{}; + final Map _strongInstances = + {}; late final Finalizer _finalizer; int _nextIdentifier = 0; @@ -122,7 +126,8 @@ class PigeonInstanceManager { static PigeonInstanceManager _initInstance() { WidgetsFlutterBinding.ensureInitialized(); - final _PigeonInternalInstanceManagerApi api = _PigeonInternalInstanceManagerApi(); + final _PigeonInternalInstanceManagerApi api = + _PigeonInternalInstanceManagerApi(); // Clears the native `PigeonInstanceManager` on the initial use of the Dart one. api.clear(); final PigeonInstanceManager instanceManager = PigeonInstanceManager( @@ -130,39 +135,70 @@ class PigeonInstanceManager { api.removeStrongReference(identifier); }, ); - _PigeonInternalInstanceManagerApi.setUpMessageHandlers(instanceManager: instanceManager); - URLRequest.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - HTTPURLResponse.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - URLResponse.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WKUserScript.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WKNavigationAction.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WKNavigationResponse.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WKFrameInfo.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - NSError.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WKScriptMessage.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WKSecurityOrigin.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - HTTPCookie.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - AuthenticationChallengeResponse.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WKWebsiteDataStore.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + _PigeonInternalInstanceManagerApi.setUpMessageHandlers( + instanceManager: instanceManager); + URLRequest.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + HTTPURLResponse.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + URLResponse.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WKUserScript.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WKNavigationAction.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WKNavigationResponse.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WKFrameInfo.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + NSError.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WKScriptMessage.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WKSecurityOrigin.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + HTTPCookie.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + AuthenticationChallengeResponse.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WKWebsiteDataStore.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); UIView.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - UIScrollView.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WKWebViewConfiguration.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WKUserContentController.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WKPreferences.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WKScriptMessageHandler.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WKNavigationDelegate.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - NSObject.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - UIViewWKWebView.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - NSViewWKWebView.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WKWebView.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WKUIDelegate.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WKHTTPCookieStore.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - UIScrollViewDelegate.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - URLCredential.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - URLProtectionSpace.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - URLAuthenticationChallenge.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + UIScrollView.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WKWebViewConfiguration.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WKUserContentController.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WKPreferences.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WKScriptMessageHandler.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WKNavigationDelegate.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + NSObject.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + UIViewWKWebView.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + NSViewWKWebView.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WKWebView.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WKUIDelegate.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WKHTTPCookieStore.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + UIScrollViewDelegate.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + URLCredential.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + URLProtectionSpace.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + URLAuthenticationChallenge.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); URL.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WKWebpagePreferences.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + WKWebpagePreferences.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); return instanceManager; } @@ -226,15 +262,20 @@ class PigeonInstanceManager { /// /// This method also expects the host `InstanceManager` to have a strong /// reference to the instance the identifier is associated with. - T? getInstanceWithWeakReference(int identifier) { - final PigeonInternalProxyApiBaseClass? weakInstance = _weakInstances[identifier]?.target; + T? getInstanceWithWeakReference( + int identifier) { + final PigeonInternalProxyApiBaseClass? weakInstance = + _weakInstances[identifier]?.target; if (weakInstance == null) { - final PigeonInternalProxyApiBaseClass? strongInstance = _strongInstances[identifier]; + final PigeonInternalProxyApiBaseClass? strongInstance = + _strongInstances[identifier]; if (strongInstance != null) { - final PigeonInternalProxyApiBaseClass copy = strongInstance.pigeon_copy(); + final PigeonInternalProxyApiBaseClass copy = + strongInstance.pigeon_copy(); _identifiers[copy] = identifier; - _weakInstances[identifier] = WeakReference(copy); + _weakInstances[identifier] = + WeakReference(copy); _finalizer.attach(copy, identifier, detach: copy); return copy as T; } @@ -258,17 +299,20 @@ class PigeonInstanceManager { /// added. /// /// Returns unique identifier of the [instance] added. - void addHostCreatedInstance(PigeonInternalProxyApiBaseClass instance, int identifier) { + void addHostCreatedInstance( + PigeonInternalProxyApiBaseClass instance, int identifier) { _addInstanceWithIdentifier(instance, identifier); } - void _addInstanceWithIdentifier(PigeonInternalProxyApiBaseClass instance, int identifier) { + void _addInstanceWithIdentifier( + PigeonInternalProxyApiBaseClass instance, int identifier) { assert(!containsIdentifier(identifier)); assert(getIdentifier(instance) == null); assert(identifier >= 0); _identifiers[instance] = identifier; - _weakInstances[identifier] = WeakReference(instance); + _weakInstances[identifier] = + WeakReference(instance); _finalizer.attach(instance, identifier, detach: instance); final PigeonInternalProxyApiBaseClass copy = instance.pigeon_copy(); @@ -395,29 +439,29 @@ class _PigeonInternalInstanceManagerApi { } class _PigeonInternalProxyApiBaseCodec extends _PigeonCodec { - const _PigeonInternalProxyApiBaseCodec(this.instanceManager); - final PigeonInstanceManager instanceManager; - @override - void writeValue(WriteBuffer buffer, Object? value) { - if (value is PigeonInternalProxyApiBaseClass) { - buffer.putUint8(128); - writeValue(buffer, instanceManager.getIdentifier(value)); - } else { - super.writeValue(buffer, value); - } - } - @override - Object? readValueOfType(int type, ReadBuffer buffer) { - switch (type) { - case 128: - return instanceManager - .getInstanceWithWeakReference(readValue(buffer)! as int); - default: - return super.readValueOfType(type, buffer); - } - } -} + const _PigeonInternalProxyApiBaseCodec(this.instanceManager); + final PigeonInstanceManager instanceManager; + @override + void writeValue(WriteBuffer buffer, Object? value) { + if (value is PigeonInternalProxyApiBaseClass) { + buffer.putUint8(128); + writeValue(buffer, instanceManager.getIdentifier(value)); + } else { + super.writeValue(buffer, value); + } + } + @override + Object? readValueOfType(int type, ReadBuffer buffer) { + switch (type) { + case 128: + return instanceManager + .getInstanceWithWeakReference(readValue(buffer)! as int); + default: + return super.readValueOfType(type, buffer); + } + } +} /// The values that can be returned in a change dictionary. /// @@ -426,12 +470,15 @@ enum KeyValueObservingOptions { /// Indicates that the change dictionary should provide the new attribute /// value, if applicable. newValue, + /// Indicates that the change dictionary should contain the old attribute /// value, if applicable. oldValue, + /// If specified, a notification should be sent to the observer immediately, /// before the observer registration method even returns. initialValue, + /// Whether separate notifications should be sent to the observer before and /// after each change, instead of a single notification after the change. priorNotification, @@ -443,15 +490,19 @@ enum KeyValueObservingOptions { enum KeyValueChange { /// Indicates that the value of the observed key path was set to a new value. setting, + /// Indicates that an object has been inserted into the to-many relationship /// that is being observed. insertion, + /// Indicates that an object has been removed from the to-many relationship /// that is being observed. removal, + /// Indicates that an object has been replaced in the to-many relationship /// that is being observed. replacement, + /// The value is not recognized by the wrapper. unknown, } @@ -465,23 +516,28 @@ enum KeyValueChangeKey { /// `KeyValueChange.replacement`, the value of this key is a Set object that /// contains the indexes of the inserted, removed, or replaced objects. indexes, + /// An object that contains a value corresponding to one of the /// `KeyValueChange` enum, indicating what sort of change has occurred. kind, + /// If the value of the `KeyValueChange.kind` entry is /// `KeyValueChange.setting, and `KeyValueObservingOptions.newValue` was /// specified when the observer was registered, the value of this key is the /// new value for the attribute. newValue, + /// If the `KeyValueObservingOptions.priorNotification` option was specified /// when the observer was registered this notification is sent prior to a /// change. notificationIsPrior, + /// If the value of the `KeyValueChange.kind` entry is /// `KeyValueChange.setting`, and `KeyValueObservingOptions.old` was specified /// when the observer was registered, the value of this key is the value /// before the attribute was changed. oldValue, + /// The value is not recognized by the wrapper. unknown, } @@ -493,9 +549,11 @@ enum UserScriptInjectionTime { /// A constant to inject the script after the creation of the webpage’s /// document element, but before loading any other content. atDocumentStart, + /// A constant to inject the script after the document finishes loading, but /// before loading any other subresources. atDocumentEnd, + /// The value is not recognized by the wrapper. unknown, } @@ -506,10 +564,13 @@ enum UserScriptInjectionTime { enum AudiovisualMediaType { /// No media types require a user gesture to begin playing. none, + /// Media types that contain audio require a user gesture to begin playing. audio, + /// Media types that contain video require a user gesture to begin playing. video, + /// All media types require a user gesture to begin playing. all, } @@ -521,18 +582,25 @@ enum AudiovisualMediaType { enum WebsiteDataType { /// Cookies. cookies, + /// In-memory caches. memoryCache, + /// On-disk caches. diskCache, + /// HTML offline web app caches. offlineWebApplicationCache, + /// HTML local storage. localStorage, + /// HTML session storage. sessionStorage, + /// WebSQL databases. webSQLDatabases, + /// IndexedDB databases. indexedDBDatabases, } @@ -544,8 +612,10 @@ enum WebsiteDataType { enum NavigationActionPolicy { /// Allow the navigation to continue. allow, + /// Cancel the navigation. cancel, + /// Allow the download to proceed. download, } @@ -557,8 +627,10 @@ enum NavigationActionPolicy { enum NavigationResponsePolicy { /// Allow the navigation to continue. allow, + /// Cancel the navigation. cancel, + /// Allow the download to proceed. download, } @@ -569,37 +641,51 @@ enum NavigationResponsePolicy { enum HttpCookiePropertyKey { /// A String object containing the comment for the cookie. comment, + /// An Uri object or String object containing the comment URL for the cookie. commentUrl, + /// Aa String object stating whether the cookie should be discarded at the end /// of the session. discard, + /// An String object containing the domain for the cookie. domain, + /// An Date object or String object specifying the expiration date for the /// cookie. expires, + /// An String object containing an integer value stating how long in seconds /// the cookie should be kept, at most. maximumAge, + /// An String object containing the name of the cookie (required). name, + /// A URL or String object containing the URL that set this cookie. originUrl, + /// A String object containing the path for the cookie. path, + /// An String object containing comma-separated integer values specifying the /// ports for the cookie. port, + /// A string indicating the same-site policy for the cookie. sameSitePolicy, + /// A String object indicating that the cookie should be transmitted only over /// secure channels. secure, + /// A String object containing the value of the cookie. value, + /// A String object that specifies the version of the cookie. version, + /// The value is not recognized by the wrapper. unknown, } @@ -610,16 +696,22 @@ enum HttpCookiePropertyKey { enum NavigationType { /// A link activation. linkActivated, + /// A request to submit a form. formSubmitted, + /// A request for the frame’s next or previous item. backForward, + /// A request to reload the webpage. reload, + /// A request to resubmit a form. formResubmitted, + /// A navigation request that originates for some other reason. other, + /// The value is not recognized by the wrapper. unknown, } @@ -630,8 +722,10 @@ enum NavigationType { enum PermissionDecision { /// Deny permission for the requested resource. deny, + /// Deny permission for the requested resource. grant, + /// Prompt the user for permission for the requested resource. prompt, } @@ -642,10 +736,13 @@ enum PermissionDecision { enum MediaCaptureType { /// A media device that can capture video. camera, + /// A media device or devices that can capture audio and video. cameraAndMicrophone, + /// A media device that can capture audio. microphone, + /// The value is not recognized by the wrapper. unknown, } @@ -656,14 +753,18 @@ enum MediaCaptureType { enum UrlSessionAuthChallengeDisposition { /// Use the specified credential, which may be nil. useCredential, + /// Use the default handling for the challenge as though this delegate method /// were not implemented. performDefaultHandling, + /// Cancel the entire request. cancelAuthenticationChallenge, + /// Reject this challenge, and call the authentication delegate method again /// with the next authentication protection space. rejectProtectionSpace, + /// The value is not recognized by the wrapper. unknown, } @@ -674,17 +775,19 @@ enum UrlSessionAuthChallengeDisposition { enum UrlCredentialPersistence { /// The credential should not be stored. none, + /// The credential should be stored only for this session. forSession, + /// The credential should be stored in the keychain. permanent, + /// The credential should be stored permanently in the keychain, and in /// addition should be distributed to other devices based on the owning Apple /// ID. synchronizable, } - class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override @@ -692,46 +795,46 @@ class _PigeonCodec extends StandardMessageCodec { if (value is int) { buffer.putUint8(4); buffer.putInt64(value); - } else if (value is KeyValueObservingOptions) { + } else if (value is KeyValueObservingOptions) { buffer.putUint8(129); writeValue(buffer, value.index); - } else if (value is KeyValueChange) { + } else if (value is KeyValueChange) { buffer.putUint8(130); writeValue(buffer, value.index); - } else if (value is KeyValueChangeKey) { + } else if (value is KeyValueChangeKey) { buffer.putUint8(131); writeValue(buffer, value.index); - } else if (value is UserScriptInjectionTime) { + } else if (value is UserScriptInjectionTime) { buffer.putUint8(132); writeValue(buffer, value.index); - } else if (value is AudiovisualMediaType) { + } else if (value is AudiovisualMediaType) { buffer.putUint8(133); writeValue(buffer, value.index); - } else if (value is WebsiteDataType) { + } else if (value is WebsiteDataType) { buffer.putUint8(134); writeValue(buffer, value.index); - } else if (value is NavigationActionPolicy) { + } else if (value is NavigationActionPolicy) { buffer.putUint8(135); writeValue(buffer, value.index); - } else if (value is NavigationResponsePolicy) { + } else if (value is NavigationResponsePolicy) { buffer.putUint8(136); writeValue(buffer, value.index); - } else if (value is HttpCookiePropertyKey) { + } else if (value is HttpCookiePropertyKey) { buffer.putUint8(137); writeValue(buffer, value.index); - } else if (value is NavigationType) { + } else if (value is NavigationType) { buffer.putUint8(138); writeValue(buffer, value.index); - } else if (value is PermissionDecision) { + } else if (value is PermissionDecision) { buffer.putUint8(139); writeValue(buffer, value.index); - } else if (value is MediaCaptureType) { + } else if (value is MediaCaptureType) { buffer.putUint8(140); writeValue(buffer, value.index); - } else if (value is UrlSessionAuthChallengeDisposition) { + } else if (value is UrlSessionAuthChallengeDisposition) { buffer.putUint8(141); writeValue(buffer, value.index); - } else if (value is UrlCredentialPersistence) { + } else if (value is UrlCredentialPersistence) { buffer.putUint8(142); writeValue(buffer, value.index); } else { @@ -742,46 +845,48 @@ class _PigeonCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 129: + case 129: final int? value = readValue(buffer) as int?; return value == null ? null : KeyValueObservingOptions.values[value]; - case 130: + case 130: final int? value = readValue(buffer) as int?; return value == null ? null : KeyValueChange.values[value]; - case 131: + case 131: final int? value = readValue(buffer) as int?; return value == null ? null : KeyValueChangeKey.values[value]; - case 132: + case 132: final int? value = readValue(buffer) as int?; return value == null ? null : UserScriptInjectionTime.values[value]; - case 133: + case 133: final int? value = readValue(buffer) as int?; return value == null ? null : AudiovisualMediaType.values[value]; - case 134: + case 134: final int? value = readValue(buffer) as int?; return value == null ? null : WebsiteDataType.values[value]; - case 135: + case 135: final int? value = readValue(buffer) as int?; return value == null ? null : NavigationActionPolicy.values[value]; - case 136: + case 136: final int? value = readValue(buffer) as int?; return value == null ? null : NavigationResponsePolicy.values[value]; - case 137: + case 137: final int? value = readValue(buffer) as int?; return value == null ? null : HttpCookiePropertyKey.values[value]; - case 138: + case 138: final int? value = readValue(buffer) as int?; return value == null ? null : NavigationType.values[value]; - case 139: + case 139: final int? value = readValue(buffer) as int?; return value == null ? null : PermissionDecision.values[value]; - case 140: + case 140: final int? value = readValue(buffer) as int?; return value == null ? null : MediaCaptureType.values[value]; - case 141: + case 141: final int? value = readValue(buffer) as int?; - return value == null ? null : UrlSessionAuthChallengeDisposition.values[value]; - case 142: + return value == null + ? null + : UrlSessionAuthChallengeDisposition.values[value]; + case 142: final int? value = readValue(buffer) as int?; return value == null ? null : UrlCredentialPersistence.values[value]; default: @@ -789,6 +894,7 @@ class _PigeonCodec extends StandardMessageCodec { } } } + /// A URL load request that is independent of protocol or URL scheme. /// /// See https://developer.apple.com/documentation/foundation/urlrequest. @@ -7922,4 +8028,3 @@ class WKWebpagePreferences extends NSObject { ); } } - 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 016dba58184..71ce8d734a1 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,86 +36,86 @@ 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 _FakeWKNavigationDelegate_3 extends _i1.SmartFake implements _i2.WKNavigationDelegate { _FakeWKNavigationDelegate_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 _FakeWKScriptMessageHandler_5 extends _i1.SmartFake implements _i2.WKScriptMessageHandler { _FakeWKScriptMessageHandler_5(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWKWebView_6 extends _i1.SmartFake implements _i2.WKWebView { _FakeWKWebView_6(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWKWebViewConfiguration_7 extends _i1.SmartFake implements _i2.WKWebViewConfiguration { _FakeWKWebViewConfiguration_7(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeUIViewWKWebView_8 extends _i1.SmartFake implements _i2.UIViewWKWebView { _FakeUIViewWKWebView_8(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWKUserContentController_9 extends _i1.SmartFake implements _i2.WKUserContentController { _FakeWKUserContentController_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 _FakeWKHTTPCookieStore_12 extends _i1.SmartFake implements _i2.WKHTTPCookieStore { _FakeWKHTTPCookieStore_12(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWKUIDelegate_13 extends _i1.SmartFake implements _i2.WKUIDelegate { _FakeWKUIDelegate_13(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakePlatformWebView_14 extends _i1.SmartFake implements _i3.PlatformWebView { _FakePlatformWebView_14(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } /// A class which mocks [UIScrollView]. @@ -127,142 +127,117 @@ 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 _i4.Future setShowsVerticalScrollIndicator(bool? value) => (super.noSuchMethod( - Invocation.method(#setShowsVerticalScrollIndicator, [value]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#setShowsVerticalScrollIndicator, [value]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future setShowsHorizontalScrollIndicator(bool? value) => (super.noSuchMethod( - Invocation.method(#setShowsHorizontalScrollIndicator, [value]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#setShowsHorizontalScrollIndicator, [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( @@ -271,20 +246,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]. @@ -296,85 +269,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( @@ -383,20 +340,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]. @@ -413,92 +368,79 @@ 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> 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>.value([]), - ) - as _i4.Future> 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); + ) get didReceiveAuthenticationChallenge => (super.noSuchMethod( + Invocation.getter(#didReceiveAuthenticationChallenge), + returnValue: ( + _i2.WKNavigationDelegate pigeon_instance, + _i2.WKWebView webView, + _i2.URLAuthenticationChallenge challenge, + ) => + _i4.Future>.value([]), + ) as _i4.Future> 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); @override _i4.Future addObserver( @@ -507,20 +449,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]. @@ -532,35 +472,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_4( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WKPreferences); + _i2.WKPreferences pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKPreferences_4( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WKPreferences); @override _i4.Future addObserver( @@ -569,20 +503,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]. @@ -599,44 +531,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_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_5( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WKScriptMessageHandler); @override _i4.Future addObserver( @@ -645,20 +569,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]. @@ -670,26 +592,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_6( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WKWebView); + _i2.WKWebView pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKWebView_6( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WKWebView); @override _i4.Future addObserver( @@ -698,20 +616,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]. @@ -723,252 +639,204 @@ 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); + _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); + _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_7( - this, - Invocation.method(#pigeonVar_configuration, []), - ), - ) - as _i2.WKWebViewConfiguration); + _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.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_8( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.UIViewWKWebView); + _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); + _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( @@ -977,20 +845,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]. @@ -1003,138 +869,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_9( + this, Invocation.method(#getUserContentController, []), - returnValue: _i4.Future<_i2.WKUserContentController>.value( - _FakeWKUserContentController_9( - 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_10( + this, Invocation.method(#getWebsiteDataStore, []), - returnValue: _i4.Future<_i2.WKWebsiteDataStore>.value( - _FakeWKWebsiteDataStore_10( - 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_4( + this, Invocation.method(#getPreferences, []), - returnValue: _i4.Future<_i2.WKPreferences>.value( - _FakeWKPreferences_4( - 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_11( + this, Invocation.method(#getDefaultWebpagePreferences, []), - returnValue: _i4.Future<_i2.WKWebpagePreferences>.value( - _FakeWKWebpagePreferences_11( - 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_7( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WKWebViewConfiguration); + _i2.WKWebViewConfiguration pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKWebViewConfiguration_7( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WKWebViewConfiguration); @override _i4.Future addObserver( @@ -1143,20 +994,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]. @@ -1169,37 +1018,31 @@ class MockWKWebsiteDataStore extends _i1.Mock } @override - _i2.WKHTTPCookieStore get httpCookieStore => - (super.noSuchMethod( - Invocation.getter(#httpCookieStore), - returnValue: _FakeWKHTTPCookieStore_12( - this, - Invocation.getter(#httpCookieStore), - ), - ) - as _i2.WKHTTPCookieStore); + _i2.WKHTTPCookieStore get httpCookieStore => (super.noSuchMethod( + Invocation.getter(#httpCookieStore), + returnValue: _FakeWKHTTPCookieStore_12( + 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_12( - this, - Invocation.method(#pigeonVar_httpCookieStore, []), - ), - ) - as _i2.WKHTTPCookieStore); + _i2.WKHTTPCookieStore pigeonVar_httpCookieStore() => (super.noSuchMethod( + Invocation.method(#pigeonVar_httpCookieStore, []), + returnValue: _FakeWKHTTPCookieStore_12( + this, + Invocation.method(#pigeonVar_httpCookieStore, []), + ), + ) as _i2.WKHTTPCookieStore); @override _i4.Future removeDataOfTypes( @@ -1207,24 +1050,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_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, []), + ), + ) as _i2.WKWebsiteDataStore); @override _i4.Future addObserver( @@ -1233,20 +1073,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]. @@ -1264,28 +1102,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( @@ -1293,46 +1128,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_13( - 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_13( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WKUIDelegate); @override _i4.Future addObserver( @@ -1341,20 +1169,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]. @@ -1367,15 +1193,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( @@ -1383,58 +1207,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_9( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WKUserContentController); + _i2.WKUserContentController pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKUserContentController_9( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WKUserContentController); @override _i4.Future addObserver( @@ -1443,20 +1258,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]. @@ -1469,12 +1282,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) => @@ -1506,37 +1317,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]. @@ -1552,35 +1362,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_14( - 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_14( + 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({ @@ -1588,21 +1395,19 @@ class MockWebViewWidgetProxy extends _i1.Mock _i2.WKScriptMessageHandler, _i2.WKUserContentController, _i2.WKScriptMessage, - )? - didReceiveScriptMessage, + )? didReceiveScriptMessage, }) => (super.noSuchMethod( - Invocation.method(#createScriptMessageHandler, [], { - #didReceiveScriptMessage: didReceiveScriptMessage, - }), - returnValue: _FakeWKScriptMessageHandler_5( - this, - Invocation.method(#createScriptMessageHandler, [], { - #didReceiveScriptMessage: didReceiveScriptMessage, - }), - ), - ) - as _i2.WKScriptMessageHandler); + Invocation.method(#createScriptMessageHandler, [], { + #didReceiveScriptMessage: didReceiveScriptMessage, + }), + returnValue: _FakeWKScriptMessageHandler_5( + this, + Invocation.method(#createScriptMessageHandler, [], { + #didReceiveScriptMessage: didReceiveScriptMessage, + }), + ), + ) as _i2.WKScriptMessageHandler); @override _i2.WKUIDelegate createUIDelgate({ @@ -1611,86 +1416,77 @@ class MockWebViewWidgetProxy extends _i1.Mock _i2.WKWebView, _i2.WKWebViewConfiguration, _i2.WKNavigationAction, - )? - onCreateWebView, + )? onCreateWebView, }) => (super.noSuchMethod( - Invocation.method(#createUIDelgate, [], { - #onCreateWebView: onCreateWebView, - }), - returnValue: _FakeWKUIDelegate_13( - this, - Invocation.method(#createUIDelgate, [], { - #onCreateWebView: onCreateWebView, - }), - ), - ) - as _i2.WKUIDelegate); + Invocation.method(#createUIDelgate, [], { + #onCreateWebView: onCreateWebView, + }), + returnValue: _FakeWKUIDelegate_13( + 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> 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, [], { - #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_3( + 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]. @@ -1703,35 +1499,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_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, []), + ), + ) as _i2.WKWebpagePreferences); @override _i4.Future addObserver( @@ -1740,18 +1531,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 8fa65f231ef..5a95c3f7cb8 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,153 +113,128 @@ 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 _i3.Future setShowsVerticalScrollIndicator(bool? value) => (super.noSuchMethod( - Invocation.method(#setShowsVerticalScrollIndicator, [value]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#setShowsVerticalScrollIndicator, [value]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future setShowsHorizontalScrollIndicator(bool? value) => (super.noSuchMethod( - Invocation.method(#setShowsHorizontalScrollIndicator, [value]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#setShowsHorizontalScrollIndicator, [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( @@ -268,20 +243,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]. @@ -290,34 +263,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( @@ -326,20 +295,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]. @@ -347,50 +314,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( @@ -399,20 +360,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]. @@ -420,97 +379,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( @@ -519,20 +462,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]. @@ -540,43 +481,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( @@ -585,20 +520,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]. @@ -611,58 +544,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( @@ -671,20 +595,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]. @@ -693,19 +615,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( @@ -713,62 +633,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( @@ -777,20 +688,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]. @@ -798,68 +707,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( @@ -868,20 +766,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]. @@ -889,34 +785,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( @@ -925,20 +817,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]. @@ -947,172 +837,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( @@ -1121,20 +995,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]. @@ -1143,43 +1015,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( @@ -1188,20 +1055,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]. @@ -1209,283 +1074,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( @@ -1494,20 +1311,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]. @@ -1516,49 +1331,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( @@ -1566,29 +1375,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( @@ -1597,18 +1403,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 61de0ebc21be7063de7a260b4937e72c6bb7ce72 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Mon, 7 Apr 2025 23:44:06 -0400 Subject: [PATCH 13/29] suppress --- .../io/flutter/plugins/webviewflutter/AndroidWebkitLibrary.g.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/AndroidWebkitLibrary.g.kt b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/AndroidWebkitLibrary.g.kt index fae5fc19707..376b978dfa0 100644 --- a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/AndroidWebkitLibrary.g.kt +++ b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/AndroidWebkitLibrary.g.kt @@ -3,7 +3,7 @@ // found in the LICENSE file. // Autogenerated from Pigeon (v22.7.4), do not edit directly. // See also: https://pub.dev/packages/pigeon -@file:Suppress("UNCHECKED_CAST", "ArrayInDataClass") +@file:Suppress("UNCHECKED_CAST", "ArrayInDataClass", "SyntheticAccessor") package io.flutter.plugins.webviewflutter From 72f9feaeea5d0cc6f6e52b43b79b89f76118da05 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Tue, 8 Apr 2025 00:56:10 -0400 Subject: [PATCH 14/29] add destroy --- .../flutter/plugins/webviewflutter/AndroidWebkitLibrary.g.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/AndroidWebkitLibrary.g.kt b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/AndroidWebkitLibrary.g.kt index 376b978dfa0..a69f9d1219c 100644 --- a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/AndroidWebkitLibrary.g.kt +++ b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/AndroidWebkitLibrary.g.kt @@ -121,6 +121,10 @@ class AndroidWebkitLibraryPigeonInstanceManager( */ fun remove(identifier: Long): T? { logWarningIfFinalizationListenerHasStopped() + val instance: Any? = getInstance(identifier) + if (instance is WebViewProxyApi.WebViewPlatformView) { + instance.destroy() + } return strongInstances.remove(identifier) as T? } From ac414dedb76b2873268b531a34e49145300a92e7 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Sun, 20 Apr 2025 22:12:32 -0400 Subject: [PATCH 15/29] update generated code --- .../lib/src/android_webview_controller.dart | 2 +- ...ndroid_navigation_delegate_test.mocks.dart | 124 +- ...android_webview_controller_test.mocks.dart | 3882 +++++++------ ...oid_webview_cookie_manager_test.mocks.dart | 587 +- ...iew_android_cookie_manager_test.mocks.dart | 67 +- .../webview_android_widget_test.mocks.dart | 1223 ++-- .../WebKitLibrary.g.swift | 4970 +++++++---------- .../lib/src/common/web_kit.g.dart | 326 +- .../web_kit_cookie_manager_test.mocks.dart | 163 +- .../web_kit_webview_widget_test.mocks.dart | 1819 +++--- ...webkit_navigation_delegate_test.mocks.dart | 257 +- .../webkit_webview_controller_test.mocks.dart | 1964 ++++--- ...kit_webview_cookie_manager_test.mocks.dart | 163 +- .../webkit_webview_widget_test.mocks.dart | 361 +- 14 files changed, 7873 insertions(+), 8035 deletions(-) diff --git a/packages/webview_flutter/webview_flutter_android/lib/src/android_webview_controller.dart b/packages/webview_flutter/webview_flutter_android/lib/src/android_webview_controller.dart index 9e8659895c4..d1c04152887 100644 --- a/packages/webview_flutter/webview_flutter_android/lib/src/android_webview_controller.dart +++ b/packages/webview_flutter/webview_flutter_android/lib/src/android_webview_controller.dart @@ -740,7 +740,7 @@ class AndroidWebViewController extends PlatformWebViewController { Future setHorizontalScrollBarEnabled(bool enabled) => _webView.setHorizontalScrollBarEnabled(enabled); - @Override + @override Future setOverScrollMode(WebViewOverScrollMode mode) { return switch (mode) { WebViewOverScrollMode.always => _webView.setOverScrollMode( diff --git a/packages/webview_flutter/webview_flutter_android/test/android_navigation_delegate_test.mocks.dart b/packages/webview_flutter/webview_flutter_android/test/android_navigation_delegate_test.mocks.dart index 7d84c4694a1..52363b1bd59 100644 --- a/packages/webview_flutter/webview_flutter_android/test/android_navigation_delegate_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_android/test/android_navigation_delegate_test.mocks.dart @@ -25,19 +25,19 @@ import 'package:webview_flutter_android/src/android_webkit.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 _FakeHttpAuthHandler_1 extends _i1.SmartFake implements _i2.HttpAuthHandler { _FakeHttpAuthHandler_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeDownloadListener_2 extends _i1.SmartFake implements _i2.DownloadListener { _FakeDownloadListener_2(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } /// A class which mocks [HttpAuthHandler]. @@ -49,43 +49,52 @@ class MockHttpAuthHandler extends _i1.Mock implements _i2.HttpAuthHandler { } @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 useHttpAuthUsernamePassword() => (super.noSuchMethod( - Invocation.method(#useHttpAuthUsernamePassword, []), - returnValue: _i3.Future.value(false), - ) as _i3.Future); + _i3.Future useHttpAuthUsernamePassword() => + (super.noSuchMethod( + Invocation.method(#useHttpAuthUsernamePassword, []), + returnValue: _i3.Future.value(false), + ) + as _i3.Future); @override - _i3.Future cancel() => (super.noSuchMethod( - Invocation.method(#cancel, []), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + _i3.Future cancel() => + (super.noSuchMethod( + Invocation.method(#cancel, []), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override _i3.Future proceed(String? username, String? password) => (super.noSuchMethod( - Invocation.method(#proceed, [username, password]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#proceed, [username, password]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override - _i2.HttpAuthHandler pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeHttpAuthHandler_1( - this, - Invocation.method(#pigeon_copy, []), - ), - ) as _i2.HttpAuthHandler); + _i2.HttpAuthHandler pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeHttpAuthHandler_1( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.HttpAuthHandler); } /// A class which mocks [DownloadListener]. @@ -98,17 +107,20 @@ class MockDownloadListener extends _i1.Mock implements _i2.DownloadListener { @override void Function(_i2.DownloadListener, String, String, String, String, int) - get onDownloadStart => (super.noSuchMethod( + get onDownloadStart => + (super.noSuchMethod( Invocation.getter(#onDownloadStart), - returnValue: ( - _i2.DownloadListener pigeon_instance, - String url, - String userAgent, - String contentDisposition, - String mimetype, - int contentLength, - ) {}, - ) as void Function( + returnValue: + ( + _i2.DownloadListener pigeon_instance, + String url, + String userAgent, + String contentDisposition, + String mimetype, + int contentLength, + ) {}, + ) + as void Function( _i2.DownloadListener, String, String, @@ -118,20 +130,24 @@ class MockDownloadListener extends _i1.Mock implements _i2.DownloadListener { )); @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.DownloadListener pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeDownloadListener_2( - this, - Invocation.method(#pigeon_copy, []), - ), - ) as _i2.DownloadListener); + _i2.DownloadListener pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeDownloadListener_2( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.DownloadListener); } diff --git a/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.mocks.dart b/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.mocks.dart index 2d9de54dcf8..00b24c67bba 100644 --- a/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.mocks.dart @@ -38,18 +38,18 @@ import 'package:webview_flutter_platform_interface/webview_flutter_platform_inte class _FakeWebChromeClient_0 extends _i1.SmartFake implements _i2.WebChromeClient { _FakeWebChromeClient_0(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWebViewClient_1 extends _i1.SmartFake implements _i2.WebViewClient { _FakeWebViewClient_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeDownloadListener_2 extends _i1.SmartFake implements _i2.DownloadListener { _FakeDownloadListener_2(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakePlatformNavigationDelegateCreationParams_3 extends _i1.SmartFake @@ -70,62 +70,62 @@ class _FakePlatformWebViewControllerCreationParams_4 extends _i1.SmartFake class _FakeObject_5 extends _i1.SmartFake implements Object { _FakeObject_5(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeOffset_6 extends _i1.SmartFake implements _i4.Offset { _FakeOffset_6(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWebView_7 extends _i1.SmartFake implements _i2.WebView { _FakeWebView_7(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeJavaScriptChannel_8 extends _i1.SmartFake implements _i2.JavaScriptChannel { _FakeJavaScriptChannel_8(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeCookieManager_9 extends _i1.SmartFake implements _i2.CookieManager { _FakeCookieManager_9(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeFlutterAssetManager_10 extends _i1.SmartFake implements _i2.FlutterAssetManager { _FakeFlutterAssetManager_10(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWebStorage_11 extends _i1.SmartFake implements _i2.WebStorage { _FakeWebStorage_11(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakePigeonInstanceManager_12 extends _i1.SmartFake implements _i2.PigeonInstanceManager { _FakePigeonInstanceManager_12(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakePlatformViewsServiceProxy_13 extends _i1.SmartFake implements _i5.PlatformViewsServiceProxy { _FakePlatformViewsServiceProxy_13(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakePlatformWebViewController_14 extends _i1.SmartFake implements _i3.PlatformWebViewController { _FakePlatformWebViewController_14(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeSize_15 extends _i1.SmartFake implements _i4.Size { _FakeSize_15(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeGeolocationPermissionsCallback_16 extends _i1.SmartFake @@ -139,7 +139,7 @@ class _FakeGeolocationPermissionsCallback_16 extends _i1.SmartFake class _FakePermissionRequest_17 extends _i1.SmartFake implements _i2.PermissionRequest { _FakePermissionRequest_17(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeExpensiveAndroidViewController_18 extends _i1.SmartFake @@ -160,12 +160,12 @@ class _FakeSurfaceAndroidViewController_19 extends _i1.SmartFake class _FakeWebSettings_20 extends _i1.SmartFake implements _i2.WebSettings { _FakeWebSettings_20(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWebViewPoint_21 extends _i1.SmartFake implements _i2.WebViewPoint { _FakeWebViewPoint_21(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } /// A class which mocks [AndroidNavigationDelegate]. @@ -174,136 +174,152 @@ class _FakeWebViewPoint_21 extends _i1.SmartFake implements _i2.WebViewPoint { class MockAndroidNavigationDelegate extends _i1.Mock implements _i7.AndroidNavigationDelegate { @override - _i2.WebChromeClient get androidWebChromeClient => (super.noSuchMethod( - Invocation.getter(#androidWebChromeClient), - returnValue: _FakeWebChromeClient_0( - this, - Invocation.getter(#androidWebChromeClient), - ), - returnValueForMissingStub: _FakeWebChromeClient_0( - this, - Invocation.getter(#androidWebChromeClient), - ), - ) as _i2.WebChromeClient); - - @override - _i2.WebViewClient get androidWebViewClient => (super.noSuchMethod( - Invocation.getter(#androidWebViewClient), - returnValue: _FakeWebViewClient_1( - this, - Invocation.getter(#androidWebViewClient), - ), - returnValueForMissingStub: _FakeWebViewClient_1( - this, - Invocation.getter(#androidWebViewClient), - ), - ) as _i2.WebViewClient); - - @override - _i2.DownloadListener get androidDownloadListener => (super.noSuchMethod( - Invocation.getter(#androidDownloadListener), - returnValue: _FakeDownloadListener_2( - this, - Invocation.getter(#androidDownloadListener), - ), - returnValueForMissingStub: _FakeDownloadListener_2( - this, - Invocation.getter(#androidDownloadListener), - ), - ) as _i2.DownloadListener); + _i2.WebChromeClient get androidWebChromeClient => + (super.noSuchMethod( + Invocation.getter(#androidWebChromeClient), + returnValue: _FakeWebChromeClient_0( + this, + Invocation.getter(#androidWebChromeClient), + ), + returnValueForMissingStub: _FakeWebChromeClient_0( + this, + Invocation.getter(#androidWebChromeClient), + ), + ) + as _i2.WebChromeClient); + + @override + _i2.WebViewClient get androidWebViewClient => + (super.noSuchMethod( + Invocation.getter(#androidWebViewClient), + returnValue: _FakeWebViewClient_1( + this, + Invocation.getter(#androidWebViewClient), + ), + returnValueForMissingStub: _FakeWebViewClient_1( + this, + Invocation.getter(#androidWebViewClient), + ), + ) + as _i2.WebViewClient); + + @override + _i2.DownloadListener get androidDownloadListener => + (super.noSuchMethod( + Invocation.getter(#androidDownloadListener), + returnValue: _FakeDownloadListener_2( + this, + Invocation.getter(#androidDownloadListener), + ), + returnValueForMissingStub: _FakeDownloadListener_2( + this, + Invocation.getter(#androidDownloadListener), + ), + ) + as _i2.DownloadListener); @override _i3.PlatformNavigationDelegateCreationParams get params => (super.noSuchMethod( - Invocation.getter(#params), - returnValue: _FakePlatformNavigationDelegateCreationParams_3( - this, - Invocation.getter(#params), - ), - returnValueForMissingStub: - _FakePlatformNavigationDelegateCreationParams_3( - this, - Invocation.getter(#params), - ), - ) as _i3.PlatformNavigationDelegateCreationParams); + Invocation.getter(#params), + returnValue: _FakePlatformNavigationDelegateCreationParams_3( + this, + Invocation.getter(#params), + ), + returnValueForMissingStub: + _FakePlatformNavigationDelegateCreationParams_3( + this, + Invocation.getter(#params), + ), + ) + as _i3.PlatformNavigationDelegateCreationParams); @override _i8.Future setOnLoadRequest(_i7.LoadRequestCallback? onLoadRequest) => (super.noSuchMethod( - Invocation.method(#setOnLoadRequest, [onLoadRequest]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setOnLoadRequest, [onLoadRequest]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setOnNavigationRequest( _i3.NavigationRequestCallback? onNavigationRequest, ) => (super.noSuchMethod( - Invocation.method(#setOnNavigationRequest, [onNavigationRequest]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setOnNavigationRequest, [onNavigationRequest]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setOnPageStarted(_i3.PageEventCallback? onPageStarted) => (super.noSuchMethod( - Invocation.method(#setOnPageStarted, [onPageStarted]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setOnPageStarted, [onPageStarted]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setOnPageFinished(_i3.PageEventCallback? onPageFinished) => (super.noSuchMethod( - Invocation.method(#setOnPageFinished, [onPageFinished]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setOnPageFinished, [onPageFinished]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setOnHttpError(_i3.HttpResponseErrorCallback? onHttpError) => (super.noSuchMethod( - Invocation.method(#setOnHttpError, [onHttpError]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setOnHttpError, [onHttpError]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setOnProgress(_i3.ProgressCallback? onProgress) => (super.noSuchMethod( - Invocation.method(#setOnProgress, [onProgress]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setOnProgress, [onProgress]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setOnWebResourceError( _i3.WebResourceErrorCallback? onWebResourceError, ) => (super.noSuchMethod( - Invocation.method(#setOnWebResourceError, [onWebResourceError]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setOnWebResourceError, [onWebResourceError]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setOnUrlChange(_i3.UrlChangeCallback? onUrlChange) => (super.noSuchMethod( - Invocation.method(#setOnUrlChange, [onUrlChange]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setOnUrlChange, [onUrlChange]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setOnHttpAuthRequest( _i3.HttpAuthRequestCallback? onHttpAuthRequest, ) => (super.noSuchMethod( - Invocation.method(#setOnHttpAuthRequest, [onHttpAuthRequest]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setOnHttpAuthRequest, [onHttpAuthRequest]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); } /// A class which mocks [AndroidWebViewController]. @@ -312,298 +328,357 @@ class MockAndroidNavigationDelegate extends _i1.Mock class MockAndroidWebViewController extends _i1.Mock implements _i7.AndroidWebViewController { @override - int get webViewIdentifier => (super.noSuchMethod( - Invocation.getter(#webViewIdentifier), - returnValue: 0, - returnValueForMissingStub: 0, - ) as int); + int get webViewIdentifier => + (super.noSuchMethod( + Invocation.getter(#webViewIdentifier), + returnValue: 0, + returnValueForMissingStub: 0, + ) + as int); @override - _i3.PlatformWebViewControllerCreationParams get params => (super.noSuchMethod( - Invocation.getter(#params), - returnValue: _FakePlatformWebViewControllerCreationParams_4( - this, - Invocation.getter(#params), - ), - returnValueForMissingStub: - _FakePlatformWebViewControllerCreationParams_4( - this, - Invocation.getter(#params), - ), - ) as _i3.PlatformWebViewControllerCreationParams); + _i3.PlatformWebViewControllerCreationParams get params => + (super.noSuchMethod( + Invocation.getter(#params), + returnValue: _FakePlatformWebViewControllerCreationParams_4( + this, + Invocation.getter(#params), + ), + returnValueForMissingStub: + _FakePlatformWebViewControllerCreationParams_4( + this, + Invocation.getter(#params), + ), + ) + as _i3.PlatformWebViewControllerCreationParams); @override - _i8.Future setAllowFileAccess(bool? allow) => (super.noSuchMethod( - Invocation.method(#setAllowFileAccess, [allow]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future setAllowFileAccess(bool? allow) => + (super.noSuchMethod( + Invocation.method(#setAllowFileAccess, [allow]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future loadFile(String? absoluteFilePath) => (super.noSuchMethod( - Invocation.method(#loadFile, [absoluteFilePath]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future loadFile(String? absoluteFilePath) => + (super.noSuchMethod( + Invocation.method(#loadFile, [absoluteFilePath]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future loadFlutterAsset(String? key) => (super.noSuchMethod( - Invocation.method(#loadFlutterAsset, [key]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future loadFlutterAsset(String? key) => + (super.noSuchMethod( + Invocation.method(#loadFlutterAsset, [key]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future loadHtmlString(String? html, {String? baseUrl}) => (super.noSuchMethod( - Invocation.method(#loadHtmlString, [html], {#baseUrl: baseUrl}), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#loadHtmlString, [html], {#baseUrl: baseUrl}), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future loadRequest(_i3.LoadRequestParams? params) => (super.noSuchMethod( - Invocation.method(#loadRequest, [params]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#loadRequest, [params]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future currentUrl() => (super.noSuchMethod( - Invocation.method(#currentUrl, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future currentUrl() => + (super.noSuchMethod( + Invocation.method(#currentUrl, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future canGoBack() => (super.noSuchMethod( - Invocation.method(#canGoBack, []), - returnValue: _i8.Future.value(false), - returnValueForMissingStub: _i8.Future.value(false), - ) as _i8.Future); + _i8.Future canGoBack() => + (super.noSuchMethod( + Invocation.method(#canGoBack, []), + returnValue: _i8.Future.value(false), + returnValueForMissingStub: _i8.Future.value(false), + ) + as _i8.Future); @override - _i8.Future canGoForward() => (super.noSuchMethod( - Invocation.method(#canGoForward, []), - returnValue: _i8.Future.value(false), - returnValueForMissingStub: _i8.Future.value(false), - ) as _i8.Future); + _i8.Future canGoForward() => + (super.noSuchMethod( + Invocation.method(#canGoForward, []), + returnValue: _i8.Future.value(false), + returnValueForMissingStub: _i8.Future.value(false), + ) + as _i8.Future); @override - _i8.Future goBack() => (super.noSuchMethod( - Invocation.method(#goBack, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future goBack() => + (super.noSuchMethod( + Invocation.method(#goBack, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future goForward() => (super.noSuchMethod( - Invocation.method(#goForward, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future goForward() => + (super.noSuchMethod( + Invocation.method(#goForward, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future reload() => (super.noSuchMethod( - Invocation.method(#reload, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future reload() => + (super.noSuchMethod( + Invocation.method(#reload, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future clearCache() => (super.noSuchMethod( - Invocation.method(#clearCache, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future clearCache() => + (super.noSuchMethod( + Invocation.method(#clearCache, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future clearLocalStorage() => (super.noSuchMethod( - Invocation.method(#clearLocalStorage, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future clearLocalStorage() => + (super.noSuchMethod( + Invocation.method(#clearLocalStorage, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setPlatformNavigationDelegate( _i3.PlatformNavigationDelegate? handler, ) => (super.noSuchMethod( - Invocation.method(#setPlatformNavigationDelegate, [handler]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setPlatformNavigationDelegate, [handler]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future runJavaScript(String? javaScript) => (super.noSuchMethod( - Invocation.method(#runJavaScript, [javaScript]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future runJavaScript(String? javaScript) => + (super.noSuchMethod( + Invocation.method(#runJavaScript, [javaScript]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future runJavaScriptReturningResult(String? javaScript) => (super.noSuchMethod( - Invocation.method(#runJavaScriptReturningResult, [javaScript]), - returnValue: _i8.Future.value( - _FakeObject_5( - this, - Invocation.method(#runJavaScriptReturningResult, [javaScript]), - ), - ), - returnValueForMissingStub: _i8.Future.value( - _FakeObject_5( - this, Invocation.method(#runJavaScriptReturningResult, [javaScript]), - ), - ), - ) as _i8.Future); + returnValue: _i8.Future.value( + _FakeObject_5( + this, + Invocation.method(#runJavaScriptReturningResult, [javaScript]), + ), + ), + returnValueForMissingStub: _i8.Future.value( + _FakeObject_5( + this, + Invocation.method(#runJavaScriptReturningResult, [javaScript]), + ), + ), + ) + as _i8.Future); @override _i8.Future addJavaScriptChannel( _i3.JavaScriptChannelParams? javaScriptChannelParams, ) => (super.noSuchMethod( - Invocation.method(#addJavaScriptChannel, [javaScriptChannelParams]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#addJavaScriptChannel, [javaScriptChannelParams]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future removeJavaScriptChannel(String? javaScriptChannelName) => (super.noSuchMethod( - Invocation.method(#removeJavaScriptChannel, [ - javaScriptChannelName, - ]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#removeJavaScriptChannel, [ + javaScriptChannelName, + ]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future getTitle() => (super.noSuchMethod( - Invocation.method(#getTitle, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future getTitle() => + (super.noSuchMethod( + Invocation.method(#getTitle, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future scrollTo(int? x, int? y) => (super.noSuchMethod( - Invocation.method(#scrollTo, [x, y]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future scrollTo(int? x, int? y) => + (super.noSuchMethod( + Invocation.method(#scrollTo, [x, y]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future scrollBy(int? x, int? y) => (super.noSuchMethod( - Invocation.method(#scrollBy, [x, y]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future scrollBy(int? x, int? y) => + (super.noSuchMethod( + Invocation.method(#scrollBy, [x, y]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future<_i4.Offset> getScrollPosition() => (super.noSuchMethod( - Invocation.method(#getScrollPosition, []), - returnValue: _i8.Future<_i4.Offset>.value( - _FakeOffset_6(this, Invocation.method(#getScrollPosition, [])), - ), - returnValueForMissingStub: _i8.Future<_i4.Offset>.value( - _FakeOffset_6(this, Invocation.method(#getScrollPosition, [])), - ), - ) as _i8.Future<_i4.Offset>); + _i8.Future<_i4.Offset> getScrollPosition() => + (super.noSuchMethod( + Invocation.method(#getScrollPosition, []), + returnValue: _i8.Future<_i4.Offset>.value( + _FakeOffset_6(this, Invocation.method(#getScrollPosition, [])), + ), + returnValueForMissingStub: _i8.Future<_i4.Offset>.value( + _FakeOffset_6(this, Invocation.method(#getScrollPosition, [])), + ), + ) + as _i8.Future<_i4.Offset>); @override - _i8.Future enableZoom(bool? enabled) => (super.noSuchMethod( - Invocation.method(#enableZoom, [enabled]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future enableZoom(bool? enabled) => + (super.noSuchMethod( + Invocation.method(#enableZoom, [enabled]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future setBackgroundColor(_i4.Color? color) => (super.noSuchMethod( - Invocation.method(#setBackgroundColor, [color]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future setBackgroundColor(_i4.Color? color) => + (super.noSuchMethod( + Invocation.method(#setBackgroundColor, [color]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setJavaScriptMode(_i3.JavaScriptMode? javaScriptMode) => (super.noSuchMethod( - Invocation.method(#setJavaScriptMode, [javaScriptMode]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setJavaScriptMode, [javaScriptMode]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future setUserAgent(String? userAgent) => (super.noSuchMethod( - Invocation.method(#setUserAgent, [userAgent]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future setUserAgent(String? userAgent) => + (super.noSuchMethod( + Invocation.method(#setUserAgent, [userAgent]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setOnScrollPositionChange( void Function(_i3.ScrollPositionChange)? onScrollPositionChange, ) => (super.noSuchMethod( - Invocation.method(#setOnScrollPositionChange, [ - onScrollPositionChange, - ]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setOnScrollPositionChange, [ + onScrollPositionChange, + ]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setMediaPlaybackRequiresUserGesture(bool? require) => (super.noSuchMethod( - Invocation.method(#setMediaPlaybackRequiresUserGesture, [require]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setMediaPlaybackRequiresUserGesture, [require]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future setTextZoom(int? textZoom) => (super.noSuchMethod( - Invocation.method(#setTextZoom, [textZoom]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future setTextZoom(int? textZoom) => + (super.noSuchMethod( + Invocation.method(#setTextZoom, [textZoom]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future setAllowContentAccess(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setAllowContentAccess, [enabled]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future setAllowContentAccess(bool? enabled) => + (super.noSuchMethod( + Invocation.method(#setAllowContentAccess, [enabled]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future setGeolocationEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setGeolocationEnabled, [enabled]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future setGeolocationEnabled(bool? enabled) => + (super.noSuchMethod( + Invocation.method(#setGeolocationEnabled, [enabled]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setOnShowFileSelector( _i8.Future> Function(_i7.FileSelectorParams)? - onShowFileSelector, + onShowFileSelector, ) => (super.noSuchMethod( - Invocation.method(#setOnShowFileSelector, [onShowFileSelector]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setOnShowFileSelector, [onShowFileSelector]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setOnPlatformPermissionRequest( void Function(_i3.PlatformWebViewPermissionRequest)? onPermissionRequest, ) => (super.noSuchMethod( - Invocation.method(#setOnPlatformPermissionRequest, [ - onPermissionRequest, - ]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setOnPlatformPermissionRequest, [ + onPermissionRequest, + ]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setGeolocationPermissionsPromptCallbacks({ @@ -611,13 +686,14 @@ class MockAndroidWebViewController extends _i1.Mock _i7.OnGeolocationPermissionsHidePrompt? onHidePrompt, }) => (super.noSuchMethod( - Invocation.method(#setGeolocationPermissionsPromptCallbacks, [], { - #onShowPrompt: onShowPrompt, - #onHidePrompt: onHidePrompt, - }), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setGeolocationPermissionsPromptCallbacks, [], { + #onShowPrompt: onShowPrompt, + #onHidePrompt: onHidePrompt, + }), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setCustomWidgetCallbacks({ @@ -625,91 +701,103 @@ class MockAndroidWebViewController extends _i1.Mock required _i7.OnHideCustomWidgetCallback? onHideCustomWidget, }) => (super.noSuchMethod( - Invocation.method(#setCustomWidgetCallbacks, [], { - #onShowCustomWidget: onShowCustomWidget, - #onHideCustomWidget: onHideCustomWidget, - }), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setCustomWidgetCallbacks, [], { + #onShowCustomWidget: onShowCustomWidget, + #onHideCustomWidget: onHideCustomWidget, + }), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setOnConsoleMessage( void Function(_i3.JavaScriptConsoleMessage)? onConsoleMessage, ) => (super.noSuchMethod( - Invocation.method(#setOnConsoleMessage, [onConsoleMessage]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setOnConsoleMessage, [onConsoleMessage]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future getUserAgent() => (super.noSuchMethod( - Invocation.method(#getUserAgent, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future getUserAgent() => + (super.noSuchMethod( + Invocation.method(#getUserAgent, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setOnJavaScriptAlertDialog( _i8.Future Function(_i3.JavaScriptAlertDialogRequest)? - onJavaScriptAlertDialog, + onJavaScriptAlertDialog, ) => (super.noSuchMethod( - Invocation.method(#setOnJavaScriptAlertDialog, [ - onJavaScriptAlertDialog, - ]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setOnJavaScriptAlertDialog, [ + onJavaScriptAlertDialog, + ]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setOnJavaScriptConfirmDialog( _i8.Future Function(_i3.JavaScriptConfirmDialogRequest)? - onJavaScriptConfirmDialog, + onJavaScriptConfirmDialog, ) => (super.noSuchMethod( - Invocation.method(#setOnJavaScriptConfirmDialog, [ - onJavaScriptConfirmDialog, - ]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setOnJavaScriptConfirmDialog, [ + onJavaScriptConfirmDialog, + ]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setOnJavaScriptTextInputDialog( _i8.Future Function(_i3.JavaScriptTextInputDialogRequest)? - onJavaScriptTextInputDialog, + onJavaScriptTextInputDialog, ) => (super.noSuchMethod( - Invocation.method(#setOnJavaScriptTextInputDialog, [ - onJavaScriptTextInputDialog, - ]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setOnJavaScriptTextInputDialog, [ + onJavaScriptTextInputDialog, + ]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override -<<<<<<< HEAD _i8.Future setVerticalScrollBarEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setVerticalScrollBarEnabled, [enabled]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setVerticalScrollBarEnabled, [enabled]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setHorizontalScrollBarEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setHorizontalScrollBarEnabled, [enabled]), -======= + Invocation.method(#setHorizontalScrollBarEnabled, [enabled]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override _i8.Future setOverScrollMode(_i3.WebViewOverScrollMode? mode) => (super.noSuchMethod( - Invocation.method(#setOverScrollMode, [mode]), ->>>>>>> bfb42a62a56ee53010e7c2601cbf1bac993122f2 - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setOverScrollMode, [mode]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); } /// A class which mocks [AndroidWebViewProxy]. @@ -720,359 +808,386 @@ class MockAndroidWebViewProxy extends _i1.Mock @override _i2.WebView Function({ void Function(_i2.WebView, int, int, int, int)? onScrollChanged, - }) get newWebView => (super.noSuchMethod( - Invocation.getter(#newWebView), - returnValue: ({ - void Function(_i2.WebView, int, int, int, int)? onScrollChanged, - }) => - _FakeWebView_7(this, Invocation.getter(#newWebView)), - returnValueForMissingStub: ({ - void Function(_i2.WebView, int, int, int, int)? onScrollChanged, - }) => - _FakeWebView_7(this, Invocation.getter(#newWebView)), - ) as _i2.WebView Function({ - void Function(_i2.WebView, int, int, int, int)? onScrollChanged, - })); + }) + get newWebView => + (super.noSuchMethod( + Invocation.getter(#newWebView), + returnValue: + ({ + void Function(_i2.WebView, int, int, int, int)? + onScrollChanged, + }) => _FakeWebView_7(this, Invocation.getter(#newWebView)), + returnValueForMissingStub: + ({ + void Function(_i2.WebView, int, int, int, int)? + onScrollChanged, + }) => _FakeWebView_7(this, Invocation.getter(#newWebView)), + ) + as _i2.WebView Function({ + void Function(_i2.WebView, int, int, int, int)? onScrollChanged, + })); @override _i2.JavaScriptChannel Function({ required String channelName, required void Function(_i2.JavaScriptChannel, String) postMessage, - }) get newJavaScriptChannel => (super.noSuchMethod( - Invocation.getter(#newJavaScriptChannel), - returnValue: ({ - required String channelName, - required void Function(_i2.JavaScriptChannel, String) postMessage, - }) => - _FakeJavaScriptChannel_8( - this, - Invocation.getter(#newJavaScriptChannel), - ), - returnValueForMissingStub: ({ - required String channelName, - required void Function(_i2.JavaScriptChannel, String) postMessage, - }) => - _FakeJavaScriptChannel_8( - this, - Invocation.getter(#newJavaScriptChannel), - ), - ) as _i2.JavaScriptChannel Function({ - required String channelName, - required void Function(_i2.JavaScriptChannel, String) postMessage, - })); + }) + get newJavaScriptChannel => + (super.noSuchMethod( + Invocation.getter(#newJavaScriptChannel), + returnValue: + ({ + required String channelName, + required void Function(_i2.JavaScriptChannel, String) + postMessage, + }) => _FakeJavaScriptChannel_8( + this, + Invocation.getter(#newJavaScriptChannel), + ), + returnValueForMissingStub: + ({ + required String channelName, + required void Function(_i2.JavaScriptChannel, String) + postMessage, + }) => _FakeJavaScriptChannel_8( + this, + Invocation.getter(#newJavaScriptChannel), + ), + ) + as _i2.JavaScriptChannel Function({ + required String channelName, + required void Function(_i2.JavaScriptChannel, String) postMessage, + })); @override _i2.WebViewClient Function({ void Function(_i2.WebViewClient, _i2.WebView, String, bool)? - doUpdateVisitedHistory, -<<<<<<< HEAD - void Function(_i2.WebViewClient, _i2.WebView, String)? onPageFinished, - void Function(_i2.WebViewClient, _i2.WebView, String)? onPageStarted, -======= + doUpdateVisitedHistory, void Function( _i2.WebViewClient, _i2.WebView, _i2.AndroidMessage, _i2.AndroidMessage, - )? onFormResubmission, + )? + onFormResubmission, void Function(_i2.WebViewClient, _i2.WebView, String)? onLoadResource, void Function(_i2.WebViewClient, _i2.WebView, String)? onPageCommitVisible, void Function(_i2.WebViewClient, _i2.WebView, String)? onPageFinished, void Function(_i2.WebViewClient, _i2.WebView, String)? onPageStarted, void Function(_i2.WebViewClient, _i2.WebView, _i2.ClientCertRequest)? - onReceivedClientCertRequest, ->>>>>>> bfb42a62a56ee53010e7c2601cbf1bac993122f2 + onReceivedClientCertRequest, void Function(_i2.WebViewClient, _i2.WebView, int, String, String)? - onReceivedError, + onReceivedError, void Function( _i2.WebViewClient, _i2.WebView, _i2.HttpAuthHandler, String, String, - )? onReceivedHttpAuthRequest, + )? + onReceivedHttpAuthRequest, void Function( _i2.WebViewClient, _i2.WebView, _i2.WebResourceRequest, _i2.WebResourceResponse, - )? onReceivedHttpError, + )? + onReceivedHttpError, void Function(_i2.WebViewClient, _i2.WebView, String, String?, String)? - onReceivedLoginRequest, + onReceivedLoginRequest, void Function( _i2.WebViewClient, _i2.WebView, _i2.WebResourceRequest, _i2.WebResourceError, - )? onReceivedRequestError, + )? + onReceivedRequestError, void Function( _i2.WebViewClient, _i2.WebView, _i2.WebResourceRequest, _i2.WebResourceErrorCompat, - )? onReceivedRequestErrorCompat, -<<<<<<< HEAD -======= + )? + onReceivedRequestErrorCompat, void Function( _i2.WebViewClient, _i2.WebView, _i2.SslErrorHandler, _i2.SslError, - )? onReceivedSslError, + )? + onReceivedSslError, void Function(_i2.WebViewClient, _i2.WebView, double, double)? - onScaleChanged, ->>>>>>> bfb42a62a56ee53010e7c2601cbf1bac993122f2 + onScaleChanged, void Function(_i2.WebViewClient, _i2.WebView, _i2.WebResourceRequest)? - requestLoading, + requestLoading, void Function(_i2.WebViewClient, _i2.WebView, String)? urlLoading, - }) get newWebViewClient => (super.noSuchMethod( - Invocation.getter(#newWebViewClient), - returnValue: ({ - void Function(_i2.WebViewClient, _i2.WebView, String, bool)? - doUpdateVisitedHistory, -<<<<<<< HEAD - void Function(_i2.WebViewClient, _i2.WebView, String)? onPageFinished, - void Function(_i2.WebViewClient, _i2.WebView, String)? onPageStarted, -======= - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.AndroidMessage, - _i2.AndroidMessage, - )? onFormResubmission, - void Function(_i2.WebViewClient, _i2.WebView, String)? onLoadResource, - void Function(_i2.WebViewClient, _i2.WebView, String)? - onPageCommitVisible, - void Function(_i2.WebViewClient, _i2.WebView, String)? onPageFinished, - void Function(_i2.WebViewClient, _i2.WebView, String)? onPageStarted, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.ClientCertRequest, - )? onReceivedClientCertRequest, ->>>>>>> bfb42a62a56ee53010e7c2601cbf1bac993122f2 - void Function( - _i2.WebViewClient, - _i2.WebView, - int, - String, - String, - )? onReceivedError, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.HttpAuthHandler, - String, - String, - )? onReceivedHttpAuthRequest, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.WebResourceRequest, - _i2.WebResourceResponse, - )? onReceivedHttpError, - void Function( - _i2.WebViewClient, - _i2.WebView, - String, - String?, - String, - )? onReceivedLoginRequest, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.WebResourceRequest, - _i2.WebResourceError, - )? onReceivedRequestError, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.WebResourceRequest, - _i2.WebResourceErrorCompat, - )? onReceivedRequestErrorCompat, - void Function( - _i2.WebViewClient, - _i2.WebView, -<<<<<<< HEAD -======= - _i2.SslErrorHandler, - _i2.SslError, - )? onReceivedSslError, - void Function(_i2.WebViewClient, _i2.WebView, double, double)? - onScaleChanged, - void Function( - _i2.WebViewClient, - _i2.WebView, ->>>>>>> bfb42a62a56ee53010e7c2601cbf1bac993122f2 - _i2.WebResourceRequest, - )? requestLoading, - void Function(_i2.WebViewClient, _i2.WebView, String)? urlLoading, - }) => - _FakeWebViewClient_1( - this, - Invocation.getter(#newWebViewClient), - ), - returnValueForMissingStub: ({ - void Function(_i2.WebViewClient, _i2.WebView, String, bool)? - doUpdateVisitedHistory, -<<<<<<< HEAD - void Function(_i2.WebViewClient, _i2.WebView, String)? onPageFinished, - void Function(_i2.WebViewClient, _i2.WebView, String)? onPageStarted, -======= - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.AndroidMessage, - _i2.AndroidMessage, - )? onFormResubmission, - void Function(_i2.WebViewClient, _i2.WebView, String)? onLoadResource, - void Function(_i2.WebViewClient, _i2.WebView, String)? - onPageCommitVisible, - void Function(_i2.WebViewClient, _i2.WebView, String)? onPageFinished, - void Function(_i2.WebViewClient, _i2.WebView, String)? onPageStarted, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.ClientCertRequest, - )? onReceivedClientCertRequest, ->>>>>>> bfb42a62a56ee53010e7c2601cbf1bac993122f2 - void Function( - _i2.WebViewClient, - _i2.WebView, - int, - String, - String, - )? onReceivedError, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.HttpAuthHandler, - String, - String, - )? onReceivedHttpAuthRequest, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.WebResourceRequest, - _i2.WebResourceResponse, - )? onReceivedHttpError, - void Function( - _i2.WebViewClient, - _i2.WebView, - String, - String?, - String, - )? onReceivedLoginRequest, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.WebResourceRequest, - _i2.WebResourceError, - )? onReceivedRequestError, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.WebResourceRequest, - _i2.WebResourceErrorCompat, - )? onReceivedRequestErrorCompat, - void Function( - _i2.WebViewClient, - _i2.WebView, -<<<<<<< HEAD -======= - _i2.SslErrorHandler, - _i2.SslError, - )? onReceivedSslError, - void Function(_i2.WebViewClient, _i2.WebView, double, double)? - onScaleChanged, - void Function( - _i2.WebViewClient, - _i2.WebView, ->>>>>>> bfb42a62a56ee53010e7c2601cbf1bac993122f2 - _i2.WebResourceRequest, - )? requestLoading, - void Function(_i2.WebViewClient, _i2.WebView, String)? urlLoading, - }) => - _FakeWebViewClient_1( - this, - Invocation.getter(#newWebViewClient), - ), - ) as _i2.WebViewClient Function({ - void Function(_i2.WebViewClient, _i2.WebView, String, bool)? + }) + get newWebViewClient => + (super.noSuchMethod( + Invocation.getter(#newWebViewClient), + returnValue: + ({ + void Function(_i2.WebViewClient, _i2.WebView, String, bool)? + doUpdateVisitedHistory, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.AndroidMessage, + _i2.AndroidMessage, + )? + onFormResubmission, + void Function(_i2.WebViewClient, _i2.WebView, String)? + onLoadResource, + void Function(_i2.WebViewClient, _i2.WebView, String)? + onPageCommitVisible, + void Function(_i2.WebViewClient, _i2.WebView, String)? + onPageFinished, + void Function(_i2.WebViewClient, _i2.WebView, String)? + onPageStarted, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.ClientCertRequest, + )? + onReceivedClientCertRequest, + void Function( + _i2.WebViewClient, + _i2.WebView, + int, + String, + String, + )? + onReceivedError, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.HttpAuthHandler, + String, + String, + )? + onReceivedHttpAuthRequest, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.WebResourceRequest, + _i2.WebResourceResponse, + )? + onReceivedHttpError, + void Function( + _i2.WebViewClient, + _i2.WebView, + String, + String?, + String, + )? + onReceivedLoginRequest, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.WebResourceRequest, + _i2.WebResourceError, + )? + onReceivedRequestError, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.WebResourceRequest, + _i2.WebResourceErrorCompat, + )? + onReceivedRequestErrorCompat, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.SslErrorHandler, + _i2.SslError, + )? + onReceivedSslError, + void Function(_i2.WebViewClient, _i2.WebView, double, double)? + onScaleChanged, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.WebResourceRequest, + )? + requestLoading, + void Function(_i2.WebViewClient, _i2.WebView, String)? + urlLoading, + }) => _FakeWebViewClient_1( + this, + Invocation.getter(#newWebViewClient), + ), + returnValueForMissingStub: + ({ + void Function(_i2.WebViewClient, _i2.WebView, String, bool)? + doUpdateVisitedHistory, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.AndroidMessage, + _i2.AndroidMessage, + )? + onFormResubmission, + void Function(_i2.WebViewClient, _i2.WebView, String)? + onLoadResource, + void Function(_i2.WebViewClient, _i2.WebView, String)? + onPageCommitVisible, + void Function(_i2.WebViewClient, _i2.WebView, String)? + onPageFinished, + void Function(_i2.WebViewClient, _i2.WebView, String)? + onPageStarted, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.ClientCertRequest, + )? + onReceivedClientCertRequest, + void Function( + _i2.WebViewClient, + _i2.WebView, + int, + String, + String, + )? + onReceivedError, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.HttpAuthHandler, + String, + String, + )? + onReceivedHttpAuthRequest, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.WebResourceRequest, + _i2.WebResourceResponse, + )? + onReceivedHttpError, + void Function( + _i2.WebViewClient, + _i2.WebView, + String, + String?, + String, + )? + onReceivedLoginRequest, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.WebResourceRequest, + _i2.WebResourceError, + )? + onReceivedRequestError, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.WebResourceRequest, + _i2.WebResourceErrorCompat, + )? + onReceivedRequestErrorCompat, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.SslErrorHandler, + _i2.SslError, + )? + onReceivedSslError, + void Function(_i2.WebViewClient, _i2.WebView, double, double)? + onScaleChanged, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.WebResourceRequest, + )? + requestLoading, + void Function(_i2.WebViewClient, _i2.WebView, String)? + urlLoading, + }) => _FakeWebViewClient_1( + this, + Invocation.getter(#newWebViewClient), + ), + ) + as _i2.WebViewClient Function({ + void Function(_i2.WebViewClient, _i2.WebView, String, bool)? doUpdateVisitedHistory, -<<<<<<< HEAD - void Function(_i2.WebViewClient, _i2.WebView, String)? onPageFinished, - void Function(_i2.WebViewClient, _i2.WebView, String)? onPageStarted, -======= - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.AndroidMessage, - _i2.AndroidMessage, - )? onFormResubmission, - void Function(_i2.WebViewClient, _i2.WebView, String)? onLoadResource, - void Function(_i2.WebViewClient, _i2.WebView, String)? + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.AndroidMessage, + _i2.AndroidMessage, + )? + onFormResubmission, + void Function(_i2.WebViewClient, _i2.WebView, String)? + onLoadResource, + void Function(_i2.WebViewClient, _i2.WebView, String)? onPageCommitVisible, - void Function(_i2.WebViewClient, _i2.WebView, String)? onPageFinished, - void Function(_i2.WebViewClient, _i2.WebView, String)? onPageStarted, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.ClientCertRequest, - )? onReceivedClientCertRequest, ->>>>>>> bfb42a62a56ee53010e7c2601cbf1bac993122f2 - void Function(_i2.WebViewClient, _i2.WebView, int, String, String)? + void Function(_i2.WebViewClient, _i2.WebView, String)? + onPageFinished, + void Function(_i2.WebViewClient, _i2.WebView, String)? + onPageStarted, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.ClientCertRequest, + )? + onReceivedClientCertRequest, + void Function(_i2.WebViewClient, _i2.WebView, int, String, String)? onReceivedError, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.HttpAuthHandler, - String, - String, - )? onReceivedHttpAuthRequest, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.WebResourceRequest, - _i2.WebResourceResponse, - )? onReceivedHttpError, - void Function( - _i2.WebViewClient, - _i2.WebView, - String, - String?, - String, - )? onReceivedLoginRequest, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.WebResourceRequest, - _i2.WebResourceError, - )? onReceivedRequestError, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.WebResourceRequest, - _i2.WebResourceErrorCompat, - )? onReceivedRequestErrorCompat, - void Function( - _i2.WebViewClient, - _i2.WebView, -<<<<<<< HEAD -======= - _i2.SslErrorHandler, - _i2.SslError, - )? onReceivedSslError, - void Function(_i2.WebViewClient, _i2.WebView, double, double)? + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.HttpAuthHandler, + String, + String, + )? + onReceivedHttpAuthRequest, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.WebResourceRequest, + _i2.WebResourceResponse, + )? + onReceivedHttpError, + void Function( + _i2.WebViewClient, + _i2.WebView, + String, + String?, + String, + )? + onReceivedLoginRequest, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.WebResourceRequest, + _i2.WebResourceError, + )? + onReceivedRequestError, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.WebResourceRequest, + _i2.WebResourceErrorCompat, + )? + onReceivedRequestErrorCompat, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.SslErrorHandler, + _i2.SslError, + )? + onReceivedSslError, + void Function(_i2.WebViewClient, _i2.WebView, double, double)? onScaleChanged, - void Function( - _i2.WebViewClient, - _i2.WebView, ->>>>>>> bfb42a62a56ee53010e7c2601cbf1bac993122f2 - _i2.WebResourceRequest, - )? requestLoading, - void Function(_i2.WebViewClient, _i2.WebView, String)? urlLoading, - })); + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.WebResourceRequest, + )? + requestLoading, + void Function(_i2.WebViewClient, _i2.WebView, String)? urlLoading, + })); @override _i2.DownloadListener Function({ @@ -1083,293 +1198,320 @@ class MockAndroidWebViewProxy extends _i1.Mock String, String, int, - ) onDownloadStart, - }) get newDownloadListener => (super.noSuchMethod( - Invocation.getter(#newDownloadListener), - returnValue: ({ - required void Function( - _i2.DownloadListener, - String, - String, - String, - String, - int, - ) onDownloadStart, - }) => - _FakeDownloadListener_2( - this, - Invocation.getter(#newDownloadListener), - ), - returnValueForMissingStub: ({ - required void Function( - _i2.DownloadListener, - String, - String, - String, - String, - int, - ) onDownloadStart, - }) => - _FakeDownloadListener_2( - this, - Invocation.getter(#newDownloadListener), - ), - ) as _i2.DownloadListener Function({ - required void Function( - _i2.DownloadListener, - String, - String, - String, - String, - int, - ) onDownloadStart, - })); + ) + onDownloadStart, + }) + get newDownloadListener => + (super.noSuchMethod( + Invocation.getter(#newDownloadListener), + returnValue: + ({ + required void Function( + _i2.DownloadListener, + String, + String, + String, + String, + int, + ) + onDownloadStart, + }) => _FakeDownloadListener_2( + this, + Invocation.getter(#newDownloadListener), + ), + returnValueForMissingStub: + ({ + required void Function( + _i2.DownloadListener, + String, + String, + String, + String, + int, + ) + onDownloadStart, + }) => _FakeDownloadListener_2( + this, + Invocation.getter(#newDownloadListener), + ), + ) + as _i2.DownloadListener Function({ + required void Function( + _i2.DownloadListener, + String, + String, + String, + String, + int, + ) + onDownloadStart, + })); @override _i2.WebChromeClient Function({ -<<<<<<< HEAD -======= required _i8.Future Function( _i2.WebChromeClient, _i2.WebView, String, String, - ) onJsConfirm, + ) + onJsConfirm, required _i8.Future> Function( _i2.WebChromeClient, _i2.WebView, _i2.FileChooserParams, - ) onShowFileChooser, ->>>>>>> bfb42a62a56ee53010e7c2601cbf1bac993122f2 + ) + onShowFileChooser, void Function(_i2.WebChromeClient, _i2.ConsoleMessage)? onConsoleMessage, void Function(_i2.WebChromeClient)? onGeolocationPermissionsHidePrompt, void Function( _i2.WebChromeClient, String, _i2.GeolocationPermissionsCallback, - )? onGeolocationPermissionsShowPrompt, + )? + onGeolocationPermissionsShowPrompt, void Function(_i2.WebChromeClient)? onHideCustomView, _i8.Future Function(_i2.WebChromeClient, _i2.WebView, String, String)? - onJsAlert, -<<<<<<< HEAD - _i8.Future Function(_i2.WebChromeClient, _i2.WebView, String, String)? - onJsConfirm, -======= ->>>>>>> bfb42a62a56ee53010e7c2601cbf1bac993122f2 + onJsAlert, _i8.Future Function( _i2.WebChromeClient, _i2.WebView, String, String, String, - )? onJsPrompt, + )? + onJsPrompt, void Function(_i2.WebChromeClient, _i2.PermissionRequest)? - onPermissionRequest, + onPermissionRequest, void Function(_i2.WebChromeClient, _i2.WebView, int)? onProgressChanged, void Function(_i2.WebChromeClient, _i2.View, _i2.CustomViewCallback)? - onShowCustomView, -<<<<<<< HEAD - _i8.Future> Function( - _i2.WebChromeClient, - _i2.WebView, - _i2.FileChooserParams, - )? onShowFileChooser, -======= ->>>>>>> bfb42a62a56ee53010e7c2601cbf1bac993122f2 - }) get newWebChromeClient => (super.noSuchMethod( - Invocation.getter(#newWebChromeClient), - returnValue: ({ - void Function(_i2.WebChromeClient, _i2.ConsoleMessage)? - onConsoleMessage, - void Function(_i2.WebChromeClient)? - onGeolocationPermissionsHidePrompt, - void Function( - _i2.WebChromeClient, - String, - _i2.GeolocationPermissionsCallback, - )? onGeolocationPermissionsShowPrompt, - void Function(_i2.WebChromeClient)? onHideCustomView, - _i8.Future Function( - _i2.WebChromeClient, - _i2.WebView, - String, - String, - )? onJsAlert, - required _i8.Future Function( - _i2.WebChromeClient, - _i2.WebView, - String, - String, - ) onJsConfirm, - _i8.Future Function( - _i2.WebChromeClient, - _i2.WebView, - String, - String, - String, - )? onJsPrompt, - void Function(_i2.WebChromeClient, _i2.PermissionRequest)? - onPermissionRequest, - void Function(_i2.WebChromeClient, _i2.WebView, int)? - onProgressChanged, - void Function( - _i2.WebChromeClient, - _i2.View, - _i2.CustomViewCallback, - )? onShowCustomView, - required _i8.Future> Function( - _i2.WebChromeClient, - _i2.WebView, - _i2.FileChooserParams, - ) onShowFileChooser, - }) => - _FakeWebChromeClient_0( - this, - Invocation.getter(#newWebChromeClient), - ), - returnValueForMissingStub: ({ - void Function(_i2.WebChromeClient, _i2.ConsoleMessage)? - onConsoleMessage, - void Function(_i2.WebChromeClient)? - onGeolocationPermissionsHidePrompt, - void Function( - _i2.WebChromeClient, - String, - _i2.GeolocationPermissionsCallback, - )? onGeolocationPermissionsShowPrompt, - void Function(_i2.WebChromeClient)? onHideCustomView, - _i8.Future Function( - _i2.WebChromeClient, - _i2.WebView, - String, - String, - )? onJsAlert, - required _i8.Future Function( - _i2.WebChromeClient, - _i2.WebView, - String, - String, - ) onJsConfirm, - _i8.Future Function( - _i2.WebChromeClient, - _i2.WebView, - String, - String, - String, - )? onJsPrompt, - void Function(_i2.WebChromeClient, _i2.PermissionRequest)? - onPermissionRequest, - void Function(_i2.WebChromeClient, _i2.WebView, int)? - onProgressChanged, - void Function( - _i2.WebChromeClient, - _i2.View, - _i2.CustomViewCallback, - )? onShowCustomView, - required _i8.Future> Function( - _i2.WebChromeClient, - _i2.WebView, - _i2.FileChooserParams, - ) onShowFileChooser, - }) => - _FakeWebChromeClient_0( - this, - Invocation.getter(#newWebChromeClient), - ), - ) as _i2.WebChromeClient Function({ -<<<<<<< HEAD -======= - required _i8.Future Function( - _i2.WebChromeClient, - _i2.WebView, - String, - String, - ) onJsConfirm, - required _i8.Future> Function( - _i2.WebChromeClient, - _i2.WebView, - _i2.FileChooserParams, - ) onShowFileChooser, ->>>>>>> bfb42a62a56ee53010e7c2601cbf1bac993122f2 - void Function(_i2.WebChromeClient, _i2.ConsoleMessage)? + onShowCustomView, + }) + get newWebChromeClient => + (super.noSuchMethod( + Invocation.getter(#newWebChromeClient), + returnValue: + ({ + void Function(_i2.WebChromeClient, _i2.ConsoleMessage)? + onConsoleMessage, + void Function(_i2.WebChromeClient)? + onGeolocationPermissionsHidePrompt, + void Function( + _i2.WebChromeClient, + String, + _i2.GeolocationPermissionsCallback, + )? + onGeolocationPermissionsShowPrompt, + void Function(_i2.WebChromeClient)? onHideCustomView, + _i8.Future Function( + _i2.WebChromeClient, + _i2.WebView, + String, + String, + )? + onJsAlert, + required _i8.Future Function( + _i2.WebChromeClient, + _i2.WebView, + String, + String, + ) + onJsConfirm, + _i8.Future Function( + _i2.WebChromeClient, + _i2.WebView, + String, + String, + String, + )? + onJsPrompt, + void Function(_i2.WebChromeClient, _i2.PermissionRequest)? + onPermissionRequest, + void Function(_i2.WebChromeClient, _i2.WebView, int)? + onProgressChanged, + void Function( + _i2.WebChromeClient, + _i2.View, + _i2.CustomViewCallback, + )? + onShowCustomView, + required _i8.Future> Function( + _i2.WebChromeClient, + _i2.WebView, + _i2.FileChooserParams, + ) + onShowFileChooser, + }) => _FakeWebChromeClient_0( + this, + Invocation.getter(#newWebChromeClient), + ), + returnValueForMissingStub: + ({ + void Function(_i2.WebChromeClient, _i2.ConsoleMessage)? + onConsoleMessage, + void Function(_i2.WebChromeClient)? + onGeolocationPermissionsHidePrompt, + void Function( + _i2.WebChromeClient, + String, + _i2.GeolocationPermissionsCallback, + )? + onGeolocationPermissionsShowPrompt, + void Function(_i2.WebChromeClient)? onHideCustomView, + _i8.Future Function( + _i2.WebChromeClient, + _i2.WebView, + String, + String, + )? + onJsAlert, + required _i8.Future Function( + _i2.WebChromeClient, + _i2.WebView, + String, + String, + ) + onJsConfirm, + _i8.Future Function( + _i2.WebChromeClient, + _i2.WebView, + String, + String, + String, + )? + onJsPrompt, + void Function(_i2.WebChromeClient, _i2.PermissionRequest)? + onPermissionRequest, + void Function(_i2.WebChromeClient, _i2.WebView, int)? + onProgressChanged, + void Function( + _i2.WebChromeClient, + _i2.View, + _i2.CustomViewCallback, + )? + onShowCustomView, + required _i8.Future> Function( + _i2.WebChromeClient, + _i2.WebView, + _i2.FileChooserParams, + ) + onShowFileChooser, + }) => _FakeWebChromeClient_0( + this, + Invocation.getter(#newWebChromeClient), + ), + ) + as _i2.WebChromeClient Function({ + required _i8.Future Function( + _i2.WebChromeClient, + _i2.WebView, + String, + String, + ) + onJsConfirm, + required _i8.Future> Function( + _i2.WebChromeClient, + _i2.WebView, + _i2.FileChooserParams, + ) + onShowFileChooser, + void Function(_i2.WebChromeClient, _i2.ConsoleMessage)? onConsoleMessage, - void Function(_i2.WebChromeClient)? onGeolocationPermissionsHidePrompt, - void Function( - _i2.WebChromeClient, - String, - _i2.GeolocationPermissionsCallback, - )? onGeolocationPermissionsShowPrompt, - void Function(_i2.WebChromeClient)? onHideCustomView, - _i8.Future Function( - _i2.WebChromeClient, - _i2.WebView, - String, - String, - )? onJsAlert, - _i8.Future Function( - _i2.WebChromeClient, - _i2.WebView, - String, - String, - String, - )? onJsPrompt, - void Function(_i2.WebChromeClient, _i2.PermissionRequest)? + void Function(_i2.WebChromeClient)? + onGeolocationPermissionsHidePrompt, + void Function( + _i2.WebChromeClient, + String, + _i2.GeolocationPermissionsCallback, + )? + onGeolocationPermissionsShowPrompt, + void Function(_i2.WebChromeClient)? onHideCustomView, + _i8.Future Function( + _i2.WebChromeClient, + _i2.WebView, + String, + String, + )? + onJsAlert, + _i8.Future Function( + _i2.WebChromeClient, + _i2.WebView, + String, + String, + String, + )? + onJsPrompt, + void Function(_i2.WebChromeClient, _i2.PermissionRequest)? onPermissionRequest, - void Function(_i2.WebChromeClient, _i2.WebView, int)? onProgressChanged, - void Function( - _i2.WebChromeClient, - _i2.View, - _i2.CustomViewCallback, - )? onShowCustomView, - })); + void Function(_i2.WebChromeClient, _i2.WebView, int)? + onProgressChanged, + void Function( + _i2.WebChromeClient, + _i2.View, + _i2.CustomViewCallback, + )? + onShowCustomView, + })); @override _i8.Future Function(bool) get setWebContentsDebuggingEnabledWebView => (super.noSuchMethod( - Invocation.getter(#setWebContentsDebuggingEnabledWebView), - returnValue: (bool __p0) => _i8.Future.value(), - returnValueForMissingStub: (bool __p0) => _i8.Future.value(), - ) as _i8.Future Function(bool)); + Invocation.getter(#setWebContentsDebuggingEnabledWebView), + returnValue: (bool __p0) => _i8.Future.value(), + returnValueForMissingStub: (bool __p0) => _i8.Future.value(), + ) + as _i8.Future Function(bool)); @override - _i2.CookieManager Function() get instanceCookieManager => (super.noSuchMethod( - Invocation.getter(#instanceCookieManager), - returnValue: () => _FakeCookieManager_9( - this, - Invocation.getter(#instanceCookieManager), - ), - returnValueForMissingStub: () => _FakeCookieManager_9( - this, - Invocation.getter(#instanceCookieManager), - ), - ) as _i2.CookieManager Function()); + _i2.CookieManager Function() get instanceCookieManager => + (super.noSuchMethod( + Invocation.getter(#instanceCookieManager), + returnValue: + () => _FakeCookieManager_9( + this, + Invocation.getter(#instanceCookieManager), + ), + returnValueForMissingStub: + () => _FakeCookieManager_9( + this, + Invocation.getter(#instanceCookieManager), + ), + ) + as _i2.CookieManager Function()); @override _i2.FlutterAssetManager Function() get instanceFlutterAssetManager => (super.noSuchMethod( - Invocation.getter(#instanceFlutterAssetManager), - returnValue: () => _FakeFlutterAssetManager_10( - this, - Invocation.getter(#instanceFlutterAssetManager), - ), - returnValueForMissingStub: () => _FakeFlutterAssetManager_10( - this, - Invocation.getter(#instanceFlutterAssetManager), - ), - ) as _i2.FlutterAssetManager Function()); - - @override - _i2.WebStorage Function() get instanceWebStorage => (super.noSuchMethod( - Invocation.getter(#instanceWebStorage), - returnValue: () => _FakeWebStorage_11( - this, - Invocation.getter(#instanceWebStorage), - ), - returnValueForMissingStub: () => _FakeWebStorage_11( - this, - Invocation.getter(#instanceWebStorage), - ), - ) as _i2.WebStorage Function()); + Invocation.getter(#instanceFlutterAssetManager), + returnValue: + () => _FakeFlutterAssetManager_10( + this, + Invocation.getter(#instanceFlutterAssetManager), + ), + returnValueForMissingStub: + () => _FakeFlutterAssetManager_10( + this, + Invocation.getter(#instanceFlutterAssetManager), + ), + ) + as _i2.FlutterAssetManager Function()); + + @override + _i2.WebStorage Function() get instanceWebStorage => + (super.noSuchMethod( + Invocation.getter(#instanceWebStorage), + returnValue: + () => _FakeWebStorage_11( + this, + Invocation.getter(#instanceWebStorage), + ), + returnValueForMissingStub: + () => _FakeWebStorage_11( + this, + Invocation.getter(#instanceWebStorage), + ), + ) + as _i2.WebStorage Function()); } /// A class which mocks [AndroidWebViewWidgetCreationParams]. @@ -1379,67 +1521,77 @@ class MockAndroidWebViewProxy extends _i1.Mock class MockAndroidWebViewWidgetCreationParams extends _i1.Mock implements _i7.AndroidWebViewWidgetCreationParams { @override - _i2.PigeonInstanceManager get instanceManager => (super.noSuchMethod( - Invocation.getter(#instanceManager), - returnValue: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#instanceManager), - ), - ) as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get instanceManager => + (super.noSuchMethod( + Invocation.getter(#instanceManager), + returnValue: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#instanceManager), + ), + ) + as _i2.PigeonInstanceManager); @override _i5.PlatformViewsServiceProxy get platformViewsServiceProxy => (super.noSuchMethod( - Invocation.getter(#platformViewsServiceProxy), - returnValue: _FakePlatformViewsServiceProxy_13( - this, - Invocation.getter(#platformViewsServiceProxy), - ), - returnValueForMissingStub: _FakePlatformViewsServiceProxy_13( - this, - Invocation.getter(#platformViewsServiceProxy), - ), - ) as _i5.PlatformViewsServiceProxy); - - @override - bool get displayWithHybridComposition => (super.noSuchMethod( - Invocation.getter(#displayWithHybridComposition), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); - - @override - _i3.PlatformWebViewController get controller => (super.noSuchMethod( - Invocation.getter(#controller), - returnValue: _FakePlatformWebViewController_14( - this, - Invocation.getter(#controller), - ), - returnValueForMissingStub: _FakePlatformWebViewController_14( - this, - Invocation.getter(#controller), - ), - ) as _i3.PlatformWebViewController); - - @override - _i4.TextDirection get layoutDirection => (super.noSuchMethod( - Invocation.getter(#layoutDirection), - returnValue: _i4.TextDirection.rtl, - returnValueForMissingStub: _i4.TextDirection.rtl, - ) as _i4.TextDirection); + Invocation.getter(#platformViewsServiceProxy), + returnValue: _FakePlatformViewsServiceProxy_13( + this, + Invocation.getter(#platformViewsServiceProxy), + ), + returnValueForMissingStub: _FakePlatformViewsServiceProxy_13( + this, + Invocation.getter(#platformViewsServiceProxy), + ), + ) + as _i5.PlatformViewsServiceProxy); + + @override + bool get displayWithHybridComposition => + (super.noSuchMethod( + Invocation.getter(#displayWithHybridComposition), + returnValue: false, + returnValueForMissingStub: false, + ) + as bool); + + @override + _i3.PlatformWebViewController get controller => + (super.noSuchMethod( + Invocation.getter(#controller), + returnValue: _FakePlatformWebViewController_14( + this, + Invocation.getter(#controller), + ), + returnValueForMissingStub: _FakePlatformWebViewController_14( + this, + Invocation.getter(#controller), + ), + ) + as _i3.PlatformWebViewController); + + @override + _i4.TextDirection get layoutDirection => + (super.noSuchMethod( + Invocation.getter(#layoutDirection), + returnValue: _i4.TextDirection.rtl, + returnValueForMissingStub: _i4.TextDirection.rtl, + ) + as _i4.TextDirection); @override Set<_i10.Factory<_i11.OneSequenceGestureRecognizer>> get gestureRecognizers => (super.noSuchMethod( - Invocation.getter(#gestureRecognizers), - returnValue: <_i10.Factory<_i11.OneSequenceGestureRecognizer>>{}, - returnValueForMissingStub: <_i10 - .Factory<_i11.OneSequenceGestureRecognizer>>{}, - ) as Set<_i10.Factory<_i11.OneSequenceGestureRecognizer>>); + Invocation.getter(#gestureRecognizers), + returnValue: <_i10.Factory<_i11.OneSequenceGestureRecognizer>>{}, + returnValueForMissingStub: + <_i10.Factory<_i11.OneSequenceGestureRecognizer>>{}, + ) + as Set<_i10.Factory<_i11.OneSequenceGestureRecognizer>>); } /// A class which mocks [ExpensiveAndroidViewController]. @@ -1448,137 +1600,160 @@ class MockAndroidWebViewWidgetCreationParams extends _i1.Mock class MockExpensiveAndroidViewController extends _i1.Mock implements _i6.ExpensiveAndroidViewController { @override - bool get requiresViewComposition => (super.noSuchMethod( - Invocation.getter(#requiresViewComposition), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); + bool get requiresViewComposition => + (super.noSuchMethod( + Invocation.getter(#requiresViewComposition), + returnValue: false, + returnValueForMissingStub: false, + ) + as bool); @override - int get viewId => (super.noSuchMethod( - Invocation.getter(#viewId), - returnValue: 0, - returnValueForMissingStub: 0, - ) as int); + int get viewId => + (super.noSuchMethod( + Invocation.getter(#viewId), + returnValue: 0, + returnValueForMissingStub: 0, + ) + as int); @override - bool get awaitingCreation => (super.noSuchMethod( - Invocation.getter(#awaitingCreation), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); + bool get awaitingCreation => + (super.noSuchMethod( + Invocation.getter(#awaitingCreation), + returnValue: false, + returnValueForMissingStub: false, + ) + as bool); @override - _i6.PointTransformer get pointTransformer => (super.noSuchMethod( - Invocation.getter(#pointTransformer), - returnValue: (_i4.Offset position) => - _FakeOffset_6(this, Invocation.getter(#pointTransformer)), - returnValueForMissingStub: (_i4.Offset position) => - _FakeOffset_6(this, Invocation.getter(#pointTransformer)), - ) as _i6.PointTransformer); + _i6.PointTransformer get pointTransformer => + (super.noSuchMethod( + Invocation.getter(#pointTransformer), + returnValue: + (_i4.Offset position) => + _FakeOffset_6(this, Invocation.getter(#pointTransformer)), + returnValueForMissingStub: + (_i4.Offset position) => + _FakeOffset_6(this, Invocation.getter(#pointTransformer)), + ) + as _i6.PointTransformer); @override set pointTransformer(_i6.PointTransformer? transformer) => super.noSuchMethod( - Invocation.setter(#pointTransformer, transformer), - returnValueForMissingStub: null, - ); + Invocation.setter(#pointTransformer, transformer), + returnValueForMissingStub: null, + ); @override - bool get isCreated => (super.noSuchMethod( - Invocation.getter(#isCreated), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); + bool get isCreated => + (super.noSuchMethod( + Invocation.getter(#isCreated), + returnValue: false, + returnValueForMissingStub: false, + ) + as bool); @override List<_i6.PlatformViewCreatedCallback> get createdCallbacks => (super.noSuchMethod( - Invocation.getter(#createdCallbacks), - returnValue: <_i6.PlatformViewCreatedCallback>[], - returnValueForMissingStub: <_i6.PlatformViewCreatedCallback>[], - ) as List<_i6.PlatformViewCreatedCallback>); + Invocation.getter(#createdCallbacks), + returnValue: <_i6.PlatformViewCreatedCallback>[], + returnValueForMissingStub: <_i6.PlatformViewCreatedCallback>[], + ) + as List<_i6.PlatformViewCreatedCallback>); @override - _i8.Future setOffset(_i4.Offset? off) => (super.noSuchMethod( - Invocation.method(#setOffset, [off]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future setOffset(_i4.Offset? off) => + (super.noSuchMethod( + Invocation.method(#setOffset, [off]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future create({_i4.Size? size, _i4.Offset? position}) => (super.noSuchMethod( - Invocation.method(#create, [], {#size: size, #position: position}), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#create, [], {#size: size, #position: position}), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future<_i4.Size> setSize(_i4.Size? size) => (super.noSuchMethod( - Invocation.method(#setSize, [size]), - returnValue: _i8.Future<_i4.Size>.value( - _FakeSize_15(this, Invocation.method(#setSize, [size])), - ), - returnValueForMissingStub: _i8.Future<_i4.Size>.value( - _FakeSize_15(this, Invocation.method(#setSize, [size])), - ), - ) as _i8.Future<_i4.Size>); + _i8.Future<_i4.Size> setSize(_i4.Size? size) => + (super.noSuchMethod( + Invocation.method(#setSize, [size]), + returnValue: _i8.Future<_i4.Size>.value( + _FakeSize_15(this, Invocation.method(#setSize, [size])), + ), + returnValueForMissingStub: _i8.Future<_i4.Size>.value( + _FakeSize_15(this, Invocation.method(#setSize, [size])), + ), + ) + as _i8.Future<_i4.Size>); @override _i8.Future sendMotionEvent(_i6.AndroidMotionEvent? event) => (super.noSuchMethod( - Invocation.method(#sendMotionEvent, [event]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#sendMotionEvent, [event]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override void addOnPlatformViewCreatedListener( _i6.PlatformViewCreatedCallback? listener, - ) => - super.noSuchMethod( - Invocation.method(#addOnPlatformViewCreatedListener, [listener]), - returnValueForMissingStub: null, - ); + ) => super.noSuchMethod( + Invocation.method(#addOnPlatformViewCreatedListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeOnPlatformViewCreatedListener( _i6.PlatformViewCreatedCallback? listener, - ) => - super.noSuchMethod( - Invocation.method(#removeOnPlatformViewCreatedListener, [listener]), - returnValueForMissingStub: null, - ); + ) => super.noSuchMethod( + Invocation.method(#removeOnPlatformViewCreatedListener, [listener]), + returnValueForMissingStub: null, + ); @override _i8.Future setLayoutDirection(_i4.TextDirection? layoutDirection) => (super.noSuchMethod( - Invocation.method(#setLayoutDirection, [layoutDirection]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setLayoutDirection, [layoutDirection]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future dispatchPointerEvent(_i11.PointerEvent? event) => (super.noSuchMethod( - Invocation.method(#dispatchPointerEvent, [event]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#dispatchPointerEvent, [event]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future clearFocus() => (super.noSuchMethod( - Invocation.method(#clearFocus, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future clearFocus() => + (super.noSuchMethod( + Invocation.method(#clearFocus, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future dispose() => (super.noSuchMethod( - Invocation.method(#dispose, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future dispose() => + (super.noSuchMethod( + Invocation.method(#dispose, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); } /// A class which mocks [FlutterAssetManager]. @@ -1587,57 +1762,64 @@ class MockExpensiveAndroidViewController extends _i1.Mock class MockFlutterAssetManager extends _i1.Mock implements _i2.FlutterAssetManager { @override - _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); @override - _i8.Future> list(String? path) => (super.noSuchMethod( - Invocation.method(#list, [path]), - returnValue: _i8.Future>.value([]), - returnValueForMissingStub: _i8.Future>.value( - [], - ), - ) as _i8.Future>); + _i8.Future> list(String? path) => + (super.noSuchMethod( + Invocation.method(#list, [path]), + returnValue: _i8.Future>.value([]), + returnValueForMissingStub: _i8.Future>.value( + [], + ), + ) + as _i8.Future>); @override _i8.Future getAssetFilePathByName(String? name) => (super.noSuchMethod( - Invocation.method(#getAssetFilePathByName, [name]), - returnValue: _i8.Future.value( - _i12.dummyValue( - this, - Invocation.method(#getAssetFilePathByName, [name]), - ), - ), - returnValueForMissingStub: _i8.Future.value( - _i12.dummyValue( - this, Invocation.method(#getAssetFilePathByName, [name]), - ), - ), - ) as _i8.Future); - - @override - _i2.FlutterAssetManager pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeFlutterAssetManager_10( - this, - Invocation.method(#pigeon_copy, []), - ), - returnValueForMissingStub: _FakeFlutterAssetManager_10( - this, - Invocation.method(#pigeon_copy, []), - ), - ) as _i2.FlutterAssetManager); + returnValue: _i8.Future.value( + _i12.dummyValue( + this, + Invocation.method(#getAssetFilePathByName, [name]), + ), + ), + returnValueForMissingStub: _i8.Future.value( + _i12.dummyValue( + this, + Invocation.method(#getAssetFilePathByName, [name]), + ), + ), + ) + as _i8.Future); + + @override + _i2.FlutterAssetManager pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeFlutterAssetManager_10( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeFlutterAssetManager_10( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.FlutterAssetManager); } /// A class which mocks [GeolocationPermissionsCallback]. @@ -1646,38 +1828,43 @@ class MockFlutterAssetManager extends _i1.Mock class MockGeolocationPermissionsCallback extends _i1.Mock implements _i2.GeolocationPermissionsCallback { @override - _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); @override _i8.Future invoke(String? origin, bool? allow, bool? retain) => (super.noSuchMethod( - Invocation.method(#invoke, [origin, allow, retain]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i2.GeolocationPermissionsCallback pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeGeolocationPermissionsCallback_16( - this, - Invocation.method(#pigeon_copy, []), - ), - returnValueForMissingStub: _FakeGeolocationPermissionsCallback_16( - this, - Invocation.method(#pigeon_copy, []), - ), - ) as _i2.GeolocationPermissionsCallback); + Invocation.method(#invoke, [origin, allow, retain]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i2.GeolocationPermissionsCallback pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeGeolocationPermissionsCallback_16( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeGeolocationPermissionsCallback_16( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.GeolocationPermissionsCallback); } /// A class which mocks [JavaScriptChannel]. @@ -1685,52 +1872,60 @@ class MockGeolocationPermissionsCallback extends _i1.Mock /// See the documentation for Mockito's code generation for more information. class MockJavaScriptChannel extends _i1.Mock implements _i2.JavaScriptChannel { @override - String get channelName => (super.noSuchMethod( - Invocation.getter(#channelName), - returnValue: _i12.dummyValue( - this, - Invocation.getter(#channelName), - ), - returnValueForMissingStub: _i12.dummyValue( - this, - Invocation.getter(#channelName), - ), - ) as String); + String get channelName => + (super.noSuchMethod( + Invocation.getter(#channelName), + returnValue: _i12.dummyValue( + this, + Invocation.getter(#channelName), + ), + returnValueForMissingStub: _i12.dummyValue( + this, + Invocation.getter(#channelName), + ), + ) + as String); @override void Function(_i2.JavaScriptChannel, String) get postMessage => (super.noSuchMethod( - Invocation.getter(#postMessage), - returnValue: (_i2.JavaScriptChannel pigeon_instance, String message) {}, - returnValueForMissingStub: - (_i2.JavaScriptChannel pigeon_instance, String message) {}, - ) as void Function(_i2.JavaScriptChannel, String)); - - @override - _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) as _i2.PigeonInstanceManager); - - @override - _i2.JavaScriptChannel pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeJavaScriptChannel_8( - this, - Invocation.method(#pigeon_copy, []), - ), - returnValueForMissingStub: _FakeJavaScriptChannel_8( - this, - Invocation.method(#pigeon_copy, []), - ), - ) as _i2.JavaScriptChannel); + Invocation.getter(#postMessage), + returnValue: + (_i2.JavaScriptChannel pigeon_instance, String message) {}, + returnValueForMissingStub: + (_i2.JavaScriptChannel pigeon_instance, String message) {}, + ) + as void Function(_i2.JavaScriptChannel, String)); + + @override + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); + + @override + _i2.JavaScriptChannel pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeJavaScriptChannel_8( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeJavaScriptChannel_8( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.JavaScriptChannel); } /// A class which mocks [PermissionRequest]. @@ -1738,51 +1933,61 @@ class MockJavaScriptChannel extends _i1.Mock implements _i2.JavaScriptChannel { /// See the documentation for Mockito's code generation for more information. class MockPermissionRequest extends _i1.Mock implements _i2.PermissionRequest { @override - List get resources => (super.noSuchMethod( - Invocation.getter(#resources), - returnValue: [], - returnValueForMissingStub: [], - ) as List); - - @override - _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) as _i2.PigeonInstanceManager); - - @override - _i8.Future grant(List? resources) => (super.noSuchMethod( - Invocation.method(#grant, [resources]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i8.Future deny() => (super.noSuchMethod( - Invocation.method(#deny, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i2.PermissionRequest pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakePermissionRequest_17( - this, - Invocation.method(#pigeon_copy, []), - ), - returnValueForMissingStub: _FakePermissionRequest_17( - this, - Invocation.method(#pigeon_copy, []), - ), - ) as _i2.PermissionRequest); + List get resources => + (super.noSuchMethod( + Invocation.getter(#resources), + returnValue: [], + returnValueForMissingStub: [], + ) + as List); + + @override + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); + + @override + _i8.Future grant(List? resources) => + (super.noSuchMethod( + Invocation.method(#grant, [resources]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i8.Future deny() => + (super.noSuchMethod( + Invocation.method(#deny, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i2.PermissionRequest pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakePermissionRequest_17( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakePermissionRequest_17( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.PermissionRequest); } /// A class which mocks [PlatformViewsServiceProxy]. @@ -1801,37 +2006,38 @@ class MockPlatformViewsServiceProxy extends _i1.Mock _i4.VoidCallback? onFocus, }) => (super.noSuchMethod( - Invocation.method(#initExpensiveAndroidView, [], { - #id: id, - #viewType: viewType, - #layoutDirection: layoutDirection, - #creationParams: creationParams, - #creationParamsCodec: creationParamsCodec, - #onFocus: onFocus, - }), - returnValue: _FakeExpensiveAndroidViewController_18( - this, - Invocation.method(#initExpensiveAndroidView, [], { - #id: id, - #viewType: viewType, - #layoutDirection: layoutDirection, - #creationParams: creationParams, - #creationParamsCodec: creationParamsCodec, - #onFocus: onFocus, - }), - ), - returnValueForMissingStub: _FakeExpensiveAndroidViewController_18( - this, - Invocation.method(#initExpensiveAndroidView, [], { - #id: id, - #viewType: viewType, - #layoutDirection: layoutDirection, - #creationParams: creationParams, - #creationParamsCodec: creationParamsCodec, - #onFocus: onFocus, - }), - ), - ) as _i6.ExpensiveAndroidViewController); + Invocation.method(#initExpensiveAndroidView, [], { + #id: id, + #viewType: viewType, + #layoutDirection: layoutDirection, + #creationParams: creationParams, + #creationParamsCodec: creationParamsCodec, + #onFocus: onFocus, + }), + returnValue: _FakeExpensiveAndroidViewController_18( + this, + Invocation.method(#initExpensiveAndroidView, [], { + #id: id, + #viewType: viewType, + #layoutDirection: layoutDirection, + #creationParams: creationParams, + #creationParamsCodec: creationParamsCodec, + #onFocus: onFocus, + }), + ), + returnValueForMissingStub: _FakeExpensiveAndroidViewController_18( + this, + Invocation.method(#initExpensiveAndroidView, [], { + #id: id, + #viewType: viewType, + #layoutDirection: layoutDirection, + #creationParams: creationParams, + #creationParamsCodec: creationParamsCodec, + #onFocus: onFocus, + }), + ), + ) + as _i6.ExpensiveAndroidViewController); @override _i6.SurfaceAndroidViewController initSurfaceAndroidView({ @@ -1843,37 +2049,38 @@ class MockPlatformViewsServiceProxy extends _i1.Mock _i4.VoidCallback? onFocus, }) => (super.noSuchMethod( - Invocation.method(#initSurfaceAndroidView, [], { - #id: id, - #viewType: viewType, - #layoutDirection: layoutDirection, - #creationParams: creationParams, - #creationParamsCodec: creationParamsCodec, - #onFocus: onFocus, - }), - returnValue: _FakeSurfaceAndroidViewController_19( - this, - Invocation.method(#initSurfaceAndroidView, [], { - #id: id, - #viewType: viewType, - #layoutDirection: layoutDirection, - #creationParams: creationParams, - #creationParamsCodec: creationParamsCodec, - #onFocus: onFocus, - }), - ), - returnValueForMissingStub: _FakeSurfaceAndroidViewController_19( - this, - Invocation.method(#initSurfaceAndroidView, [], { - #id: id, - #viewType: viewType, - #layoutDirection: layoutDirection, - #creationParams: creationParams, - #creationParamsCodec: creationParamsCodec, - #onFocus: onFocus, - }), - ), - ) as _i6.SurfaceAndroidViewController); + Invocation.method(#initSurfaceAndroidView, [], { + #id: id, + #viewType: viewType, + #layoutDirection: layoutDirection, + #creationParams: creationParams, + #creationParamsCodec: creationParamsCodec, + #onFocus: onFocus, + }), + returnValue: _FakeSurfaceAndroidViewController_19( + this, + Invocation.method(#initSurfaceAndroidView, [], { + #id: id, + #viewType: viewType, + #layoutDirection: layoutDirection, + #creationParams: creationParams, + #creationParamsCodec: creationParamsCodec, + #onFocus: onFocus, + }), + ), + returnValueForMissingStub: _FakeSurfaceAndroidViewController_19( + this, + Invocation.method(#initSurfaceAndroidView, [], { + #id: id, + #viewType: viewType, + #layoutDirection: layoutDirection, + #creationParams: creationParams, + #creationParamsCodec: creationParamsCodec, + #onFocus: onFocus, + }), + ), + ) + as _i6.SurfaceAndroidViewController); } /// A class which mocks [SurfaceAndroidViewController]. @@ -1882,137 +2089,160 @@ class MockPlatformViewsServiceProxy extends _i1.Mock class MockSurfaceAndroidViewController extends _i1.Mock implements _i6.SurfaceAndroidViewController { @override - bool get requiresViewComposition => (super.noSuchMethod( - Invocation.getter(#requiresViewComposition), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); + bool get requiresViewComposition => + (super.noSuchMethod( + Invocation.getter(#requiresViewComposition), + returnValue: false, + returnValueForMissingStub: false, + ) + as bool); @override - int get viewId => (super.noSuchMethod( - Invocation.getter(#viewId), - returnValue: 0, - returnValueForMissingStub: 0, - ) as int); + int get viewId => + (super.noSuchMethod( + Invocation.getter(#viewId), + returnValue: 0, + returnValueForMissingStub: 0, + ) + as int); @override - bool get awaitingCreation => (super.noSuchMethod( - Invocation.getter(#awaitingCreation), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); + bool get awaitingCreation => + (super.noSuchMethod( + Invocation.getter(#awaitingCreation), + returnValue: false, + returnValueForMissingStub: false, + ) + as bool); @override - _i6.PointTransformer get pointTransformer => (super.noSuchMethod( - Invocation.getter(#pointTransformer), - returnValue: (_i4.Offset position) => - _FakeOffset_6(this, Invocation.getter(#pointTransformer)), - returnValueForMissingStub: (_i4.Offset position) => - _FakeOffset_6(this, Invocation.getter(#pointTransformer)), - ) as _i6.PointTransformer); + _i6.PointTransformer get pointTransformer => + (super.noSuchMethod( + Invocation.getter(#pointTransformer), + returnValue: + (_i4.Offset position) => + _FakeOffset_6(this, Invocation.getter(#pointTransformer)), + returnValueForMissingStub: + (_i4.Offset position) => + _FakeOffset_6(this, Invocation.getter(#pointTransformer)), + ) + as _i6.PointTransformer); @override set pointTransformer(_i6.PointTransformer? transformer) => super.noSuchMethod( - Invocation.setter(#pointTransformer, transformer), - returnValueForMissingStub: null, - ); + Invocation.setter(#pointTransformer, transformer), + returnValueForMissingStub: null, + ); @override - bool get isCreated => (super.noSuchMethod( - Invocation.getter(#isCreated), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); + bool get isCreated => + (super.noSuchMethod( + Invocation.getter(#isCreated), + returnValue: false, + returnValueForMissingStub: false, + ) + as bool); @override List<_i6.PlatformViewCreatedCallback> get createdCallbacks => (super.noSuchMethod( - Invocation.getter(#createdCallbacks), - returnValue: <_i6.PlatformViewCreatedCallback>[], - returnValueForMissingStub: <_i6.PlatformViewCreatedCallback>[], - ) as List<_i6.PlatformViewCreatedCallback>); + Invocation.getter(#createdCallbacks), + returnValue: <_i6.PlatformViewCreatedCallback>[], + returnValueForMissingStub: <_i6.PlatformViewCreatedCallback>[], + ) + as List<_i6.PlatformViewCreatedCallback>); @override - _i8.Future setOffset(_i4.Offset? off) => (super.noSuchMethod( - Invocation.method(#setOffset, [off]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future setOffset(_i4.Offset? off) => + (super.noSuchMethod( + Invocation.method(#setOffset, [off]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future create({_i4.Size? size, _i4.Offset? position}) => (super.noSuchMethod( - Invocation.method(#create, [], {#size: size, #position: position}), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#create, [], {#size: size, #position: position}), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future<_i4.Size> setSize(_i4.Size? size) => (super.noSuchMethod( - Invocation.method(#setSize, [size]), - returnValue: _i8.Future<_i4.Size>.value( - _FakeSize_15(this, Invocation.method(#setSize, [size])), - ), - returnValueForMissingStub: _i8.Future<_i4.Size>.value( - _FakeSize_15(this, Invocation.method(#setSize, [size])), - ), - ) as _i8.Future<_i4.Size>); + _i8.Future<_i4.Size> setSize(_i4.Size? size) => + (super.noSuchMethod( + Invocation.method(#setSize, [size]), + returnValue: _i8.Future<_i4.Size>.value( + _FakeSize_15(this, Invocation.method(#setSize, [size])), + ), + returnValueForMissingStub: _i8.Future<_i4.Size>.value( + _FakeSize_15(this, Invocation.method(#setSize, [size])), + ), + ) + as _i8.Future<_i4.Size>); @override _i8.Future sendMotionEvent(_i6.AndroidMotionEvent? event) => (super.noSuchMethod( - Invocation.method(#sendMotionEvent, [event]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#sendMotionEvent, [event]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override void addOnPlatformViewCreatedListener( _i6.PlatformViewCreatedCallback? listener, - ) => - super.noSuchMethod( - Invocation.method(#addOnPlatformViewCreatedListener, [listener]), - returnValueForMissingStub: null, - ); + ) => super.noSuchMethod( + Invocation.method(#addOnPlatformViewCreatedListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeOnPlatformViewCreatedListener( _i6.PlatformViewCreatedCallback? listener, - ) => - super.noSuchMethod( - Invocation.method(#removeOnPlatformViewCreatedListener, [listener]), - returnValueForMissingStub: null, - ); + ) => super.noSuchMethod( + Invocation.method(#removeOnPlatformViewCreatedListener, [listener]), + returnValueForMissingStub: null, + ); @override _i8.Future setLayoutDirection(_i4.TextDirection? layoutDirection) => (super.noSuchMethod( - Invocation.method(#setLayoutDirection, [layoutDirection]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setLayoutDirection, [layoutDirection]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future dispatchPointerEvent(_i11.PointerEvent? event) => (super.noSuchMethod( - Invocation.method(#dispatchPointerEvent, [event]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#dispatchPointerEvent, [event]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future clearFocus() => (super.noSuchMethod( - Invocation.method(#clearFocus, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future clearFocus() => + (super.noSuchMethod( + Invocation.method(#clearFocus, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future dispose() => (super.noSuchMethod( - Invocation.method(#dispose, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future dispose() => + (super.noSuchMethod( + Invocation.method(#dispose, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); } /// A class which mocks [WebChromeClient]. @@ -2024,45 +2254,50 @@ class MockWebChromeClient extends _i1.Mock implements _i2.WebChromeClient { _i2.WebChromeClient, _i2.WebView, _i2.FileChooserParams, - ) get onShowFileChooser => (super.noSuchMethod( - Invocation.getter(#onShowFileChooser), - returnValue: ( - _i2.WebChromeClient pigeon_instance, - _i2.WebView webView, - _i2.FileChooserParams params, - ) => - _i8.Future>.value([]), - returnValueForMissingStub: ( - _i2.WebChromeClient pigeon_instance, - _i2.WebView webView, - _i2.FileChooserParams params, - ) => - _i8.Future>.value([]), - ) as _i8.Future> Function( - _i2.WebChromeClient, - _i2.WebView, - _i2.FileChooserParams, - )); + ) + get onShowFileChooser => + (super.noSuchMethod( + Invocation.getter(#onShowFileChooser), + returnValue: + ( + _i2.WebChromeClient pigeon_instance, + _i2.WebView webView, + _i2.FileChooserParams params, + ) => _i8.Future>.value([]), + returnValueForMissingStub: + ( + _i2.WebChromeClient pigeon_instance, + _i2.WebView webView, + _i2.FileChooserParams params, + ) => _i8.Future>.value([]), + ) + as _i8.Future> Function( + _i2.WebChromeClient, + _i2.WebView, + _i2.FileChooserParams, + )); @override _i8.Future Function(_i2.WebChromeClient, _i2.WebView, String, String) - get onJsConfirm => (super.noSuchMethod( + get onJsConfirm => + (super.noSuchMethod( Invocation.getter(#onJsConfirm), - returnValue: ( - _i2.WebChromeClient pigeon_instance, - _i2.WebView webView, - String url, - String message, - ) => - _i8.Future.value(false), - returnValueForMissingStub: ( - _i2.WebChromeClient pigeon_instance, - _i2.WebView webView, - String url, - String message, - ) => - _i8.Future.value(false), - ) as _i8.Future Function( + returnValue: + ( + _i2.WebChromeClient pigeon_instance, + _i2.WebView webView, + String url, + String message, + ) => _i8.Future.value(false), + returnValueForMissingStub: + ( + _i2.WebChromeClient pigeon_instance, + _i2.WebView webView, + String url, + String message, + ) => _i8.Future.value(false), + ) + as _i8.Future Function( _i2.WebChromeClient, _i2.WebView, String, @@ -2070,76 +2305,85 @@ class MockWebChromeClient extends _i1.Mock implements _i2.WebChromeClient { )); @override - _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); @override _i8.Future setSynchronousReturnValueForOnShowFileChooser(bool? value) => (super.noSuchMethod( - Invocation.method(#setSynchronousReturnValueForOnShowFileChooser, [ - value, - ]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setSynchronousReturnValueForOnShowFileChooser, [ + value, + ]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setSynchronousReturnValueForOnConsoleMessage(bool? value) => (super.noSuchMethod( - Invocation.method(#setSynchronousReturnValueForOnConsoleMessage, [ - value, - ]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setSynchronousReturnValueForOnConsoleMessage, [ + value, + ]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setSynchronousReturnValueForOnJsAlert(bool? value) => (super.noSuchMethod( - Invocation.method(#setSynchronousReturnValueForOnJsAlert, [value]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setSynchronousReturnValueForOnJsAlert, [value]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setSynchronousReturnValueForOnJsConfirm(bool? value) => (super.noSuchMethod( - Invocation.method(#setSynchronousReturnValueForOnJsConfirm, [ - value, - ]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setSynchronousReturnValueForOnJsConfirm, [ + value, + ]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setSynchronousReturnValueForOnJsPrompt(bool? value) => (super.noSuchMethod( - Invocation.method(#setSynchronousReturnValueForOnJsPrompt, [value]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i2.WebChromeClient pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWebChromeClient_0( - this, - Invocation.method(#pigeon_copy, []), - ), - returnValueForMissingStub: _FakeWebChromeClient_0( - this, - Invocation.method(#pigeon_copy, []), - ), - ) as _i2.WebChromeClient); + Invocation.method(#setSynchronousReturnValueForOnJsPrompt, [value]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i2.WebChromeClient pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWebChromeClient_0( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeWebChromeClient_0( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WebChromeClient); } /// A class which mocks [WebSettings]. @@ -2147,159 +2391,190 @@ class MockWebChromeClient extends _i1.Mock implements _i2.WebChromeClient { /// See the documentation for Mockito's code generation for more information. class MockWebSettings extends _i1.Mock implements _i2.WebSettings { @override - _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); @override - _i8.Future setDomStorageEnabled(bool? flag) => (super.noSuchMethod( - Invocation.method(#setDomStorageEnabled, [flag]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future setDomStorageEnabled(bool? flag) => + (super.noSuchMethod( + Invocation.method(#setDomStorageEnabled, [flag]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setJavaScriptCanOpenWindowsAutomatically(bool? flag) => (super.noSuchMethod( - Invocation.method(#setJavaScriptCanOpenWindowsAutomatically, [ - flag, - ]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setJavaScriptCanOpenWindowsAutomatically, [ + flag, + ]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setSupportMultipleWindows(bool? support) => (super.noSuchMethod( - Invocation.method(#setSupportMultipleWindows, [support]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setSupportMultipleWindows, [support]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future setJavaScriptEnabled(bool? flag) => (super.noSuchMethod( - Invocation.method(#setJavaScriptEnabled, [flag]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future setJavaScriptEnabled(bool? flag) => + (super.noSuchMethod( + Invocation.method(#setJavaScriptEnabled, [flag]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setUserAgentString(String? userAgentString) => (super.noSuchMethod( - Invocation.method(#setUserAgentString, [userAgentString]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setUserAgentString, [userAgentString]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setMediaPlaybackRequiresUserGesture(bool? require) => (super.noSuchMethod( - Invocation.method(#setMediaPlaybackRequiresUserGesture, [require]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setMediaPlaybackRequiresUserGesture, [require]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future setSupportZoom(bool? support) => (super.noSuchMethod( - Invocation.method(#setSupportZoom, [support]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future setSupportZoom(bool? support) => + (super.noSuchMethod( + Invocation.method(#setSupportZoom, [support]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setLoadWithOverviewMode(bool? overview) => (super.noSuchMethod( - Invocation.method(#setLoadWithOverviewMode, [overview]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setLoadWithOverviewMode, [overview]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future setUseWideViewPort(bool? use) => (super.noSuchMethod( - Invocation.method(#setUseWideViewPort, [use]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future setUseWideViewPort(bool? use) => + (super.noSuchMethod( + Invocation.method(#setUseWideViewPort, [use]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future setDisplayZoomControls(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setDisplayZoomControls, [enabled]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future setDisplayZoomControls(bool? enabled) => + (super.noSuchMethod( + Invocation.method(#setDisplayZoomControls, [enabled]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future setBuiltInZoomControls(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setBuiltInZoomControls, [enabled]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future setBuiltInZoomControls(bool? enabled) => + (super.noSuchMethod( + Invocation.method(#setBuiltInZoomControls, [enabled]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future setAllowFileAccess(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setAllowFileAccess, [enabled]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future setAllowFileAccess(bool? enabled) => + (super.noSuchMethod( + Invocation.method(#setAllowFileAccess, [enabled]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future setAllowContentAccess(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setAllowContentAccess, [enabled]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future setAllowContentAccess(bool? enabled) => + (super.noSuchMethod( + Invocation.method(#setAllowContentAccess, [enabled]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future setGeolocationEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setGeolocationEnabled, [enabled]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future setGeolocationEnabled(bool? enabled) => + (super.noSuchMethod( + Invocation.method(#setGeolocationEnabled, [enabled]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future setTextZoom(int? textZoom) => (super.noSuchMethod( - Invocation.method(#setTextZoom, [textZoom]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future setTextZoom(int? textZoom) => + (super.noSuchMethod( + Invocation.method(#setTextZoom, [textZoom]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future getUserAgentString() => (super.noSuchMethod( - Invocation.method(#getUserAgentString, []), - returnValue: _i8.Future.value( - _i12.dummyValue( - this, - Invocation.method(#getUserAgentString, []), - ), - ), - returnValueForMissingStub: _i8.Future.value( - _i12.dummyValue( - this, + _i8.Future getUserAgentString() => + (super.noSuchMethod( Invocation.method(#getUserAgentString, []), - ), - ), - ) as _i8.Future); - - @override - _i2.WebSettings pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWebSettings_20( - this, - Invocation.method(#pigeon_copy, []), - ), - returnValueForMissingStub: _FakeWebSettings_20( - this, - Invocation.method(#pigeon_copy, []), - ), - ) as _i2.WebSettings); + returnValue: _i8.Future.value( + _i12.dummyValue( + this, + Invocation.method(#getUserAgentString, []), + ), + ), + returnValueForMissingStub: _i8.Future.value( + _i12.dummyValue( + this, + Invocation.method(#getUserAgentString, []), + ), + ), + ) + as _i8.Future); + + @override + _i2.WebSettings pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWebSettings_20( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeWebSettings_20( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WebSettings); } /// A class which mocks [WebView]. @@ -2307,51 +2582,58 @@ class MockWebSettings extends _i1.Mock implements _i2.WebSettings { /// See the documentation for Mockito's code generation for more information. class MockWebView extends _i1.Mock implements _i2.WebView { @override - _i2.WebSettings get settings => (super.noSuchMethod( - Invocation.getter(#settings), - returnValue: _FakeWebSettings_20( - this, - Invocation.getter(#settings), - ), - returnValueForMissingStub: _FakeWebSettings_20( - this, - Invocation.getter(#settings), - ), - ) as _i2.WebSettings); - - @override - _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) as _i2.PigeonInstanceManager); - - @override - _i2.WebSettings pigeonVar_settings() => (super.noSuchMethod( - Invocation.method(#pigeonVar_settings, []), - returnValue: _FakeWebSettings_20( - this, - Invocation.method(#pigeonVar_settings, []), - ), - returnValueForMissingStub: _FakeWebSettings_20( - this, - Invocation.method(#pigeonVar_settings, []), - ), - ) as _i2.WebSettings); + _i2.WebSettings get settings => + (super.noSuchMethod( + Invocation.getter(#settings), + returnValue: _FakeWebSettings_20( + this, + Invocation.getter(#settings), + ), + returnValueForMissingStub: _FakeWebSettings_20( + this, + Invocation.getter(#settings), + ), + ) + as _i2.WebSettings); + + @override + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); + + @override + _i2.WebSettings pigeonVar_settings() => + (super.noSuchMethod( + Invocation.method(#pigeonVar_settings, []), + returnValue: _FakeWebSettings_20( + this, + Invocation.method(#pigeonVar_settings, []), + ), + returnValueForMissingStub: _FakeWebSettings_20( + this, + Invocation.method(#pigeonVar_settings, []), + ), + ) + as _i2.WebSettings); @override _i8.Future loadData(String? data, String? mimeType, String? encoding) => (super.noSuchMethod( - Invocation.method(#loadData, [data, mimeType, encoding]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#loadData, [data, mimeType, encoding]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future loadDataWithBaseUrl( @@ -2362,215 +2644,258 @@ class MockWebView extends _i1.Mock implements _i2.WebView { String? historyUrl, ) => (super.noSuchMethod( - Invocation.method(#loadDataWithBaseUrl, [ - baseUrl, - data, - mimeType, - encoding, - historyUrl, - ]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#loadDataWithBaseUrl, [ + baseUrl, + data, + mimeType, + encoding, + historyUrl, + ]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future loadUrl(String? url, Map? headers) => (super.noSuchMethod( - Invocation.method(#loadUrl, [url, headers]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#loadUrl, [url, headers]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future postUrl(String? url, _i13.Uint8List? data) => (super.noSuchMethod( - Invocation.method(#postUrl, [url, data]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#postUrl, [url, data]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future getUrl() => (super.noSuchMethod( - Invocation.method(#getUrl, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future getUrl() => + (super.noSuchMethod( + Invocation.method(#getUrl, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future canGoBack() => (super.noSuchMethod( - Invocation.method(#canGoBack, []), - returnValue: _i8.Future.value(false), - returnValueForMissingStub: _i8.Future.value(false), - ) as _i8.Future); + _i8.Future canGoBack() => + (super.noSuchMethod( + Invocation.method(#canGoBack, []), + returnValue: _i8.Future.value(false), + returnValueForMissingStub: _i8.Future.value(false), + ) + as _i8.Future); @override - _i8.Future canGoForward() => (super.noSuchMethod( - Invocation.method(#canGoForward, []), - returnValue: _i8.Future.value(false), - returnValueForMissingStub: _i8.Future.value(false), - ) as _i8.Future); + _i8.Future canGoForward() => + (super.noSuchMethod( + Invocation.method(#canGoForward, []), + returnValue: _i8.Future.value(false), + returnValueForMissingStub: _i8.Future.value(false), + ) + as _i8.Future); @override - _i8.Future goBack() => (super.noSuchMethod( - Invocation.method(#goBack, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future goBack() => + (super.noSuchMethod( + Invocation.method(#goBack, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future goForward() => (super.noSuchMethod( - Invocation.method(#goForward, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future goForward() => + (super.noSuchMethod( + Invocation.method(#goForward, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future reload() => (super.noSuchMethod( - Invocation.method(#reload, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future reload() => + (super.noSuchMethod( + Invocation.method(#reload, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future clearCache(bool? includeDiskFiles) => (super.noSuchMethod( - Invocation.method(#clearCache, [includeDiskFiles]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future clearCache(bool? includeDiskFiles) => + (super.noSuchMethod( + Invocation.method(#clearCache, [includeDiskFiles]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future evaluateJavascript(String? javascriptString) => (super.noSuchMethod( - Invocation.method(#evaluateJavascript, [javascriptString]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#evaluateJavascript, [javascriptString]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future getTitle() => (super.noSuchMethod( - Invocation.method(#getTitle, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future getTitle() => + (super.noSuchMethod( + Invocation.method(#getTitle, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setWebViewClient(_i2.WebViewClient? client) => (super.noSuchMethod( - Invocation.method(#setWebViewClient, [client]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setWebViewClient, [client]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future addJavaScriptChannel(_i2.JavaScriptChannel? channel) => (super.noSuchMethod( - Invocation.method(#addJavaScriptChannel, [channel]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#addJavaScriptChannel, [channel]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future removeJavaScriptChannel(String? name) => (super.noSuchMethod( - Invocation.method(#removeJavaScriptChannel, [name]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future removeJavaScriptChannel(String? name) => + (super.noSuchMethod( + Invocation.method(#removeJavaScriptChannel, [name]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setDownloadListener(_i2.DownloadListener? listener) => (super.noSuchMethod( - Invocation.method(#setDownloadListener, [listener]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setDownloadListener, [listener]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setWebChromeClient(_i2.WebChromeClient? client) => (super.noSuchMethod( - Invocation.method(#setWebChromeClient, [client]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setWebChromeClient, [client]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future setBackgroundColor(int? color) => (super.noSuchMethod( - Invocation.method(#setBackgroundColor, [color]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future setBackgroundColor(int? color) => + (super.noSuchMethod( + Invocation.method(#setBackgroundColor, [color]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future destroy() => (super.noSuchMethod( - Invocation.method(#destroy, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future destroy() => + (super.noSuchMethod( + Invocation.method(#destroy, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i2.WebView pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWebView_7( - this, - Invocation.method(#pigeon_copy, []), - ), - returnValueForMissingStub: _FakeWebView_7( - this, - Invocation.method(#pigeon_copy, []), - ), - ) as _i2.WebView); + _i2.WebView pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWebView_7( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeWebView_7( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WebView); @override - _i8.Future scrollTo(int? x, int? y) => (super.noSuchMethod( - Invocation.method(#scrollTo, [x, y]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future scrollTo(int? x, int? y) => + (super.noSuchMethod( + Invocation.method(#scrollTo, [x, y]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future scrollBy(int? x, int? y) => (super.noSuchMethod( - Invocation.method(#scrollBy, [x, y]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + _i8.Future scrollBy(int? x, int? y) => + (super.noSuchMethod( + Invocation.method(#scrollBy, [x, y]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override - _i8.Future<_i2.WebViewPoint> getScrollPosition() => (super.noSuchMethod( - Invocation.method(#getScrollPosition, []), - returnValue: _i8.Future<_i2.WebViewPoint>.value( - _FakeWebViewPoint_21( - this, - Invocation.method(#getScrollPosition, []), - ), - ), - returnValueForMissingStub: _i8.Future<_i2.WebViewPoint>.value( - _FakeWebViewPoint_21( - this, + _i8.Future<_i2.WebViewPoint> getScrollPosition() => + (super.noSuchMethod( Invocation.method(#getScrollPosition, []), - ), - ), - ) as _i8.Future<_i2.WebViewPoint>); + returnValue: _i8.Future<_i2.WebViewPoint>.value( + _FakeWebViewPoint_21( + this, + Invocation.method(#getScrollPosition, []), + ), + ), + returnValueForMissingStub: _i8.Future<_i2.WebViewPoint>.value( + _FakeWebViewPoint_21( + this, + Invocation.method(#getScrollPosition, []), + ), + ), + ) + as _i8.Future<_i2.WebViewPoint>); @override -<<<<<<< HEAD _i8.Future setVerticalScrollBarEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setVerticalScrollBarEnabled, [enabled]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setVerticalScrollBarEnabled, [enabled]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setHorizontalScrollBarEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setHorizontalScrollBarEnabled, [enabled]), -======= + Invocation.method(#setHorizontalScrollBarEnabled, [enabled]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override _i8.Future setOverScrollMode(_i2.OverScrollMode? mode) => (super.noSuchMethod( - Invocation.method(#setOverScrollMode, [mode]), ->>>>>>> bfb42a62a56ee53010e7c2601cbf1bac993122f2 - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setOverScrollMode, [mode]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); } /// A class which mocks [WebViewClient]. @@ -2578,43 +2903,48 @@ class MockWebView extends _i1.Mock implements _i2.WebView { /// See the documentation for Mockito's code generation for more information. class MockWebViewClient extends _i1.Mock implements _i2.WebViewClient { @override - _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); @override _i8.Future setSynchronousReturnValueForShouldOverrideUrlLoading( bool? value, ) => (super.noSuchMethod( - Invocation.method( - #setSynchronousReturnValueForShouldOverrideUrlLoading, - [value], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i2.WebViewClient pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWebViewClient_1( - this, - Invocation.method(#pigeon_copy, []), - ), - returnValueForMissingStub: _FakeWebViewClient_1( - this, - Invocation.method(#pigeon_copy, []), - ), - ) as _i2.WebViewClient); + Invocation.method( + #setSynchronousReturnValueForShouldOverrideUrlLoading, + [value], + ), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i2.WebViewClient pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWebViewClient_1( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeWebViewClient_1( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WebViewClient); } /// A class which mocks [WebStorage]. @@ -2622,35 +2952,41 @@ class MockWebViewClient extends _i1.Mock implements _i2.WebViewClient { /// See the documentation for Mockito's code generation for more information. class MockWebStorage extends _i1.Mock implements _i2.WebStorage { @override - _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) as _i2.PigeonInstanceManager); - - @override - _i8.Future deleteAllData() => (super.noSuchMethod( - Invocation.method(#deleteAllData, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); - - @override - _i2.WebStorage pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWebStorage_11( - this, - Invocation.method(#pigeon_copy, []), - ), - returnValueForMissingStub: _FakeWebStorage_11( - this, - Invocation.method(#pigeon_copy, []), - ), - ) as _i2.WebStorage); + _i2.PigeonInstanceManager get pigeon_instanceManager => + (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) + as _i2.PigeonInstanceManager); + + @override + _i8.Future deleteAllData() => + (super.noSuchMethod( + Invocation.method(#deleteAllData, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); + + @override + _i2.WebStorage pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWebStorage_11( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeWebStorage_11( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WebStorage); } diff --git a/packages/webview_flutter/webview_flutter_android/test/android_webview_cookie_manager_test.mocks.dart b/packages/webview_flutter/webview_flutter_android/test/android_webview_cookie_manager_test.mocks.dart index c284dbe1aed..e7f4624138d 100644 --- a/packages/webview_flutter/webview_flutter_android/test/android_webview_cookie_manager_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_android/test/android_webview_cookie_manager_test.mocks.dart @@ -30,12 +30,12 @@ import 'package:webview_flutter_platform_interface/webview_flutter_platform_inte class _FakePigeonInstanceManager_0 extends _i1.SmartFake implements _i2.PigeonInstanceManager { _FakePigeonInstanceManager_0(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeCookieManager_1 extends _i1.SmartFake implements _i2.CookieManager { _FakeCookieManager_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakePlatformWebViewControllerCreationParams_2 extends _i1.SmartFake @@ -48,12 +48,12 @@ class _FakePlatformWebViewControllerCreationParams_2 extends _i1.SmartFake class _FakeObject_3 extends _i1.SmartFake implements Object { _FakeObject_3(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeOffset_4 extends _i1.SmartFake implements _i4.Offset { _FakeOffset_4(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } /// A class which mocks [CookieManager]. @@ -65,26 +65,32 @@ class MockCookieManager extends _i1.Mock implements _i2.CookieManager { } @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 - _i5.Future setCookie(String? url, String? value) => (super.noSuchMethod( - Invocation.method(#setCookie, [url, value]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future setCookie(String? url, String? value) => + (super.noSuchMethod( + Invocation.method(#setCookie, [url, value]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future removeAllCookies() => (super.noSuchMethod( - Invocation.method(#removeAllCookies, []), - returnValue: _i5.Future.value(false), - ) as _i5.Future); + _i5.Future removeAllCookies() => + (super.noSuchMethod( + Invocation.method(#removeAllCookies, []), + returnValue: _i5.Future.value(false), + ) + as _i5.Future); @override _i5.Future setAcceptThirdPartyCookies( @@ -92,19 +98,22 @@ class MockCookieManager extends _i1.Mock implements _i2.CookieManager { bool? accept, ) => (super.noSuchMethod( - Invocation.method(#setAcceptThirdPartyCookies, [webView, accept]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setAcceptThirdPartyCookies, [webView, accept]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i2.CookieManager pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeCookieManager_1( - this, - Invocation.method(#pigeon_copy, []), - ), - ) as _i2.CookieManager); + _i2.CookieManager pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeCookieManager_1( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.CookieManager); } /// A class which mocks [AndroidWebViewController]. @@ -122,273 +131,330 @@ class MockAndroidWebViewController extends _i1.Mock as int); @override - _i3.PlatformWebViewControllerCreationParams get params => (super.noSuchMethod( - Invocation.getter(#params), - returnValue: _FakePlatformWebViewControllerCreationParams_2( - this, - Invocation.getter(#params), - ), - ) as _i3.PlatformWebViewControllerCreationParams); + _i3.PlatformWebViewControllerCreationParams get params => + (super.noSuchMethod( + Invocation.getter(#params), + returnValue: _FakePlatformWebViewControllerCreationParams_2( + this, + Invocation.getter(#params), + ), + ) + as _i3.PlatformWebViewControllerCreationParams); @override - _i5.Future setAllowFileAccess(bool? allow) => (super.noSuchMethod( - Invocation.method(#setAllowFileAccess, [allow]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future setAllowFileAccess(bool? allow) => + (super.noSuchMethod( + Invocation.method(#setAllowFileAccess, [allow]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future loadFile(String? absoluteFilePath) => (super.noSuchMethod( - Invocation.method(#loadFile, [absoluteFilePath]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future loadFile(String? absoluteFilePath) => + (super.noSuchMethod( + Invocation.method(#loadFile, [absoluteFilePath]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future loadFlutterAsset(String? key) => (super.noSuchMethod( - Invocation.method(#loadFlutterAsset, [key]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future loadFlutterAsset(String? key) => + (super.noSuchMethod( + Invocation.method(#loadFlutterAsset, [key]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future loadHtmlString(String? html, {String? baseUrl}) => (super.noSuchMethod( - Invocation.method(#loadHtmlString, [html], {#baseUrl: baseUrl}), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#loadHtmlString, [html], {#baseUrl: baseUrl}), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future loadRequest(_i3.LoadRequestParams? params) => (super.noSuchMethod( - Invocation.method(#loadRequest, [params]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#loadRequest, [params]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future currentUrl() => (super.noSuchMethod( - Invocation.method(#currentUrl, []), - returnValue: _i5.Future.value(), - ) as _i5.Future); + _i5.Future currentUrl() => + (super.noSuchMethod( + Invocation.method(#currentUrl, []), + returnValue: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future canGoBack() => (super.noSuchMethod( - Invocation.method(#canGoBack, []), - returnValue: _i5.Future.value(false), - ) as _i5.Future); + _i5.Future canGoBack() => + (super.noSuchMethod( + Invocation.method(#canGoBack, []), + returnValue: _i5.Future.value(false), + ) + as _i5.Future); @override - _i5.Future canGoForward() => (super.noSuchMethod( - Invocation.method(#canGoForward, []), - returnValue: _i5.Future.value(false), - ) as _i5.Future); + _i5.Future canGoForward() => + (super.noSuchMethod( + Invocation.method(#canGoForward, []), + returnValue: _i5.Future.value(false), + ) + as _i5.Future); @override - _i5.Future goBack() => (super.noSuchMethod( - Invocation.method(#goBack, []), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future goBack() => + (super.noSuchMethod( + Invocation.method(#goBack, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future goForward() => (super.noSuchMethod( - Invocation.method(#goForward, []), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future goForward() => + (super.noSuchMethod( + Invocation.method(#goForward, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future reload() => (super.noSuchMethod( - Invocation.method(#reload, []), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future reload() => + (super.noSuchMethod( + Invocation.method(#reload, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future clearCache() => (super.noSuchMethod( - Invocation.method(#clearCache, []), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future clearCache() => + (super.noSuchMethod( + Invocation.method(#clearCache, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future clearLocalStorage() => (super.noSuchMethod( - Invocation.method(#clearLocalStorage, []), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future clearLocalStorage() => + (super.noSuchMethod( + Invocation.method(#clearLocalStorage, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setPlatformNavigationDelegate( _i3.PlatformNavigationDelegate? handler, ) => (super.noSuchMethod( - Invocation.method(#setPlatformNavigationDelegate, [handler]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setPlatformNavigationDelegate, [handler]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future runJavaScript(String? javaScript) => (super.noSuchMethod( - Invocation.method(#runJavaScript, [javaScript]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future runJavaScript(String? javaScript) => + (super.noSuchMethod( + Invocation.method(#runJavaScript, [javaScript]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future runJavaScriptReturningResult(String? javaScript) => (super.noSuchMethod( - Invocation.method(#runJavaScriptReturningResult, [javaScript]), - returnValue: _i5.Future.value( - _FakeObject_3( - this, Invocation.method(#runJavaScriptReturningResult, [javaScript]), - ), - ), - ) as _i5.Future); + returnValue: _i5.Future.value( + _FakeObject_3( + this, + Invocation.method(#runJavaScriptReturningResult, [javaScript]), + ), + ), + ) + as _i5.Future); @override _i5.Future addJavaScriptChannel( _i3.JavaScriptChannelParams? javaScriptChannelParams, ) => (super.noSuchMethod( - Invocation.method(#addJavaScriptChannel, [javaScriptChannelParams]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#addJavaScriptChannel, [javaScriptChannelParams]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future removeJavaScriptChannel(String? javaScriptChannelName) => (super.noSuchMethod( - Invocation.method(#removeJavaScriptChannel, [ - javaScriptChannelName, - ]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#removeJavaScriptChannel, [ + javaScriptChannelName, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future getTitle() => (super.noSuchMethod( - Invocation.method(#getTitle, []), - returnValue: _i5.Future.value(), - ) as _i5.Future); + _i5.Future getTitle() => + (super.noSuchMethod( + Invocation.method(#getTitle, []), + returnValue: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future scrollTo(int? x, int? y) => (super.noSuchMethod( - Invocation.method(#scrollTo, [x, y]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future scrollTo(int? x, int? y) => + (super.noSuchMethod( + Invocation.method(#scrollTo, [x, y]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future scrollBy(int? x, int? y) => (super.noSuchMethod( - Invocation.method(#scrollBy, [x, y]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future scrollBy(int? x, int? y) => + (super.noSuchMethod( + Invocation.method(#scrollBy, [x, y]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future<_i4.Offset> getScrollPosition() => (super.noSuchMethod( - Invocation.method(#getScrollPosition, []), - returnValue: _i5.Future<_i4.Offset>.value( - _FakeOffset_4(this, Invocation.method(#getScrollPosition, [])), - ), - ) as _i5.Future<_i4.Offset>); + _i5.Future<_i4.Offset> getScrollPosition() => + (super.noSuchMethod( + Invocation.method(#getScrollPosition, []), + returnValue: _i5.Future<_i4.Offset>.value( + _FakeOffset_4(this, Invocation.method(#getScrollPosition, [])), + ), + ) + as _i5.Future<_i4.Offset>); @override - _i5.Future enableZoom(bool? enabled) => (super.noSuchMethod( - Invocation.method(#enableZoom, [enabled]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future enableZoom(bool? enabled) => + (super.noSuchMethod( + Invocation.method(#enableZoom, [enabled]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future setBackgroundColor(_i4.Color? color) => (super.noSuchMethod( - Invocation.method(#setBackgroundColor, [color]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future setBackgroundColor(_i4.Color? color) => + (super.noSuchMethod( + Invocation.method(#setBackgroundColor, [color]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setJavaScriptMode(_i3.JavaScriptMode? javaScriptMode) => (super.noSuchMethod( - Invocation.method(#setJavaScriptMode, [javaScriptMode]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setJavaScriptMode, [javaScriptMode]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future setUserAgent(String? userAgent) => (super.noSuchMethod( - Invocation.method(#setUserAgent, [userAgent]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future setUserAgent(String? userAgent) => + (super.noSuchMethod( + Invocation.method(#setUserAgent, [userAgent]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setOnScrollPositionChange( void Function(_i3.ScrollPositionChange)? onScrollPositionChange, ) => (super.noSuchMethod( - Invocation.method(#setOnScrollPositionChange, [ - onScrollPositionChange, - ]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setOnScrollPositionChange, [ + onScrollPositionChange, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setMediaPlaybackRequiresUserGesture(bool? require) => (super.noSuchMethod( - Invocation.method(#setMediaPlaybackRequiresUserGesture, [require]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setMediaPlaybackRequiresUserGesture, [require]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future setTextZoom(int? textZoom) => (super.noSuchMethod( - Invocation.method(#setTextZoom, [textZoom]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future setTextZoom(int? textZoom) => + (super.noSuchMethod( + Invocation.method(#setTextZoom, [textZoom]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future setAllowContentAccess(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setAllowContentAccess, [enabled]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future setAllowContentAccess(bool? enabled) => + (super.noSuchMethod( + Invocation.method(#setAllowContentAccess, [enabled]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future setGeolocationEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setGeolocationEnabled, [enabled]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future setGeolocationEnabled(bool? enabled) => + (super.noSuchMethod( + Invocation.method(#setGeolocationEnabled, [enabled]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setOnShowFileSelector( _i5.Future> Function(_i6.FileSelectorParams)? - onShowFileSelector, + onShowFileSelector, ) => (super.noSuchMethod( - Invocation.method(#setOnShowFileSelector, [onShowFileSelector]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setOnShowFileSelector, [onShowFileSelector]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setOnPlatformPermissionRequest( void Function(_i3.PlatformWebViewPermissionRequest)? onPermissionRequest, ) => (super.noSuchMethod( - Invocation.method(#setOnPlatformPermissionRequest, [ - onPermissionRequest, - ]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setOnPlatformPermissionRequest, [ + onPermissionRequest, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setGeolocationPermissionsPromptCallbacks({ @@ -396,13 +462,14 @@ class MockAndroidWebViewController extends _i1.Mock _i6.OnGeolocationPermissionsHidePrompt? onHidePrompt, }) => (super.noSuchMethod( - Invocation.method(#setGeolocationPermissionsPromptCallbacks, [], { - #onShowPrompt: onShowPrompt, - #onHidePrompt: onHidePrompt, - }), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setGeolocationPermissionsPromptCallbacks, [], { + #onShowPrompt: onShowPrompt, + #onHidePrompt: onHidePrompt, + }), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setCustomWidgetCallbacks({ @@ -410,88 +477,100 @@ class MockAndroidWebViewController extends _i1.Mock required _i6.OnHideCustomWidgetCallback? onHideCustomWidget, }) => (super.noSuchMethod( - Invocation.method(#setCustomWidgetCallbacks, [], { - #onShowCustomWidget: onShowCustomWidget, - #onHideCustomWidget: onHideCustomWidget, - }), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setCustomWidgetCallbacks, [], { + #onShowCustomWidget: onShowCustomWidget, + #onHideCustomWidget: onHideCustomWidget, + }), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setOnConsoleMessage( void Function(_i3.JavaScriptConsoleMessage)? onConsoleMessage, ) => (super.noSuchMethod( - Invocation.method(#setOnConsoleMessage, [onConsoleMessage]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setOnConsoleMessage, [onConsoleMessage]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future getUserAgent() => (super.noSuchMethod( - Invocation.method(#getUserAgent, []), - returnValue: _i5.Future.value(), - ) as _i5.Future); + _i5.Future getUserAgent() => + (super.noSuchMethod( + Invocation.method(#getUserAgent, []), + returnValue: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setOnJavaScriptAlertDialog( _i5.Future Function(_i3.JavaScriptAlertDialogRequest)? - onJavaScriptAlertDialog, + onJavaScriptAlertDialog, ) => (super.noSuchMethod( - Invocation.method(#setOnJavaScriptAlertDialog, [ - onJavaScriptAlertDialog, - ]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setOnJavaScriptAlertDialog, [ + onJavaScriptAlertDialog, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setOnJavaScriptConfirmDialog( _i5.Future Function(_i3.JavaScriptConfirmDialogRequest)? - onJavaScriptConfirmDialog, + onJavaScriptConfirmDialog, ) => (super.noSuchMethod( - Invocation.method(#setOnJavaScriptConfirmDialog, [ - onJavaScriptConfirmDialog, - ]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setOnJavaScriptConfirmDialog, [ + onJavaScriptConfirmDialog, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setOnJavaScriptTextInputDialog( _i5.Future Function(_i3.JavaScriptTextInputDialogRequest)? - onJavaScriptTextInputDialog, + onJavaScriptTextInputDialog, ) => (super.noSuchMethod( - Invocation.method(#setOnJavaScriptTextInputDialog, [ - onJavaScriptTextInputDialog, - ]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setOnJavaScriptTextInputDialog, [ + onJavaScriptTextInputDialog, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override -<<<<<<< HEAD _i5.Future setVerticalScrollBarEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setVerticalScrollBarEnabled, [enabled]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setVerticalScrollBarEnabled, [enabled]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setHorizontalScrollBarEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setHorizontalScrollBarEnabled, [enabled]), -======= + Invocation.method(#setHorizontalScrollBarEnabled, [enabled]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); + + @override _i5.Future setOverScrollMode(_i3.WebViewOverScrollMode? mode) => (super.noSuchMethod( - Invocation.method(#setOverScrollMode, [mode]), ->>>>>>> bfb42a62a56ee53010e7c2601cbf1bac993122f2 - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setOverScrollMode, [mode]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); } diff --git a/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_cookie_manager_test.mocks.dart b/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_cookie_manager_test.mocks.dart index 68d1d82b29c..74d4075c1b5 100644 --- a/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_cookie_manager_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_cookie_manager_test.mocks.dart @@ -25,12 +25,12 @@ import 'package:webview_flutter_android/src/android_webkit.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 _FakeCookieManager_1 extends _i1.SmartFake implements _i2.CookieManager { _FakeCookieManager_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } /// A class which mocks [CookieManager]. @@ -42,26 +42,32 @@ class MockCookieManager extends _i1.Mock implements _i2.CookieManager { } @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(String? url, String? value) => (super.noSuchMethod( - Invocation.method(#setCookie, [url, value]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + _i3.Future setCookie(String? url, String? value) => + (super.noSuchMethod( + Invocation.method(#setCookie, [url, value]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override - _i3.Future removeAllCookies() => (super.noSuchMethod( - Invocation.method(#removeAllCookies, []), - returnValue: _i3.Future.value(false), - ) as _i3.Future); + _i3.Future removeAllCookies() => + (super.noSuchMethod( + Invocation.method(#removeAllCookies, []), + returnValue: _i3.Future.value(false), + ) + as _i3.Future); @override _i3.Future setAcceptThirdPartyCookies( @@ -69,17 +75,20 @@ class MockCookieManager extends _i1.Mock implements _i2.CookieManager { bool? accept, ) => (super.noSuchMethod( - Invocation.method(#setAcceptThirdPartyCookies, [webView, accept]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#setAcceptThirdPartyCookies, [webView, accept]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override - _i2.CookieManager pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeCookieManager_1( - this, - Invocation.method(#pigeon_copy, []), - ), - ) as _i2.CookieManager); + _i2.CookieManager pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeCookieManager_1( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.CookieManager); } diff --git a/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_widget_test.mocks.dart b/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_widget_test.mocks.dart index f7712c8b9d7..d60a80b7501 100644 --- a/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_widget_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_widget_test.mocks.dart @@ -31,68 +31,68 @@ import 'package:webview_flutter_platform_interface/src/webview_flutter_platform_ class _FakePigeonInstanceManager_0 extends _i1.SmartFake implements _i2.PigeonInstanceManager { _FakePigeonInstanceManager_0(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeFlutterAssetManager_1 extends _i1.SmartFake implements _i2.FlutterAssetManager { _FakeFlutterAssetManager_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWebSettings_2 extends _i1.SmartFake implements _i2.WebSettings { _FakeWebSettings_2(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWebStorage_3 extends _i1.SmartFake implements _i2.WebStorage { _FakeWebStorage_3(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWebView_4 extends _i1.SmartFake implements _i2.WebView { _FakeWebView_4(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWebViewPoint_5 extends _i1.SmartFake implements _i2.WebViewPoint { _FakeWebViewPoint_5(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWebResourceRequest_6 extends _i1.SmartFake implements _i2.WebResourceRequest { _FakeWebResourceRequest_6(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeDownloadListener_7 extends _i1.SmartFake implements _i2.DownloadListener { _FakeDownloadListener_7(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeJavascriptChannelRegistry_8 extends _i1.SmartFake implements _i3.JavascriptChannelRegistry { _FakeJavascriptChannelRegistry_8(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeJavaScriptChannel_9 extends _i1.SmartFake implements _i2.JavaScriptChannel { _FakeJavaScriptChannel_9(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWebChromeClient_10 extends _i1.SmartFake implements _i2.WebChromeClient { _FakeWebChromeClient_10(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWebViewClient_11 extends _i1.SmartFake implements _i2.WebViewClient { _FakeWebViewClient_11(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } /// A class which mocks [FlutterAssetManager]. @@ -105,40 +105,47 @@ class MockFlutterAssetManager 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> list(String? path) => (super.noSuchMethod( - Invocation.method(#list, [path]), - returnValue: _i4.Future>.value([]), - ) as _i4.Future>); + _i4.Future> list(String? path) => + (super.noSuchMethod( + Invocation.method(#list, [path]), + returnValue: _i4.Future>.value([]), + ) + as _i4.Future>); @override _i4.Future getAssetFilePathByName(String? name) => (super.noSuchMethod( - Invocation.method(#getAssetFilePathByName, [name]), - returnValue: _i4.Future.value( - _i5.dummyValue( - this, Invocation.method(#getAssetFilePathByName, [name]), - ), - ), - ) as _i4.Future); - - @override - _i2.FlutterAssetManager pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeFlutterAssetManager_1( - this, - Invocation.method(#pigeon_copy, []), - ), - ) as _i2.FlutterAssetManager); + returnValue: _i4.Future.value( + _i5.dummyValue( + this, + Invocation.method(#getAssetFilePathByName, [name]), + ), + ), + ) + as _i4.Future); + + @override + _i2.FlutterAssetManager pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeFlutterAssetManager_1( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.FlutterAssetManager); } /// A class which mocks [WebSettings]. @@ -150,145 +157,176 @@ class MockWebSettings extends _i1.Mock implements _i2.WebSettings { } @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 setDomStorageEnabled(bool? flag) => (super.noSuchMethod( - Invocation.method(#setDomStorageEnabled, [flag]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + _i4.Future setDomStorageEnabled(bool? flag) => + (super.noSuchMethod( + Invocation.method(#setDomStorageEnabled, [flag]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override _i4.Future setJavaScriptCanOpenWindowsAutomatically(bool? flag) => (super.noSuchMethod( - Invocation.method(#setJavaScriptCanOpenWindowsAutomatically, [ - flag, - ]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#setJavaScriptCanOpenWindowsAutomatically, [ + flag, + ]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override _i4.Future setSupportMultipleWindows(bool? support) => (super.noSuchMethod( - Invocation.method(#setSupportMultipleWindows, [support]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#setSupportMultipleWindows, [support]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override - _i4.Future setJavaScriptEnabled(bool? flag) => (super.noSuchMethod( - Invocation.method(#setJavaScriptEnabled, [flag]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + _i4.Future setJavaScriptEnabled(bool? flag) => + (super.noSuchMethod( + Invocation.method(#setJavaScriptEnabled, [flag]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override _i4.Future setUserAgentString(String? userAgentString) => (super.noSuchMethod( - Invocation.method(#setUserAgentString, [userAgentString]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#setUserAgentString, [userAgentString]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override _i4.Future setMediaPlaybackRequiresUserGesture(bool? require) => (super.noSuchMethod( - Invocation.method(#setMediaPlaybackRequiresUserGesture, [require]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#setMediaPlaybackRequiresUserGesture, [require]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override - _i4.Future setSupportZoom(bool? support) => (super.noSuchMethod( - Invocation.method(#setSupportZoom, [support]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + _i4.Future setSupportZoom(bool? support) => + (super.noSuchMethod( + Invocation.method(#setSupportZoom, [support]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override _i4.Future setLoadWithOverviewMode(bool? overview) => (super.noSuchMethod( - Invocation.method(#setLoadWithOverviewMode, [overview]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#setLoadWithOverviewMode, [overview]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override - _i4.Future setUseWideViewPort(bool? use) => (super.noSuchMethod( - Invocation.method(#setUseWideViewPort, [use]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + _i4.Future setUseWideViewPort(bool? use) => + (super.noSuchMethod( + Invocation.method(#setUseWideViewPort, [use]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override - _i4.Future setDisplayZoomControls(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setDisplayZoomControls, [enabled]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + _i4.Future setDisplayZoomControls(bool? enabled) => + (super.noSuchMethod( + Invocation.method(#setDisplayZoomControls, [enabled]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override - _i4.Future setBuiltInZoomControls(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setBuiltInZoomControls, [enabled]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + _i4.Future setBuiltInZoomControls(bool? enabled) => + (super.noSuchMethod( + Invocation.method(#setBuiltInZoomControls, [enabled]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override - _i4.Future setAllowFileAccess(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setAllowFileAccess, [enabled]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + _i4.Future setAllowFileAccess(bool? enabled) => + (super.noSuchMethod( + Invocation.method(#setAllowFileAccess, [enabled]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override - _i4.Future setAllowContentAccess(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setAllowContentAccess, [enabled]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + _i4.Future setAllowContentAccess(bool? enabled) => + (super.noSuchMethod( + Invocation.method(#setAllowContentAccess, [enabled]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override - _i4.Future setGeolocationEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setGeolocationEnabled, [enabled]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + _i4.Future setGeolocationEnabled(bool? enabled) => + (super.noSuchMethod( + Invocation.method(#setGeolocationEnabled, [enabled]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override - _i4.Future setTextZoom(int? textZoom) => (super.noSuchMethod( - Invocation.method(#setTextZoom, [textZoom]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + _i4.Future setTextZoom(int? textZoom) => + (super.noSuchMethod( + Invocation.method(#setTextZoom, [textZoom]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override - _i4.Future getUserAgentString() => (super.noSuchMethod( - Invocation.method(#getUserAgentString, []), - returnValue: _i4.Future.value( - _i5.dummyValue( - this, + _i4.Future getUserAgentString() => + (super.noSuchMethod( Invocation.method(#getUserAgentString, []), - ), - ), - ) as _i4.Future); - - @override - _i2.WebSettings pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWebSettings_2( - this, - Invocation.method(#pigeon_copy, []), - ), - ) as _i2.WebSettings); + returnValue: _i4.Future.value( + _i5.dummyValue( + this, + Invocation.method(#getUserAgentString, []), + ), + ), + ) + as _i4.Future); + + @override + _i2.WebSettings pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWebSettings_2( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WebSettings); } /// A class which mocks [WebStorage]. @@ -300,29 +338,35 @@ class MockWebStorage extends _i1.Mock implements _i2.WebStorage { } @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 deleteAllData() => (super.noSuchMethod( - Invocation.method(#deleteAllData, []), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + _i4.Future deleteAllData() => + (super.noSuchMethod( + Invocation.method(#deleteAllData, []), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override - _i2.WebStorage pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWebStorage_3( - this, - Invocation.method(#pigeon_copy, []), - ), - ) as _i2.WebStorage); + _i2.WebStorage pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWebStorage_3( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WebStorage); } /// A class which mocks [WebView]. @@ -334,36 +378,43 @@ class MockWebView extends _i1.Mock implements _i2.WebView { } @override - _i2.WebSettings get settings => (super.noSuchMethod( - Invocation.getter(#settings), - returnValue: _FakeWebSettings_2(this, Invocation.getter(#settings)), - ) as _i2.WebSettings); + _i2.WebSettings get settings => + (super.noSuchMethod( + Invocation.getter(#settings), + returnValue: _FakeWebSettings_2(this, Invocation.getter(#settings)), + ) + as _i2.WebSettings); @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.WebSettings pigeonVar_settings() => (super.noSuchMethod( - Invocation.method(#pigeonVar_settings, []), - returnValue: _FakeWebSettings_2( - this, - Invocation.method(#pigeonVar_settings, []), - ), - ) as _i2.WebSettings); + _i2.WebSettings pigeonVar_settings() => + (super.noSuchMethod( + Invocation.method(#pigeonVar_settings, []), + returnValue: _FakeWebSettings_2( + this, + Invocation.method(#pigeonVar_settings, []), + ), + ) + as _i2.WebSettings); @override _i4.Future loadData(String? data, String? mimeType, String? encoding) => (super.noSuchMethod( - Invocation.method(#loadData, [data, mimeType, encoding]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#loadData, [data, mimeType, encoding]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override _i4.Future loadDataWithBaseUrl( @@ -374,200 +425,243 @@ class MockWebView extends _i1.Mock implements _i2.WebView { String? historyUrl, ) => (super.noSuchMethod( - Invocation.method(#loadDataWithBaseUrl, [ - baseUrl, - data, - mimeType, - encoding, - historyUrl, - ]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#loadDataWithBaseUrl, [ + baseUrl, + data, + mimeType, + encoding, + historyUrl, + ]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override _i4.Future loadUrl(String? url, Map? headers) => (super.noSuchMethod( - Invocation.method(#loadUrl, [url, headers]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#loadUrl, [url, headers]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override _i4.Future postUrl(String? url, _i6.Uint8List? data) => (super.noSuchMethod( - Invocation.method(#postUrl, [url, data]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#postUrl, [url, data]), + 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 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 clearCache(bool? includeDiskFiles) => (super.noSuchMethod( - Invocation.method(#clearCache, [includeDiskFiles]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + _i4.Future clearCache(bool? includeDiskFiles) => + (super.noSuchMethod( + Invocation.method(#clearCache, [includeDiskFiles]), + 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 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 setWebViewClient(_i2.WebViewClient? client) => (super.noSuchMethod( - Invocation.method(#setWebViewClient, [client]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#setWebViewClient, [client]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override _i4.Future addJavaScriptChannel(_i2.JavaScriptChannel? channel) => (super.noSuchMethod( - Invocation.method(#addJavaScriptChannel, [channel]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#addJavaScriptChannel, [channel]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override - _i4.Future removeJavaScriptChannel(String? name) => (super.noSuchMethod( - Invocation.method(#removeJavaScriptChannel, [name]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + _i4.Future removeJavaScriptChannel(String? name) => + (super.noSuchMethod( + Invocation.method(#removeJavaScriptChannel, [name]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override _i4.Future setDownloadListener(_i2.DownloadListener? listener) => (super.noSuchMethod( - Invocation.method(#setDownloadListener, [listener]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#setDownloadListener, [listener]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override _i4.Future setWebChromeClient(_i2.WebChromeClient? client) => (super.noSuchMethod( - Invocation.method(#setWebChromeClient, [client]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#setWebChromeClient, [client]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override - _i4.Future setBackgroundColor(int? color) => (super.noSuchMethod( - Invocation.method(#setBackgroundColor, [color]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + _i4.Future setBackgroundColor(int? color) => + (super.noSuchMethod( + Invocation.method(#setBackgroundColor, [color]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override - _i4.Future destroy() => (super.noSuchMethod( - Invocation.method(#destroy, []), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + _i4.Future destroy() => + (super.noSuchMethod( + Invocation.method(#destroy, []), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override - _i2.WebView pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWebView_4( - this, - Invocation.method(#pigeon_copy, []), - ), - ) as _i2.WebView); + _i2.WebView pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWebView_4( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WebView); @override - _i4.Future scrollTo(int? x, int? y) => (super.noSuchMethod( - Invocation.method(#scrollTo, [x, y]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + _i4.Future scrollTo(int? x, int? y) => + (super.noSuchMethod( + Invocation.method(#scrollTo, [x, y]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override - _i4.Future scrollBy(int? x, int? y) => (super.noSuchMethod( - Invocation.method(#scrollBy, [x, y]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + _i4.Future scrollBy(int? x, int? y) => + (super.noSuchMethod( + Invocation.method(#scrollBy, [x, y]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override - _i4.Future<_i2.WebViewPoint> getScrollPosition() => (super.noSuchMethod( - Invocation.method(#getScrollPosition, []), - returnValue: _i4.Future<_i2.WebViewPoint>.value( - _FakeWebViewPoint_5( - this, + _i4.Future<_i2.WebViewPoint> getScrollPosition() => + (super.noSuchMethod( Invocation.method(#getScrollPosition, []), - ), - ), - ) as _i4.Future<_i2.WebViewPoint>); + returnValue: _i4.Future<_i2.WebViewPoint>.value( + _FakeWebViewPoint_5( + this, + Invocation.method(#getScrollPosition, []), + ), + ), + ) + as _i4.Future<_i2.WebViewPoint>); @override -<<<<<<< HEAD _i4.Future setVerticalScrollBarEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setVerticalScrollBarEnabled, [enabled]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#setVerticalScrollBarEnabled, [enabled]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override _i4.Future setHorizontalScrollBarEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setHorizontalScrollBarEnabled, [enabled]), -======= + Invocation.method(#setHorizontalScrollBarEnabled, [enabled]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); + + @override _i4.Future setOverScrollMode(_i2.OverScrollMode? mode) => (super.noSuchMethod( - Invocation.method(#setOverScrollMode, [mode]), ->>>>>>> bfb42a62a56ee53010e7c2601cbf1bac993122f2 - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#setOverScrollMode, [mode]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); } /// A class which mocks [WebResourceRequest]. @@ -580,16 +674,20 @@ class MockWebResourceRequest extends _i1.Mock } @override - String get url => (super.noSuchMethod( - Invocation.getter(#url), - returnValue: _i5.dummyValue(this, Invocation.getter(#url)), - ) as String); + String get url => + (super.noSuchMethod( + Invocation.getter(#url), + returnValue: _i5.dummyValue(this, Invocation.getter(#url)), + ) + as String); @override - bool get isForMainFrame => (super.noSuchMethod( - Invocation.getter(#isForMainFrame), - returnValue: false, - ) as bool); + bool get isForMainFrame => + (super.noSuchMethod( + Invocation.getter(#isForMainFrame), + returnValue: false, + ) + as bool); @override bool get hasGesture => @@ -597,31 +695,37 @@ class MockWebResourceRequest extends _i1.Mock as bool); @override - String get method => (super.noSuchMethod( - Invocation.getter(#method), - returnValue: _i5.dummyValue( - this, - Invocation.getter(#method), - ), - ) as String); + String get method => + (super.noSuchMethod( + Invocation.getter(#method), + returnValue: _i5.dummyValue( + this, + Invocation.getter(#method), + ), + ) + as String); @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.WebResourceRequest pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWebResourceRequest_6( - this, - Invocation.method(#pigeon_copy, []), - ), - ) as _i2.WebResourceRequest); + _i2.WebResourceRequest pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWebResourceRequest_6( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WebResourceRequest); } /// A class which mocks [DownloadListener]. @@ -634,17 +738,20 @@ class MockDownloadListener extends _i1.Mock implements _i2.DownloadListener { @override void Function(_i2.DownloadListener, String, String, String, String, int) - get onDownloadStart => (super.noSuchMethod( + get onDownloadStart => + (super.noSuchMethod( Invocation.getter(#onDownloadStart), - returnValue: ( - _i2.DownloadListener pigeon_instance, - String url, - String userAgent, - String contentDisposition, - String mimetype, - int contentLength, - ) {}, - ) as void Function( + returnValue: + ( + _i2.DownloadListener pigeon_instance, + String url, + String userAgent, + String contentDisposition, + String mimetype, + int contentLength, + ) {}, + ) + as void Function( _i2.DownloadListener, String, String, @@ -654,22 +761,26 @@ class MockDownloadListener extends _i1.Mock implements _i2.DownloadListener { )); @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.DownloadListener pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeDownloadListener_7( - this, - Invocation.method(#pigeon_copy, []), - ), - ) as _i2.DownloadListener); + _i2.DownloadListener pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeDownloadListener_7( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.DownloadListener); } /// A class which mocks [WebViewAndroidJavaScriptChannel]. @@ -684,46 +795,55 @@ class MockWebViewAndroidJavaScriptChannel extends _i1.Mock @override _i3.JavascriptChannelRegistry get javascriptChannelRegistry => (super.noSuchMethod( - Invocation.getter(#javascriptChannelRegistry), - returnValue: _FakeJavascriptChannelRegistry_8( - this, - Invocation.getter(#javascriptChannelRegistry), - ), - ) as _i3.JavascriptChannelRegistry); + Invocation.getter(#javascriptChannelRegistry), + returnValue: _FakeJavascriptChannelRegistry_8( + this, + Invocation.getter(#javascriptChannelRegistry), + ), + ) + as _i3.JavascriptChannelRegistry); @override - String get channelName => (super.noSuchMethod( - Invocation.getter(#channelName), - returnValue: _i5.dummyValue( - this, - Invocation.getter(#channelName), - ), - ) as String); + String get channelName => + (super.noSuchMethod( + Invocation.getter(#channelName), + returnValue: _i5.dummyValue( + this, + Invocation.getter(#channelName), + ), + ) + as String); @override void Function(_i2.JavaScriptChannel, String) get postMessage => (super.noSuchMethod( - Invocation.getter(#postMessage), - returnValue: (_i2.JavaScriptChannel pigeon_instance, String message) {}, - ) as void Function(_i2.JavaScriptChannel, String)); + Invocation.getter(#postMessage), + returnValue: + (_i2.JavaScriptChannel pigeon_instance, String message) {}, + ) + as void Function(_i2.JavaScriptChannel, String)); @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.JavaScriptChannel pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeJavaScriptChannel_9( - this, - Invocation.method(#pigeon_copy, []), - ), - ) as _i2.JavaScriptChannel); + _i2.JavaScriptChannel pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeJavaScriptChannel_9( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.JavaScriptChannel); } /// A class which mocks [WebChromeClient]. @@ -739,32 +859,37 @@ class MockWebChromeClient extends _i1.Mock implements _i2.WebChromeClient { _i2.WebChromeClient, _i2.WebView, _i2.FileChooserParams, - ) get onShowFileChooser => (super.noSuchMethod( - Invocation.getter(#onShowFileChooser), - returnValue: ( - _i2.WebChromeClient pigeon_instance, - _i2.WebView webView, - _i2.FileChooserParams params, - ) => - _i4.Future>.value([]), - ) as _i4.Future> Function( - _i2.WebChromeClient, - _i2.WebView, - _i2.FileChooserParams, - )); + ) + get onShowFileChooser => + (super.noSuchMethod( + Invocation.getter(#onShowFileChooser), + returnValue: + ( + _i2.WebChromeClient pigeon_instance, + _i2.WebView webView, + _i2.FileChooserParams params, + ) => _i4.Future>.value([]), + ) + as _i4.Future> Function( + _i2.WebChromeClient, + _i2.WebView, + _i2.FileChooserParams, + )); @override _i4.Future Function(_i2.WebChromeClient, _i2.WebView, String, String) - get onJsConfirm => (super.noSuchMethod( + get onJsConfirm => + (super.noSuchMethod( Invocation.getter(#onJsConfirm), - returnValue: ( - _i2.WebChromeClient pigeon_instance, - _i2.WebView webView, - String url, - String message, - ) => - _i4.Future.value(false), - ) as _i4.Future Function( + returnValue: + ( + _i2.WebChromeClient pigeon_instance, + _i2.WebView webView, + String url, + String message, + ) => _i4.Future.value(false), + ) + as _i4.Future Function( _i2.WebChromeClient, _i2.WebView, String, @@ -772,68 +897,77 @@ class MockWebChromeClient extends _i1.Mock implements _i2.WebChromeClient { )); @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 setSynchronousReturnValueForOnShowFileChooser(bool? value) => (super.noSuchMethod( - Invocation.method(#setSynchronousReturnValueForOnShowFileChooser, [ - value, - ]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#setSynchronousReturnValueForOnShowFileChooser, [ + value, + ]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override _i4.Future setSynchronousReturnValueForOnConsoleMessage(bool? value) => (super.noSuchMethod( - Invocation.method(#setSynchronousReturnValueForOnConsoleMessage, [ - value, - ]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#setSynchronousReturnValueForOnConsoleMessage, [ + value, + ]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override _i4.Future setSynchronousReturnValueForOnJsAlert(bool? value) => (super.noSuchMethod( - Invocation.method(#setSynchronousReturnValueForOnJsAlert, [value]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#setSynchronousReturnValueForOnJsAlert, [value]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override _i4.Future setSynchronousReturnValueForOnJsConfirm(bool? value) => (super.noSuchMethod( - Invocation.method(#setSynchronousReturnValueForOnJsConfirm, [ - value, - ]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#setSynchronousReturnValueForOnJsConfirm, [ + value, + ]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override _i4.Future setSynchronousReturnValueForOnJsPrompt(bool? value) => (super.noSuchMethod( - Invocation.method(#setSynchronousReturnValueForOnJsPrompt, [value]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#setSynchronousReturnValueForOnJsPrompt, [value]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override - _i2.WebChromeClient pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWebChromeClient_10( - this, - Invocation.method(#pigeon_copy, []), - ), - ) as _i2.WebChromeClient); + _i2.WebChromeClient pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWebChromeClient_10( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WebChromeClient); } /// A class which mocks [WebViewClient]. @@ -845,35 +979,40 @@ class MockWebViewClient extends _i1.Mock implements _i2.WebViewClient { } @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 setSynchronousReturnValueForShouldOverrideUrlLoading( bool? value, ) => (super.noSuchMethod( - Invocation.method( - #setSynchronousReturnValueForShouldOverrideUrlLoading, - [value], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - - @override - _i2.WebViewClient pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWebViewClient_11( - this, - Invocation.method(#pigeon_copy, []), - ), - ) as _i2.WebViewClient); + Invocation.method( + #setSynchronousReturnValueForShouldOverrideUrlLoading, + [value], + ), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); + + @override + _i2.WebViewClient pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWebViewClient_11( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WebViewClient); } /// A class which mocks [JavascriptChannelRegistry]. @@ -886,10 +1025,12 @@ 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) => @@ -921,36 +1062,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(_i3.WebResourceError? error) => super.noSuchMethod( - Invocation.method(#onWebResourceError, [error]), - returnValueForMissingStub: null, - ); + Invocation.method(#onWebResourceError, [error]), + returnValueForMissingStub: null, + ); } /// A class which mocks [WebViewProxy]. @@ -962,13 +1104,15 @@ class MockWebViewProxy extends _i1.Mock implements _i7.WebViewProxy { } @override - _i2.WebView createWebView() => (super.noSuchMethod( - Invocation.method(#createWebView, []), - returnValue: _FakeWebView_4( - this, - Invocation.method(#createWebView, []), - ), - ) as _i2.WebView); + _i2.WebView createWebView() => + (super.noSuchMethod( + Invocation.method(#createWebView, []), + returnValue: _FakeWebView_4( + this, + Invocation.method(#createWebView, []), + ), + ) + as _i2.WebView); @override _i2.WebViewClient createWebViewClient({ @@ -979,66 +1123,65 @@ class MockWebViewProxy extends _i1.Mock implements _i7.WebViewProxy { _i2.WebView, _i2.WebResourceRequest, _i2.WebResourceError, - )? onReceivedRequestError, + )? + onReceivedRequestError, void Function(_i2.WebViewClient, _i2.WebView, int, String, String)? - onReceivedError, + onReceivedError, void Function(_i2.WebViewClient, _i2.WebView, _i2.WebResourceRequest)? - requestLoading, -<<<<<<< HEAD -======= + requestLoading, void Function( _i2.WebViewClient, _i2.WebView, _i2.AndroidMessage, _i2.AndroidMessage, - )? onFormResubmission, + )? + onFormResubmission, void Function(_i2.WebViewClient, _i2.WebView, _i2.ClientCertRequest)? - onReceivedClientCertRequest, + onReceivedClientCertRequest, void Function( _i2.WebViewClient, _i2.WebView, _i2.SslErrorHandler, _i2.SslError, - )? onReceivedSslError, ->>>>>>> bfb42a62a56ee53010e7c2601cbf1bac993122f2 + )? + onReceivedSslError, void Function(_i2.WebViewClient, _i2.WebView, String)? urlLoading, }) => (super.noSuchMethod( - Invocation.method(#createWebViewClient, [], { - #onPageStarted: onPageStarted, - #onPageFinished: onPageFinished, - #onReceivedRequestError: onReceivedRequestError, - #onReceivedError: onReceivedError, - #requestLoading: requestLoading, -<<<<<<< HEAD -======= - #onFormResubmission: onFormResubmission, - #onReceivedClientCertRequest: onReceivedClientCertRequest, - #onReceivedSslError: onReceivedSslError, ->>>>>>> bfb42a62a56ee53010e7c2601cbf1bac993122f2 - #urlLoading: urlLoading, - }), - returnValue: _FakeWebViewClient_11( - this, - Invocation.method(#createWebViewClient, [], { - #onPageStarted: onPageStarted, - #onPageFinished: onPageFinished, - #onReceivedRequestError: onReceivedRequestError, - #onReceivedError: onReceivedError, - #requestLoading: requestLoading, - #onFormResubmission: onFormResubmission, - #onReceivedClientCertRequest: onReceivedClientCertRequest, - #onReceivedSslError: onReceivedSslError, - #urlLoading: urlLoading, - }), - ), - ) as _i2.WebViewClient); + Invocation.method(#createWebViewClient, [], { + #onPageStarted: onPageStarted, + #onPageFinished: onPageFinished, + #onReceivedRequestError: onReceivedRequestError, + #onReceivedError: onReceivedError, + #requestLoading: requestLoading, + #onFormResubmission: onFormResubmission, + #onReceivedClientCertRequest: onReceivedClientCertRequest, + #onReceivedSslError: onReceivedSslError, + #urlLoading: urlLoading, + }), + returnValue: _FakeWebViewClient_11( + this, + Invocation.method(#createWebViewClient, [], { + #onPageStarted: onPageStarted, + #onPageFinished: onPageFinished, + #onReceivedRequestError: onReceivedRequestError, + #onReceivedError: onReceivedError, + #requestLoading: requestLoading, + #onFormResubmission: onFormResubmission, + #onReceivedClientCertRequest: onReceivedClientCertRequest, + #onReceivedSslError: onReceivedSslError, + #urlLoading: urlLoading, + }), + ), + ) + as _i2.WebViewClient); @override _i4.Future setWebContentsDebuggingEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setWebContentsDebuggingEnabled, [enabled]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#setWebContentsDebuggingEnabled, [enabled]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); } 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 68afb89a786..e4e4b0956c6 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,18 +1,13 @@ // 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. -<<<<<<< HEAD -// Autogenerated from Pigeon (v24.2.2), do not edit directly. -======= // Autogenerated from Pigeon (v25.3.0), do not edit directly. ->>>>>>> bfb42a62a56ee53010e7c2601cbf1bac993122f2 // See also: https://pub.dev/packages/pigeon import Foundation import WebKit - #if !os(macOS) - import UIKit +import UIKit #endif #if os(iOS) @@ -68,9 +63,7 @@ private func wrapError(_ error: Any) -> [Any?] { } private func createConnectionError(withChannelName channelName: String) -> PigeonError { - return PigeonError( - code: "channel-error", message: "Unable to establish connection on channel: '\(channelName)'.", - details: "") + return PigeonError(code: "channel-error", message: "Unable to establish connection on channel: '\(channelName)'.", details: "") } private func isNullish(_ value: Any?) -> Bool { @@ -88,6 +81,7 @@ protocol WebKitLibraryPigeonInternalFinalizerDelegate: AnyObject { func onDeinit(identifier: Int64) } + // Attaches to an object to receive a callback when the object is deallocated. internal final class WebKitLibraryPigeonInternalFinalizer { private static let associatedObjectKey = malloc(1)! @@ -103,8 +97,7 @@ internal final class WebKitLibraryPigeonInternalFinalizer { } internal static func attach( - to instance: AnyObject, identifier: Int64, - delegate: WebKitLibraryPigeonInternalFinalizerDelegate + to instance: AnyObject, identifier: Int64, delegate: WebKitLibraryPigeonInternalFinalizerDelegate ) { let finalizer = WebKitLibraryPigeonInternalFinalizer(identifier: identifier, delegate: delegate) objc_setAssociatedObject(instance, associatedObjectKey, finalizer, .OBJC_ASSOCIATION_RETAIN) @@ -119,6 +112,7 @@ internal final class WebKitLibraryPigeonInternalFinalizer { } } + /// Maintains instances used to communicate with the corresponding objects in Dart. /// /// Objects stored in this container are represented by an object in Dart that is also stored in @@ -222,8 +216,7 @@ final class WebKitLibraryPigeonInstanceManager { identifiers.setObject(NSNumber(value: identifier), forKey: instance) weakInstances.setObject(instance, forKey: NSNumber(value: identifier)) strongInstances.setObject(instance, forKey: NSNumber(value: identifier)) - WebKitLibraryPigeonInternalFinalizer.attach( - to: instance, identifier: identifier, delegate: finalizerDelegate) + WebKitLibraryPigeonInternalFinalizer.attach(to: instance, identifier: identifier, delegate: finalizerDelegate) } /// Retrieves the identifier paired with an instance. @@ -300,6 +293,7 @@ final class WebKitLibraryPigeonInstanceManager { } } + private class WebKitLibraryPigeonInstanceManagerApi { /// The codec used for serializing messages. var codec: FlutterStandardMessageCodec { WebKitLibraryPigeonCodec.shared } @@ -312,14 +306,9 @@ private class WebKitLibraryPigeonInstanceManagerApi { } /// Sets up an instance of `WebKitLibraryPigeonInstanceManagerApi` to handle messages through the `binaryMessenger`. - static func setUpMessageHandlers( - binaryMessenger: FlutterBinaryMessenger, instanceManager: WebKitLibraryPigeonInstanceManager? - ) { + static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, instanceManager: WebKitLibraryPigeonInstanceManager?) { let codec = WebKitLibraryPigeonCodec.shared - let removeStrongReferenceChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.webview_flutter_wkwebview.PigeonInternalInstanceManager.removeStrongReference", - binaryMessenger: binaryMessenger, codec: codec) + let removeStrongReferenceChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.PigeonInternalInstanceManager.removeStrongReference", binaryMessenger: binaryMessenger, codec: codec) if let instanceManager = instanceManager { removeStrongReferenceChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -334,9 +323,7 @@ private class WebKitLibraryPigeonInstanceManagerApi { } else { removeStrongReferenceChannel.setMessageHandler(nil) } - let clearChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.PigeonInternalInstanceManager.clear", - binaryMessenger: binaryMessenger, codec: codec) + let clearChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.PigeonInternalInstanceManager.clear", binaryMessenger: binaryMessenger, codec: codec) if let instanceManager = instanceManager { clearChannel.setMessageHandler { _, reply in do { @@ -352,13 +339,9 @@ private class WebKitLibraryPigeonInstanceManagerApi { } /// Sends a message to the Dart `InstanceManager` to remove the strong reference of the instance associated with `identifier`. - func removeStrongReference( - identifier identifierArg: Int64, completion: @escaping (Result) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.PigeonInternalInstanceManager.removeStrongReference" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func removeStrongReference(identifier identifierArg: Int64, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.PigeonInternalInstanceManager.removeStrongReference" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([identifierArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -381,141 +364,111 @@ protocol WebKitLibraryPigeonProxyApiDelegate { func pigeonApiURLRequest(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiURLRequest /// An implementation of [PigeonApiHTTPURLResponse] used to add a new Dart instance of /// `HTTPURLResponse` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiHTTPURLResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiHTTPURLResponse + func pigeonApiHTTPURLResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiHTTPURLResponse /// An implementation of [PigeonApiURLResponse] used to add a new Dart instance of /// `URLResponse` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiURLResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiURLResponse + func pigeonApiURLResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiURLResponse /// An implementation of [PigeonApiWKUserScript] used to add a new Dart instance of /// `WKUserScript` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKUserScript(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiWKUserScript + func pigeonApiWKUserScript(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKUserScript /// An implementation of [PigeonApiWKNavigationAction] used to add a new Dart instance of /// `WKNavigationAction` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKNavigationAction(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiWKNavigationAction + func pigeonApiWKNavigationAction(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKNavigationAction /// An implementation of [PigeonApiWKNavigationResponse] used to add a new Dart instance of /// `WKNavigationResponse` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKNavigationResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiWKNavigationResponse + func pigeonApiWKNavigationResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKNavigationResponse /// An implementation of [PigeonApiWKFrameInfo] used to add a new Dart instance of /// `WKFrameInfo` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKFrameInfo(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiWKFrameInfo + func pigeonApiWKFrameInfo(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKFrameInfo /// An implementation of [PigeonApiNSError] used to add a new Dart instance of /// `NSError` to the Dart `InstanceManager` and make calls to Dart. func pigeonApiNSError(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiNSError /// An implementation of [PigeonApiWKScriptMessage] used to add a new Dart instance of /// `WKScriptMessage` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKScriptMessage(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiWKScriptMessage + func pigeonApiWKScriptMessage(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKScriptMessage /// An implementation of [PigeonApiWKSecurityOrigin] used to add a new Dart instance of /// `WKSecurityOrigin` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKSecurityOrigin(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiWKSecurityOrigin + func pigeonApiWKSecurityOrigin(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKSecurityOrigin /// An implementation of [PigeonApiHTTPCookie] used to add a new Dart instance of /// `HTTPCookie` to the Dart `InstanceManager` and make calls to Dart. func pigeonApiHTTPCookie(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiHTTPCookie /// An implementation of [PigeonApiAuthenticationChallengeResponse] used to add a new Dart instance of /// `AuthenticationChallengeResponse` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiAuthenticationChallengeResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiAuthenticationChallengeResponse + func pigeonApiAuthenticationChallengeResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiAuthenticationChallengeResponse /// An implementation of [PigeonApiWKWebsiteDataStore] used to add a new Dart instance of /// `WKWebsiteDataStore` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKWebsiteDataStore(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiWKWebsiteDataStore + func pigeonApiWKWebsiteDataStore(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKWebsiteDataStore /// An implementation of [PigeonApiUIView] used to add a new Dart instance of /// `UIView` to the Dart `InstanceManager` and make calls to Dart. func pigeonApiUIView(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiUIView /// An implementation of [PigeonApiUIScrollView] used to add a new Dart instance of /// `UIScrollView` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiUIScrollView(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiUIScrollView + func pigeonApiUIScrollView(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiUIScrollView /// An implementation of [PigeonApiWKWebViewConfiguration] used to add a new Dart instance of /// `WKWebViewConfiguration` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKWebViewConfiguration(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiWKWebViewConfiguration + func pigeonApiWKWebViewConfiguration(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKWebViewConfiguration /// An implementation of [PigeonApiWKUserContentController] used to add a new Dart instance of /// `WKUserContentController` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKUserContentController(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiWKUserContentController + func pigeonApiWKUserContentController(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKUserContentController /// An implementation of [PigeonApiWKPreferences] used to add a new Dart instance of /// `WKPreferences` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKPreferences(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiWKPreferences + func pigeonApiWKPreferences(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKPreferences /// An implementation of [PigeonApiWKScriptMessageHandler] used to add a new Dart instance of /// `WKScriptMessageHandler` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKScriptMessageHandler(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiWKScriptMessageHandler + func pigeonApiWKScriptMessageHandler(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKScriptMessageHandler /// An implementation of [PigeonApiWKNavigationDelegate] used to add a new Dart instance of /// `WKNavigationDelegate` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKNavigationDelegate(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiWKNavigationDelegate + func pigeonApiWKNavigationDelegate(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKNavigationDelegate /// An implementation of [PigeonApiNSObject] used to add a new Dart instance of /// `NSObject` to the Dart `InstanceManager` and make calls to Dart. func pigeonApiNSObject(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiNSObject /// An implementation of [PigeonApiUIViewWKWebView] used to add a new Dart instance of /// `UIViewWKWebView` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiUIViewWKWebView(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiUIViewWKWebView + func pigeonApiUIViewWKWebView(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiUIViewWKWebView /// An implementation of [PigeonApiNSViewWKWebView] used to add a new Dart instance of /// `NSViewWKWebView` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiNSViewWKWebView(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiNSViewWKWebView + func pigeonApiNSViewWKWebView(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiNSViewWKWebView /// An implementation of [PigeonApiWKWebView] used to add a new Dart instance of /// `WKWebView` to the Dart `InstanceManager` and make calls to Dart. func pigeonApiWKWebView(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKWebView /// An implementation of [PigeonApiWKUIDelegate] used to add a new Dart instance of /// `WKUIDelegate` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKUIDelegate(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiWKUIDelegate + func pigeonApiWKUIDelegate(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKUIDelegate /// An implementation of [PigeonApiWKHTTPCookieStore] used to add a new Dart instance of /// `WKHTTPCookieStore` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKHTTPCookieStore(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiWKHTTPCookieStore + func pigeonApiWKHTTPCookieStore(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKHTTPCookieStore /// An implementation of [PigeonApiUIScrollViewDelegate] used to add a new Dart instance of /// `UIScrollViewDelegate` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiUIScrollViewDelegate(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiUIScrollViewDelegate + func pigeonApiUIScrollViewDelegate(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiUIScrollViewDelegate /// An implementation of [PigeonApiURLCredential] used to add a new Dart instance of /// `URLCredential` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiURLCredential(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiURLCredential + func pigeonApiURLCredential(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiURLCredential /// An implementation of [PigeonApiURLProtectionSpace] used to add a new Dart instance of /// `URLProtectionSpace` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiURLProtectionSpace(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiURLProtectionSpace + func pigeonApiURLProtectionSpace(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiURLProtectionSpace /// An implementation of [PigeonApiURLAuthenticationChallenge] used to add a new Dart instance of /// `URLAuthenticationChallenge` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiURLAuthenticationChallenge(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiURLAuthenticationChallenge + func pigeonApiURLAuthenticationChallenge(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiURLAuthenticationChallenge /// 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 + func pigeonApiWKWebpagePreferences(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKWebpagePreferences /// An implementation of [PigeonApiGetTrustResultResponse] used to add a new Dart instance of /// `GetTrustResultResponse` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiGetTrustResultResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiGetTrustResultResponse + func pigeonApiGetTrustResultResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiGetTrustResultResponse /// An implementation of [PigeonApiSecTrust] used to add a new Dart instance of /// `SecTrust` to the Dart `InstanceManager` and make calls to Dart. func pigeonApiSecTrust(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiSecTrust /// An implementation of [PigeonApiSecCertificate] used to add a new Dart instance of /// `SecCertificate` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiSecCertificate(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiSecCertificate + func pigeonApiSecCertificate(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiSecCertificate } extension WebKitLibraryPigeonProxyApiDelegate { - func pigeonApiURLResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) - -> PigeonApiURLResponse - { - return PigeonApiURLResponse( - pigeonRegistrar: registrar, delegate: PigeonApiDelegateURLResponse()) + func pigeonApiURLResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiURLResponse { + return PigeonApiURLResponse(pigeonRegistrar: registrar, delegate: PigeonApiDelegateURLResponse()) } func pigeonApiWKWebView(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKWebView { return PigeonApiWKWebView(pigeonRegistrar: registrar, delegate: PigeonApiDelegateWKWebView()) @@ -560,72 +513,43 @@ open class WebKitLibraryPigeonProxyApiRegistrar { } func setUp() { - WebKitLibraryPigeonInstanceManagerApi.setUpMessageHandlers( - binaryMessenger: binaryMessenger, instanceManager: instanceManager) - PigeonApiURLRequest.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiURLRequest(self)) - PigeonApiWKUserScript.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKUserScript(self)) - PigeonApiHTTPCookie.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiHTTPCookie(self)) - PigeonApiAuthenticationChallengeResponse.setUpMessageHandlers( - binaryMessenger: binaryMessenger, - api: apiDelegate.pigeonApiAuthenticationChallengeResponse(self)) - PigeonApiWKWebsiteDataStore.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKWebsiteDataStore(self)) - PigeonApiUIView.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiUIView(self)) - PigeonApiUIScrollView.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiUIScrollView(self)) - PigeonApiWKWebViewConfiguration.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKWebViewConfiguration(self)) - PigeonApiWKUserContentController.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKUserContentController(self)) - PigeonApiWKPreferences.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKPreferences(self)) - PigeonApiWKScriptMessageHandler.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKScriptMessageHandler(self)) - PigeonApiWKNavigationDelegate.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKNavigationDelegate(self)) - PigeonApiNSObject.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiNSObject(self)) - PigeonApiUIViewWKWebView.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiUIViewWKWebView(self)) - PigeonApiNSViewWKWebView.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiNSViewWKWebView(self)) - PigeonApiWKUIDelegate.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKUIDelegate(self)) - PigeonApiWKHTTPCookieStore.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKHTTPCookieStore(self)) - PigeonApiUIScrollViewDelegate.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiUIScrollViewDelegate(self)) - PigeonApiURLCredential.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiURLCredential(self)) - PigeonApiURLAuthenticationChallenge.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiURLAuthenticationChallenge(self)) - PigeonApiURL.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiURL(self)) - PigeonApiWKWebpagePreferences.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKWebpagePreferences(self)) - PigeonApiSecTrust.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiSecTrust(self)) - PigeonApiSecCertificate.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiSecCertificate(self)) + WebKitLibraryPigeonInstanceManagerApi.setUpMessageHandlers(binaryMessenger: binaryMessenger, instanceManager: instanceManager) + PigeonApiURLRequest.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiURLRequest(self)) + PigeonApiWKUserScript.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKUserScript(self)) + PigeonApiHTTPCookie.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiHTTPCookie(self)) + PigeonApiAuthenticationChallengeResponse.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiAuthenticationChallengeResponse(self)) + PigeonApiWKWebsiteDataStore.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKWebsiteDataStore(self)) + PigeonApiUIView.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiUIView(self)) + PigeonApiUIScrollView.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiUIScrollView(self)) + PigeonApiWKWebViewConfiguration.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKWebViewConfiguration(self)) + PigeonApiWKUserContentController.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKUserContentController(self)) + PigeonApiWKPreferences.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKPreferences(self)) + PigeonApiWKScriptMessageHandler.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKScriptMessageHandler(self)) + PigeonApiWKNavigationDelegate.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKNavigationDelegate(self)) + PigeonApiNSObject.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiNSObject(self)) + PigeonApiUIViewWKWebView.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiUIViewWKWebView(self)) + PigeonApiNSViewWKWebView.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiNSViewWKWebView(self)) + PigeonApiWKUIDelegate.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKUIDelegate(self)) + PigeonApiWKHTTPCookieStore.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKHTTPCookieStore(self)) + PigeonApiUIScrollViewDelegate.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiUIScrollViewDelegate(self)) + PigeonApiURLCredential.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiURLCredential(self)) + PigeonApiURLAuthenticationChallenge.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiURLAuthenticationChallenge(self)) + PigeonApiURL.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiURL(self)) + PigeonApiWKWebpagePreferences.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKWebpagePreferences(self)) + PigeonApiSecTrust.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiSecTrust(self)) + PigeonApiSecCertificate.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiSecCertificate(self)) } func tearDown() { - WebKitLibraryPigeonInstanceManagerApi.setUpMessageHandlers( - binaryMessenger: binaryMessenger, instanceManager: nil) + WebKitLibraryPigeonInstanceManagerApi.setUpMessageHandlers(binaryMessenger: binaryMessenger, instanceManager: nil) PigeonApiURLRequest.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiWKUserScript.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiHTTPCookie.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) - PigeonApiAuthenticationChallengeResponse.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: nil) + PigeonApiAuthenticationChallengeResponse.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiWKWebsiteDataStore.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiUIView.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiUIScrollView.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiWKWebViewConfiguration.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) - PigeonApiWKUserContentController.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: nil) + PigeonApiWKUserContentController.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiWKPreferences.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiWKScriptMessageHandler.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiWKNavigationDelegate.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) @@ -636,8 +560,7 @@ open class WebKitLibraryPigeonProxyApiRegistrar { PigeonApiWKHTTPCookieStore.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiUIScrollViewDelegate.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiURLCredential.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) - PigeonApiURLAuthenticationChallenge.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: nil) + PigeonApiURLAuthenticationChallenge.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiURL.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiWKWebpagePreferences.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiSecTrust.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) @@ -680,272 +603,252 @@ private class WebKitLibraryPigeonInternalProxyApiCodecReaderWriter: FlutterStand } override func writeValue(_ value: Any) { - if value is [Any] || value is Bool || value is Data || value is [AnyHashable: Any] - || value is Double || value is FlutterStandardTypedData || value is Int64 || value is String - || value is KeyValueObservingOptions || value is KeyValueChange - || value is KeyValueChangeKey || value is UserScriptInjectionTime - || value is AudiovisualMediaType || value is WebsiteDataType - || value is NavigationActionPolicy || value is NavigationResponsePolicy - || value is HttpCookiePropertyKey || value is NavigationType || value is PermissionDecision - || value is MediaCaptureType || value is UrlSessionAuthChallengeDisposition - || value is UrlCredentialPersistence || value is DartSecTrustResultType - { + if value is [Any] || value is Bool || value is Data || value is [AnyHashable: Any] || value is Double || value is FlutterStandardTypedData || value is Int64 || value is String || value is KeyValueObservingOptions || value is KeyValueChange || value is KeyValueChangeKey || value is UserScriptInjectionTime || value is AudiovisualMediaType || value is WebsiteDataType || value is NavigationActionPolicy || value is NavigationResponsePolicy || value is HttpCookiePropertyKey || value is NavigationType || value is PermissionDecision || value is MediaCaptureType || value is UrlSessionAuthChallengeDisposition || value is UrlCredentialPersistence || value is DartSecTrustResultType { super.writeValue(value) return } + if let instance = value as? URLRequestWrapper { pigeonRegistrar.apiDelegate.pigeonApiURLRequest(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } + if let instance = value as? HTTPURLResponse { pigeonRegistrar.apiDelegate.pigeonApiHTTPURLResponse(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } + if let instance = value as? URLResponse { pigeonRegistrar.apiDelegate.pigeonApiURLResponse(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } + if let instance = value as? WKUserScript { pigeonRegistrar.apiDelegate.pigeonApiWKUserScript(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } + if let instance = value as? WKNavigationAction { pigeonRegistrar.apiDelegate.pigeonApiWKNavigationAction(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } + if let instance = value as? WKNavigationResponse { - pigeonRegistrar.apiDelegate.pigeonApiWKNavigationResponse(pigeonRegistrar) - .pigeonNewInstance( - pigeonInstance: instance - ) { _ in } + pigeonRegistrar.apiDelegate.pigeonApiWKNavigationResponse(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } + if let instance = value as? WKFrameInfo { pigeonRegistrar.apiDelegate.pigeonApiWKFrameInfo(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } + if let instance = value as? NSError { pigeonRegistrar.apiDelegate.pigeonApiNSError(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } + if let instance = value as? WKScriptMessage { pigeonRegistrar.apiDelegate.pigeonApiWKScriptMessage(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } + if let instance = value as? WKSecurityOrigin { pigeonRegistrar.apiDelegate.pigeonApiWKSecurityOrigin(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } + if let instance = value as? HTTPCookie { pigeonRegistrar.apiDelegate.pigeonApiHTTPCookie(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } + if let instance = value as? AuthenticationChallengeResponse { - pigeonRegistrar.apiDelegate.pigeonApiAuthenticationChallengeResponse(pigeonRegistrar) - .pigeonNewInstance( - pigeonInstance: instance - ) { _ in } + pigeonRegistrar.apiDelegate.pigeonApiAuthenticationChallengeResponse(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } + if let instance = value as? WKWebsiteDataStore { pigeonRegistrar.apiDelegate.pigeonApiWKWebsiteDataStore(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } #if !os(macOS) - if let instance = value as? UIScrollView { - pigeonRegistrar.apiDelegate.pigeonApiUIScrollView(pigeonRegistrar).pigeonNewInstance( - pigeonInstance: instance - ) { _ in } - super.writeByte(128) - super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) - return - } + if let instance = value as? UIScrollView { + pigeonRegistrar.apiDelegate.pigeonApiUIScrollView(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + return + } #endif if let instance = value as? WKWebViewConfiguration { - pigeonRegistrar.apiDelegate.pigeonApiWKWebViewConfiguration(pigeonRegistrar) - .pigeonNewInstance( - pigeonInstance: instance - ) { _ in } + pigeonRegistrar.apiDelegate.pigeonApiWKWebViewConfiguration(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } + if let instance = value as? WKUserContentController { - pigeonRegistrar.apiDelegate.pigeonApiWKUserContentController(pigeonRegistrar) - .pigeonNewInstance( - pigeonInstance: instance - ) { _ in } + pigeonRegistrar.apiDelegate.pigeonApiWKUserContentController(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } + if let instance = value as? WKPreferences { pigeonRegistrar.apiDelegate.pigeonApiWKPreferences(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } + if let instance = value as? WKScriptMessageHandler { - pigeonRegistrar.apiDelegate.pigeonApiWKScriptMessageHandler(pigeonRegistrar) - .pigeonNewInstance( - pigeonInstance: instance - ) { _ in } + pigeonRegistrar.apiDelegate.pigeonApiWKScriptMessageHandler(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } + if let instance = value as? WKNavigationDelegate { - pigeonRegistrar.apiDelegate.pigeonApiWKNavigationDelegate(pigeonRegistrar) - .pigeonNewInstance( - pigeonInstance: instance - ) { _ in } + pigeonRegistrar.apiDelegate.pigeonApiWKNavigationDelegate(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } #if !os(macOS) - if let instance = value as? WKWebView { - pigeonRegistrar.apiDelegate.pigeonApiUIViewWKWebView(pigeonRegistrar).pigeonNewInstance( - pigeonInstance: instance - ) { _ in } - super.writeByte(128) - super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) - return - } + if let instance = value as? WKWebView { + pigeonRegistrar.apiDelegate.pigeonApiUIViewWKWebView(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + return + } #endif #if !os(macOS) - if let instance = value as? UIView { - pigeonRegistrar.apiDelegate.pigeonApiUIView(pigeonRegistrar).pigeonNewInstance( - pigeonInstance: instance - ) { _ in } - super.writeByte(128) - super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) - return - } + if let instance = value as? UIView { + pigeonRegistrar.apiDelegate.pigeonApiUIView(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + return + } #endif #if !os(iOS) - if let instance = value as? WKWebView { - pigeonRegistrar.apiDelegate.pigeonApiNSViewWKWebView(pigeonRegistrar).pigeonNewInstance( - pigeonInstance: instance - ) { _ in } - super.writeByte(128) - super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) - return - } + if let instance = value as? WKWebView { + pigeonRegistrar.apiDelegate.pigeonApiNSViewWKWebView(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + return + } #endif if let instance = value as? WKWebView { @@ -954,45 +857,42 @@ private class WebKitLibraryPigeonInternalProxyApiCodecReaderWriter: FlutterStand ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } + if let instance = value as? WKUIDelegate { pigeonRegistrar.apiDelegate.pigeonApiWKUIDelegate(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } + if let instance = value as? WKHTTPCookieStore { pigeonRegistrar.apiDelegate.pigeonApiWKHTTPCookieStore(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } #if !os(macOS) - if let instance = value as? UIScrollViewDelegate { - pigeonRegistrar.apiDelegate.pigeonApiUIScrollViewDelegate(pigeonRegistrar) - .pigeonNewInstance( - pigeonInstance: instance - ) { _ in } - super.writeByte(128) - super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) - return - } + if let instance = value as? UIScrollViewDelegate { + pigeonRegistrar.apiDelegate.pigeonApiUIScrollViewDelegate(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + return + } #endif if let instance = value as? URLCredential { @@ -1001,104 +901,100 @@ private class WebKitLibraryPigeonInternalProxyApiCodecReaderWriter: FlutterStand ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } + if let instance = value as? URLProtectionSpace { pigeonRegistrar.apiDelegate.pigeonApiURLProtectionSpace(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } + if let instance = value as? URLAuthenticationChallenge { - pigeonRegistrar.apiDelegate.pigeonApiURLAuthenticationChallenge(pigeonRegistrar) - .pigeonNewInstance( - pigeonInstance: instance - ) { _ in } + pigeonRegistrar.apiDelegate.pigeonApiURLAuthenticationChallenge(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } + if let instance = value as? URL { pigeonRegistrar.apiDelegate.pigeonApiURL(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } + if #available(iOS 13.0.0, macOS 10.15.0, *), let instance = value as? WKWebpagePreferences { - pigeonRegistrar.apiDelegate.pigeonApiWKWebpagePreferences(pigeonRegistrar) - .pigeonNewInstance( - pigeonInstance: instance - ) { _ in } + pigeonRegistrar.apiDelegate.pigeonApiWKWebpagePreferences(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } + if let instance = value as? GetTrustResultResponse { - pigeonRegistrar.apiDelegate.pigeonApiGetTrustResultResponse(pigeonRegistrar) - .pigeonNewInstance( - pigeonInstance: instance - ) { _ in } + pigeonRegistrar.apiDelegate.pigeonApiGetTrustResultResponse(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } + if let instance = value as? SecTrustWrapper { pigeonRegistrar.apiDelegate.pigeonApiSecTrust(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } + if let instance = value as? SecCertificateWrapper { pigeonRegistrar.apiDelegate.pigeonApiSecCertificate(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } + if let instance = value as? NSObject { pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) return } - if let instance = value as AnyObject?, - pigeonRegistrar.instanceManager.containsInstance(instance) + + if let instance = value as AnyObject?, pigeonRegistrar.instanceManager.containsInstance(instance) { super.writeByte(128) super.writeValue( @@ -1116,13 +1012,11 @@ private class WebKitLibraryPigeonInternalProxyApiCodecReaderWriter: FlutterStand } override func reader(with data: Data) -> FlutterStandardReader { - return WebKitLibraryPigeonInternalProxyApiCodecReader( - data: data, pigeonRegistrar: pigeonRegistrar) + return WebKitLibraryPigeonInternalProxyApiCodecReader(data: data, pigeonRegistrar: pigeonRegistrar) } override func writer(with data: NSMutableData) -> FlutterStandardWriter { - return WebKitLibraryPigeonInternalProxyApiCodecWriter( - data: data, pigeonRegistrar: pigeonRegistrar) + return WebKitLibraryPigeonInternalProxyApiCodecWriter(data: data, pigeonRegistrar: pigeonRegistrar) } } @@ -1583,36 +1477,27 @@ class WebKitLibraryPigeonCodec: FlutterStandardMessageCodec, @unchecked Sendable } protocol PigeonApiDelegateURLRequest { - func pigeonDefaultConstructor(pigeonApi: PigeonApiURLRequest, url: String) throws - -> URLRequestWrapper + func pigeonDefaultConstructor(pigeonApi: PigeonApiURLRequest, url: String) throws -> URLRequestWrapper /// The URL being requested. func getUrl(pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper) throws -> String? /// The HTTP request method. - func setHttpMethod( - pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper, method: String?) throws + func setHttpMethod(pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper, method: String?) throws /// The HTTP request method. - func getHttpMethod(pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper) throws - -> String? + func getHttpMethod(pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper) throws -> String? /// The request body. - func setHttpBody( - pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper, - body: FlutterStandardTypedData?) throws + func setHttpBody(pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper, body: FlutterStandardTypedData?) throws /// The request body. - func getHttpBody(pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper) throws - -> FlutterStandardTypedData? + func getHttpBody(pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper) throws -> FlutterStandardTypedData? /// A dictionary containing all of the HTTP header fields for a request. - func setAllHttpHeaderFields( - pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper, fields: [String: String]?) - throws + func setAllHttpHeaderFields(pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper, fields: [String: String]?) throws /// A dictionary containing all of the HTTP header fields for a request. - func getAllHttpHeaderFields(pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper) - throws -> [String: String]? + func getAllHttpHeaderFields(pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper) throws -> [String: String]? } protocol PigeonApiProtocolURLRequest { } -final class PigeonApiURLRequest: PigeonApiProtocolURLRequest { +final class PigeonApiURLRequest: PigeonApiProtocolURLRequest { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateURLRequest ///An implementation of [NSObject] used to access callback methods @@ -1620,23 +1505,17 @@ final class PigeonApiURLRequest: PigeonApiProtocolURLRequest { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateURLRequest) - { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateURLRequest) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers( - binaryMessenger: FlutterBinaryMessenger, api: PigeonApiURLRequest? - ) { + static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiURLRequest?) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( - pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.pigeon_defaultConstructor", - binaryMessenger: binaryMessenger, codec: codec) + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.pigeon_defaultConstructor", binaryMessenger: binaryMessenger, codec: codec) if let api = api { pigeonDefaultConstructorChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1644,8 +1523,8 @@ final class PigeonApiURLRequest: PigeonApiProtocolURLRequest { let urlArg = args[1] as! String do { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api, url: urlArg), - withIdentifier: pigeonIdentifierArg) +try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api, url: urlArg), +withIdentifier: pigeonIdentifierArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -1654,16 +1533,13 @@ final class PigeonApiURLRequest: PigeonApiProtocolURLRequest { } else { pigeonDefaultConstructorChannel.setMessageHandler(nil) } - let getUrlChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.getUrl", - binaryMessenger: binaryMessenger, codec: codec) + let getUrlChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.getUrl", binaryMessenger: binaryMessenger, codec: codec) if let api = api { getUrlChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! URLRequestWrapper do { - let result = try api.pigeonDelegate.getUrl( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) + let result = try api.pigeonDelegate.getUrl(pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -1672,17 +1548,14 @@ final class PigeonApiURLRequest: PigeonApiProtocolURLRequest { } else { getUrlChannel.setMessageHandler(nil) } - let setHttpMethodChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.setHttpMethod", - binaryMessenger: binaryMessenger, codec: codec) + let setHttpMethodChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.setHttpMethod", binaryMessenger: binaryMessenger, codec: codec) if let api = api { setHttpMethodChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! URLRequestWrapper let methodArg: String? = nilOrValue(args[1]) do { - try api.pigeonDelegate.setHttpMethod( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, method: methodArg) + try api.pigeonDelegate.setHttpMethod(pigeonApi: api, pigeonInstance: pigeonInstanceArg, method: methodArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -1691,16 +1564,13 @@ final class PigeonApiURLRequest: PigeonApiProtocolURLRequest { } else { setHttpMethodChannel.setMessageHandler(nil) } - let getHttpMethodChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.getHttpMethod", - binaryMessenger: binaryMessenger, codec: codec) + let getHttpMethodChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.getHttpMethod", binaryMessenger: binaryMessenger, codec: codec) if let api = api { getHttpMethodChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! URLRequestWrapper do { - let result = try api.pigeonDelegate.getHttpMethod( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) + let result = try api.pigeonDelegate.getHttpMethod(pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -1709,17 +1579,14 @@ final class PigeonApiURLRequest: PigeonApiProtocolURLRequest { } else { getHttpMethodChannel.setMessageHandler(nil) } - let setHttpBodyChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.setHttpBody", - binaryMessenger: binaryMessenger, codec: codec) + let setHttpBodyChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.setHttpBody", binaryMessenger: binaryMessenger, codec: codec) if let api = api { setHttpBodyChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! URLRequestWrapper let bodyArg: FlutterStandardTypedData? = nilOrValue(args[1]) do { - try api.pigeonDelegate.setHttpBody( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, body: bodyArg) + try api.pigeonDelegate.setHttpBody(pigeonApi: api, pigeonInstance: pigeonInstanceArg, body: bodyArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -1728,16 +1595,13 @@ final class PigeonApiURLRequest: PigeonApiProtocolURLRequest { } else { setHttpBodyChannel.setMessageHandler(nil) } - let getHttpBodyChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.getHttpBody", - binaryMessenger: binaryMessenger, codec: codec) + let getHttpBodyChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.getHttpBody", binaryMessenger: binaryMessenger, codec: codec) if let api = api { getHttpBodyChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! URLRequestWrapper do { - let result = try api.pigeonDelegate.getHttpBody( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) + let result = try api.pigeonDelegate.getHttpBody(pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -1746,17 +1610,14 @@ final class PigeonApiURLRequest: PigeonApiProtocolURLRequest { } else { getHttpBodyChannel.setMessageHandler(nil) } - let setAllHttpHeaderFieldsChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.setAllHttpHeaderFields", - binaryMessenger: binaryMessenger, codec: codec) + let setAllHttpHeaderFieldsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.setAllHttpHeaderFields", binaryMessenger: binaryMessenger, codec: codec) if let api = api { setAllHttpHeaderFieldsChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! URLRequestWrapper let fieldsArg: [String: String]? = nilOrValue(args[1]) do { - try api.pigeonDelegate.setAllHttpHeaderFields( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, fields: fieldsArg) + try api.pigeonDelegate.setAllHttpHeaderFields(pigeonApi: api, pigeonInstance: pigeonInstanceArg, fields: fieldsArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -1765,16 +1626,13 @@ final class PigeonApiURLRequest: PigeonApiProtocolURLRequest { } else { setAllHttpHeaderFieldsChannel.setMessageHandler(nil) } - let getAllHttpHeaderFieldsChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.getAllHttpHeaderFields", - binaryMessenger: binaryMessenger, codec: codec) + let getAllHttpHeaderFieldsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.getAllHttpHeaderFields", binaryMessenger: binaryMessenger, codec: codec) if let api = api { getAllHttpHeaderFieldsChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! URLRequestWrapper do { - let result = try api.pigeonDelegate.getAllHttpHeaderFields( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) + let result = try api.pigeonDelegate.getAllHttpHeaderFields(pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -1786,26 +1644,21 @@ final class PigeonApiURLRequest: PigeonApiProtocolURLRequest { } ///Creates a Dart instance of URLRequest and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: URLRequestWrapper, completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: URLRequestWrapper, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) + } 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) + 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))) @@ -1825,14 +1678,13 @@ final class PigeonApiURLRequest: PigeonApiProtocolURLRequest { } protocol PigeonApiDelegateHTTPURLResponse { /// The response’s HTTP status code. - func statusCode(pigeonApi: PigeonApiHTTPURLResponse, pigeonInstance: HTTPURLResponse) throws - -> Int64 + func statusCode(pigeonApi: PigeonApiHTTPURLResponse, pigeonInstance: HTTPURLResponse) throws -> Int64 } protocol PigeonApiProtocolHTTPURLResponse { } -final class PigeonApiHTTPURLResponse: PigeonApiProtocolHTTPURLResponse { +final class PigeonApiHTTPURLResponse: PigeonApiProtocolHTTPURLResponse { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateHTTPURLResponse ///An implementation of [URLResponse] used to access callback methods @@ -1840,36 +1692,27 @@ final class PigeonApiHTTPURLResponse: PigeonApiProtocolHTTPURLResponse { return pigeonRegistrar.apiDelegate.pigeonApiURLResponse(pigeonRegistrar) } - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, - delegate: PigeonApiDelegateHTTPURLResponse - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateHTTPURLResponse) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } ///Creates a Dart instance of HTTPURLResponse and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: HTTPURLResponse, completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: HTTPURLResponse, 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) { + } 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) + } 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) + 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))) @@ -1893,7 +1736,7 @@ open class PigeonApiDelegateURLResponse { protocol PigeonApiProtocolURLResponse { } -final class PigeonApiURLResponse: PigeonApiProtocolURLResponse { +final class PigeonApiURLResponse: PigeonApiProtocolURLResponse { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateURLResponse ///An implementation of [NSObject] used to access callback methods @@ -1901,33 +1744,26 @@ final class PigeonApiURLResponse: PigeonApiProtocolURLResponse { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateURLResponse - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateURLResponse) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } ///Creates a Dart instance of URLResponse and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: URLResponse, completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: URLResponse, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) + } 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) + 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))) @@ -1948,25 +1784,20 @@ final class PigeonApiURLResponse: PigeonApiProtocolURLResponse { protocol PigeonApiDelegateWKUserScript { /// Creates a user script object that contains the specified source code and /// attributes. - func pigeonDefaultConstructor( - pigeonApi: PigeonApiWKUserScript, source: String, injectionTime: UserScriptInjectionTime, - isForMainFrameOnly: Bool - ) throws -> WKUserScript + func pigeonDefaultConstructor(pigeonApi: PigeonApiWKUserScript, source: String, injectionTime: UserScriptInjectionTime, isForMainFrameOnly: Bool) throws -> WKUserScript /// The script’s source code. func source(pigeonApi: PigeonApiWKUserScript, pigeonInstance: WKUserScript) throws -> String /// The time at which to inject the script into the webpage. - func injectionTime(pigeonApi: PigeonApiWKUserScript, pigeonInstance: WKUserScript) throws - -> UserScriptInjectionTime + func injectionTime(pigeonApi: PigeonApiWKUserScript, pigeonInstance: WKUserScript) throws -> UserScriptInjectionTime /// A Boolean value that indicates whether to inject the script into the main /// frame or all frames. - func isForMainFrameOnly(pigeonApi: PigeonApiWKUserScript, pigeonInstance: WKUserScript) throws - -> Bool + func isForMainFrameOnly(pigeonApi: PigeonApiWKUserScript, pigeonInstance: WKUserScript) throws -> Bool } protocol PigeonApiProtocolWKUserScript { } -final class PigeonApiWKUserScript: PigeonApiProtocolWKUserScript { +final class PigeonApiWKUserScript: PigeonApiProtocolWKUserScript { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKUserScript ///An implementation of [NSObject] used to access callback methods @@ -1974,24 +1805,17 @@ final class PigeonApiWKUserScript: PigeonApiProtocolWKUserScript { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKUserScript - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKUserScript) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers( - binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKUserScript? - ) { + static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKUserScript?) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( - pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserScript.pigeon_defaultConstructor", - binaryMessenger: binaryMessenger, codec: codec) + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserScript.pigeon_defaultConstructor", binaryMessenger: binaryMessenger, codec: codec) if let api = api { pigeonDefaultConstructorChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2001,10 +1825,8 @@ final class PigeonApiWKUserScript: PigeonApiProtocolWKUserScript { let isForMainFrameOnlyArg = args[3] as! Bool do { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - try api.pigeonDelegate.pigeonDefaultConstructor( - pigeonApi: api, source: sourceArg, injectionTime: injectionTimeArg, - isForMainFrameOnly: isForMainFrameOnlyArg), - withIdentifier: pigeonIdentifierArg) +try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api, source: sourceArg, injectionTime: injectionTimeArg, isForMainFrameOnly: isForMainFrameOnlyArg), +withIdentifier: pigeonIdentifierArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -2016,34 +1838,25 @@ final class PigeonApiWKUserScript: PigeonApiProtocolWKUserScript { } ///Creates a Dart instance of WKUserScript and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: WKUserScript, completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: WKUserScript, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) + } 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 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 + 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 @@ -2062,22 +1875,19 @@ final class PigeonApiWKUserScript: PigeonApiProtocolWKUserScript { } protocol PigeonApiDelegateWKNavigationAction { /// The URL request object associated with the navigation action. - func request(pigeonApi: PigeonApiWKNavigationAction, pigeonInstance: WKNavigationAction) throws - -> URLRequestWrapper + func request(pigeonApi: PigeonApiWKNavigationAction, pigeonInstance: WKNavigationAction) throws -> URLRequestWrapper /// The frame in which to display the new content. /// /// If the target of the navigation is a new window, this property is nil. - func targetFrame(pigeonApi: PigeonApiWKNavigationAction, pigeonInstance: WKNavigationAction) - throws -> WKFrameInfo? + func targetFrame(pigeonApi: PigeonApiWKNavigationAction, pigeonInstance: WKNavigationAction) throws -> WKFrameInfo? /// The type of action that triggered the navigation. - func navigationType(pigeonApi: PigeonApiWKNavigationAction, pigeonInstance: WKNavigationAction) - throws -> NavigationType + func navigationType(pigeonApi: PigeonApiWKNavigationAction, pigeonInstance: WKNavigationAction) throws -> NavigationType } protocol PigeonApiProtocolWKNavigationAction { } -final class PigeonApiWKNavigationAction: PigeonApiProtocolWKNavigationAction { +final class PigeonApiWKNavigationAction: PigeonApiProtocolWKNavigationAction { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKNavigationAction ///An implementation of [NSObject] used to access callback methods @@ -2085,42 +1895,30 @@ final class PigeonApiWKNavigationAction: PigeonApiProtocolWKNavigationAction { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, - delegate: PigeonApiDelegateWKNavigationAction - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKNavigationAction) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } ///Creates a Dart instance of WKNavigationAction and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: WKNavigationAction, completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: WKNavigationAction, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) + } 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 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 + 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 @@ -2139,19 +1937,16 @@ final class PigeonApiWKNavigationAction: PigeonApiProtocolWKNavigationAction { } protocol PigeonApiDelegateWKNavigationResponse { /// The frame’s response. - func response(pigeonApi: PigeonApiWKNavigationResponse, pigeonInstance: WKNavigationResponse) - throws -> URLResponse + func response(pigeonApi: PigeonApiWKNavigationResponse, pigeonInstance: WKNavigationResponse) throws -> URLResponse /// A Boolean value that indicates whether the response targets the web view’s /// main frame. - func isForMainFrame( - pigeonApi: PigeonApiWKNavigationResponse, pigeonInstance: WKNavigationResponse - ) throws -> Bool + func isForMainFrame(pigeonApi: PigeonApiWKNavigationResponse, pigeonInstance: WKNavigationResponse) throws -> Bool } protocol PigeonApiProtocolWKNavigationResponse { } -final class PigeonApiWKNavigationResponse: PigeonApiProtocolWKNavigationResponse { +final class PigeonApiWKNavigationResponse: PigeonApiProtocolWKNavigationResponse { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKNavigationResponse ///An implementation of [NSObject] used to access callback methods @@ -2159,40 +1954,29 @@ final class PigeonApiWKNavigationResponse: PigeonApiProtocolWKNavigationResponse return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, - delegate: PigeonApiDelegateWKNavigationResponse - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKNavigationResponse) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } ///Creates a Dart instance of WKNavigationResponse and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: WKNavigationResponse, completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: WKNavigationResponse, 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) { + } 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) + } 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 + 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 @@ -2214,14 +1998,13 @@ protocol PigeonApiDelegateWKFrameInfo { /// or a subframe. func isMainFrame(pigeonApi: PigeonApiWKFrameInfo, pigeonInstance: WKFrameInfo) throws -> Bool /// The frame’s current request. - func request(pigeonApi: PigeonApiWKFrameInfo, pigeonInstance: WKFrameInfo) throws - -> URLRequestWrapper? + func request(pigeonApi: PigeonApiWKFrameInfo, pigeonInstance: WKFrameInfo) throws -> URLRequestWrapper? } protocol PigeonApiProtocolWKFrameInfo { } -final class PigeonApiWKFrameInfo: PigeonApiProtocolWKFrameInfo { +final class PigeonApiWKFrameInfo: PigeonApiProtocolWKFrameInfo { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKFrameInfo ///An implementation of [NSObject] used to access callback methods @@ -2229,36 +2012,28 @@ final class PigeonApiWKFrameInfo: PigeonApiProtocolWKFrameInfo { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKFrameInfo - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKFrameInfo) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } ///Creates a Dart instance of WKFrameInfo and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: WKFrameInfo, completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: WKFrameInfo, 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) { + } 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) + } 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) + 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))) @@ -2288,7 +2063,7 @@ protocol PigeonApiDelegateNSError { protocol PigeonApiProtocolNSError { } -final class PigeonApiNSError: PigeonApiProtocolNSError { +final class PigeonApiNSError: PigeonApiProtocolNSError { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateNSError ///An implementation of [NSObject] used to access callback methods @@ -2301,32 +2076,25 @@ final class PigeonApiNSError: PigeonApiProtocolNSError { self.pigeonDelegate = delegate } ///Creates a Dart instance of NSError and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: NSError, completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: NSError, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) + } 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 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 + 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 @@ -2353,7 +2121,7 @@ protocol PigeonApiDelegateWKScriptMessage { protocol PigeonApiProtocolWKScriptMessage { } -final class PigeonApiWKScriptMessage: PigeonApiProtocolWKScriptMessage { +final class PigeonApiWKScriptMessage: PigeonApiProtocolWKScriptMessage { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKScriptMessage ///An implementation of [NSObject] used to access callback methods @@ -2361,36 +2129,28 @@ final class PigeonApiWKScriptMessage: PigeonApiProtocolWKScriptMessage { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, - delegate: PigeonApiDelegateWKScriptMessage - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKScriptMessage) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } ///Creates a Dart instance of WKScriptMessage and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: WKScriptMessage, completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: WKScriptMessage, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) + } 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) + 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))) @@ -2414,14 +2174,13 @@ protocol PigeonApiDelegateWKSecurityOrigin { /// The security origin's port. func port(pigeonApi: PigeonApiWKSecurityOrigin, pigeonInstance: WKSecurityOrigin) throws -> Int64 /// The security origin's protocol. - func securityProtocol(pigeonApi: PigeonApiWKSecurityOrigin, pigeonInstance: WKSecurityOrigin) - throws -> String + func securityProtocol(pigeonApi: PigeonApiWKSecurityOrigin, pigeonInstance: WKSecurityOrigin) throws -> String } protocol PigeonApiProtocolWKSecurityOrigin { } -final class PigeonApiWKSecurityOrigin: PigeonApiProtocolWKSecurityOrigin { +final class PigeonApiWKSecurityOrigin: PigeonApiProtocolWKSecurityOrigin { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKSecurityOrigin ///An implementation of [NSObject] used to access callback methods @@ -2429,40 +2188,30 @@ final class PigeonApiWKSecurityOrigin: PigeonApiProtocolWKSecurityOrigin { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, - delegate: PigeonApiDelegateWKSecurityOrigin - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKSecurityOrigin) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } ///Creates a Dart instance of WKSecurityOrigin and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: WKSecurityOrigin, completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: WKSecurityOrigin, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) + } 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 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 + 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 @@ -2480,18 +2229,15 @@ final class PigeonApiWKSecurityOrigin: PigeonApiProtocolWKSecurityOrigin { } } protocol PigeonApiDelegateHTTPCookie { - func pigeonDefaultConstructor( - pigeonApi: PigeonApiHTTPCookie, properties: [HttpCookiePropertyKey: Any] - ) throws -> HTTPCookie + func pigeonDefaultConstructor(pigeonApi: PigeonApiHTTPCookie, properties: [HttpCookiePropertyKey: Any]) throws -> HTTPCookie /// The cookie’s properties. - func getProperties(pigeonApi: PigeonApiHTTPCookie, pigeonInstance: HTTPCookie) throws - -> [HttpCookiePropertyKey: Any]? + func getProperties(pigeonApi: PigeonApiHTTPCookie, pigeonInstance: HTTPCookie) throws -> [HttpCookiePropertyKey: Any]? } protocol PigeonApiProtocolHTTPCookie { } -final class PigeonApiHTTPCookie: PigeonApiProtocolHTTPCookie { +final class PigeonApiHTTPCookie: PigeonApiProtocolHTTPCookie { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateHTTPCookie ///An implementation of [NSObject] used to access callback methods @@ -2499,23 +2245,17 @@ final class PigeonApiHTTPCookie: PigeonApiProtocolHTTPCookie { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateHTTPCookie) - { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateHTTPCookie) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers( - binaryMessenger: FlutterBinaryMessenger, api: PigeonApiHTTPCookie? - ) { + static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiHTTPCookie?) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( - pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.HTTPCookie.pigeon_defaultConstructor", - binaryMessenger: binaryMessenger, codec: codec) + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.HTTPCookie.pigeon_defaultConstructor", binaryMessenger: binaryMessenger, codec: codec) if let api = api { pigeonDefaultConstructorChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2523,9 +2263,8 @@ final class PigeonApiHTTPCookie: PigeonApiProtocolHTTPCookie { let propertiesArg = args[1] as? [HttpCookiePropertyKey: Any] do { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - try api.pigeonDelegate.pigeonDefaultConstructor( - pigeonApi: api, properties: propertiesArg!), - withIdentifier: pigeonIdentifierArg) +try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api, properties: propertiesArg!), +withIdentifier: pigeonIdentifierArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -2534,16 +2273,13 @@ final class PigeonApiHTTPCookie: PigeonApiProtocolHTTPCookie { } else { pigeonDefaultConstructorChannel.setMessageHandler(nil) } - let getPropertiesChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.HTTPCookie.getProperties", - binaryMessenger: binaryMessenger, codec: codec) + let getPropertiesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.HTTPCookie.getProperties", binaryMessenger: binaryMessenger, codec: codec) if let api = api { getPropertiesChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! HTTPCookie do { - let result = try api.pigeonDelegate.getProperties( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) + let result = try api.pigeonDelegate.getProperties(pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -2555,26 +2291,21 @@ final class PigeonApiHTTPCookie: PigeonApiProtocolHTTPCookie { } ///Creates a Dart instance of HTTPCookie and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: HTTPCookie, completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: HTTPCookie, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) + } 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) + 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))) @@ -2593,51 +2324,31 @@ final class PigeonApiHTTPCookie: PigeonApiProtocolHTTPCookie { } } protocol PigeonApiDelegateAuthenticationChallengeResponse { - func pigeonDefaultConstructor( - pigeonApi: PigeonApiAuthenticationChallengeResponse, - disposition: UrlSessionAuthChallengeDisposition, credential: URLCredential? - ) throws -> AuthenticationChallengeResponse + func pigeonDefaultConstructor(pigeonApi: PigeonApiAuthenticationChallengeResponse, disposition: UrlSessionAuthChallengeDisposition, credential: URLCredential?) throws -> AuthenticationChallengeResponse /// The option to use to handle the challenge. - func disposition( - pigeonApi: PigeonApiAuthenticationChallengeResponse, - pigeonInstance: AuthenticationChallengeResponse - ) throws -> UrlSessionAuthChallengeDisposition + func disposition(pigeonApi: PigeonApiAuthenticationChallengeResponse, pigeonInstance: AuthenticationChallengeResponse) throws -> UrlSessionAuthChallengeDisposition /// The credential to use for authentication when the disposition parameter /// contains the value URLSession.AuthChallengeDisposition.useCredential. - func credential( - pigeonApi: PigeonApiAuthenticationChallengeResponse, - pigeonInstance: AuthenticationChallengeResponse - ) throws -> URLCredential? + func credential(pigeonApi: PigeonApiAuthenticationChallengeResponse, pigeonInstance: AuthenticationChallengeResponse) throws -> URLCredential? } protocol PigeonApiProtocolAuthenticationChallengeResponse { } -final class PigeonApiAuthenticationChallengeResponse: - PigeonApiProtocolAuthenticationChallengeResponse -{ +final class PigeonApiAuthenticationChallengeResponse: PigeonApiProtocolAuthenticationChallengeResponse { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateAuthenticationChallengeResponse - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, - delegate: PigeonApiDelegateAuthenticationChallengeResponse - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateAuthenticationChallengeResponse) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers( - binaryMessenger: FlutterBinaryMessenger, api: PigeonApiAuthenticationChallengeResponse? - ) { + static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiAuthenticationChallengeResponse?) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( - pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.webview_flutter_wkwebview.AuthenticationChallengeResponse.pigeon_defaultConstructor", - binaryMessenger: binaryMessenger, codec: codec) + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.AuthenticationChallengeResponse.pigeon_defaultConstructor", binaryMessenger: binaryMessenger, codec: codec) if let api = api { pigeonDefaultConstructorChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2646,9 +2357,8 @@ final class PigeonApiAuthenticationChallengeResponse: let credentialArg: URLCredential? = nilOrValue(args[2]) do { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - try api.pigeonDelegate.pigeonDefaultConstructor( - pigeonApi: api, disposition: dispositionArg, credential: credentialArg), - withIdentifier: pigeonIdentifierArg) +try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api, disposition: dispositionArg, credential: credentialArg), +withIdentifier: pigeonIdentifierArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -2660,33 +2370,24 @@ final class PigeonApiAuthenticationChallengeResponse: } ///Creates a Dart instance of AuthenticationChallengeResponse and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: AuthenticationChallengeResponse, - completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: AuthenticationChallengeResponse, 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) { + } 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) + } 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 + 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 @@ -2707,19 +2408,15 @@ protocol PigeonApiDelegateWKWebsiteDataStore { /// The default data store, which stores data persistently to disk. func defaultDataStore(pigeonApi: PigeonApiWKWebsiteDataStore) throws -> WKWebsiteDataStore /// The object that manages the HTTP cookies for your website. - func httpCookieStore(pigeonApi: PigeonApiWKWebsiteDataStore, pigeonInstance: WKWebsiteDataStore) - throws -> WKHTTPCookieStore + func httpCookieStore(pigeonApi: PigeonApiWKWebsiteDataStore, pigeonInstance: WKWebsiteDataStore) throws -> WKHTTPCookieStore /// Removes the specified types of website data from one or more data records. - func removeDataOfTypes( - pigeonApi: PigeonApiWKWebsiteDataStore, pigeonInstance: WKWebsiteDataStore, - dataTypes: [WebsiteDataType], modificationTimeInSecondsSinceEpoch: Double, - completion: @escaping (Result) -> Void) + func removeDataOfTypes(pigeonApi: PigeonApiWKWebsiteDataStore, pigeonInstance: WKWebsiteDataStore, dataTypes: [WebsiteDataType], modificationTimeInSecondsSinceEpoch: Double, completion: @escaping (Result) -> Void) } protocol PigeonApiProtocolWKWebsiteDataStore { } -final class PigeonApiWKWebsiteDataStore: PigeonApiProtocolWKWebsiteDataStore { +final class PigeonApiWKWebsiteDataStore: PigeonApiProtocolWKWebsiteDataStore { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKWebsiteDataStore ///An implementation of [NSObject] used to access callback methods @@ -2727,33 +2424,23 @@ final class PigeonApiWKWebsiteDataStore: PigeonApiProtocolWKWebsiteDataStore { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, - delegate: PigeonApiDelegateWKWebsiteDataStore - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKWebsiteDataStore) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers( - binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKWebsiteDataStore? - ) { + static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKWebsiteDataStore?) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( - pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let defaultDataStoreChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStore.defaultDataStore", - binaryMessenger: binaryMessenger, codec: codec) + let defaultDataStoreChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStore.defaultDataStore", binaryMessenger: binaryMessenger, codec: codec) if let api = api { defaultDataStoreChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonIdentifierArg = args[0] as! Int64 do { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - try api.pigeonDelegate.defaultDataStore(pigeonApi: api), - withIdentifier: pigeonIdentifierArg) + api.pigeonRegistrar.instanceManager.addDartCreatedInstance(try api.pigeonDelegate.defaultDataStore(pigeonApi: api), withIdentifier: pigeonIdentifierArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -2762,19 +2449,14 @@ final class PigeonApiWKWebsiteDataStore: PigeonApiProtocolWKWebsiteDataStore { } else { defaultDataStoreChannel.setMessageHandler(nil) } - let httpCookieStoreChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStore.httpCookieStore", - binaryMessenger: binaryMessenger, codec: codec) + let httpCookieStoreChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStore.httpCookieStore", binaryMessenger: binaryMessenger, codec: codec) if let api = api { httpCookieStoreChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKWebsiteDataStore let pigeonIdentifierArg = args[1] as! Int64 do { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - try api.pigeonDelegate.httpCookieStore( - pigeonApi: api, pigeonInstance: pigeonInstanceArg), - withIdentifier: pigeonIdentifierArg) + api.pigeonRegistrar.instanceManager.addDartCreatedInstance(try api.pigeonDelegate.httpCookieStore(pigeonApi: api, pigeonInstance: pigeonInstanceArg), withIdentifier: pigeonIdentifierArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -2783,19 +2465,14 @@ final class PigeonApiWKWebsiteDataStore: PigeonApiProtocolWKWebsiteDataStore { } else { httpCookieStoreChannel.setMessageHandler(nil) } - let removeDataOfTypesChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStore.removeDataOfTypes", - binaryMessenger: binaryMessenger, codec: codec) + let removeDataOfTypesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStore.removeDataOfTypes", binaryMessenger: binaryMessenger, codec: codec) if let api = api { removeDataOfTypesChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKWebsiteDataStore let dataTypesArg = args[1] as! [WebsiteDataType] let modificationTimeInSecondsSinceEpochArg = args[2] as! Double - api.pigeonDelegate.removeDataOfTypes( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, dataTypes: dataTypesArg, - modificationTimeInSecondsSinceEpoch: modificationTimeInSecondsSinceEpochArg - ) { result in + api.pigeonDelegate.removeDataOfTypes(pigeonApi: api, pigeonInstance: pigeonInstanceArg, dataTypes: dataTypesArg, modificationTimeInSecondsSinceEpoch: modificationTimeInSecondsSinceEpochArg) { result in switch result { case .success(let res): reply(wrapResult(res)) @@ -2810,26 +2487,21 @@ final class PigeonApiWKWebsiteDataStore: PigeonApiProtocolWKWebsiteDataStore { } ///Creates a Dart instance of WKWebsiteDataStore and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: WKWebsiteDataStore, completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: WKWebsiteDataStore, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) + } 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) + 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))) @@ -2849,20 +2521,19 @@ final class PigeonApiWKWebsiteDataStore: PigeonApiProtocolWKWebsiteDataStore { } protocol PigeonApiDelegateUIView { #if !os(macOS) - /// The view’s background color. - func setBackgroundColor(pigeonApi: PigeonApiUIView, pigeonInstance: UIView, value: Int64?) - throws + /// The view’s background color. + func setBackgroundColor(pigeonApi: PigeonApiUIView, pigeonInstance: UIView, value: Int64?) throws #endif #if !os(macOS) - /// A Boolean value that determines whether the view is opaque. - func setOpaque(pigeonApi: PigeonApiUIView, pigeonInstance: UIView, opaque: Bool) throws + /// A Boolean value that determines whether the view is opaque. + func setOpaque(pigeonApi: PigeonApiUIView, pigeonInstance: UIView, opaque: Bool) throws #endif } protocol PigeonApiProtocolUIView { } -final class PigeonApiUIView: PigeonApiProtocolUIView { +final class PigeonApiUIView: PigeonApiProtocolUIView { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateUIView ///An implementation of [NSObject] used to access callback methods @@ -2878,176 +2549,152 @@ final class PigeonApiUIView: PigeonApiProtocolUIView { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( - pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() #if !os(macOS) - let setBackgroundColorChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIView.setBackgroundColor", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setBackgroundColorChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! UIView - let valueArg: Int64? = nilOrValue(args[1]) - do { - try api.pigeonDelegate.setBackgroundColor( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let setBackgroundColorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIView.setBackgroundColor", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setBackgroundColorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIView + let valueArg: Int64? = nilOrValue(args[1]) + do { + try api.pigeonDelegate.setBackgroundColor(pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - setBackgroundColorChannel.setMessageHandler(nil) } + } else { + setBackgroundColorChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let setOpaqueChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIView.setOpaque", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setOpaqueChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! UIView - let opaqueArg = args[1] as! Bool - do { - try api.pigeonDelegate.setOpaque( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, opaque: opaqueArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let setOpaqueChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIView.setOpaque", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setOpaqueChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIView + let opaqueArg = args[1] as! Bool + do { + try api.pigeonDelegate.setOpaque(pigeonApi: api, pigeonInstance: pigeonInstanceArg, opaque: opaqueArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - setOpaqueChannel.setMessageHandler(nil) } + } else { + setOpaqueChannel.setMessageHandler(nil) + } #endif } #if !os(macOS) - ///Creates a Dart instance of UIView and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: UIView, 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.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(())) - } + ///Creates a Dart instance of UIView and attaches it to [pigeonInstance]. + func pigeonNewInstance(pigeonInstance: UIView, 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.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(())) } } } + } #endif } protocol PigeonApiDelegateUIScrollView { #if !os(macOS) - /// The point at which the origin of the content view is offset from the - /// origin of the scroll view. - func getContentOffset(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView) throws - -> [Double] + /// The point at which the origin of the content view is offset from the + /// origin of the scroll view. + func getContentOffset(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView) throws -> [Double] #endif #if !os(macOS) - /// Move the scrolled position of your view. - /// - /// Convenience method to synchronize change to the x and y scroll position. - func scrollBy( - pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, x: Double, y: Double) throws + /// Move the scrolled position of your view. + /// + /// Convenience method to synchronize change to the x and y scroll position. + func scrollBy(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, x: Double, y: Double) throws #endif #if !os(macOS) - /// The point at which the origin of the content view is offset from the - /// origin of the scroll view. - func setContentOffset( - pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, x: Double, y: Double) throws + /// The point at which the origin of the content view is offset from the + /// origin of the scroll view. + func setContentOffset(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, x: Double, y: Double) throws #endif #if !os(macOS) - /// The delegate of the scroll view. - func setDelegate( - pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, - delegate: UIScrollViewDelegate?) throws + /// The delegate of the scroll view. + func setDelegate(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, delegate: UIScrollViewDelegate?) throws #endif #if !os(macOS) - /// Whether the scroll view bounces past the edge of content and back again. - func setBounces(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) - throws + /// Whether the scroll view bounces past the edge of content and back again. + func setBounces(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws #endif #if !os(macOS) - /// Whether the scroll view bounces when it reaches the ends of its horizontal - /// axis. - func setBouncesHorizontally( - pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws + /// Whether the scroll view bounces when it reaches the ends of its horizontal + /// axis. + func setBouncesHorizontally(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws #endif #if !os(macOS) - /// Whether the scroll view bounces when it reaches the ends of its vertical - /// axis. - func setBouncesVertically( - pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws + /// Whether the scroll view bounces when it reaches the ends of its vertical + /// axis. + func setBouncesVertically(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws #endif #if !os(macOS) - /// Whether bouncing always occurs when vertical scrolling reaches the end of - /// the content. - /// - /// If the value of this property is true and `bouncesVertically` is true, the - /// scroll view allows vertical dragging even if the content is smaller than - /// the bounds of the scroll view. - func setAlwaysBounceVertical( - pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws + /// Whether bouncing always occurs when vertical scrolling reaches the end of + /// the content. + /// + /// If the value of this property is true and `bouncesVertically` is true, the + /// scroll view allows vertical dragging even if the content is smaller than + /// the bounds of the scroll view. + func setAlwaysBounceVertical(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws #endif #if !os(macOS) - /// Whether bouncing always occurs when horizontal scrolling reaches the end - /// of the content view. - /// - /// If the value of this property is true and `bouncesHorizontally` is true, - /// the scroll view allows horizontal dragging even if the content is smaller - /// than the bounds of the scroll view. - func setAlwaysBounceHorizontal( - pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws + /// Whether bouncing always occurs when horizontal scrolling reaches the end + /// of the content view. + /// + /// If the value of this property is true and `bouncesHorizontally` is true, + /// the scroll view allows horizontal dragging even if the content is smaller + /// than the bounds of the scroll view. + func setAlwaysBounceHorizontal(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws #endif #if !os(macOS) - /// Whether the vertical scroll indicator is visible. - /// - /// The default value is true. - func setShowsVerticalScrollIndicator( - pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws + /// Whether the vertical scroll indicator is visible. + /// + /// The default value is true. + func setShowsVerticalScrollIndicator(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws #endif #if !os(macOS) - /// Whether the horizontal scroll indicator is visible. - /// - /// The default value is true. - func setShowsHorizontalScrollIndicator( - pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws + /// Whether the horizontal scroll indicator is visible. + /// + /// The default value is true. + func setShowsHorizontalScrollIndicator(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws #endif } protocol PigeonApiProtocolUIScrollView { } -final class PigeonApiUIScrollView: PigeonApiProtocolUIScrollView { +final class PigeonApiUIScrollView: PigeonApiProtocolUIScrollView { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateUIScrollView ///An implementation of [UIView] used to access callback methods @@ -3055,353 +2702,287 @@ final class PigeonApiUIScrollView: PigeonApiProtocolUIScrollView { return pigeonRegistrar.apiDelegate.pigeonApiUIView(pigeonRegistrar) } - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateUIScrollView - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateUIScrollView) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers( - binaryMessenger: FlutterBinaryMessenger, api: PigeonApiUIScrollView? - ) { + static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiUIScrollView?) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( - pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() #if !os(macOS) - let getContentOffsetChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.getContentOffset", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - getContentOffsetChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! UIScrollView - do { - let result = try api.pigeonDelegate.getContentOffset( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } + let getContentOffsetChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.getContentOffset", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getContentOffsetChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + do { + let result = try api.pigeonDelegate.getContentOffset(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) } - } else { - getContentOffsetChannel.setMessageHandler(nil) } + } else { + getContentOffsetChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let scrollByChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.scrollBy", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - scrollByChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! UIScrollView - let xArg = args[1] as! Double - let yArg = args[2] as! Double - do { - try api.pigeonDelegate.scrollBy( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, x: xArg, y: yArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let scrollByChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.scrollBy", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + scrollByChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + let xArg = args[1] as! Double + let yArg = args[2] as! Double + do { + try api.pigeonDelegate.scrollBy(pigeonApi: api, pigeonInstance: pigeonInstanceArg, x: xArg, y: yArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - scrollByChannel.setMessageHandler(nil) } + } else { + scrollByChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let setContentOffsetChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setContentOffset", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setContentOffsetChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! UIScrollView - let xArg = args[1] as! Double - let yArg = args[2] as! Double - do { - try api.pigeonDelegate.setContentOffset( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, x: xArg, y: yArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let setContentOffsetChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setContentOffset", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setContentOffsetChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + let xArg = args[1] as! Double + let yArg = args[2] as! Double + do { + try api.pigeonDelegate.setContentOffset(pigeonApi: api, pigeonInstance: pigeonInstanceArg, x: xArg, y: yArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - setContentOffsetChannel.setMessageHandler(nil) } + } else { + setContentOffsetChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let setDelegateChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setDelegate", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setDelegateChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! UIScrollView - let delegateArg: UIScrollViewDelegate? = nilOrValue(args[1]) - do { - try api.pigeonDelegate.setDelegate( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, delegate: delegateArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let setDelegateChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setDelegate", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setDelegateChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + let delegateArg: UIScrollViewDelegate? = nilOrValue(args[1]) + do { + try api.pigeonDelegate.setDelegate(pigeonApi: api, pigeonInstance: pigeonInstanceArg, delegate: delegateArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - setDelegateChannel.setMessageHandler(nil) } + } else { + setDelegateChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let setBouncesChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setBounces", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setBouncesChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! UIScrollView - let valueArg = args[1] as! Bool - do { - try api.pigeonDelegate.setBounces( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let setBouncesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setBounces", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setBouncesChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + let valueArg = args[1] as! Bool + do { + try api.pigeonDelegate.setBounces(pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - setBouncesChannel.setMessageHandler(nil) } + } else { + setBouncesChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let setBouncesHorizontallyChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setBouncesHorizontally", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setBouncesHorizontallyChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! UIScrollView - let valueArg = args[1] as! Bool - do { - try api.pigeonDelegate.setBouncesHorizontally( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let setBouncesHorizontallyChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setBouncesHorizontally", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setBouncesHorizontallyChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + let valueArg = args[1] as! Bool + do { + try api.pigeonDelegate.setBouncesHorizontally(pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - setBouncesHorizontallyChannel.setMessageHandler(nil) } + } else { + setBouncesHorizontallyChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let setBouncesVerticallyChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setBouncesVertically", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setBouncesVerticallyChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! UIScrollView - let valueArg = args[1] as! Bool - do { - try api.pigeonDelegate.setBouncesVertically( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let setBouncesVerticallyChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setBouncesVertically", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setBouncesVerticallyChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + let valueArg = args[1] as! Bool + do { + try api.pigeonDelegate.setBouncesVertically(pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - setBouncesVerticallyChannel.setMessageHandler(nil) } + } else { + setBouncesVerticallyChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let setAlwaysBounceVerticalChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setAlwaysBounceVertical", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setAlwaysBounceVerticalChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! UIScrollView - let valueArg = args[1] as! Bool - do { - try api.pigeonDelegate.setAlwaysBounceVertical( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let setAlwaysBounceVerticalChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setAlwaysBounceVertical", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setAlwaysBounceVerticalChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + let valueArg = args[1] as! Bool + do { + try api.pigeonDelegate.setAlwaysBounceVertical(pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - setAlwaysBounceVerticalChannel.setMessageHandler(nil) } + } else { + setAlwaysBounceVerticalChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let setAlwaysBounceHorizontalChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setAlwaysBounceHorizontal", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setAlwaysBounceHorizontalChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! UIScrollView - let valueArg = args[1] as! Bool - do { - try api.pigeonDelegate.setAlwaysBounceHorizontal( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let setAlwaysBounceHorizontalChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setAlwaysBounceHorizontal", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setAlwaysBounceHorizontalChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + let valueArg = args[1] as! Bool + do { + try api.pigeonDelegate.setAlwaysBounceHorizontal(pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - setAlwaysBounceHorizontalChannel.setMessageHandler(nil) } + } else { + setAlwaysBounceHorizontalChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let setShowsVerticalScrollIndicatorChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setShowsVerticalScrollIndicator", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setShowsVerticalScrollIndicatorChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! UIScrollView - let valueArg = args[1] as! Bool - do { - try api.pigeonDelegate.setShowsVerticalScrollIndicator( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let setShowsVerticalScrollIndicatorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setShowsVerticalScrollIndicator", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setShowsVerticalScrollIndicatorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + let valueArg = args[1] as! Bool + do { + try api.pigeonDelegate.setShowsVerticalScrollIndicator(pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - setShowsVerticalScrollIndicatorChannel.setMessageHandler(nil) } + } else { + setShowsVerticalScrollIndicatorChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let setShowsHorizontalScrollIndicatorChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setShowsHorizontalScrollIndicator", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setShowsHorizontalScrollIndicatorChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! UIScrollView - let valueArg = args[1] as! Bool - do { - try api.pigeonDelegate.setShowsHorizontalScrollIndicator( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let setShowsHorizontalScrollIndicatorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setShowsHorizontalScrollIndicator", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setShowsHorizontalScrollIndicatorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + let valueArg = args[1] as! Bool + do { + try api.pigeonDelegate.setShowsHorizontalScrollIndicator(pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - setShowsHorizontalScrollIndicatorChannel.setMessageHandler(nil) } + } else { + setShowsHorizontalScrollIndicatorChannel.setMessageHandler(nil) + } #endif } #if !os(macOS) - ///Creates a Dart instance of UIScrollView and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: UIScrollView, 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.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(())) - } + ///Creates a Dart instance of UIScrollView and attaches it to [pigeonInstance]. + func pigeonNewInstance(pigeonInstance: UIScrollView, 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.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(())) } } } + } #endif } protocol PigeonApiDelegateWKWebViewConfiguration { - func pigeonDefaultConstructor(pigeonApi: PigeonApiWKWebViewConfiguration) throws - -> WKWebViewConfiguration + func pigeonDefaultConstructor(pigeonApi: PigeonApiWKWebViewConfiguration) throws -> WKWebViewConfiguration /// The object that coordinates interactions between your app’s native code /// and the webpage’s scripts and other content. - func setUserContentController( - pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, - controller: WKUserContentController) throws + func setUserContentController(pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, controller: WKUserContentController) throws /// The object that coordinates interactions between your app’s native code /// and the webpage’s scripts and other content. - func getUserContentController( - pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration - ) throws -> WKUserContentController + func getUserContentController(pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration) throws -> WKUserContentController /// The object you use to get and set the site’s cookies and to track the /// cached data objects. - func setWebsiteDataStore( - pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, - dataStore: WKWebsiteDataStore) throws + func setWebsiteDataStore(pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, dataStore: WKWebsiteDataStore) throws /// The object you use to get and set the site’s cookies and to track the /// cached data objects. - func getWebsiteDataStore( - pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration - ) throws -> WKWebsiteDataStore + func getWebsiteDataStore(pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration) throws -> WKWebsiteDataStore /// The object that manages the preference-related settings for the web view. - func setPreferences( - pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, - preferences: WKPreferences) throws + func setPreferences(pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, preferences: WKPreferences) throws /// The object that manages the preference-related settings for the web view. - func getPreferences( - pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration - ) throws -> WKPreferences + func getPreferences(pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration) throws -> WKPreferences /// A Boolean value that indicates whether HTML5 videos play inline or use the /// native full-screen controller. - func setAllowsInlineMediaPlayback( - pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, allow: Bool) - throws + func setAllowsInlineMediaPlayback(pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, allow: Bool) throws /// A Boolean value that indicates whether the web view limits navigation to /// pages within the app’s domain. - func setLimitsNavigationsToAppBoundDomains( - pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, limit: Bool) - throws + func setLimitsNavigationsToAppBoundDomains(pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, limit: Bool) throws /// The media types that require a user gesture to begin playing. - func setMediaTypesRequiringUserActionForPlayback( - pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, - type: AudiovisualMediaType) throws + 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 + func getDefaultWebpagePreferences(pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration) throws -> WKWebpagePreferences } protocol PigeonApiProtocolWKWebViewConfiguration { } -final class PigeonApiWKWebViewConfiguration: PigeonApiProtocolWKWebViewConfiguration { +final class PigeonApiWKWebViewConfiguration: PigeonApiProtocolWKWebViewConfiguration { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKWebViewConfiguration ///An implementation of [NSObject] used to access callback methods @@ -3409,34 +2990,25 @@ final class PigeonApiWKWebViewConfiguration: PigeonApiProtocolWKWebViewConfigura return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, - delegate: PigeonApiDelegateWKWebViewConfiguration - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKWebViewConfiguration) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers( - binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKWebViewConfiguration? - ) { + static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKWebViewConfiguration?) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( - pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.pigeon_defaultConstructor", - binaryMessenger: binaryMessenger, codec: codec) + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.pigeon_defaultConstructor", binaryMessenger: binaryMessenger, codec: codec) if let api = api { pigeonDefaultConstructorChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonIdentifierArg = args[0] as! Int64 do { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), - withIdentifier: pigeonIdentifierArg) +try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), +withIdentifier: pigeonIdentifierArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3445,18 +3017,14 @@ final class PigeonApiWKWebViewConfiguration: PigeonApiProtocolWKWebViewConfigura } else { pigeonDefaultConstructorChannel.setMessageHandler(nil) } - let setUserContentControllerChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setUserContentController", - binaryMessenger: binaryMessenger, codec: codec) + let setUserContentControllerChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setUserContentController", binaryMessenger: binaryMessenger, codec: codec) if let api = api { setUserContentControllerChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKWebViewConfiguration let controllerArg = args[1] as! WKUserContentController do { - try api.pigeonDelegate.setUserContentController( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, controller: controllerArg) + try api.pigeonDelegate.setUserContentController(pigeonApi: api, pigeonInstance: pigeonInstanceArg, controller: controllerArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3465,17 +3033,13 @@ final class PigeonApiWKWebViewConfiguration: PigeonApiProtocolWKWebViewConfigura } else { setUserContentControllerChannel.setMessageHandler(nil) } - let getUserContentControllerChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.getUserContentController", - binaryMessenger: binaryMessenger, codec: codec) + let getUserContentControllerChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.getUserContentController", binaryMessenger: binaryMessenger, codec: codec) if let api = api { getUserContentControllerChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKWebViewConfiguration do { - let result = try api.pigeonDelegate.getUserContentController( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) + let result = try api.pigeonDelegate.getUserContentController(pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -3484,18 +3048,14 @@ final class PigeonApiWKWebViewConfiguration: PigeonApiProtocolWKWebViewConfigura } else { getUserContentControllerChannel.setMessageHandler(nil) } - let setWebsiteDataStoreChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setWebsiteDataStore", - binaryMessenger: binaryMessenger, codec: codec) + let setWebsiteDataStoreChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setWebsiteDataStore", binaryMessenger: binaryMessenger, codec: codec) if let api = api { setWebsiteDataStoreChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKWebViewConfiguration let dataStoreArg = args[1] as! WKWebsiteDataStore do { - try api.pigeonDelegate.setWebsiteDataStore( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, dataStore: dataStoreArg) + try api.pigeonDelegate.setWebsiteDataStore(pigeonApi: api, pigeonInstance: pigeonInstanceArg, dataStore: dataStoreArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3504,17 +3064,13 @@ final class PigeonApiWKWebViewConfiguration: PigeonApiProtocolWKWebViewConfigura } else { setWebsiteDataStoreChannel.setMessageHandler(nil) } - let getWebsiteDataStoreChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.getWebsiteDataStore", - binaryMessenger: binaryMessenger, codec: codec) + let getWebsiteDataStoreChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.getWebsiteDataStore", binaryMessenger: binaryMessenger, codec: codec) if let api = api { getWebsiteDataStoreChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKWebViewConfiguration do { - let result = try api.pigeonDelegate.getWebsiteDataStore( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) + let result = try api.pigeonDelegate.getWebsiteDataStore(pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -3523,17 +3079,14 @@ final class PigeonApiWKWebViewConfiguration: PigeonApiProtocolWKWebViewConfigura } else { getWebsiteDataStoreChannel.setMessageHandler(nil) } - let setPreferencesChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setPreferences", - binaryMessenger: binaryMessenger, codec: codec) + let setPreferencesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setPreferences", binaryMessenger: binaryMessenger, codec: codec) if let api = api { setPreferencesChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKWebViewConfiguration let preferencesArg = args[1] as! WKPreferences do { - try api.pigeonDelegate.setPreferences( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, preferences: preferencesArg) + try api.pigeonDelegate.setPreferences(pigeonApi: api, pigeonInstance: pigeonInstanceArg, preferences: preferencesArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3542,16 +3095,13 @@ final class PigeonApiWKWebViewConfiguration: PigeonApiProtocolWKWebViewConfigura } else { setPreferencesChannel.setMessageHandler(nil) } - let getPreferencesChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.getPreferences", - binaryMessenger: binaryMessenger, codec: codec) + let getPreferencesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.getPreferences", binaryMessenger: binaryMessenger, codec: codec) if let api = api { getPreferencesChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKWebViewConfiguration do { - let result = try api.pigeonDelegate.getPreferences( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) + let result = try api.pigeonDelegate.getPreferences(pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -3560,18 +3110,14 @@ final class PigeonApiWKWebViewConfiguration: PigeonApiProtocolWKWebViewConfigura } else { getPreferencesChannel.setMessageHandler(nil) } - let setAllowsInlineMediaPlaybackChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setAllowsInlineMediaPlayback", - binaryMessenger: binaryMessenger, codec: codec) + let setAllowsInlineMediaPlaybackChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setAllowsInlineMediaPlayback", binaryMessenger: binaryMessenger, codec: codec) if let api = api { setAllowsInlineMediaPlaybackChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKWebViewConfiguration let allowArg = args[1] as! Bool do { - try api.pigeonDelegate.setAllowsInlineMediaPlayback( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, allow: allowArg) + try api.pigeonDelegate.setAllowsInlineMediaPlayback(pigeonApi: api, pigeonInstance: pigeonInstanceArg, allow: allowArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3580,18 +3126,14 @@ final class PigeonApiWKWebViewConfiguration: PigeonApiProtocolWKWebViewConfigura } else { setAllowsInlineMediaPlaybackChannel.setMessageHandler(nil) } - let setLimitsNavigationsToAppBoundDomainsChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setLimitsNavigationsToAppBoundDomains", - binaryMessenger: binaryMessenger, codec: codec) + let setLimitsNavigationsToAppBoundDomainsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setLimitsNavigationsToAppBoundDomains", binaryMessenger: binaryMessenger, codec: codec) if let api = api { setLimitsNavigationsToAppBoundDomainsChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKWebViewConfiguration let limitArg = args[1] as! Bool do { - try api.pigeonDelegate.setLimitsNavigationsToAppBoundDomains( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, limit: limitArg) + try api.pigeonDelegate.setLimitsNavigationsToAppBoundDomains(pigeonApi: api, pigeonInstance: pigeonInstanceArg, limit: limitArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3600,18 +3142,14 @@ final class PigeonApiWKWebViewConfiguration: PigeonApiProtocolWKWebViewConfigura } else { setLimitsNavigationsToAppBoundDomainsChannel.setMessageHandler(nil) } - let setMediaTypesRequiringUserActionForPlaybackChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setMediaTypesRequiringUserActionForPlayback", - binaryMessenger: binaryMessenger, codec: codec) + let setMediaTypesRequiringUserActionForPlaybackChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setMediaTypesRequiringUserActionForPlayback", binaryMessenger: binaryMessenger, codec: codec) if let api = api { setMediaTypesRequiringUserActionForPlaybackChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKWebViewConfiguration let typeArg = args[1] as! AudiovisualMediaType do { - try api.pigeonDelegate.setMediaTypesRequiringUserActionForPlayback( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, type: typeArg) + try api.pigeonDelegate.setMediaTypesRequiringUserActionForPlayback(pigeonApi: api, pigeonInstance: pigeonInstanceArg, type: typeArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3621,17 +3159,13 @@ final class PigeonApiWKWebViewConfiguration: PigeonApiProtocolWKWebViewConfigura 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) + 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) + let result = try api.pigeonDelegate.getDefaultWebpagePreferences(pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -3640,21 +3174,16 @@ final class PigeonApiWKWebViewConfiguration: PigeonApiProtocolWKWebViewConfigura } else { getDefaultWebpagePreferencesChannel.setMessageHandler(nil) } - } else { + } else { let getDefaultWebpagePreferencesChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.getDefaultWebpagePreferences", + 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 - ))) + 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) @@ -3663,27 +3192,21 @@ final class PigeonApiWKWebViewConfiguration: PigeonApiProtocolWKWebViewConfigura } ///Creates a Dart instance of WKWebViewConfiguration and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: WKWebViewConfiguration, - completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: WKWebViewConfiguration, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) + } 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) + 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))) @@ -3703,31 +3226,23 @@ final class PigeonApiWKWebViewConfiguration: PigeonApiProtocolWKWebViewConfigura } protocol PigeonApiDelegateWKUserContentController { /// Installs a message handler that you can call from your JavaScript code. - func addScriptMessageHandler( - pigeonApi: PigeonApiWKUserContentController, pigeonInstance: WKUserContentController, - handler: WKScriptMessageHandler, name: String) throws + func addScriptMessageHandler(pigeonApi: PigeonApiWKUserContentController, pigeonInstance: WKUserContentController, handler: WKScriptMessageHandler, name: String) throws /// Uninstalls the custom message handler with the specified name from your /// JavaScript code. - func removeScriptMessageHandler( - pigeonApi: PigeonApiWKUserContentController, pigeonInstance: WKUserContentController, - name: String) throws + func removeScriptMessageHandler(pigeonApi: PigeonApiWKUserContentController, pigeonInstance: WKUserContentController, name: String) throws /// Uninstalls all custom message handlers associated with the user content /// controller. - func removeAllScriptMessageHandlers( - pigeonApi: PigeonApiWKUserContentController, pigeonInstance: WKUserContentController) throws + func removeAllScriptMessageHandlers(pigeonApi: PigeonApiWKUserContentController, pigeonInstance: WKUserContentController) throws /// Injects the specified script into the webpage’s content. - func addUserScript( - pigeonApi: PigeonApiWKUserContentController, pigeonInstance: WKUserContentController, - userScript: WKUserScript) throws + func addUserScript(pigeonApi: PigeonApiWKUserContentController, pigeonInstance: WKUserContentController, userScript: WKUserScript) throws /// Removes all user scripts from the web view. - func removeAllUserScripts( - pigeonApi: PigeonApiWKUserContentController, pigeonInstance: WKUserContentController) throws + func removeAllUserScripts(pigeonApi: PigeonApiWKUserContentController, pigeonInstance: WKUserContentController) throws } protocol PigeonApiProtocolWKUserContentController { } -final class PigeonApiWKUserContentController: PigeonApiProtocolWKUserContentController { +final class PigeonApiWKUserContentController: PigeonApiProtocolWKUserContentController { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKUserContentController ///An implementation of [NSObject] used to access callback methods @@ -3735,26 +3250,17 @@ final class PigeonApiWKUserContentController: PigeonApiProtocolWKUserContentCont return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, - delegate: PigeonApiDelegateWKUserContentController - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKUserContentController) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers( - binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKUserContentController? - ) { + static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKUserContentController?) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( - pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let addScriptMessageHandlerChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.addScriptMessageHandler", - binaryMessenger: binaryMessenger, codec: codec) + let addScriptMessageHandlerChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.addScriptMessageHandler", binaryMessenger: binaryMessenger, codec: codec) if let api = api { addScriptMessageHandlerChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -3762,8 +3268,7 @@ final class PigeonApiWKUserContentController: PigeonApiProtocolWKUserContentCont let handlerArg = args[1] as! WKScriptMessageHandler let nameArg = args[2] as! String do { - try api.pigeonDelegate.addScriptMessageHandler( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, handler: handlerArg, name: nameArg) + try api.pigeonDelegate.addScriptMessageHandler(pigeonApi: api, pigeonInstance: pigeonInstanceArg, handler: handlerArg, name: nameArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3772,18 +3277,14 @@ final class PigeonApiWKUserContentController: PigeonApiProtocolWKUserContentCont } else { addScriptMessageHandlerChannel.setMessageHandler(nil) } - let removeScriptMessageHandlerChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.removeScriptMessageHandler", - binaryMessenger: binaryMessenger, codec: codec) + let removeScriptMessageHandlerChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.removeScriptMessageHandler", binaryMessenger: binaryMessenger, codec: codec) if let api = api { removeScriptMessageHandlerChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKUserContentController let nameArg = args[1] as! String do { - try api.pigeonDelegate.removeScriptMessageHandler( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, name: nameArg) + try api.pigeonDelegate.removeScriptMessageHandler(pigeonApi: api, pigeonInstance: pigeonInstanceArg, name: nameArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3792,17 +3293,13 @@ final class PigeonApiWKUserContentController: PigeonApiProtocolWKUserContentCont } else { removeScriptMessageHandlerChannel.setMessageHandler(nil) } - let removeAllScriptMessageHandlersChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.removeAllScriptMessageHandlers", - binaryMessenger: binaryMessenger, codec: codec) + let removeAllScriptMessageHandlersChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.removeAllScriptMessageHandlers", binaryMessenger: binaryMessenger, codec: codec) if let api = api { removeAllScriptMessageHandlersChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKUserContentController do { - try api.pigeonDelegate.removeAllScriptMessageHandlers( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) + try api.pigeonDelegate.removeAllScriptMessageHandlers(pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3811,17 +3308,14 @@ final class PigeonApiWKUserContentController: PigeonApiProtocolWKUserContentCont } else { removeAllScriptMessageHandlersChannel.setMessageHandler(nil) } - let addUserScriptChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.addUserScript", - binaryMessenger: binaryMessenger, codec: codec) + let addUserScriptChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.addUserScript", binaryMessenger: binaryMessenger, codec: codec) if let api = api { addUserScriptChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKUserContentController let userScriptArg = args[1] as! WKUserScript do { - try api.pigeonDelegate.addUserScript( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, userScript: userScriptArg) + try api.pigeonDelegate.addUserScript(pigeonApi: api, pigeonInstance: pigeonInstanceArg, userScript: userScriptArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3830,17 +3324,13 @@ final class PigeonApiWKUserContentController: PigeonApiProtocolWKUserContentCont } else { addUserScriptChannel.setMessageHandler(nil) } - let removeAllUserScriptsChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.removeAllUserScripts", - binaryMessenger: binaryMessenger, codec: codec) + let removeAllUserScriptsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.removeAllUserScripts", binaryMessenger: binaryMessenger, codec: codec) if let api = api { removeAllUserScriptsChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKUserContentController do { - try api.pigeonDelegate.removeAllUserScripts( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) + try api.pigeonDelegate.removeAllUserScripts(pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3852,27 +3342,21 @@ final class PigeonApiWKUserContentController: PigeonApiProtocolWKUserContentCont } ///Creates a Dart instance of WKUserContentController and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: WKUserContentController, - completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: WKUserContentController, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) + } 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) + 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))) @@ -3892,14 +3376,13 @@ final class PigeonApiWKUserContentController: PigeonApiProtocolWKUserContentCont } protocol PigeonApiDelegateWKPreferences { /// A Boolean value that indicates whether JavaScript is enabled. - func setJavaScriptEnabled( - pigeonApi: PigeonApiWKPreferences, pigeonInstance: WKPreferences, enabled: Bool) throws + func setJavaScriptEnabled(pigeonApi: PigeonApiWKPreferences, pigeonInstance: WKPreferences, enabled: Bool) throws } protocol PigeonApiProtocolWKPreferences { } -final class PigeonApiWKPreferences: PigeonApiProtocolWKPreferences { +final class PigeonApiWKPreferences: PigeonApiProtocolWKPreferences { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKPreferences ///An implementation of [NSObject] used to access callback methods @@ -3907,32 +3390,24 @@ final class PigeonApiWKPreferences: PigeonApiProtocolWKPreferences { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKPreferences - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKPreferences) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers( - binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKPreferences? - ) { + static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKPreferences?) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( - pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let setJavaScriptEnabledChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKPreferences.setJavaScriptEnabled", - binaryMessenger: binaryMessenger, codec: codec) + let setJavaScriptEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKPreferences.setJavaScriptEnabled", binaryMessenger: binaryMessenger, codec: codec) if let api = api { setJavaScriptEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKPreferences let enabledArg = args[1] as! Bool do { - try api.pigeonDelegate.setJavaScriptEnabled( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, enabled: enabledArg) + try api.pigeonDelegate.setJavaScriptEnabled(pigeonApi: api, pigeonInstance: pigeonInstanceArg, enabled: enabledArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3944,26 +3419,21 @@ final class PigeonApiWKPreferences: PigeonApiProtocolWKPreferences { } ///Creates a Dart instance of WKPreferences and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: WKPreferences, completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: WKPreferences, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) + } 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) + 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))) @@ -3982,19 +3452,15 @@ final class PigeonApiWKPreferences: PigeonApiProtocolWKPreferences { } } protocol PigeonApiDelegateWKScriptMessageHandler { - func pigeonDefaultConstructor(pigeonApi: PigeonApiWKScriptMessageHandler) throws - -> WKScriptMessageHandler + func pigeonDefaultConstructor(pigeonApi: PigeonApiWKScriptMessageHandler) throws -> WKScriptMessageHandler } protocol PigeonApiProtocolWKScriptMessageHandler { /// Tells the handler that a webpage sent a script message. - func didReceiveScriptMessage( - pigeonInstance pigeonInstanceArg: WKScriptMessageHandler, - controller controllerArg: WKUserContentController, message messageArg: WKScriptMessage, - completion: @escaping (Result) -> Void) + func didReceiveScriptMessage(pigeonInstance pigeonInstanceArg: WKScriptMessageHandler, controller controllerArg: WKUserContentController, message messageArg: WKScriptMessage, completion: @escaping (Result) -> Void) } -final class PigeonApiWKScriptMessageHandler: PigeonApiProtocolWKScriptMessageHandler { +final class PigeonApiWKScriptMessageHandler: PigeonApiProtocolWKScriptMessageHandler { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKScriptMessageHandler ///An implementation of [NSObject] used to access callback methods @@ -4002,34 +3468,25 @@ final class PigeonApiWKScriptMessageHandler: PigeonApiProtocolWKScriptMessageHan return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, - delegate: PigeonApiDelegateWKScriptMessageHandler - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKScriptMessageHandler) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers( - binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKScriptMessageHandler? - ) { + static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKScriptMessageHandler?) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( - pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.webview_flutter_wkwebview.WKScriptMessageHandler.pigeon_defaultConstructor", - binaryMessenger: binaryMessenger, codec: codec) + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKScriptMessageHandler.pigeon_defaultConstructor", binaryMessenger: binaryMessenger, codec: codec) if let api = api { pigeonDefaultConstructorChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonIdentifierArg = args[0] as! Int64 do { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), - withIdentifier: pigeonIdentifierArg) +try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), +withIdentifier: pigeonIdentifierArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -4041,34 +3498,25 @@ final class PigeonApiWKScriptMessageHandler: PigeonApiProtocolWKScriptMessageHan } ///Creates a Dart instance of WKScriptMessageHandler and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: WKScriptMessageHandler, - completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: WKScriptMessageHandler, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { + } 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: ""))) + message: "Error: Attempting to create a new Dart instance of WKScriptMessageHandler, but the class has a nonnull callback method.", details: ""))) } } /// Tells the handler that a webpage sent a script message. - func didReceiveScriptMessage( - pigeonInstance pigeonInstanceArg: WKScriptMessageHandler, - controller controllerArg: WKUserContentController, message messageArg: WKScriptMessage, - completion: @escaping (Result) -> Void - ) { + func didReceiveScriptMessage(pigeonInstance pigeonInstanceArg: WKScriptMessageHandler, controller controllerArg: WKUserContentController, message messageArg: WKScriptMessage, completion: @escaping (Result) -> Void) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -4079,10 +3527,8 @@ final class PigeonApiWKScriptMessageHandler: PigeonApiProtocolWKScriptMessageHan } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.WKScriptMessageHandler.didReceiveScriptMessage" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKScriptMessageHandler.didReceiveScriptMessage" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([pigeonInstanceArg, controllerArg, messageArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -4101,44 +3547,27 @@ final class PigeonApiWKScriptMessageHandler: PigeonApiProtocolWKScriptMessageHan } protocol PigeonApiDelegateWKNavigationDelegate { - func pigeonDefaultConstructor(pigeonApi: PigeonApiWKNavigationDelegate) throws - -> WKNavigationDelegate + func pigeonDefaultConstructor(pigeonApi: PigeonApiWKNavigationDelegate) throws -> WKNavigationDelegate } protocol PigeonApiProtocolWKNavigationDelegate { /// Tells the delegate that navigation is complete. - func didFinishNavigation( - pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, - url urlArg: String?, completion: @escaping (Result) -> Void) + func didFinishNavigation(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, url urlArg: String?, completion: @escaping (Result) -> Void) /// Tells the delegate that navigation from the main frame has started. - func didStartProvisionalNavigation( - pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, - url urlArg: String?, completion: @escaping (Result) -> Void) + func didStartProvisionalNavigation(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, url urlArg: String?, completion: @escaping (Result) -> Void) /// Asks the delegate for permission to navigate to new content based on the /// specified action information. - func decidePolicyForNavigationAction( - pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, - navigationAction navigationActionArg: WKNavigationAction, - completion: @escaping (Result) -> Void) + func decidePolicyForNavigationAction(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, navigationAction navigationActionArg: WKNavigationAction, completion: @escaping (Result) -> Void) /// Asks the delegate for permission to navigate to new content after the /// response to the navigation request is known. - func decidePolicyForNavigationResponse( - pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, - navigationResponse navigationResponseArg: WKNavigationResponse, - completion: @escaping (Result) -> Void) + func decidePolicyForNavigationResponse(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, navigationResponse navigationResponseArg: WKNavigationResponse, completion: @escaping (Result) -> Void) /// Tells the delegate that an error occurred during navigation. - func didFailNavigation( - pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, - error errorArg: NSError, completion: @escaping (Result) -> Void) + func didFailNavigation(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, error errorArg: NSError, completion: @escaping (Result) -> Void) /// Tells the delegate that an error occurred during the early navigation /// process. - func didFailProvisionalNavigation( - pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, - error errorArg: NSError, completion: @escaping (Result) -> Void) + func didFailProvisionalNavigation(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, error errorArg: NSError, completion: @escaping (Result) -> Void) /// Tells the delegate that the web view’s content process was terminated. - func webViewWebContentProcessDidTerminate( - pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, - completion: @escaping (Result) -> Void) + func webViewWebContentProcessDidTerminate(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, completion: @escaping (Result) -> Void) /// Asks the delegate to respond to an authentication challenge. /// /// This return value expects a List with: @@ -4150,13 +3579,10 @@ protocol PigeonApiProtocolWKNavigationDelegate { /// "password": "", /// "persistence": , /// ] - func didReceiveAuthenticationChallenge( - pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, - challenge challengeArg: URLAuthenticationChallenge, - completion: @escaping (Result<[Any?], PigeonError>) -> Void) + func didReceiveAuthenticationChallenge(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, challenge challengeArg: URLAuthenticationChallenge, completion: @escaping (Result<[Any?], PigeonError>) -> Void) } -final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate { +final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKNavigationDelegate ///An implementation of [NSObject] used to access callback methods @@ -4164,34 +3590,25 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, - delegate: PigeonApiDelegateWKNavigationDelegate - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKNavigationDelegate) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers( - binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKNavigationDelegate? - ) { + static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKNavigationDelegate?) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( - pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.pigeon_defaultConstructor", - binaryMessenger: binaryMessenger, codec: codec) + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.pigeon_defaultConstructor", binaryMessenger: binaryMessenger, codec: codec) if let api = api { pigeonDefaultConstructorChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonIdentifierArg = args[0] as! Int64 do { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), - withIdentifier: pigeonIdentifierArg) +try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), +withIdentifier: pigeonIdentifierArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -4203,32 +3620,25 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate } ///Creates a Dart instance of WKNavigationDelegate and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: WKNavigationDelegate, completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: WKNavigationDelegate, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { + } 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: ""))) + message: "Error: Attempting to create a new Dart instance of WKNavigationDelegate, but the class has a nonnull callback method.", details: ""))) } } /// Tells the delegate that navigation is complete. - func didFinishNavigation( - pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, - url urlArg: String?, completion: @escaping (Result) -> Void - ) { + func didFinishNavigation(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, url urlArg: String?, completion: @escaping (Result) -> Void) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -4239,10 +3649,8 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didFinishNavigation" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didFinishNavigation" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([pigeonInstanceArg, webViewArg, urlArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -4260,10 +3668,7 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate } /// Tells the delegate that navigation from the main frame has started. - func didStartProvisionalNavigation( - pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, - url urlArg: String?, completion: @escaping (Result) -> Void - ) { + func didStartProvisionalNavigation(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, url urlArg: String?, completion: @escaping (Result) -> Void) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -4274,10 +3679,8 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didStartProvisionalNavigation" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didStartProvisionalNavigation" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([pigeonInstanceArg, webViewArg, urlArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -4296,11 +3699,7 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate /// Asks the delegate for permission to navigate to new content based on the /// specified action information. - func decidePolicyForNavigationAction( - pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, - navigationAction navigationActionArg: WKNavigationAction, - completion: @escaping (Result) -> Void - ) { + func decidePolicyForNavigationAction(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, navigationAction navigationActionArg: WKNavigationAction, completion: @escaping (Result) -> Void) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -4311,12 +3710,9 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.decidePolicyForNavigationAction" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, webViewArg, navigationActionArg] as [Any?]) { - response in + let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.decidePolicyForNavigationAction" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, webViewArg, navigationActionArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -4327,11 +3723,7 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) + completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! NavigationActionPolicy completion(.success(result)) @@ -4341,11 +3733,7 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate /// Asks the delegate for permission to navigate to new content after the /// response to the navigation request is known. - func decidePolicyForNavigationResponse( - pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, - navigationResponse navigationResponseArg: WKNavigationResponse, - completion: @escaping (Result) -> Void - ) { + func decidePolicyForNavigationResponse(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, navigationResponse navigationResponseArg: WKNavigationResponse, completion: @escaping (Result) -> Void) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -4356,12 +3744,9 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.decidePolicyForNavigationResponse" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, webViewArg, navigationResponseArg] as [Any?]) { - response in + let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.decidePolicyForNavigationResponse" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, webViewArg, navigationResponseArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -4372,11 +3757,7 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) + completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! NavigationResponsePolicy completion(.success(result)) @@ -4385,10 +3766,7 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate } /// Tells the delegate that an error occurred during navigation. - func didFailNavigation( - pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, - error errorArg: NSError, completion: @escaping (Result) -> Void - ) { + func didFailNavigation(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, error errorArg: NSError, completion: @escaping (Result) -> Void) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -4399,10 +3777,8 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didFailNavigation" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didFailNavigation" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([pigeonInstanceArg, webViewArg, errorArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -4421,10 +3797,7 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate /// Tells the delegate that an error occurred during the early navigation /// process. - func didFailProvisionalNavigation( - pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, - error errorArg: NSError, completion: @escaping (Result) -> Void - ) { + func didFailProvisionalNavigation(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, error errorArg: NSError, completion: @escaping (Result) -> Void) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -4435,10 +3808,8 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didFailProvisionalNavigation" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didFailProvisionalNavigation" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([pigeonInstanceArg, webViewArg, errorArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -4456,10 +3827,7 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate } /// Tells the delegate that the web view’s content process was terminated. - func webViewWebContentProcessDidTerminate( - pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, - completion: @escaping (Result) -> Void - ) { + func webViewWebContentProcessDidTerminate(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, completion: @escaping (Result) -> Void) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -4470,10 +3838,8 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.webViewWebContentProcessDidTerminate" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.webViewWebContentProcessDidTerminate" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([pigeonInstanceArg, webViewArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -4501,11 +3867,7 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate /// "password": "", /// "persistence": , /// ] - func didReceiveAuthenticationChallenge( - pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, - challenge challengeArg: URLAuthenticationChallenge, - completion: @escaping (Result<[Any?], PigeonError>) -> Void - ) { + func didReceiveAuthenticationChallenge(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, challenge challengeArg: URLAuthenticationChallenge, completion: @escaping (Result<[Any?], PigeonError>) -> Void) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -4516,10 +3878,8 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didReceiveAuthenticationChallenge" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didReceiveAuthenticationChallenge" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([pigeonInstanceArg, webViewArg, challengeArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -4531,11 +3891,7 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) + completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! [Any?] completion(.success(result)) @@ -4548,52 +3904,41 @@ protocol PigeonApiDelegateNSObject { func pigeonDefaultConstructor(pigeonApi: PigeonApiNSObject) throws -> NSObject /// Registers the observer object to receive KVO notifications for the key /// path relative to the object receiving this message. - func addObserver( - pigeonApi: PigeonApiNSObject, pigeonInstance: NSObject, observer: NSObject, keyPath: String, - options: [KeyValueObservingOptions]) throws + func addObserver(pigeonApi: PigeonApiNSObject, pigeonInstance: NSObject, observer: NSObject, keyPath: String, options: [KeyValueObservingOptions]) throws /// Stops the observer object from receiving change notifications for the /// property specified by the key path relative to the object receiving this /// message. - func removeObserver( - pigeonApi: PigeonApiNSObject, pigeonInstance: NSObject, observer: NSObject, keyPath: String) - throws + func removeObserver(pigeonApi: PigeonApiNSObject, pigeonInstance: NSObject, observer: NSObject, keyPath: String) throws } protocol PigeonApiProtocolNSObject { /// Informs the observing object when the value at the specified key path /// relative to the observed object has changed. - func observeValue( - pigeonInstance pigeonInstanceArg: NSObject, keyPath keyPathArg: String?, - object objectArg: NSObject?, change changeArg: [KeyValueChangeKey: Any?]?, - completion: @escaping (Result) -> Void) + func observeValue(pigeonInstance pigeonInstanceArg: NSObject, keyPath keyPathArg: String?, object objectArg: NSObject?, change changeArg: [KeyValueChangeKey: Any?]?, completion: @escaping (Result) -> Void) } -final class PigeonApiNSObject: PigeonApiProtocolNSObject { +final class PigeonApiNSObject: PigeonApiProtocolNSObject { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateNSObject init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateNSObject) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiNSObject?) - { + static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiNSObject?) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( - pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSObject.pigeon_defaultConstructor", - binaryMessenger: binaryMessenger, codec: codec) + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSObject.pigeon_defaultConstructor", binaryMessenger: binaryMessenger, codec: codec) if let api = api { pigeonDefaultConstructorChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonIdentifierArg = args[0] as! Int64 do { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), - withIdentifier: pigeonIdentifierArg) +try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), +withIdentifier: pigeonIdentifierArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -4602,9 +3947,7 @@ final class PigeonApiNSObject: PigeonApiProtocolNSObject { } else { pigeonDefaultConstructorChannel.setMessageHandler(nil) } - let addObserverChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSObject.addObserver", - binaryMessenger: binaryMessenger, codec: codec) + let addObserverChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSObject.addObserver", binaryMessenger: binaryMessenger, codec: codec) if let api = api { addObserverChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -4613,9 +3956,7 @@ final class PigeonApiNSObject: PigeonApiProtocolNSObject { let keyPathArg = args[2] as! String let optionsArg = args[3] as! [KeyValueObservingOptions] do { - try api.pigeonDelegate.addObserver( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, observer: observerArg, - keyPath: keyPathArg, options: optionsArg) + try api.pigeonDelegate.addObserver(pigeonApi: api, pigeonInstance: pigeonInstanceArg, observer: observerArg, keyPath: keyPathArg, options: optionsArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -4624,9 +3965,7 @@ final class PigeonApiNSObject: PigeonApiProtocolNSObject { } else { addObserverChannel.setMessageHandler(nil) } - let removeObserverChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSObject.removeObserver", - binaryMessenger: binaryMessenger, codec: codec) + let removeObserverChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSObject.removeObserver", binaryMessenger: binaryMessenger, codec: codec) if let api = api { removeObserverChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -4634,9 +3973,7 @@ final class PigeonApiNSObject: PigeonApiProtocolNSObject { let observerArg = args[1] as! NSObject let keyPathArg = args[2] as! String do { - try api.pigeonDelegate.removeObserver( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, observer: observerArg, - keyPath: keyPathArg) + try api.pigeonDelegate.removeObserver(pigeonApi: api, pigeonInstance: pigeonInstanceArg, observer: observerArg, keyPath: keyPathArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -4648,26 +3985,21 @@ final class PigeonApiNSObject: PigeonApiProtocolNSObject { } ///Creates a Dart instance of NSObject and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: NSObject, completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: NSObject, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) + } 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) + 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))) @@ -4686,11 +4018,7 @@ final class PigeonApiNSObject: PigeonApiProtocolNSObject { } /// Informs the observing object when the value at the specified key path /// relative to the observed object has changed. - func observeValue( - pigeonInstance pigeonInstanceArg: NSObject, keyPath keyPathArg: String?, - object objectArg: NSObject?, change changeArg: [KeyValueChangeKey: Any?]?, - completion: @escaping (Result) -> Void - ) { + func observeValue(pigeonInstance pigeonInstanceArg: NSObject, keyPath keyPathArg: String?, object objectArg: NSObject?, change changeArg: [KeyValueChangeKey: Any?]?, completion: @escaping (Result) -> Void) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -4702,10 +4030,8 @@ final class PigeonApiNSObject: PigeonApiProtocolNSObject { let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.NSObject.observeValue" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, keyPathArg, objectArg, changeArg] as [Any?]) { - response in + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, keyPathArg, objectArg, changeArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -4724,133 +4050,111 @@ final class PigeonApiNSObject: PigeonApiProtocolNSObject { } protocol PigeonApiDelegateUIViewWKWebView { #if !os(macOS) - func pigeonDefaultConstructor( - pigeonApi: PigeonApiUIViewWKWebView, initialConfiguration: WKWebViewConfiguration - ) throws -> WKWebView + func pigeonDefaultConstructor(pigeonApi: PigeonApiUIViewWKWebView, initialConfiguration: WKWebViewConfiguration) throws -> WKWebView #endif #if !os(macOS) - /// The object that contains the configuration details for the web view. - func configuration(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws - -> WKWebViewConfiguration + /// The object that contains the configuration details for the web view. + func configuration(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> WKWebViewConfiguration #endif #if !os(macOS) - /// The scroll view associated with the web view. - func scrollView(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws - -> UIScrollView + /// The scroll view associated with the web view. + func scrollView(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> UIScrollView #endif #if !os(macOS) - /// The object you use to integrate custom user interface elements, such as - /// contextual menus or panels, into web view interactions. - func setUIDelegate( - pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, delegate: WKUIDelegate) throws + /// The object you use to integrate custom user interface elements, such as + /// contextual menus or panels, into web view interactions. + func setUIDelegate(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, delegate: WKUIDelegate) throws #endif #if !os(macOS) - /// The object you use to manage navigation behavior for the web view. - func setNavigationDelegate( - pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, delegate: WKNavigationDelegate - ) throws + /// The object you use to manage navigation behavior for the web view. + func setNavigationDelegate(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, delegate: WKNavigationDelegate) throws #endif #if !os(macOS) - /// The URL for the current webpage. - func getUrl(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> String? + /// The URL for the current webpage. + func getUrl(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> String? #endif #if !os(macOS) - /// An estimate of what fraction of the current navigation has been loaded. - func getEstimatedProgress(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws - -> Double + /// An estimate of what fraction of the current navigation has been loaded. + func getEstimatedProgress(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> Double #endif #if !os(macOS) - /// Loads the web content that the specified URL request object references and - /// navigates to that content. - func load( - pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, request: URLRequestWrapper) - throws + /// Loads the web content that the specified URL request object references and + /// navigates to that content. + func load(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, request: URLRequestWrapper) throws #endif #if !os(macOS) - /// Loads the contents of the specified HTML string and navigates to it. - func loadHtmlString( - pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, string: String, - baseUrl: String?) throws + /// Loads the contents of the specified HTML string and navigates to it. + func loadHtmlString(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, string: String, baseUrl: String?) throws #endif #if !os(macOS) - /// Loads the web content from the specified file and navigates to it. - func loadFileUrl( - pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, url: String, - readAccessUrl: String) throws + /// Loads the web content from the specified file and navigates to it. + func loadFileUrl(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, url: String, readAccessUrl: String) throws #endif #if !os(macOS) - /// Convenience method to load a Flutter asset. - func loadFlutterAsset( - pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, key: String) throws + /// Convenience method to load a Flutter asset. + func loadFlutterAsset(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, key: String) throws #endif #if !os(macOS) - /// A Boolean value that indicates whether there is a valid back item in the - /// back-forward list. - func canGoBack(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> Bool + /// A Boolean value that indicates whether there is a valid back item in the + /// back-forward list. + func canGoBack(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> Bool #endif #if !os(macOS) - /// A Boolean value that indicates whether there is a valid forward item in - /// the back-forward list. - func canGoForward(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> Bool + /// A Boolean value that indicates whether there is a valid forward item in + /// the back-forward list. + func canGoForward(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> Bool #endif #if !os(macOS) - /// Navigates to the back item in the back-forward list. - func goBack(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws + /// Navigates to the back item in the back-forward list. + func goBack(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws #endif #if !os(macOS) - /// Navigates to the forward item in the back-forward list. - func goForward(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws + /// Navigates to the forward item in the back-forward list. + func goForward(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws #endif #if !os(macOS) - /// Reloads the current webpage. - func reload(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws + /// Reloads the current webpage. + func reload(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws #endif #if !os(macOS) - /// The page title. - func getTitle(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> String? + /// The page title. + func getTitle(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> String? #endif #if !os(macOS) - /// A Boolean value that indicates whether horizontal swipe gestures trigger - /// backward and forward page navigation. - func setAllowsBackForwardNavigationGestures( - pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, allow: Bool) throws + /// A Boolean value that indicates whether horizontal swipe gestures trigger + /// backward and forward page navigation. + func setAllowsBackForwardNavigationGestures(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, allow: Bool) throws #endif #if !os(macOS) - /// The custom user agent string. - func setCustomUserAgent( - pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, userAgent: String?) throws + /// The custom user agent string. + func setCustomUserAgent(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, userAgent: String?) throws #endif #if !os(macOS) - /// Evaluates the specified JavaScript string. - func evaluateJavaScript( - pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, javaScriptString: String, - completion: @escaping (Result) -> Void) + /// Evaluates the specified JavaScript string. + func evaluateJavaScript(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, javaScriptString: String, completion: @escaping (Result) -> Void) #endif #if !os(macOS) - /// A Boolean value that indicates whether you can inspect the view with - /// Safari Web Inspector. - func setInspectable( - pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, inspectable: Bool) throws + /// A Boolean value that indicates whether you can inspect the view with + /// Safari Web Inspector. + func setInspectable(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, inspectable: Bool) throws #endif #if !os(macOS) - /// The custom user agent string. - func getCustomUserAgent(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws - -> String? + /// The custom user agent string. + func getCustomUserAgent(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> String? #endif #if !os(macOS) - /// Whether to allow previews for link destinations and detected data such as - /// addresses and phone numbers. - /// - /// Defaults to true. - func setAllowsLinkPreview( - pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, allow: Bool) throws + /// Whether to allow previews for link destinations and detected data such as + /// addresses and phone numbers. + /// + /// Defaults to true. + func setAllowsLinkPreview(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, allow: Bool) throws #endif } protocol PigeonApiProtocolUIViewWKWebView { } -final class PigeonApiUIViewWKWebView: PigeonApiProtocolUIViewWKWebView { +final class PigeonApiUIViewWKWebView: PigeonApiProtocolUIViewWKWebView { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateUIViewWKWebView ///An implementation of [UIView] used to access callback methods @@ -4863,673 +4167,567 @@ final class PigeonApiUIViewWKWebView: PigeonApiProtocolUIViewWKWebView { return pigeonRegistrar.apiDelegate.pigeonApiWKWebView(pigeonRegistrar) } - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, - delegate: PigeonApiDelegateUIViewWKWebView - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateUIViewWKWebView) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers( - binaryMessenger: FlutterBinaryMessenger, api: PigeonApiUIViewWKWebView? - ) { + static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiUIViewWKWebView?) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( - pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() #if !os(macOS) - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.pigeon_defaultConstructor", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - pigeonDefaultConstructorChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonIdentifierArg = args[0] as! Int64 - let initialConfigurationArg = args[1] as! WKWebViewConfiguration - do { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - try api.pigeonDelegate.pigeonDefaultConstructor( - pigeonApi: api, initialConfiguration: initialConfigurationArg), - withIdentifier: pigeonIdentifierArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.pigeon_defaultConstructor", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + pigeonDefaultConstructorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonIdentifierArg = args[0] as! Int64 + let initialConfigurationArg = args[1] as! WKWebViewConfiguration + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( +try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api, initialConfiguration: initialConfigurationArg), +withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - pigeonDefaultConstructorChannel.setMessageHandler(nil) } + } else { + pigeonDefaultConstructorChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let configurationChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.configuration", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - configurationChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let pigeonIdentifierArg = args[1] as! Int64 - do { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - try api.pigeonDelegate.configuration( - pigeonApi: api, pigeonInstance: pigeonInstanceArg), - withIdentifier: pigeonIdentifierArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let configurationChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.configuration", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + configurationChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let pigeonIdentifierArg = args[1] as! Int64 + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance(try api.pigeonDelegate.configuration(pigeonApi: api, pigeonInstance: pigeonInstanceArg), withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - configurationChannel.setMessageHandler(nil) } + } else { + configurationChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let scrollViewChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.scrollView", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - scrollViewChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let pigeonIdentifierArg = args[1] as! Int64 - do { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - try api.pigeonDelegate.scrollView(pigeonApi: api, pigeonInstance: pigeonInstanceArg), - withIdentifier: pigeonIdentifierArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let scrollViewChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.scrollView", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + scrollViewChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let pigeonIdentifierArg = args[1] as! Int64 + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance(try api.pigeonDelegate.scrollView(pigeonApi: api, pigeonInstance: pigeonInstanceArg), withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - scrollViewChannel.setMessageHandler(nil) - } - #endif - #if !os(macOS) - let setUIDelegateChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setUIDelegate", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setUIDelegateChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let delegateArg = args[1] as! WKUIDelegate - do { - try api.pigeonDelegate.setUIDelegate( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, delegate: delegateArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } - } - } else { - setUIDelegateChannel.setMessageHandler(nil) } + } else { + scrollViewChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let setNavigationDelegateChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setNavigationDelegate", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setNavigationDelegateChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let delegateArg = args[1] as! WKNavigationDelegate - do { - try api.pigeonDelegate.setNavigationDelegate( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, delegate: delegateArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let setUIDelegateChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setUIDelegate", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setUIDelegateChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let delegateArg = args[1] as! WKUIDelegate + do { + try api.pigeonDelegate.setUIDelegate(pigeonApi: api, pigeonInstance: pigeonInstanceArg, delegate: delegateArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - setNavigationDelegateChannel.setMessageHandler(nil) } + } else { + setUIDelegateChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let getUrlChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.getUrl", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - getUrlChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - let result = try api.pigeonDelegate.getUrl( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } + let setNavigationDelegateChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setNavigationDelegate", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setNavigationDelegateChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let delegateArg = args[1] as! WKNavigationDelegate + do { + try api.pigeonDelegate.setNavigationDelegate(pigeonApi: api, pigeonInstance: pigeonInstanceArg, delegate: delegateArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - getUrlChannel.setMessageHandler(nil) } + } else { + setNavigationDelegateChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let getEstimatedProgressChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.getEstimatedProgress", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - getEstimatedProgressChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - let result = try api.pigeonDelegate.getEstimatedProgress( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } + let getUrlChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.getUrl", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getUrlChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.getUrl(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) } - } else { - getEstimatedProgressChannel.setMessageHandler(nil) } + } else { + getUrlChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let loadChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.load", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - loadChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let requestArg = args[1] as! URLRequestWrapper - do { - try api.pigeonDelegate.load( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, request: requestArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let getEstimatedProgressChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.getEstimatedProgress", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getEstimatedProgressChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.getEstimatedProgress(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) } - } else { - loadChannel.setMessageHandler(nil) } + } else { + getEstimatedProgressChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let loadHtmlStringChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.loadHtmlString", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - loadHtmlStringChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let stringArg = args[1] as! String - let baseUrlArg: String? = nilOrValue(args[2]) - do { - try api.pigeonDelegate.loadHtmlString( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, string: stringArg, - baseUrl: baseUrlArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let loadChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.load", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + loadChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let requestArg = args[1] as! URLRequestWrapper + do { + try api.pigeonDelegate.load(pigeonApi: api, pigeonInstance: pigeonInstanceArg, request: requestArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - loadHtmlStringChannel.setMessageHandler(nil) } + } else { + loadChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let loadFileUrlChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.loadFileUrl", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - loadFileUrlChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let urlArg = args[1] as! String - let readAccessUrlArg = args[2] as! String - do { - try api.pigeonDelegate.loadFileUrl( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, url: urlArg, - readAccessUrl: readAccessUrlArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let loadHtmlStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.loadHtmlString", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + loadHtmlStringChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let stringArg = args[1] as! String + let baseUrlArg: String? = nilOrValue(args[2]) + do { + try api.pigeonDelegate.loadHtmlString(pigeonApi: api, pigeonInstance: pigeonInstanceArg, string: stringArg, baseUrl: baseUrlArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - loadFileUrlChannel.setMessageHandler(nil) } + } else { + loadHtmlStringChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let loadFlutterAssetChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.loadFlutterAsset", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - loadFlutterAssetChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let keyArg = args[1] as! String - do { - try api.pigeonDelegate.loadFlutterAsset( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, key: keyArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let loadFileUrlChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.loadFileUrl", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + loadFileUrlChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let urlArg = args[1] as! String + let readAccessUrlArg = args[2] as! String + do { + try api.pigeonDelegate.loadFileUrl(pigeonApi: api, pigeonInstance: pigeonInstanceArg, url: urlArg, readAccessUrl: readAccessUrlArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - loadFlutterAssetChannel.setMessageHandler(nil) } + } else { + loadFileUrlChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let canGoBackChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.canGoBack", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - canGoBackChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - let result = try api.pigeonDelegate.canGoBack( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } + let loadFlutterAssetChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.loadFlutterAsset", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + loadFlutterAssetChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let keyArg = args[1] as! String + do { + try api.pigeonDelegate.loadFlutterAsset(pigeonApi: api, pigeonInstance: pigeonInstanceArg, key: keyArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - canGoBackChannel.setMessageHandler(nil) } + } else { + loadFlutterAssetChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let canGoForwardChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.canGoForward", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - canGoForwardChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - let result = try api.pigeonDelegate.canGoForward( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } + let canGoBackChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.canGoBack", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + canGoBackChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.canGoBack(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) } - } else { - canGoForwardChannel.setMessageHandler(nil) } + } else { + canGoBackChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let goBackChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.goBack", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - goBackChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - try api.pigeonDelegate.goBack(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let canGoForwardChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.canGoForward", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + canGoForwardChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.canGoForward(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) } - } else { - goBackChannel.setMessageHandler(nil) } + } else { + canGoForwardChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let goForwardChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.goForward", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - goForwardChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - try api.pigeonDelegate.goForward(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let goBackChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.goBack", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + goBackChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + try api.pigeonDelegate.goBack(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - goForwardChannel.setMessageHandler(nil) } + } else { + goBackChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let reloadChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.reload", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - reloadChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - try api.pigeonDelegate.reload(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let goForwardChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.goForward", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + goForwardChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + try api.pigeonDelegate.goForward(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - reloadChannel.setMessageHandler(nil) } + } else { + goForwardChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let getTitleChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.getTitle", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - getTitleChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - let result = try api.pigeonDelegate.getTitle( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } + let reloadChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.reload", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + reloadChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + try api.pigeonDelegate.reload(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - getTitleChannel.setMessageHandler(nil) } + } else { + reloadChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let setAllowsBackForwardNavigationGesturesChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setAllowsBackForwardNavigationGestures", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setAllowsBackForwardNavigationGesturesChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let allowArg = args[1] as! Bool - do { - try api.pigeonDelegate.setAllowsBackForwardNavigationGestures( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, allow: allowArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let getTitleChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.getTitle", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getTitleChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.getTitle(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) } - } else { - setAllowsBackForwardNavigationGesturesChannel.setMessageHandler(nil) } + } else { + getTitleChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let setCustomUserAgentChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setCustomUserAgent", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setCustomUserAgentChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let userAgentArg: String? = nilOrValue(args[1]) - do { - try api.pigeonDelegate.setCustomUserAgent( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, userAgent: userAgentArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let setAllowsBackForwardNavigationGesturesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setAllowsBackForwardNavigationGestures", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setAllowsBackForwardNavigationGesturesChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let allowArg = args[1] as! Bool + do { + try api.pigeonDelegate.setAllowsBackForwardNavigationGestures(pigeonApi: api, pigeonInstance: pigeonInstanceArg, allow: allowArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - setCustomUserAgentChannel.setMessageHandler(nil) } + } else { + setAllowsBackForwardNavigationGesturesChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let evaluateJavaScriptChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.evaluateJavaScript", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - evaluateJavaScriptChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let javaScriptStringArg = args[1] as! String - api.pigeonDelegate.evaluateJavaScript( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, javaScriptString: javaScriptStringArg - ) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } + let setCustomUserAgentChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setCustomUserAgent", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setCustomUserAgentChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let userAgentArg: String? = nilOrValue(args[1]) + do { + try api.pigeonDelegate.setCustomUserAgent(pigeonApi: api, pigeonInstance: pigeonInstanceArg, userAgent: userAgentArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - evaluateJavaScriptChannel.setMessageHandler(nil) } + } else { + setCustomUserAgentChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let setInspectableChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setInspectable", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setInspectableChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let inspectableArg = args[1] as! Bool - do { - try api.pigeonDelegate.setInspectable( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, inspectable: inspectableArg) - reply(wrapResult(nil)) - } catch { + let evaluateJavaScriptChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.evaluateJavaScript", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + evaluateJavaScriptChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let javaScriptStringArg = args[1] as! String + api.pigeonDelegate.evaluateJavaScript(pigeonApi: api, pigeonInstance: pigeonInstanceArg, javaScriptString: javaScriptStringArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): reply(wrapError(error)) } } - } else { - setInspectableChannel.setMessageHandler(nil) } + } else { + evaluateJavaScriptChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let getCustomUserAgentChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.getCustomUserAgent", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - getCustomUserAgentChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - let result = try api.pigeonDelegate.getCustomUserAgent( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } + let setInspectableChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setInspectable", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setInspectableChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let inspectableArg = args[1] as! Bool + do { + try api.pigeonDelegate.setInspectable(pigeonApi: api, pigeonInstance: pigeonInstanceArg, inspectable: inspectableArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - getCustomUserAgentChannel.setMessageHandler(nil) } + } else { + setInspectableChannel.setMessageHandler(nil) + } #endif #if !os(macOS) - let setAllowsLinkPreviewChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setAllowsLinkPreview", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setAllowsLinkPreviewChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let allowArg = args[1] as! Bool - do { - try api.pigeonDelegate.setAllowsLinkPreview( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, allow: allowArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let getCustomUserAgentChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.getCustomUserAgent", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getCustomUserAgentChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.getCustomUserAgent(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) } - } else { - setAllowsLinkPreviewChannel.setMessageHandler(nil) } + } else { + getCustomUserAgentChannel.setMessageHandler(nil) + } + #endif + #if !os(macOS) + let setAllowsLinkPreviewChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setAllowsLinkPreview", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setAllowsLinkPreviewChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let allowArg = args[1] as! Bool + do { + try api.pigeonDelegate.setAllowsLinkPreview(pigeonApi: api, pigeonInstance: pigeonInstanceArg, allow: allowArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + setAllowsLinkPreviewChannel.setMessageHandler(nil) + } #endif } #if !os(macOS) - ///Creates a Dart instance of UIViewWKWebView 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: ""))) - } 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(())) - } + ///Creates a Dart instance of UIViewWKWebView 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: ""))) + } 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(())) } } } + } #endif } protocol PigeonApiDelegateNSViewWKWebView { #if !os(iOS) - func pigeonDefaultConstructor( - pigeonApi: PigeonApiNSViewWKWebView, initialConfiguration: WKWebViewConfiguration - ) throws -> WKWebView + func pigeonDefaultConstructor(pigeonApi: PigeonApiNSViewWKWebView, initialConfiguration: WKWebViewConfiguration) throws -> WKWebView #endif #if !os(iOS) - /// The object that contains the configuration details for the web view. - func configuration(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws - -> WKWebViewConfiguration + /// The object that contains the configuration details for the web view. + func configuration(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> WKWebViewConfiguration #endif #if !os(iOS) - /// The object you use to integrate custom user interface elements, such as - /// contextual menus or panels, into web view interactions. - func setUIDelegate( - pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, delegate: WKUIDelegate) throws + /// The object you use to integrate custom user interface elements, such as + /// contextual menus or panels, into web view interactions. + func setUIDelegate(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, delegate: WKUIDelegate) throws #endif #if !os(iOS) - /// The object you use to manage navigation behavior for the web view. - func setNavigationDelegate( - pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, delegate: WKNavigationDelegate - ) throws + /// The object you use to manage navigation behavior for the web view. + func setNavigationDelegate(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, delegate: WKNavigationDelegate) throws #endif #if !os(iOS) - /// The URL for the current webpage. - func getUrl(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> String? + /// The URL for the current webpage. + func getUrl(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> String? #endif #if !os(iOS) - /// An estimate of what fraction of the current navigation has been loaded. - func getEstimatedProgress(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws - -> Double + /// An estimate of what fraction of the current navigation has been loaded. + func getEstimatedProgress(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> Double #endif #if !os(iOS) - /// Loads the web content that the specified URL request object references and - /// navigates to that content. - func load( - pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, request: URLRequestWrapper) - throws + /// Loads the web content that the specified URL request object references and + /// navigates to that content. + func load(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, request: URLRequestWrapper) throws #endif #if !os(iOS) - /// Loads the contents of the specified HTML string and navigates to it. - func loadHtmlString( - pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, string: String, - baseUrl: String?) throws + /// Loads the contents of the specified HTML string and navigates to it. + func loadHtmlString(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, string: String, baseUrl: String?) throws #endif #if !os(iOS) - /// Loads the web content from the specified file and navigates to it. - func loadFileUrl( - pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, url: String, - readAccessUrl: String) throws + /// Loads the web content from the specified file and navigates to it. + func loadFileUrl(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, url: String, readAccessUrl: String) throws #endif #if !os(iOS) - /// Convenience method to load a Flutter asset. - func loadFlutterAsset( - pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, key: String) throws + /// Convenience method to load a Flutter asset. + func loadFlutterAsset(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, key: String) throws #endif #if !os(iOS) - /// A Boolean value that indicates whether there is a valid back item in the - /// back-forward list. - func canGoBack(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> Bool + /// A Boolean value that indicates whether there is a valid back item in the + /// back-forward list. + func canGoBack(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> Bool #endif #if !os(iOS) - /// A Boolean value that indicates whether there is a valid forward item in - /// the back-forward list. - func canGoForward(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> Bool + /// A Boolean value that indicates whether there is a valid forward item in + /// the back-forward list. + func canGoForward(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> Bool #endif #if !os(iOS) - /// Navigates to the back item in the back-forward list. - func goBack(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws + /// Navigates to the back item in the back-forward list. + func goBack(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws #endif #if !os(iOS) - /// Navigates to the forward item in the back-forward list. - func goForward(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws + /// Navigates to the forward item in the back-forward list. + func goForward(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws #endif #if !os(iOS) - /// Reloads the current webpage. - func reload(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws + /// Reloads the current webpage. + func reload(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws #endif #if !os(iOS) - /// The page title. - func getTitle(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> String? + /// The page title. + func getTitle(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> String? #endif #if !os(iOS) - /// A Boolean value that indicates whether horizontal swipe gestures trigger - /// backward and forward page navigation. - func setAllowsBackForwardNavigationGestures( - pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, allow: Bool) throws + /// A Boolean value that indicates whether horizontal swipe gestures trigger + /// backward and forward page navigation. + func setAllowsBackForwardNavigationGestures(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, allow: Bool) throws #endif #if !os(iOS) - /// The custom user agent string. - func setCustomUserAgent( - pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, userAgent: String?) throws + /// The custom user agent string. + func setCustomUserAgent(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, userAgent: String?) throws #endif #if !os(iOS) - /// Evaluates the specified JavaScript string. - func evaluateJavaScript( - pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, javaScriptString: String, - completion: @escaping (Result) -> Void) + /// Evaluates the specified JavaScript string. + func evaluateJavaScript(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, javaScriptString: String, completion: @escaping (Result) -> Void) #endif #if !os(iOS) - /// A Boolean value that indicates whether you can inspect the view with - /// Safari Web Inspector. - func setInspectable( - pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, inspectable: Bool) throws + /// A Boolean value that indicates whether you can inspect the view with + /// Safari Web Inspector. + func setInspectable(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, inspectable: Bool) throws #endif #if !os(iOS) - /// The custom user agent string. - func getCustomUserAgent(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws - -> String? + /// The custom user agent string. + func getCustomUserAgent(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> String? #endif #if !os(iOS) - /// Whether to allow previews for link destinations and detected data such as - /// addresses and phone numbers. - /// - /// Defaults to true. - func setAllowsLinkPreview( - pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, allow: Bool) throws + /// Whether to allow previews for link destinations and detected data such as + /// addresses and phone numbers. + /// + /// Defaults to true. + func setAllowsLinkPreview(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, allow: Bool) throws #endif } protocol PigeonApiProtocolNSViewWKWebView { } -final class PigeonApiNSViewWKWebView: PigeonApiProtocolNSViewWKWebView { +final class PigeonApiNSViewWKWebView: PigeonApiProtocolNSViewWKWebView { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateNSViewWKWebView ///An implementation of [NSObject] used to access callback methods @@ -5542,525 +4740,444 @@ final class PigeonApiNSViewWKWebView: PigeonApiProtocolNSViewWKWebView { return pigeonRegistrar.apiDelegate.pigeonApiWKWebView(pigeonRegistrar) } - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, - delegate: PigeonApiDelegateNSViewWKWebView - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateNSViewWKWebView) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers( - binaryMessenger: FlutterBinaryMessenger, api: PigeonApiNSViewWKWebView? - ) { + static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiNSViewWKWebView?) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( - pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() #if !os(iOS) - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.pigeon_defaultConstructor", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - pigeonDefaultConstructorChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonIdentifierArg = args[0] as! Int64 - let initialConfigurationArg = args[1] as! WKWebViewConfiguration - do { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - try api.pigeonDelegate.pigeonDefaultConstructor( - pigeonApi: api, initialConfiguration: initialConfigurationArg), - withIdentifier: pigeonIdentifierArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } - } - } else { - pigeonDefaultConstructorChannel.setMessageHandler(nil) - } - #endif - #if !os(iOS) - let configurationChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.configuration", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - configurationChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let pigeonIdentifierArg = args[1] as! Int64 - do { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - try api.pigeonDelegate.configuration( - pigeonApi: api, pigeonInstance: pigeonInstanceArg), - withIdentifier: pigeonIdentifierArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.pigeon_defaultConstructor", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + pigeonDefaultConstructorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonIdentifierArg = args[0] as! Int64 + let initialConfigurationArg = args[1] as! WKWebViewConfiguration + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( +try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api, initialConfiguration: initialConfigurationArg), +withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - configurationChannel.setMessageHandler(nil) } + } else { + pigeonDefaultConstructorChannel.setMessageHandler(nil) + } #endif #if !os(iOS) - let setUIDelegateChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setUIDelegate", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setUIDelegateChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let delegateArg = args[1] as! WKUIDelegate - do { - try api.pigeonDelegate.setUIDelegate( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, delegate: delegateArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let configurationChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.configuration", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + configurationChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let pigeonIdentifierArg = args[1] as! Int64 + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance(try api.pigeonDelegate.configuration(pigeonApi: api, pigeonInstance: pigeonInstanceArg), withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - setUIDelegateChannel.setMessageHandler(nil) } + } else { + configurationChannel.setMessageHandler(nil) + } #endif #if !os(iOS) - let setNavigationDelegateChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setNavigationDelegate", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setNavigationDelegateChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let delegateArg = args[1] as! WKNavigationDelegate - do { - try api.pigeonDelegate.setNavigationDelegate( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, delegate: delegateArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let setUIDelegateChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setUIDelegate", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setUIDelegateChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let delegateArg = args[1] as! WKUIDelegate + do { + try api.pigeonDelegate.setUIDelegate(pigeonApi: api, pigeonInstance: pigeonInstanceArg, delegate: delegateArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - setNavigationDelegateChannel.setMessageHandler(nil) } + } else { + setUIDelegateChannel.setMessageHandler(nil) + } #endif #if !os(iOS) - let getUrlChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.getUrl", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - getUrlChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - let result = try api.pigeonDelegate.getUrl( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } + let setNavigationDelegateChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setNavigationDelegate", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setNavigationDelegateChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let delegateArg = args[1] as! WKNavigationDelegate + do { + try api.pigeonDelegate.setNavigationDelegate(pigeonApi: api, pigeonInstance: pigeonInstanceArg, delegate: delegateArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - getUrlChannel.setMessageHandler(nil) } + } else { + setNavigationDelegateChannel.setMessageHandler(nil) + } #endif #if !os(iOS) - let getEstimatedProgressChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.getEstimatedProgress", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - getEstimatedProgressChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - let result = try api.pigeonDelegate.getEstimatedProgress( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } + let getUrlChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.getUrl", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getUrlChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.getUrl(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) } - } else { - getEstimatedProgressChannel.setMessageHandler(nil) } + } else { + getUrlChannel.setMessageHandler(nil) + } #endif #if !os(iOS) - let loadChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.load", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - loadChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let requestArg = args[1] as! URLRequestWrapper - do { - try api.pigeonDelegate.load( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, request: requestArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let getEstimatedProgressChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.getEstimatedProgress", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getEstimatedProgressChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.getEstimatedProgress(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) } - } else { - loadChannel.setMessageHandler(nil) } + } else { + getEstimatedProgressChannel.setMessageHandler(nil) + } #endif #if !os(iOS) - let loadHtmlStringChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.loadHtmlString", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - loadHtmlStringChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let stringArg = args[1] as! String - let baseUrlArg: String? = nilOrValue(args[2]) - do { - try api.pigeonDelegate.loadHtmlString( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, string: stringArg, - baseUrl: baseUrlArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let loadChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.load", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + loadChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let requestArg = args[1] as! URLRequestWrapper + do { + try api.pigeonDelegate.load(pigeonApi: api, pigeonInstance: pigeonInstanceArg, request: requestArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - loadHtmlStringChannel.setMessageHandler(nil) } + } else { + loadChannel.setMessageHandler(nil) + } #endif #if !os(iOS) - let loadFileUrlChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.loadFileUrl", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - loadFileUrlChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let urlArg = args[1] as! String - let readAccessUrlArg = args[2] as! String - do { - try api.pigeonDelegate.loadFileUrl( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, url: urlArg, - readAccessUrl: readAccessUrlArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let loadHtmlStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.loadHtmlString", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + loadHtmlStringChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let stringArg = args[1] as! String + let baseUrlArg: String? = nilOrValue(args[2]) + do { + try api.pigeonDelegate.loadHtmlString(pigeonApi: api, pigeonInstance: pigeonInstanceArg, string: stringArg, baseUrl: baseUrlArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - loadFileUrlChannel.setMessageHandler(nil) } + } else { + loadHtmlStringChannel.setMessageHandler(nil) + } #endif #if !os(iOS) - let loadFlutterAssetChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.loadFlutterAsset", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - loadFlutterAssetChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let keyArg = args[1] as! String - do { - try api.pigeonDelegate.loadFlutterAsset( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, key: keyArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let loadFileUrlChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.loadFileUrl", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + loadFileUrlChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let urlArg = args[1] as! String + let readAccessUrlArg = args[2] as! String + do { + try api.pigeonDelegate.loadFileUrl(pigeonApi: api, pigeonInstance: pigeonInstanceArg, url: urlArg, readAccessUrl: readAccessUrlArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - loadFlutterAssetChannel.setMessageHandler(nil) } + } else { + loadFileUrlChannel.setMessageHandler(nil) + } #endif #if !os(iOS) - let canGoBackChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.canGoBack", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - canGoBackChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - let result = try api.pigeonDelegate.canGoBack( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } + let loadFlutterAssetChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.loadFlutterAsset", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + loadFlutterAssetChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let keyArg = args[1] as! String + do { + try api.pigeonDelegate.loadFlutterAsset(pigeonApi: api, pigeonInstance: pigeonInstanceArg, key: keyArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - canGoBackChannel.setMessageHandler(nil) } + } else { + loadFlutterAssetChannel.setMessageHandler(nil) + } #endif #if !os(iOS) - let canGoForwardChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.canGoForward", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - canGoForwardChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - let result = try api.pigeonDelegate.canGoForward( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } + let canGoBackChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.canGoBack", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + canGoBackChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.canGoBack(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) } - } else { - canGoForwardChannel.setMessageHandler(nil) } + } else { + canGoBackChannel.setMessageHandler(nil) + } #endif #if !os(iOS) - let goBackChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.goBack", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - goBackChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - try api.pigeonDelegate.goBack(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let canGoForwardChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.canGoForward", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + canGoForwardChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.canGoForward(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) } - } else { - goBackChannel.setMessageHandler(nil) } + } else { + canGoForwardChannel.setMessageHandler(nil) + } #endif #if !os(iOS) - let goForwardChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.goForward", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - goForwardChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - try api.pigeonDelegate.goForward(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let goBackChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.goBack", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + goBackChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + try api.pigeonDelegate.goBack(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - goForwardChannel.setMessageHandler(nil) } + } else { + goBackChannel.setMessageHandler(nil) + } #endif #if !os(iOS) - let reloadChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.reload", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - reloadChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - try api.pigeonDelegate.reload(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let goForwardChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.goForward", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + goForwardChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + try api.pigeonDelegate.goForward(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - reloadChannel.setMessageHandler(nil) } + } else { + goForwardChannel.setMessageHandler(nil) + } #endif #if !os(iOS) - let getTitleChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.getTitle", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - getTitleChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - let result = try api.pigeonDelegate.getTitle( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } + let reloadChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.reload", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + reloadChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + try api.pigeonDelegate.reload(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - getTitleChannel.setMessageHandler(nil) } + } else { + reloadChannel.setMessageHandler(nil) + } #endif #if !os(iOS) - let setAllowsBackForwardNavigationGesturesChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setAllowsBackForwardNavigationGestures", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setAllowsBackForwardNavigationGesturesChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let allowArg = args[1] as! Bool - do { - try api.pigeonDelegate.setAllowsBackForwardNavigationGestures( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, allow: allowArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let getTitleChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.getTitle", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getTitleChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.getTitle(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) } - } else { - setAllowsBackForwardNavigationGesturesChannel.setMessageHandler(nil) } + } else { + getTitleChannel.setMessageHandler(nil) + } #endif #if !os(iOS) - let setCustomUserAgentChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setCustomUserAgent", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setCustomUserAgentChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let userAgentArg: String? = nilOrValue(args[1]) - do { - try api.pigeonDelegate.setCustomUserAgent( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, userAgent: userAgentArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let setAllowsBackForwardNavigationGesturesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setAllowsBackForwardNavigationGestures", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setAllowsBackForwardNavigationGesturesChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let allowArg = args[1] as! Bool + do { + try api.pigeonDelegate.setAllowsBackForwardNavigationGestures(pigeonApi: api, pigeonInstance: pigeonInstanceArg, allow: allowArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - setCustomUserAgentChannel.setMessageHandler(nil) } + } else { + setAllowsBackForwardNavigationGesturesChannel.setMessageHandler(nil) + } #endif #if !os(iOS) - let evaluateJavaScriptChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.evaluateJavaScript", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - evaluateJavaScriptChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let javaScriptStringArg = args[1] as! String - api.pigeonDelegate.evaluateJavaScript( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, javaScriptString: javaScriptStringArg - ) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } + let setCustomUserAgentChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setCustomUserAgent", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setCustomUserAgentChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let userAgentArg: String? = nilOrValue(args[1]) + do { + try api.pigeonDelegate.setCustomUserAgent(pigeonApi: api, pigeonInstance: pigeonInstanceArg, userAgent: userAgentArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - evaluateJavaScriptChannel.setMessageHandler(nil) } + } else { + setCustomUserAgentChannel.setMessageHandler(nil) + } #endif #if !os(iOS) - let setInspectableChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setInspectable", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setInspectableChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let inspectableArg = args[1] as! Bool - do { - try api.pigeonDelegate.setInspectable( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, inspectable: inspectableArg) - reply(wrapResult(nil)) - } catch { + let evaluateJavaScriptChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.evaluateJavaScript", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + evaluateJavaScriptChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let javaScriptStringArg = args[1] as! String + api.pigeonDelegate.evaluateJavaScript(pigeonApi: api, pigeonInstance: pigeonInstanceArg, javaScriptString: javaScriptStringArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): reply(wrapError(error)) } } - } else { - setInspectableChannel.setMessageHandler(nil) } + } else { + evaluateJavaScriptChannel.setMessageHandler(nil) + } #endif #if !os(iOS) - let getCustomUserAgentChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.getCustomUserAgent", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - getCustomUserAgentChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - let result = try api.pigeonDelegate.getCustomUserAgent( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } + let setInspectableChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setInspectable", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setInspectableChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let inspectableArg = args[1] as! Bool + do { + try api.pigeonDelegate.setInspectable(pigeonApi: api, pigeonInstance: pigeonInstanceArg, inspectable: inspectableArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - getCustomUserAgentChannel.setMessageHandler(nil) } + } else { + setInspectableChannel.setMessageHandler(nil) + } #endif #if !os(iOS) - let setAllowsLinkPreviewChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setAllowsLinkPreview", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setAllowsLinkPreviewChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let allowArg = args[1] as! Bool - do { - try api.pigeonDelegate.setAllowsLinkPreview( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, allow: allowArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let getCustomUserAgentChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.getCustomUserAgent", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getCustomUserAgentChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.getCustomUserAgent(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getCustomUserAgentChannel.setMessageHandler(nil) + } + #endif + #if !os(iOS) + let setAllowsLinkPreviewChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setAllowsLinkPreview", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setAllowsLinkPreviewChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let allowArg = args[1] as! Bool + do { + try api.pigeonDelegate.setAllowsLinkPreview(pigeonApi: api, pigeonInstance: pigeonInstanceArg, allow: allowArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - setAllowsLinkPreviewChannel.setMessageHandler(nil) } + } else { + setAllowsLinkPreviewChannel.setMessageHandler(nil) + } #endif } #if !os(iOS) - ///Creates a Dart instance of NSViewWKWebView 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: ""))) - } 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(())) - } + ///Creates a Dart instance of NSViewWKWebView 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: ""))) + } 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(())) } } } + } #endif } open class PigeonApiDelegateWKWebView { @@ -6069,7 +5186,7 @@ open class PigeonApiDelegateWKWebView { protocol PigeonApiProtocolWKWebView { } -final class PigeonApiWKWebView: PigeonApiProtocolWKWebView { +final class PigeonApiWKWebView: PigeonApiProtocolWKWebView { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKWebView ///An implementation of [NSObject] used to access callback methods @@ -6077,32 +5194,26 @@ final class PigeonApiWKWebView: PigeonApiProtocolWKWebView { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKWebView) - { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKWebView) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } ///Creates a Dart instance of WKWebView and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: WKWebView, completion: @escaping (Result) -> 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) + } 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) + 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))) @@ -6126,35 +5237,19 @@ protocol PigeonApiDelegateWKUIDelegate { protocol PigeonApiProtocolWKUIDelegate { /// Creates a new web view. - func onCreateWebView( - pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, - configuration configurationArg: WKWebViewConfiguration, - navigationAction navigationActionArg: WKNavigationAction, - completion: @escaping (Result) -> Void) + func onCreateWebView(pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, configuration configurationArg: WKWebViewConfiguration, navigationAction navigationActionArg: WKNavigationAction, completion: @escaping (Result) -> Void) /// Determines whether a web resource, which the security origin object /// describes, can access to the device’s microphone audio and camera video. - func requestMediaCapturePermission( - pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, - origin originArg: WKSecurityOrigin, frame frameArg: WKFrameInfo, type typeArg: MediaCaptureType, - completion: @escaping (Result) -> Void) + func requestMediaCapturePermission(pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, origin originArg: WKSecurityOrigin, frame frameArg: WKFrameInfo, type typeArg: MediaCaptureType, completion: @escaping (Result) -> Void) /// Displays a JavaScript alert panel. - func runJavaScriptAlertPanel( - pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, - message messageArg: String, frame frameArg: WKFrameInfo, - completion: @escaping (Result) -> Void) + func runJavaScriptAlertPanel(pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, message messageArg: String, frame frameArg: WKFrameInfo, completion: @escaping (Result) -> Void) /// Displays a JavaScript confirm panel. - func runJavaScriptConfirmPanel( - pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, - message messageArg: String, frame frameArg: WKFrameInfo, - completion: @escaping (Result) -> Void) + func runJavaScriptConfirmPanel(pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, message messageArg: String, frame frameArg: WKFrameInfo, completion: @escaping (Result) -> Void) /// Displays a JavaScript text input panel. - func runJavaScriptTextInputPanel( - pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, - prompt promptArg: String, defaultText defaultTextArg: String?, frame frameArg: WKFrameInfo, - completion: @escaping (Result) -> Void) + func runJavaScriptTextInputPanel(pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, prompt promptArg: String, defaultText defaultTextArg: String?, frame frameArg: WKFrameInfo, completion: @escaping (Result) -> Void) } -final class PigeonApiWKUIDelegate: PigeonApiProtocolWKUIDelegate { +final class PigeonApiWKUIDelegate: PigeonApiProtocolWKUIDelegate { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKUIDelegate ///An implementation of [NSObject] used to access callback methods @@ -6162,32 +5257,25 @@ final class PigeonApiWKUIDelegate: PigeonApiProtocolWKUIDelegate { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKUIDelegate - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKUIDelegate) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers( - binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKUIDelegate? - ) { + static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKUIDelegate?) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( - pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.pigeon_defaultConstructor", - binaryMessenger: binaryMessenger, codec: codec) + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.pigeon_defaultConstructor", binaryMessenger: binaryMessenger, codec: codec) if let api = api { pigeonDefaultConstructorChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonIdentifierArg = args[0] as! Int64 do { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), - withIdentifier: pigeonIdentifierArg) +try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), +withIdentifier: pigeonIdentifierArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -6199,34 +5287,25 @@ final class PigeonApiWKUIDelegate: PigeonApiProtocolWKUIDelegate { } ///Creates a Dart instance of WKUIDelegate and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: WKUIDelegate, completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: WKUIDelegate, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { + } 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: ""))) + message: "Error: Attempting to create a new Dart instance of WKUIDelegate, but the class has a nonnull callback method.", details: ""))) } } /// Creates a new web view. - func onCreateWebView( - pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, - configuration configurationArg: WKWebViewConfiguration, - navigationAction navigationActionArg: WKNavigationAction, - completion: @escaping (Result) -> Void - ) { + func onCreateWebView(pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, configuration configurationArg: WKWebViewConfiguration, navigationAction navigationActionArg: WKNavigationAction, completion: @escaping (Result) -> Void) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -6237,13 +5316,9 @@ final class PigeonApiWKUIDelegate: PigeonApiProtocolWKUIDelegate { } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.onCreateWebView" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage( - [pigeonInstanceArg, webViewArg, configurationArg, navigationActionArg] as [Any?] - ) { response in + let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.onCreateWebView" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, webViewArg, configurationArg, navigationActionArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -6261,11 +5336,7 @@ final class PigeonApiWKUIDelegate: PigeonApiProtocolWKUIDelegate { /// Determines whether a web resource, which the security origin object /// describes, can access to the device’s microphone audio and camera video. - func requestMediaCapturePermission( - pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, - origin originArg: WKSecurityOrigin, frame frameArg: WKFrameInfo, type typeArg: MediaCaptureType, - completion: @escaping (Result) -> Void - ) { + func requestMediaCapturePermission(pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, origin originArg: WKSecurityOrigin, frame frameArg: WKFrameInfo, type typeArg: MediaCaptureType, completion: @escaping (Result) -> Void) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -6276,12 +5347,9 @@ final class PigeonApiWKUIDelegate: PigeonApiProtocolWKUIDelegate { } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.requestMediaCapturePermission" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, webViewArg, originArg, frameArg, typeArg] as [Any?]) { - response in + let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.requestMediaCapturePermission" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, webViewArg, originArg, frameArg, typeArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -6292,11 +5360,7 @@ final class PigeonApiWKUIDelegate: PigeonApiProtocolWKUIDelegate { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) + completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! PermissionDecision completion(.success(result)) @@ -6305,11 +5369,7 @@ final class PigeonApiWKUIDelegate: PigeonApiProtocolWKUIDelegate { } /// Displays a JavaScript alert panel. - func runJavaScriptAlertPanel( - pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, - message messageArg: String, frame frameArg: WKFrameInfo, - completion: @escaping (Result) -> Void - ) { + func runJavaScriptAlertPanel(pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, message messageArg: String, frame frameArg: WKFrameInfo, completion: @escaping (Result) -> Void) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -6320,12 +5380,9 @@ final class PigeonApiWKUIDelegate: PigeonApiProtocolWKUIDelegate { } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.runJavaScriptAlertPanel" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, webViewArg, messageArg, frameArg] as [Any?]) { - response in + let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.runJavaScriptAlertPanel" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, webViewArg, messageArg, frameArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -6342,11 +5399,7 @@ final class PigeonApiWKUIDelegate: PigeonApiProtocolWKUIDelegate { } /// Displays a JavaScript confirm panel. - func runJavaScriptConfirmPanel( - pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, - message messageArg: String, frame frameArg: WKFrameInfo, - completion: @escaping (Result) -> Void - ) { + func runJavaScriptConfirmPanel(pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, message messageArg: String, frame frameArg: WKFrameInfo, completion: @escaping (Result) -> Void) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -6357,12 +5410,9 @@ final class PigeonApiWKUIDelegate: PigeonApiProtocolWKUIDelegate { } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.runJavaScriptConfirmPanel" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, webViewArg, messageArg, frameArg] as [Any?]) { - response in + let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.runJavaScriptConfirmPanel" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, webViewArg, messageArg, frameArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -6373,11 +5423,7 @@ final class PigeonApiWKUIDelegate: PigeonApiProtocolWKUIDelegate { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) + completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! Bool completion(.success(result)) @@ -6386,11 +5432,7 @@ final class PigeonApiWKUIDelegate: PigeonApiProtocolWKUIDelegate { } /// Displays a JavaScript text input panel. - func runJavaScriptTextInputPanel( - pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, - prompt promptArg: String, defaultText defaultTextArg: String?, frame frameArg: WKFrameInfo, - completion: @escaping (Result) -> Void - ) { + func runJavaScriptTextInputPanel(pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, prompt promptArg: String, defaultText defaultTextArg: String?, frame frameArg: WKFrameInfo, completion: @escaping (Result) -> Void) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -6401,13 +5443,9 @@ final class PigeonApiWKUIDelegate: PigeonApiProtocolWKUIDelegate { } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.runJavaScriptTextInputPanel" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage( - [pigeonInstanceArg, webViewArg, promptArg, defaultTextArg, frameArg] as [Any?] - ) { response in + let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.runJavaScriptTextInputPanel" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, webViewArg, promptArg, defaultTextArg, frameArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -6428,15 +5466,13 @@ final class PigeonApiWKUIDelegate: PigeonApiProtocolWKUIDelegate { protocol PigeonApiDelegateWKHTTPCookieStore { /// Sets a cookie policy that indicates whether the cookie store allows cookie /// storage. - func setCookie( - pigeonApi: PigeonApiWKHTTPCookieStore, pigeonInstance: WKHTTPCookieStore, cookie: HTTPCookie, - completion: @escaping (Result) -> Void) + func setCookie(pigeonApi: PigeonApiWKHTTPCookieStore, pigeonInstance: WKHTTPCookieStore, cookie: HTTPCookie, completion: @escaping (Result) -> Void) } protocol PigeonApiProtocolWKHTTPCookieStore { } -final class PigeonApiWKHTTPCookieStore: PigeonApiProtocolWKHTTPCookieStore { +final class PigeonApiWKHTTPCookieStore: PigeonApiProtocolWKHTTPCookieStore { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKHTTPCookieStore ///An implementation of [NSObject] used to access callback methods @@ -6444,33 +5480,23 @@ final class PigeonApiWKHTTPCookieStore: PigeonApiProtocolWKHTTPCookieStore { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, - delegate: PigeonApiDelegateWKHTTPCookieStore - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKHTTPCookieStore) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers( - binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKHTTPCookieStore? - ) { + static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKHTTPCookieStore?) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( - pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let setCookieChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKHTTPCookieStore.setCookie", - binaryMessenger: binaryMessenger, codec: codec) + let setCookieChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKHTTPCookieStore.setCookie", binaryMessenger: binaryMessenger, codec: codec) if let api = api { setCookieChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKHTTPCookieStore let cookieArg = args[1] as! HTTPCookie - api.pigeonDelegate.setCookie( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, cookie: cookieArg - ) { result in + api.pigeonDelegate.setCookie(pigeonApi: api, pigeonInstance: pigeonInstanceArg, cookie: cookieArg) { result in switch result { case .success: reply(wrapResult(nil)) @@ -6485,26 +5511,21 @@ final class PigeonApiWKHTTPCookieStore: PigeonApiProtocolWKHTTPCookieStore { } ///Creates a Dart instance of WKHTTPCookieStore and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: WKHTTPCookieStore, completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: WKHTTPCookieStore, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) + } 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) + 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))) @@ -6524,27 +5545,22 @@ final class PigeonApiWKHTTPCookieStore: PigeonApiProtocolWKHTTPCookieStore { } protocol PigeonApiDelegateUIScrollViewDelegate { #if !os(macOS) - func pigeonDefaultConstructor(pigeonApi: PigeonApiUIScrollViewDelegate) throws - -> UIScrollViewDelegate + func pigeonDefaultConstructor(pigeonApi: PigeonApiUIScrollViewDelegate) throws -> UIScrollViewDelegate #endif } protocol PigeonApiProtocolUIScrollViewDelegate { #if !os(macOS) - /// Tells the delegate when the user scrolls the content view within the - /// scroll view. - /// - /// Note that this is a convenient method that includes the `contentOffset` of - /// the `scrollView`. - func scrollViewDidScroll( - pigeonInstance pigeonInstanceArg: UIScrollViewDelegate, - scrollView scrollViewArg: UIScrollView, x xArg: Double, y yArg: Double, - completion: @escaping (Result) -> Void) - #endif + /// Tells the delegate when the user scrolls the content view within the + /// scroll view. + /// + /// Note that this is a convenient method that includes the `contentOffset` of + /// the `scrollView`. + func scrollViewDidScroll(pigeonInstance pigeonInstanceArg: UIScrollViewDelegate, scrollView scrollViewArg: UIScrollView, x xArg: Double, y yArg: Double, completion: @escaping (Result) -> Void) #endif } -final class PigeonApiUIScrollViewDelegate: PigeonApiProtocolUIScrollViewDelegate { +final class PigeonApiUIScrollViewDelegate: PigeonApiProtocolUIScrollViewDelegate { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateUIScrollViewDelegate ///An implementation of [NSObject] used to access callback methods @@ -6552,112 +5568,55 @@ final class PigeonApiUIScrollViewDelegate: PigeonApiProtocolUIScrollViewDelegate return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, - delegate: PigeonApiDelegateUIScrollViewDelegate - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateUIScrollViewDelegate) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers( - binaryMessenger: FlutterBinaryMessenger, api: PigeonApiUIScrollViewDelegate? - ) { + static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiUIScrollViewDelegate?) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( - pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() #if !os(macOS) - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewDelegate.pigeon_defaultConstructor", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - pigeonDefaultConstructorChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonIdentifierArg = args[0] as! Int64 - do { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), - withIdentifier: pigeonIdentifierArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewDelegate.pigeon_defaultConstructor", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + pigeonDefaultConstructorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonIdentifierArg = args[0] as! Int64 + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( +try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), +withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) } - } else { - pigeonDefaultConstructorChannel.setMessageHandler(nil) } + } else { + pigeonDefaultConstructorChannel.setMessageHandler(nil) + } #endif } #if !os(macOS) - ///Creates a Dart instance of UIScrollViewDelegate and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: UIScrollViewDelegate, - 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.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(())) - } - } - } - } - #endif - #if !os(macOS) - /// Tells the delegate when the user scrolls the content view within the - /// scroll view. - /// - /// Note that this is a convenient method that includes the `contentOffset` of - /// the `scrollView`. - func scrollViewDidScroll( - pigeonInstance pigeonInstanceArg: UIScrollViewDelegate, - scrollView scrollViewArg: UIScrollView, x xArg: Double, y yArg: Double, - completion: @escaping (Result) -> Void - ) { - if pigeonRegistrar.ignoreCallsToDart { - completion( - .failure( - PigeonError( - code: "ignore-calls-error", - message: "Calls to Dart are being ignored.", details: ""))) - return - } + ///Creates a Dart instance of UIScrollViewDelegate and attaches it to [pigeonInstance]. + func pigeonNewInstance(pigeonInstance: UIScrollViewDelegate, 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.UIScrollViewDelegate.scrollViewDidScroll" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, scrollViewArg, xArg, yArg] as [Any?]) { response in + 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 @@ -6672,22 +5631,55 @@ final class PigeonApiUIScrollViewDelegate: PigeonApiProtocolUIScrollViewDelegate } } } + } + #endif + #if !os(macOS) + /// Tells the delegate when the user scrolls the content view within the + /// scroll view. + /// + /// Note that this is a convenient method that includes the `contentOffset` of + /// the `scrollView`. + func scrollViewDidScroll(pigeonInstance pigeonInstanceArg: UIScrollViewDelegate, scrollView scrollViewArg: UIScrollView, x xArg: Double, y yArg: Double, completion: @escaping (Result) -> Void) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + PigeonError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewDelegate.scrollViewDidScroll" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, scrollViewArg, xArg, yArg] 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(())) + } + } + } #endif } protocol PigeonApiDelegateURLCredential { /// Creates a URL credential instance for internet password authentication /// with a given user name and password, using a given persistence setting. - func withUser( - pigeonApi: PigeonApiURLCredential, user: String, password: String, - persistence: UrlCredentialPersistence - ) throws -> URLCredential + func withUser(pigeonApi: PigeonApiURLCredential, user: String, password: String, persistence: UrlCredentialPersistence) throws -> URLCredential } protocol PigeonApiProtocolURLCredential { } -final class PigeonApiURLCredential: PigeonApiProtocolURLCredential { +final class PigeonApiURLCredential: PigeonApiProtocolURLCredential { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateURLCredential ///An implementation of [NSObject] used to access callback methods @@ -6695,24 +5687,17 @@ final class PigeonApiURLCredential: PigeonApiProtocolURLCredential { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateURLCredential - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateURLCredential) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers( - binaryMessenger: FlutterBinaryMessenger, api: PigeonApiURLCredential? - ) { + static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiURLCredential?) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( - pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let withUserChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLCredential.withUser", - binaryMessenger: binaryMessenger, codec: codec) + let withUserChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLCredential.withUser", binaryMessenger: binaryMessenger, codec: codec) if let api = api { withUserChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -6722,9 +5707,8 @@ final class PigeonApiURLCredential: PigeonApiProtocolURLCredential { let persistenceArg = args[3] as! UrlCredentialPersistence do { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - try api.pigeonDelegate.withUser( - pigeonApi: api, user: userArg, password: passwordArg, persistence: persistenceArg), - withIdentifier: pigeonIdentifierArg) +try api.pigeonDelegate.withUser(pigeonApi: api, user: userArg, password: passwordArg, persistence: persistenceArg), +withIdentifier: pigeonIdentifierArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -6736,26 +5720,21 @@ final class PigeonApiURLCredential: PigeonApiProtocolURLCredential { } ///Creates a Dart instance of URLCredential and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: URLCredential, completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: URLCredential, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) + } 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) + 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))) @@ -6775,27 +5754,21 @@ final class PigeonApiURLCredential: PigeonApiProtocolURLCredential { } protocol PigeonApiDelegateURLProtectionSpace { /// The receiver’s host. - func host(pigeonApi: PigeonApiURLProtectionSpace, pigeonInstance: URLProtectionSpace) throws - -> String + func host(pigeonApi: PigeonApiURLProtectionSpace, pigeonInstance: URLProtectionSpace) throws -> String /// The receiver’s port. - func port(pigeonApi: PigeonApiURLProtectionSpace, pigeonInstance: URLProtectionSpace) throws - -> Int64 + func port(pigeonApi: PigeonApiURLProtectionSpace, pigeonInstance: URLProtectionSpace) throws -> Int64 /// The receiver’s authentication realm. - func realm(pigeonApi: PigeonApiURLProtectionSpace, pigeonInstance: URLProtectionSpace) throws - -> String? + func realm(pigeonApi: PigeonApiURLProtectionSpace, pigeonInstance: URLProtectionSpace) throws -> String? /// The authentication method used by the receiver. - func authenticationMethod( - pigeonApi: PigeonApiURLProtectionSpace, pigeonInstance: URLProtectionSpace - ) throws -> String? + func authenticationMethod(pigeonApi: PigeonApiURLProtectionSpace, pigeonInstance: URLProtectionSpace) throws -> String? /// A representation of the server’s SSL transaction state. - func getServerTrust(pigeonApi: PigeonApiURLProtectionSpace, pigeonInstance: URLProtectionSpace) - throws -> SecTrustWrapper? + func getServerTrust(pigeonApi: PigeonApiURLProtectionSpace, pigeonInstance: URLProtectionSpace) throws -> SecTrustWrapper? } protocol PigeonApiProtocolURLProtectionSpace { } -final class PigeonApiURLProtectionSpace: PigeonApiProtocolURLProtectionSpace { +final class PigeonApiURLProtectionSpace: PigeonApiProtocolURLProtectionSpace { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateURLProtectionSpace ///An implementation of [NSObject] used to access callback methods @@ -6803,47 +5776,32 @@ final class PigeonApiURLProtectionSpace: PigeonApiProtocolURLProtectionSpace { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, - delegate: PigeonApiDelegateURLProtectionSpace - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateURLProtectionSpace) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } ///Creates a Dart instance of URLProtectionSpace and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: URLProtectionSpace, completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: URLProtectionSpace, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) + } 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 getServerTrustArg = try! pigeonDelegate.getServerTrust( - pigeonApi: self, pigeonInstance: pigeonInstance) + let authenticationMethodArg = try! pigeonDelegate.authenticationMethod(pigeonApi: self, pigeonInstance: pigeonInstance) + let getServerTrustArg = try! pigeonDelegate.getServerTrust(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, - getServerTrustArg, - ] as [Any?] - ) { response in + 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, getServerTrustArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -6862,15 +5820,13 @@ final class PigeonApiURLProtectionSpace: PigeonApiProtocolURLProtectionSpace { } protocol PigeonApiDelegateURLAuthenticationChallenge { /// The receiver’s protection space. - func getProtectionSpace( - pigeonApi: PigeonApiURLAuthenticationChallenge, pigeonInstance: URLAuthenticationChallenge - ) throws -> URLProtectionSpace + func getProtectionSpace(pigeonApi: PigeonApiURLAuthenticationChallenge, pigeonInstance: URLAuthenticationChallenge) throws -> URLProtectionSpace } protocol PigeonApiProtocolURLAuthenticationChallenge { } -final class PigeonApiURLAuthenticationChallenge: PigeonApiProtocolURLAuthenticationChallenge { +final class PigeonApiURLAuthenticationChallenge: PigeonApiProtocolURLAuthenticationChallenge { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateURLAuthenticationChallenge ///An implementation of [NSObject] used to access callback methods @@ -6878,33 +5834,23 @@ final class PigeonApiURLAuthenticationChallenge: PigeonApiProtocolURLAuthenticat return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, - delegate: PigeonApiDelegateURLAuthenticationChallenge - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateURLAuthenticationChallenge) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers( - binaryMessenger: FlutterBinaryMessenger, api: PigeonApiURLAuthenticationChallenge? - ) { + static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiURLAuthenticationChallenge?) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( - pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let getProtectionSpaceChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.webview_flutter_wkwebview.URLAuthenticationChallenge.getProtectionSpace", - binaryMessenger: binaryMessenger, codec: codec) + let getProtectionSpaceChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLAuthenticationChallenge.getProtectionSpace", binaryMessenger: binaryMessenger, codec: codec) if let api = api { getProtectionSpaceChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! URLAuthenticationChallenge do { - let result = try api.pigeonDelegate.getProtectionSpace( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) + let result = try api.pigeonDelegate.getProtectionSpace(pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -6916,27 +5862,21 @@ final class PigeonApiURLAuthenticationChallenge: PigeonApiProtocolURLAuthenticat } ///Creates a Dart instance of URLAuthenticationChallenge and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: URLAuthenticationChallenge, - completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: URLAuthenticationChallenge, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) + } 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) + 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))) @@ -6962,7 +5902,7 @@ protocol PigeonApiDelegateURL { protocol PigeonApiProtocolURL { } -final class PigeonApiURL: PigeonApiProtocolURL { +final class PigeonApiURL: PigeonApiProtocolURL { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateURL ///An implementation of [NSObject] used to access callback methods @@ -6978,19 +5918,15 @@ final class PigeonApiURL: PigeonApiProtocolURL { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( - pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let getAbsoluteStringChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.URL.getAbsoluteString", - binaryMessenger: binaryMessenger, codec: codec) + let getAbsoluteStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.URL.getAbsoluteString", binaryMessenger: binaryMessenger, codec: codec) if let api = api { getAbsoluteStringChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! URL do { - let result = try api.pigeonDelegate.getAbsoluteString( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) + let result = try api.pigeonDelegate.getAbsoluteString(pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -7002,26 +5938,21 @@ final class PigeonApiURL: PigeonApiProtocolURL { } ///Creates a Dart instance of URL and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: URL, completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: URL, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) + } 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) + 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))) @@ -7043,15 +5974,13 @@ 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 + func setAllowsContentJavaScript(pigeonApi: PigeonApiWKWebpagePreferences, pigeonInstance: WKWebpagePreferences, allow: Bool) throws } protocol PigeonApiProtocolWKWebpagePreferences { } -final class PigeonApiWKWebpagePreferences: PigeonApiProtocolWKWebpagePreferences { +final class PigeonApiWKWebpagePreferences: PigeonApiProtocolWKWebpagePreferences { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKWebpagePreferences ///An implementation of [NSObject] used to access callback methods @@ -7059,35 +5988,25 @@ final class PigeonApiWKWebpagePreferences: PigeonApiProtocolWKWebpagePreferences return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, - delegate: PigeonApiDelegateWKWebpagePreferences - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKWebpagePreferences) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers( - binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKWebpagePreferences? - ) { + static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKWebpagePreferences?) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( - pigeonRegistrar: api!.pigeonRegistrar)) + 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) + 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) + try api.pigeonDelegate.setAllowsContentJavaScript(pigeonApi: api, pigeonInstance: pigeonInstanceArg, allow: allowArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -7096,21 +6015,16 @@ final class PigeonApiWKWebpagePreferences: PigeonApiProtocolWKWebpagePreferences } else { setAllowsContentJavaScriptChannel.setMessageHandler(nil) } - } else { + } else { let setAllowsContentJavaScriptChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebpagePreferences.setAllowsContentJavaScript", + 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 - ))) + 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) @@ -7120,26 +6034,21 @@ final class PigeonApiWKWebpagePreferences: PigeonApiProtocolWKWebpagePreferences ///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 - ) { + 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) + } 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) + 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))) @@ -7159,20 +6068,17 @@ final class PigeonApiWKWebpagePreferences: PigeonApiProtocolWKWebpagePreferences } protocol PigeonApiDelegateGetTrustResultResponse { /// The result code from the most recent trust evaluation. - func result(pigeonApi: PigeonApiGetTrustResultResponse, pigeonInstance: GetTrustResultResponse) - throws -> DartSecTrustResultType + func result(pigeonApi: PigeonApiGetTrustResultResponse, pigeonInstance: GetTrustResultResponse) throws -> DartSecTrustResultType /// A result code. /// /// See https://developer.apple.com/documentation/security/security-framework-result-codes?language=objc. - func resultCode( - pigeonApi: PigeonApiGetTrustResultResponse, pigeonInstance: GetTrustResultResponse - ) throws -> Int64 + func resultCode(pigeonApi: PigeonApiGetTrustResultResponse, pigeonInstance: GetTrustResultResponse) throws -> Int64 } protocol PigeonApiProtocolGetTrustResultResponse { } -final class PigeonApiGetTrustResultResponse: PigeonApiProtocolGetTrustResultResponse { +final class PigeonApiGetTrustResultResponse: PigeonApiProtocolGetTrustResultResponse { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateGetTrustResultResponse ///An implementation of [NSObject] used to access callback methods @@ -7180,38 +6086,28 @@ final class PigeonApiGetTrustResultResponse: PigeonApiProtocolGetTrustResultResp return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, - delegate: PigeonApiDelegateGetTrustResultResponse - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateGetTrustResultResponse) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } ///Creates a Dart instance of GetTrustResultResponse and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: GetTrustResultResponse, - completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: GetTrustResultResponse, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) + } else { + let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeonInstance as AnyObject) let resultArg = try! pigeonDelegate.result(pigeonApi: self, pigeonInstance: pigeonInstance) - let resultCodeArg = try! pigeonDelegate.resultCode( - pigeonApi: self, pigeonInstance: pigeonInstance) + let resultCodeArg = try! pigeonDelegate.resultCode(pigeonApi: self, pigeonInstance: pigeonInstance) let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.webview_flutter_wkwebview.GetTrustResultResponse.pigeon_newInstance" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.GetTrustResultResponse.pigeon_newInstance" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([pigeonIdentifierArg, resultArg, resultCodeArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -7231,30 +6127,23 @@ final class PigeonApiGetTrustResultResponse: PigeonApiProtocolGetTrustResultResp } protocol PigeonApiDelegateSecTrust { /// Evaluates trust for the specified certificate and policies. - func evaluateWithError( - pigeonApi: PigeonApiSecTrust, trust: SecTrustWrapper, - completion: @escaping (Result) -> Void) + func evaluateWithError(pigeonApi: PigeonApiSecTrust, trust: SecTrustWrapper, completion: @escaping (Result) -> Void) /// Returns an opaque cookie containing exceptions to trust policies that will /// allow future evaluations of the current certificate to succeed. - func copyExceptions(pigeonApi: PigeonApiSecTrust, trust: SecTrustWrapper) throws - -> FlutterStandardTypedData? + func copyExceptions(pigeonApi: PigeonApiSecTrust, trust: SecTrustWrapper) throws -> FlutterStandardTypedData? /// Sets a list of exceptions that should be ignored when the certificate is /// evaluated. - func setExceptions( - pigeonApi: PigeonApiSecTrust, trust: SecTrustWrapper, exceptions: FlutterStandardTypedData? - ) throws -> Bool + func setExceptions(pigeonApi: PigeonApiSecTrust, trust: SecTrustWrapper, exceptions: FlutterStandardTypedData?) throws -> Bool /// Returns the result code from the most recent trust evaluation. - func getTrustResult(pigeonApi: PigeonApiSecTrust, trust: SecTrustWrapper) throws - -> GetTrustResultResponse + func getTrustResult(pigeonApi: PigeonApiSecTrust, trust: SecTrustWrapper) throws -> GetTrustResultResponse /// Certificates used to evaluate trust. - func copyCertificateChain(pigeonApi: PigeonApiSecTrust, trust: SecTrustWrapper) throws - -> [SecCertificateWrapper]? + func copyCertificateChain(pigeonApi: PigeonApiSecTrust, trust: SecTrustWrapper) throws -> [SecCertificateWrapper]? } protocol PigeonApiProtocolSecTrust { } -final class PigeonApiSecTrust: PigeonApiProtocolSecTrust { +final class PigeonApiSecTrust: PigeonApiProtocolSecTrust { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateSecTrust ///An implementation of [NSObject] used to access callback methods @@ -7266,17 +6155,13 @@ final class PigeonApiSecTrust: PigeonApiProtocolSecTrust { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiSecTrust?) - { + static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiSecTrust?) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( - pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let evaluateWithErrorChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.SecTrust.evaluateWithError", - binaryMessenger: binaryMessenger, codec: codec) + let evaluateWithErrorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.SecTrust.evaluateWithError", binaryMessenger: binaryMessenger, codec: codec) if let api = api { evaluateWithErrorChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -7293,9 +6178,7 @@ final class PigeonApiSecTrust: PigeonApiProtocolSecTrust { } else { evaluateWithErrorChannel.setMessageHandler(nil) } - let copyExceptionsChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.SecTrust.copyExceptions", - binaryMessenger: binaryMessenger, codec: codec) + let copyExceptionsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.SecTrust.copyExceptions", binaryMessenger: binaryMessenger, codec: codec) if let api = api { copyExceptionsChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -7310,17 +6193,14 @@ final class PigeonApiSecTrust: PigeonApiProtocolSecTrust { } else { copyExceptionsChannel.setMessageHandler(nil) } - let setExceptionsChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.SecTrust.setExceptions", - binaryMessenger: binaryMessenger, codec: codec) + let setExceptionsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.SecTrust.setExceptions", binaryMessenger: binaryMessenger, codec: codec) if let api = api { setExceptionsChannel.setMessageHandler { message, reply in let args = message as! [Any?] let trustArg = args[0] as! SecTrustWrapper let exceptionsArg: FlutterStandardTypedData? = nilOrValue(args[1]) do { - let result = try api.pigeonDelegate.setExceptions( - pigeonApi: api, trust: trustArg, exceptions: exceptionsArg) + let result = try api.pigeonDelegate.setExceptions(pigeonApi: api, trust: trustArg, exceptions: exceptionsArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -7329,9 +6209,7 @@ final class PigeonApiSecTrust: PigeonApiProtocolSecTrust { } else { setExceptionsChannel.setMessageHandler(nil) } - let getTrustResultChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.SecTrust.getTrustResult", - binaryMessenger: binaryMessenger, codec: codec) + let getTrustResultChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.SecTrust.getTrustResult", binaryMessenger: binaryMessenger, codec: codec) if let api = api { getTrustResultChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -7346,9 +6224,7 @@ final class PigeonApiSecTrust: PigeonApiProtocolSecTrust { } else { getTrustResultChannel.setMessageHandler(nil) } - let copyCertificateChainChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.SecTrust.copyCertificateChain", - binaryMessenger: binaryMessenger, codec: codec) + let copyCertificateChainChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.SecTrust.copyCertificateChain", binaryMessenger: binaryMessenger, codec: codec) if let api = api { copyCertificateChainChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -7366,26 +6242,21 @@ final class PigeonApiSecTrust: PigeonApiProtocolSecTrust { } ///Creates a Dart instance of SecTrust and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: SecTrustWrapper, completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: SecTrustWrapper, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) + } 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.SecTrust.pigeon_newInstance" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.SecTrust.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))) @@ -7405,14 +6276,13 @@ final class PigeonApiSecTrust: PigeonApiProtocolSecTrust { } protocol PigeonApiDelegateSecCertificate { /// Returns a DER representation of a certificate given a certificate object. - func copyData(pigeonApi: PigeonApiSecCertificate, certificate: SecCertificateWrapper) throws - -> FlutterStandardTypedData + func copyData(pigeonApi: PigeonApiSecCertificate, certificate: SecCertificateWrapper) throws -> FlutterStandardTypedData } protocol PigeonApiProtocolSecCertificate { } -final class PigeonApiSecCertificate: PigeonApiProtocolSecCertificate { +final class PigeonApiSecCertificate: PigeonApiProtocolSecCertificate { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateSecCertificate ///An implementation of [NSObject] used to access callback methods @@ -7420,24 +6290,17 @@ final class PigeonApiSecCertificate: PigeonApiProtocolSecCertificate { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init( - pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateSecCertificate - ) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateSecCertificate) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers( - binaryMessenger: FlutterBinaryMessenger, api: PigeonApiSecCertificate? - ) { + static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiSecCertificate?) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( - pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let copyDataChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.SecCertificate.copyData", - binaryMessenger: binaryMessenger, codec: codec) + let copyDataChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.SecCertificate.copyData", binaryMessenger: binaryMessenger, codec: codec) if let api = api { copyDataChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -7455,26 +6318,21 @@ final class PigeonApiSecCertificate: PigeonApiProtocolSecCertificate { } ///Creates a Dart instance of SecCertificate and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: SecCertificateWrapper, completion: @escaping (Result) -> Void - ) { + func pigeonNewInstance(pigeonInstance: SecCertificateWrapper, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) + } 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.SecCertificate.pigeon_newInstance" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.SecCertificate.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))) 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 b98a3a9b085..4b079c9cc96 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,19 +1,14 @@ // 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. -<<<<<<< HEAD -// Autogenerated from Pigeon (v24.2.2), do not edit directly. -======= // Autogenerated from Pigeon (v25.3.0), do not edit directly. ->>>>>>> bfb42a62a56ee53010e7c2601cbf1bac993122f2 // 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 import 'dart:async'; import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; -import 'package:flutter/foundation.dart' - show ReadBuffer, WriteBuffer, immutable, protected; +import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer, immutable, protected; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart' show WidgetsFlutterBinding; @@ -24,8 +19,7 @@ PlatformException _createConnectionError(String channelName) { ); } -List wrapResponse( - {Object? result, PlatformException? error, bool empty = false}) { +List wrapResponse({Object? result, PlatformException? error, bool empty = false}) { if (empty) { return []; } @@ -34,7 +28,6 @@ List wrapResponse( } return [error.code, error.message, error.details]; } - /// An immutable object that serves as the base class for all ProxyApis and /// can provide functional copies of itself. /// @@ -117,10 +110,9 @@ class PigeonInstanceManager { // by calling instanceManager.getIdentifier() inside of `==` while this was a // HashMap). final Expando _identifiers = Expando(); - final Map> - _weakInstances = >{}; - final Map _strongInstances = - {}; + final Map> _weakInstances = + >{}; + final Map _strongInstances = {}; late final Finalizer _finalizer; int _nextIdentifier = 0; @@ -130,8 +122,7 @@ class PigeonInstanceManager { static PigeonInstanceManager _initInstance() { WidgetsFlutterBinding.ensureInitialized(); - final _PigeonInternalInstanceManagerApi api = - _PigeonInternalInstanceManagerApi(); + final _PigeonInternalInstanceManagerApi api = _PigeonInternalInstanceManagerApi(); // Clears the native `PigeonInstanceManager` on the initial use of the Dart one. api.clear(); final PigeonInstanceManager instanceManager = PigeonInstanceManager( @@ -139,76 +130,42 @@ class PigeonInstanceManager { api.removeStrongReference(identifier); }, ); - _PigeonInternalInstanceManagerApi.setUpMessageHandlers( - instanceManager: instanceManager); - URLRequest.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - HTTPURLResponse.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - URLResponse.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - WKUserScript.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - WKNavigationAction.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - WKNavigationResponse.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - WKFrameInfo.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - NSError.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - WKScriptMessage.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - WKSecurityOrigin.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - HTTPCookie.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - AuthenticationChallengeResponse.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - WKWebsiteDataStore.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); + _PigeonInternalInstanceManagerApi.setUpMessageHandlers(instanceManager: instanceManager); + URLRequest.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + HTTPURLResponse.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + URLResponse.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + WKUserScript.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + WKNavigationAction.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + WKNavigationResponse.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + WKFrameInfo.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + NSError.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + WKScriptMessage.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + WKSecurityOrigin.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + HTTPCookie.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + AuthenticationChallengeResponse.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + WKWebsiteDataStore.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); UIView.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - UIScrollView.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - WKWebViewConfiguration.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - WKUserContentController.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - WKPreferences.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - WKScriptMessageHandler.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - WKNavigationDelegate.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - NSObject.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - UIViewWKWebView.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - NSViewWKWebView.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - WKWebView.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - WKUIDelegate.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - WKHTTPCookieStore.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - UIScrollViewDelegate.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - URLCredential.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - URLProtectionSpace.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - URLAuthenticationChallenge.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); + UIScrollView.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + WKWebViewConfiguration.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + WKUserContentController.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + WKPreferences.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + WKScriptMessageHandler.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + WKNavigationDelegate.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + NSObject.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + UIViewWKWebView.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + NSViewWKWebView.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + WKWebView.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + WKUIDelegate.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + WKHTTPCookieStore.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + UIScrollViewDelegate.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + URLCredential.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + URLProtectionSpace.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + URLAuthenticationChallenge.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); URL.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WKWebpagePreferences.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - GetTrustResultResponse.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - SecTrust.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - SecCertificate.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); + WKWebpagePreferences.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + GetTrustResultResponse.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + SecTrust.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + SecCertificate.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); return instanceManager; } @@ -272,20 +229,15 @@ class PigeonInstanceManager { /// /// This method also expects the host `InstanceManager` to have a strong /// reference to the instance the identifier is associated with. - T? getInstanceWithWeakReference( - int identifier) { - final PigeonInternalProxyApiBaseClass? weakInstance = - _weakInstances[identifier]?.target; + T? getInstanceWithWeakReference(int identifier) { + final PigeonInternalProxyApiBaseClass? weakInstance = _weakInstances[identifier]?.target; if (weakInstance == null) { - final PigeonInternalProxyApiBaseClass? strongInstance = - _strongInstances[identifier]; + final PigeonInternalProxyApiBaseClass? strongInstance = _strongInstances[identifier]; if (strongInstance != null) { - final PigeonInternalProxyApiBaseClass copy = - strongInstance.pigeon_copy(); + final PigeonInternalProxyApiBaseClass copy = strongInstance.pigeon_copy(); _identifiers[copy] = identifier; - _weakInstances[identifier] = - WeakReference(copy); + _weakInstances[identifier] = WeakReference(copy); _finalizer.attach(copy, identifier, detach: copy); return copy as T; } @@ -309,20 +261,17 @@ class PigeonInstanceManager { /// added. /// /// Returns unique identifier of the [instance] added. - void addHostCreatedInstance( - PigeonInternalProxyApiBaseClass instance, int identifier) { + void addHostCreatedInstance(PigeonInternalProxyApiBaseClass instance, int identifier) { _addInstanceWithIdentifier(instance, identifier); } - void _addInstanceWithIdentifier( - PigeonInternalProxyApiBaseClass instance, int identifier) { + void _addInstanceWithIdentifier(PigeonInternalProxyApiBaseClass instance, int identifier) { assert(!containsIdentifier(identifier)); assert(getIdentifier(instance) == null); assert(identifier >= 0); _identifiers[instance] = identifier; - _weakInstances[identifier] = - WeakReference(instance); + _weakInstances[identifier] = WeakReference(instance); _finalizer.attach(instance, identifier, detach: instance); final PigeonInternalProxyApiBaseClass copy = instance.pigeon_copy(); @@ -449,30 +398,30 @@ class _PigeonInternalInstanceManagerApi { } class _PigeonInternalProxyApiBaseCodec extends _PigeonCodec { - const _PigeonInternalProxyApiBaseCodec(this.instanceManager); - final PigeonInstanceManager instanceManager; - @override - void writeValue(WriteBuffer buffer, Object? value) { - if (value is PigeonInternalProxyApiBaseClass) { - buffer.putUint8(128); - writeValue(buffer, instanceManager.getIdentifier(value)); - } else { - super.writeValue(buffer, value); - } - } - - @override - Object? readValueOfType(int type, ReadBuffer buffer) { - switch (type) { - case 128: - return instanceManager - .getInstanceWithWeakReference(readValue(buffer)! as int); - default: - return super.readValueOfType(type, buffer); - } - } + const _PigeonInternalProxyApiBaseCodec(this.instanceManager); + final PigeonInstanceManager instanceManager; + @override + void writeValue(WriteBuffer buffer, Object? value) { + if (value is PigeonInternalProxyApiBaseClass) { + buffer.putUint8(128); + writeValue(buffer, instanceManager.getIdentifier(value)); + } else { + super.writeValue(buffer, value); + } + } + @override + Object? readValueOfType(int type, ReadBuffer buffer) { + switch (type) { + case 128: + return instanceManager + .getInstanceWithWeakReference(readValue(buffer)! as int); + default: + return super.readValueOfType(type, buffer); + } + } } + /// The values that can be returned in a change dictionary. /// /// See https://developer.apple.com/documentation/foundation/nskeyvalueobservingoptions. @@ -480,15 +429,12 @@ enum KeyValueObservingOptions { /// Indicates that the change dictionary should provide the new attribute /// value, if applicable. newValue, - /// Indicates that the change dictionary should contain the old attribute /// value, if applicable. oldValue, - /// If specified, a notification should be sent to the observer immediately, /// before the observer registration method even returns. initialValue, - /// Whether separate notifications should be sent to the observer before and /// after each change, instead of a single notification after the change. priorNotification, @@ -500,19 +446,15 @@ enum KeyValueObservingOptions { enum KeyValueChange { /// Indicates that the value of the observed key path was set to a new value. setting, - /// Indicates that an object has been inserted into the to-many relationship /// that is being observed. insertion, - /// Indicates that an object has been removed from the to-many relationship /// that is being observed. removal, - /// Indicates that an object has been replaced in the to-many relationship /// that is being observed. replacement, - /// The value is not recognized by the wrapper. unknown, } @@ -526,28 +468,23 @@ enum KeyValueChangeKey { /// `KeyValueChange.replacement`, the value of this key is a Set object that /// contains the indexes of the inserted, removed, or replaced objects. indexes, - /// An object that contains a value corresponding to one of the /// `KeyValueChange` enum, indicating what sort of change has occurred. kind, - /// If the value of the `KeyValueChange.kind` entry is /// `KeyValueChange.setting, and `KeyValueObservingOptions.newValue` was /// specified when the observer was registered, the value of this key is the /// new value for the attribute. newValue, - /// If the `KeyValueObservingOptions.priorNotification` option was specified /// when the observer was registered this notification is sent prior to a /// change. notificationIsPrior, - /// If the value of the `KeyValueChange.kind` entry is /// `KeyValueChange.setting`, and `KeyValueObservingOptions.old` was specified /// when the observer was registered, the value of this key is the value /// before the attribute was changed. oldValue, - /// The value is not recognized by the wrapper. unknown, } @@ -559,11 +496,9 @@ enum UserScriptInjectionTime { /// A constant to inject the script after the creation of the webpage’s /// document element, but before loading any other content. atDocumentStart, - /// A constant to inject the script after the document finishes loading, but /// before loading any other subresources. atDocumentEnd, - /// The value is not recognized by the wrapper. unknown, } @@ -574,13 +509,10 @@ enum UserScriptInjectionTime { enum AudiovisualMediaType { /// No media types require a user gesture to begin playing. none, - /// Media types that contain audio require a user gesture to begin playing. audio, - /// Media types that contain video require a user gesture to begin playing. video, - /// All media types require a user gesture to begin playing. all, } @@ -592,25 +524,18 @@ enum AudiovisualMediaType { enum WebsiteDataType { /// Cookies. cookies, - /// In-memory caches. memoryCache, - /// On-disk caches. diskCache, - /// HTML offline web app caches. offlineWebApplicationCache, - /// HTML local storage. localStorage, - /// HTML session storage. sessionStorage, - /// WebSQL databases. webSQLDatabases, - /// IndexedDB databases. indexedDBDatabases, } @@ -622,10 +547,8 @@ enum WebsiteDataType { enum NavigationActionPolicy { /// Allow the navigation to continue. allow, - /// Cancel the navigation. cancel, - /// Allow the download to proceed. download, } @@ -637,10 +560,8 @@ enum NavigationActionPolicy { enum NavigationResponsePolicy { /// Allow the navigation to continue. allow, - /// Cancel the navigation. cancel, - /// Allow the download to proceed. download, } @@ -651,51 +572,37 @@ enum NavigationResponsePolicy { enum HttpCookiePropertyKey { /// A String object containing the comment for the cookie. comment, - /// An Uri object or String object containing the comment URL for the cookie. commentUrl, - /// Aa String object stating whether the cookie should be discarded at the end /// of the session. discard, - /// An String object containing the domain for the cookie. domain, - /// An Date object or String object specifying the expiration date for the /// cookie. expires, - /// An String object containing an integer value stating how long in seconds /// the cookie should be kept, at most. maximumAge, - /// An String object containing the name of the cookie (required). name, - /// A URL or String object containing the URL that set this cookie. originUrl, - /// A String object containing the path for the cookie. path, - /// An String object containing comma-separated integer values specifying the /// ports for the cookie. port, - /// A string indicating the same-site policy for the cookie. sameSitePolicy, - /// A String object indicating that the cookie should be transmitted only over /// secure channels. secure, - /// A String object containing the value of the cookie. value, - /// A String object that specifies the version of the cookie. version, - /// The value is not recognized by the wrapper. unknown, } @@ -706,22 +613,16 @@ enum HttpCookiePropertyKey { enum NavigationType { /// A link activation. linkActivated, - /// A request to submit a form. formSubmitted, - /// A request for the frame’s next or previous item. backForward, - /// A request to reload the webpage. reload, - /// A request to resubmit a form. formResubmitted, - /// A navigation request that originates for some other reason. other, - /// The value is not recognized by the wrapper. unknown, } @@ -732,10 +633,8 @@ enum NavigationType { enum PermissionDecision { /// Deny permission for the requested resource. deny, - /// Deny permission for the requested resource. grant, - /// Prompt the user for permission for the requested resource. prompt, } @@ -746,13 +645,10 @@ enum PermissionDecision { enum MediaCaptureType { /// A media device that can capture video. camera, - /// A media device or devices that can capture audio and video. cameraAndMicrophone, - /// A media device that can capture audio. microphone, - /// The value is not recognized by the wrapper. unknown, } @@ -763,18 +659,14 @@ enum MediaCaptureType { enum UrlSessionAuthChallengeDisposition { /// Use the specified credential, which may be nil. useCredential, - /// Use the default handling for the challenge as though this delegate method /// were not implemented. performDefaultHandling, - /// Cancel the entire request. cancelAuthenticationChallenge, - /// Reject this challenge, and call the authentication delegate method again /// with the next authentication protection space. rejectProtectionSpace, - /// The value is not recognized by the wrapper. unknown, } @@ -785,13 +677,10 @@ enum UrlSessionAuthChallengeDisposition { enum UrlCredentialPersistence { /// The credential should not be stored. none, - /// The credential should be stored only for this session. forSession, - /// The credential should be stored in the keychain. permanent, - /// The credential should be stored permanently in the keychain, and in /// addition should be distributed to other devices based on the owning Apple /// ID. @@ -804,33 +693,26 @@ enum UrlCredentialPersistence { enum DartSecTrustResultType { /// The user did not specify a trust setting. unspecified, - /// The user granted permission to trust the certificate for the purposes /// designated in the specified policies. proceed, - /// The user specified that the certificate should not be trusted. deny, - /// Trust is denied, but recovery may be possible. recoverableTrustFailure, - /// Trust is denied and no simple fix is available. fatalTrustFailure, - /// A value that indicates a failure other than trust evaluation. otherError, - /// An indication of an invalid setting or result. invalid, - /// User confirmation is required before proceeding. confirm, - /// The type is not recognized by this wrapper. unknown, } + class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override @@ -838,49 +720,49 @@ class _PigeonCodec extends StandardMessageCodec { if (value is int) { buffer.putUint8(4); buffer.putInt64(value); - } else if (value is KeyValueObservingOptions) { + } else if (value is KeyValueObservingOptions) { buffer.putUint8(129); writeValue(buffer, value.index); - } else if (value is KeyValueChange) { + } else if (value is KeyValueChange) { buffer.putUint8(130); writeValue(buffer, value.index); - } else if (value is KeyValueChangeKey) { + } else if (value is KeyValueChangeKey) { buffer.putUint8(131); writeValue(buffer, value.index); - } else if (value is UserScriptInjectionTime) { + } else if (value is UserScriptInjectionTime) { buffer.putUint8(132); writeValue(buffer, value.index); - } else if (value is AudiovisualMediaType) { + } else if (value is AudiovisualMediaType) { buffer.putUint8(133); writeValue(buffer, value.index); - } else if (value is WebsiteDataType) { + } else if (value is WebsiteDataType) { buffer.putUint8(134); writeValue(buffer, value.index); - } else if (value is NavigationActionPolicy) { + } else if (value is NavigationActionPolicy) { buffer.putUint8(135); writeValue(buffer, value.index); - } else if (value is NavigationResponsePolicy) { + } else if (value is NavigationResponsePolicy) { buffer.putUint8(136); writeValue(buffer, value.index); - } else if (value is HttpCookiePropertyKey) { + } else if (value is HttpCookiePropertyKey) { buffer.putUint8(137); writeValue(buffer, value.index); - } else if (value is NavigationType) { + } else if (value is NavigationType) { buffer.putUint8(138); writeValue(buffer, value.index); - } else if (value is PermissionDecision) { + } else if (value is PermissionDecision) { buffer.putUint8(139); writeValue(buffer, value.index); - } else if (value is MediaCaptureType) { + } else if (value is MediaCaptureType) { buffer.putUint8(140); writeValue(buffer, value.index); - } else if (value is UrlSessionAuthChallengeDisposition) { + } else if (value is UrlSessionAuthChallengeDisposition) { buffer.putUint8(141); writeValue(buffer, value.index); - } else if (value is UrlCredentialPersistence) { + } else if (value is UrlCredentialPersistence) { buffer.putUint8(142); writeValue(buffer, value.index); - } else if (value is DartSecTrustResultType) { + } else if (value is DartSecTrustResultType) { buffer.putUint8(143); writeValue(buffer, value.index); } else { @@ -891,51 +773,49 @@ class _PigeonCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 129: + case 129: final int? value = readValue(buffer) as int?; return value == null ? null : KeyValueObservingOptions.values[value]; - case 130: + case 130: final int? value = readValue(buffer) as int?; return value == null ? null : KeyValueChange.values[value]; - case 131: + case 131: final int? value = readValue(buffer) as int?; return value == null ? null : KeyValueChangeKey.values[value]; - case 132: + case 132: final int? value = readValue(buffer) as int?; return value == null ? null : UserScriptInjectionTime.values[value]; - case 133: + case 133: final int? value = readValue(buffer) as int?; return value == null ? null : AudiovisualMediaType.values[value]; - case 134: + case 134: final int? value = readValue(buffer) as int?; return value == null ? null : WebsiteDataType.values[value]; - case 135: + case 135: final int? value = readValue(buffer) as int?; return value == null ? null : NavigationActionPolicy.values[value]; - case 136: + case 136: final int? value = readValue(buffer) as int?; return value == null ? null : NavigationResponsePolicy.values[value]; - case 137: + case 137: final int? value = readValue(buffer) as int?; return value == null ? null : HttpCookiePropertyKey.values[value]; - case 138: + case 138: final int? value = readValue(buffer) as int?; return value == null ? null : NavigationType.values[value]; - case 139: + case 139: final int? value = readValue(buffer) as int?; return value == null ? null : PermissionDecision.values[value]; - case 140: + case 140: final int? value = readValue(buffer) as int?; return value == null ? null : MediaCaptureType.values[value]; - case 141: + case 141: final int? value = readValue(buffer) as int?; - return value == null - ? null - : UrlSessionAuthChallengeDisposition.values[value]; - case 142: + return value == null ? null : UrlSessionAuthChallengeDisposition.values[value]; + case 142: final int? value = readValue(buffer) as int?; return value == null ? null : UrlCredentialPersistence.values[value]; - case 143: + case 143: final int? value = readValue(buffer) as int?; return value == null ? null : DartSecTrustResultType.values[value]; default: @@ -943,7 +823,6 @@ class _PigeonCodec extends StandardMessageCodec { } } } - /// A URL load request that is independent of protocol or URL scheme. /// /// See https://developer.apple.com/documentation/foundation/urlrequest. @@ -8637,3 +8516,4 @@ class SecCertificate extends NSObject { ); } } + 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 4e7d186e80f..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 @@ -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,29 +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( @@ -80,18 +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) => (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]. @@ -104,31 +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( @@ -136,21 +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( @@ -159,16 +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) => (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 d6981859154..51397409589 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,86 +36,86 @@ 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 _FakeWKNavigationDelegate_3 extends _i1.SmartFake implements _i2.WKNavigationDelegate { _FakeWKNavigationDelegate_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 _FakeWKScriptMessageHandler_5 extends _i1.SmartFake implements _i2.WKScriptMessageHandler { _FakeWKScriptMessageHandler_5(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWKWebView_6 extends _i1.SmartFake implements _i2.WKWebView { _FakeWKWebView_6(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWKWebViewConfiguration_7 extends _i1.SmartFake implements _i2.WKWebViewConfiguration { _FakeWKWebViewConfiguration_7(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeUIViewWKWebView_8 extends _i1.SmartFake implements _i2.UIViewWKWebView { _FakeUIViewWKWebView_8(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWKUserContentController_9 extends _i1.SmartFake implements _i2.WKUserContentController { _FakeWKUserContentController_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 _FakeWKHTTPCookieStore_12 extends _i1.SmartFake implements _i2.WKHTTPCookieStore { _FakeWKHTTPCookieStore_12(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWKUIDelegate_13 extends _i1.SmartFake implements _i2.WKUIDelegate { _FakeWKUIDelegate_13(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakePlatformWebView_14 extends _i1.SmartFake implements _i3.PlatformWebView { _FakePlatformWebView_14(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } /// A class which mocks [UIScrollView]. @@ -127,117 +127,142 @@ 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 _i4.Future setShowsVerticalScrollIndicator(bool? value) => (super.noSuchMethod( - Invocation.method(#setShowsVerticalScrollIndicator, [value]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#setShowsVerticalScrollIndicator, [value]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); @override _i4.Future setShowsHorizontalScrollIndicator(bool? value) => (super.noSuchMethod( - Invocation.method(#setShowsHorizontalScrollIndicator, [value]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + Invocation.method(#setShowsHorizontalScrollIndicator, [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( @@ -246,18 +271,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) => (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]. @@ -269,69 +296,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?>); + 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( @@ -340,18 +383,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) => (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]. @@ -368,79 +413,92 @@ 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> 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>.value([]), - ) as _i4.Future> 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); + ) + get didReceiveAuthenticationChallenge => + (super.noSuchMethod( + Invocation.getter(#didReceiveAuthenticationChallenge), + returnValue: + ( + _i2.WKNavigationDelegate pigeon_instance, + _i2.WKWebView webView, + _i2.URLAuthenticationChallenge challenge, + ) => _i4.Future>.value([]), + ) + as _i4.Future> 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); @override _i4.Future addObserver( @@ -449,18 +507,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) => (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]. @@ -472,29 +532,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); + _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_4( - this, - Invocation.method(#pigeon_copy, []), - ), - ) as _i2.WKPreferences); + _i2.WKPreferences pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKPreferences_4( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WKPreferences); @override _i4.Future addObserver( @@ -503,18 +569,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) => (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]. @@ -531,36 +599,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_5( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WKScriptMessageHandler); @override _i4.Future addObserver( @@ -569,18 +645,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) => (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]. @@ -592,22 +670,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_6( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WKWebView); @override _i4.Future addObserver( @@ -616,18 +698,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) => (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]. @@ -639,211 +723,261 @@ 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); + _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); + _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_7( - this, - Invocation.method(#pigeonVar_configuration, []), - ), - ) as _i2.WKWebViewConfiguration); + _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.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 - _i4.Future setAllowsLinkPreview(bool? allow) => (super.noSuchMethod( - Invocation.method(#setAllowsLinkPreview, [allow]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + _i4.Future setAllowsLinkPreview(bool? allow) => + (super.noSuchMethod( + Invocation.method(#setAllowsLinkPreview, [allow]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _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); + _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); + _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( @@ -852,18 +986,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) => (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]. @@ -876,123 +1012,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, ) => (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>); + returnValue: _i4.Future<_i2.WKUserContentController>.value( + _FakeWKUserContentController_9( + 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>); + returnValue: _i4.Future<_i2.WKWebsiteDataStore>.value( + _FakeWKWebsiteDataStore_10( + 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); + 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, + _i4.Future<_i2.WKPreferences> getPreferences() => + (super.noSuchMethod( Invocation.method(#getPreferences, []), - ), - ), - ) as _i4.Future<_i2.WKPreferences>); + returnValue: _i4.Future<_i2.WKPreferences>.value( + _FakeWKPreferences_4( + 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); + 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_11( - this, Invocation.method(#getDefaultWebpagePreferences, []), - ), - ), - ) as _i4.Future<_i2.WKWebpagePreferences>); + returnValue: _i4.Future<_i2.WKWebpagePreferences>.value( + _FakeWKWebpagePreferences_11( + this, + Invocation.method(#getDefaultWebpagePreferences, []), + ), + ), + ) + as _i4.Future<_i2.WKWebpagePreferences>); @override - _i2.WKWebViewConfiguration pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWKWebViewConfiguration_7( - this, - Invocation.method(#pigeon_copy, []), - ), - ) as _i2.WKWebViewConfiguration); + _i2.WKWebViewConfiguration pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKWebViewConfiguration_7( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WKWebViewConfiguration); @override _i4.Future addObserver( @@ -1001,18 +1152,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) => (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]. @@ -1025,31 +1178,37 @@ class MockWKWebsiteDataStore extends _i1.Mock } @override - _i2.WKHTTPCookieStore get httpCookieStore => (super.noSuchMethod( - Invocation.getter(#httpCookieStore), - returnValue: _FakeWKHTTPCookieStore_12( - this, - Invocation.getter(#httpCookieStore), - ), - ) as _i2.WKHTTPCookieStore); + _i2.WKHTTPCookieStore get httpCookieStore => + (super.noSuchMethod( + Invocation.getter(#httpCookieStore), + returnValue: _FakeWKHTTPCookieStore_12( + 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_12( - this, - Invocation.method(#pigeonVar_httpCookieStore, []), - ), - ) as _i2.WKHTTPCookieStore); + _i2.WKHTTPCookieStore pigeonVar_httpCookieStore() => + (super.noSuchMethod( + Invocation.method(#pigeonVar_httpCookieStore, []), + returnValue: _FakeWKHTTPCookieStore_12( + this, + Invocation.method(#pigeonVar_httpCookieStore, []), + ), + ) + as _i2.WKHTTPCookieStore); @override _i4.Future removeDataOfTypes( @@ -1057,21 +1216,24 @@ 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_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, []), + ), + ) + as _i2.WKWebsiteDataStore); @override _i4.Future addObserver( @@ -1080,18 +1242,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) => (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]. @@ -1109,25 +1273,28 @@ 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( @@ -1135,39 +1302,46 @@ 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_13( - 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_13( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WKUIDelegate); @override _i4.Future addObserver( @@ -1176,18 +1350,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) => (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]. @@ -1200,13 +1376,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( @@ -1214,49 +1392,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); + 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_9( - this, - Invocation.method(#pigeon_copy, []), - ), - ) as _i2.WKUserContentController); + _i2.WKUserContentController pigeon_copy() => + (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKUserContentController_9( + this, + Invocation.method(#pigeon_copy, []), + ), + ) + as _i2.WKUserContentController); @override _i4.Future addObserver( @@ -1265,18 +1452,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) => (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]. @@ -1289,10 +1478,12 @@ 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) => @@ -1324,36 +1515,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]. @@ -1369,32 +1561,35 @@ 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_14( - 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_14( + 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({ @@ -1402,19 +1597,21 @@ class MockWebViewWidgetProxy extends _i1.Mock _i2.WKScriptMessageHandler, _i2.WKUserContentController, _i2.WKScriptMessage, - )? didReceiveScriptMessage, + )? + didReceiveScriptMessage, }) => (super.noSuchMethod( - Invocation.method(#createScriptMessageHandler, [], { - #didReceiveScriptMessage: didReceiveScriptMessage, - }), - returnValue: _FakeWKScriptMessageHandler_5( - this, - Invocation.method(#createScriptMessageHandler, [], { - #didReceiveScriptMessage: didReceiveScriptMessage, - }), - ), - ) as _i2.WKScriptMessageHandler); + Invocation.method(#createScriptMessageHandler, [], { + #didReceiveScriptMessage: didReceiveScriptMessage, + }), + returnValue: _FakeWKScriptMessageHandler_5( + this, + Invocation.method(#createScriptMessageHandler, [], { + #didReceiveScriptMessage: didReceiveScriptMessage, + }), + ), + ) + as _i2.WKScriptMessageHandler); @override _i2.WKUIDelegate createUIDelgate({ @@ -1423,77 +1620,86 @@ class MockWebViewWidgetProxy extends _i1.Mock _i2.WKWebView, _i2.WKWebViewConfiguration, _i2.WKNavigationAction, - )? onCreateWebView, + )? + onCreateWebView, }) => (super.noSuchMethod( - Invocation.method(#createUIDelgate, [], { - #onCreateWebView: onCreateWebView, - }), - returnValue: _FakeWKUIDelegate_13( - this, - Invocation.method(#createUIDelgate, [], { - #onCreateWebView: onCreateWebView, - }), - ), - ) as _i2.WKUIDelegate); + Invocation.method(#createUIDelgate, [], { + #onCreateWebView: onCreateWebView, + }), + returnValue: _FakeWKUIDelegate_13( + 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> 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, [], { - #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_3( + 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]. @@ -1506,30 +1712,35 @@ 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_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, []), + ), + ) + as _i2.WKWebpagePreferences); @override _i4.Future addObserver( @@ -1538,16 +1749,18 @@ 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 503c38a6dc5..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 @@ -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,34 +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>); + 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( @@ -98,18 +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) => (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]. @@ -121,69 +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( @@ -192,18 +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) => (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]. @@ -215,30 +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, + _i3.Future getAbsoluteString() => + (super.noSuchMethod( Invocation.method(#getAbsoluteString, []), - ), - ), - ) as _i3.Future); + 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( @@ -247,16 +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) => (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 f5f1ce191c0..caf2e7bd565 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,128 +113,153 @@ 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> 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); + _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 _i3.Future setShowsVerticalScrollIndicator(bool? value) => (super.noSuchMethod( - Invocation.method(#setShowsVerticalScrollIndicator, [value]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#setShowsVerticalScrollIndicator, [value]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @override _i3.Future setShowsHorizontalScrollIndicator(bool? value) => (super.noSuchMethod( - Invocation.method(#setShowsHorizontalScrollIndicator, [value]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + Invocation.method(#setShowsHorizontalScrollIndicator, [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 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); + _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( @@ -243,18 +268,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) => (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]. @@ -263,30 +290,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( @@ -295,18 +326,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) => (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]. @@ -314,44 +347,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, + _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, []), - ), - ), - ) 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); + 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( @@ -360,18 +399,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) => (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]. @@ -379,81 +420,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); + _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); + _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); + _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); + _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?>); + _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( @@ -462,18 +519,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) => (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]. @@ -481,37 +540,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( @@ -520,18 +585,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) => (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]. @@ -544,49 +611,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( @@ -595,18 +671,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) => (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]. @@ -615,17 +693,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( @@ -633,53 +713,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); + 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( @@ -688,18 +777,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) => (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]. @@ -707,57 +798,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( @@ -766,18 +868,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) => (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]. @@ -785,30 +889,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( @@ -817,18 +925,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) => (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]. @@ -837,156 +947,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, ) => (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>); + 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>); + 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); + 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, + _i3.Future<_i2.WKPreferences> getPreferences() => + (super.noSuchMethod( Invocation.method(#getPreferences, []), - ), - ), - ) as _i3.Future<_i2.WKPreferences>); + 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); + 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); + 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( @@ -995,18 +1121,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) => (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]. @@ -1015,38 +1143,43 @@ 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( @@ -1055,18 +1188,20 @@ 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]. @@ -1074,242 +1209,292 @@ 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); - - @override - _i3.Future getCustomUserAgent() => (super.noSuchMethod( - Invocation.method(#getCustomUserAgent, []), - 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 setAllowsLinkPreview(bool? allow) => (super.noSuchMethod( - Invocation.method(#setAllowsLinkPreview, [allow]), - 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); + _i3.Future setAllowsLinkPreview(bool? allow) => + (super.noSuchMethod( + Invocation.method(#setAllowsLinkPreview, [allow]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) + as _i3.Future); @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 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); + _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( @@ -1318,18 +1503,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) => (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]. @@ -1338,43 +1525,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_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( @@ -1382,26 +1575,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); + 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( @@ -1410,16 +1606,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); } 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 d494fbba209..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 @@ -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,31 +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( @@ -82,21 +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( @@ -105,18 +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) => (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]. @@ -128,29 +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( @@ -159,16 +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) => (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 ce4ab60e4a0..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 @@ -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,25 +83,28 @@ 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( @@ -109,39 +112,46 @@ 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( @@ -150,18 +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) => (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]. @@ -174,123 +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, ) => (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>); + 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>); + 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, + _i3.Future<_i2.WKPreferences> getPreferences() => + (super.noSuchMethod( Invocation.method(#getPreferences, []), - ), - ), - ) as _i3.Future<_i2.WKPreferences>); + 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, ) => (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, []), - ), - ), - ) as _i3.Future<_i2.WKWebpagePreferences>); + 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); + _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( @@ -299,18 +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) => (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]. @@ -323,22 +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_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( @@ -347,16 +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) => (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 1bdd7c645dc8ac843405431b45d6083732df0288 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Sun, 20 Apr 2025 22:22:02 -0400 Subject: [PATCH 16/29] regen mocks --- .../legacy/webview_flutter_test.mocks.dart | 312 ++++++----- .../test/navigation_delegate_test.mocks.dart | 143 ++--- .../test/webview_controller_test.mocks.dart | 511 ++++++++++-------- .../webview_cookie_manager_test.mocks.dart | 35 +- .../test/webview_widget_test.mocks.dart | 460 +++++++++------- 5 files changed, 817 insertions(+), 644 deletions(-) diff --git a/packages/webview_flutter/webview_flutter/test/legacy/webview_flutter_test.mocks.dart b/packages/webview_flutter/webview_flutter/test/legacy/webview_flutter_test.mocks.dart index 7a3c4d583a9..7954c2f769a 100644 --- a/packages/webview_flutter/webview_flutter/test/legacy/webview_flutter_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter/test/legacy/webview_flutter_test.mocks.dart @@ -37,7 +37,7 @@ import 'package:webview_flutter_platform_interface/src/legacy/types/types.dart' class _FakeWidget_0 extends _i1.SmartFake implements _i2.Widget { _FakeWidget_0(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); @override String toString({_i3.DiagnosticLevel? minLevel = _i3.DiagnosticLevel.info}) => @@ -57,38 +57,42 @@ class MockWebViewPlatform extends _i1.Mock implements _i4.WebViewPlatform { required _i2.BuildContext? context, required _i5.CreationParams? creationParams, required _i6.WebViewPlatformCallbacksHandler? - webViewPlatformCallbacksHandler, + webViewPlatformCallbacksHandler, required _i7.JavascriptChannelRegistry? javascriptChannelRegistry, _i4.WebViewPlatformCreatedCallback? onWebViewPlatformCreated, Set<_i3.Factory<_i8.OneSequenceGestureRecognizer>>? gestureRecognizers, }) => (super.noSuchMethod( - Invocation.method(#build, [], { - #context: context, - #creationParams: creationParams, - #webViewPlatformCallbacksHandler: webViewPlatformCallbacksHandler, - #javascriptChannelRegistry: javascriptChannelRegistry, - #onWebViewPlatformCreated: onWebViewPlatformCreated, - #gestureRecognizers: gestureRecognizers, - }), - returnValue: _FakeWidget_0( - this, - Invocation.method(#build, [], { - #context: context, - #creationParams: creationParams, - #webViewPlatformCallbacksHandler: webViewPlatformCallbacksHandler, - #javascriptChannelRegistry: javascriptChannelRegistry, - #onWebViewPlatformCreated: onWebViewPlatformCreated, - #gestureRecognizers: gestureRecognizers, - }), - ), - ) as _i2.Widget); + Invocation.method(#build, [], { + #context: context, + #creationParams: creationParams, + #webViewPlatformCallbacksHandler: webViewPlatformCallbacksHandler, + #javascriptChannelRegistry: javascriptChannelRegistry, + #onWebViewPlatformCreated: onWebViewPlatformCreated, + #gestureRecognizers: gestureRecognizers, + }), + returnValue: _FakeWidget_0( + this, + Invocation.method(#build, [], { + #context: context, + #creationParams: creationParams, + #webViewPlatformCallbacksHandler: + webViewPlatformCallbacksHandler, + #javascriptChannelRegistry: javascriptChannelRegistry, + #onWebViewPlatformCreated: onWebViewPlatformCreated, + #gestureRecognizers: gestureRecognizers, + }), + ), + ) + as _i2.Widget); @override - _i9.Future clearCookies() => (super.noSuchMethod( - Invocation.method(#clearCookies, []), - returnValue: _i9.Future.value(false), - ) as _i9.Future); + _i9.Future clearCookies() => + (super.noSuchMethod( + Invocation.method(#clearCookies, []), + returnValue: _i9.Future.value(false), + ) + as _i9.Future); } /// A class which mocks [WebViewPlatformController]. @@ -101,177 +105,215 @@ class MockWebViewPlatformController extends _i1.Mock } @override - _i9.Future loadFile(String? absoluteFilePath) => (super.noSuchMethod( - Invocation.method(#loadFile, [absoluteFilePath]), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + _i9.Future loadFile(String? absoluteFilePath) => + (super.noSuchMethod( + Invocation.method(#loadFile, [absoluteFilePath]), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) + as _i9.Future); @override - _i9.Future loadFlutterAsset(String? key) => (super.noSuchMethod( - Invocation.method(#loadFlutterAsset, [key]), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + _i9.Future loadFlutterAsset(String? key) => + (super.noSuchMethod( + Invocation.method(#loadFlutterAsset, [key]), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) + as _i9.Future); @override _i9.Future loadHtmlString(String? html, {String? baseUrl}) => (super.noSuchMethod( - Invocation.method(#loadHtmlString, [html], {#baseUrl: baseUrl}), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + Invocation.method(#loadHtmlString, [html], {#baseUrl: baseUrl}), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) + as _i9.Future); @override _i9.Future loadUrl(String? url, Map? headers) => (super.noSuchMethod( - Invocation.method(#loadUrl, [url, headers]), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + Invocation.method(#loadUrl, [url, headers]), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) + as _i9.Future); @override _i9.Future loadRequest(_i5.WebViewRequest? request) => (super.noSuchMethod( - Invocation.method(#loadRequest, [request]), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + Invocation.method(#loadRequest, [request]), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) + as _i9.Future); @override _i9.Future updateSettings(_i5.WebSettings? setting) => (super.noSuchMethod( - Invocation.method(#updateSettings, [setting]), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + Invocation.method(#updateSettings, [setting]), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) + as _i9.Future); @override - _i9.Future currentUrl() => (super.noSuchMethod( - Invocation.method(#currentUrl, []), - returnValue: _i9.Future.value(), - ) as _i9.Future); + _i9.Future currentUrl() => + (super.noSuchMethod( + Invocation.method(#currentUrl, []), + returnValue: _i9.Future.value(), + ) + as _i9.Future); @override - _i9.Future canGoBack() => (super.noSuchMethod( - Invocation.method(#canGoBack, []), - returnValue: _i9.Future.value(false), - ) as _i9.Future); + _i9.Future canGoBack() => + (super.noSuchMethod( + Invocation.method(#canGoBack, []), + returnValue: _i9.Future.value(false), + ) + as _i9.Future); @override - _i9.Future canGoForward() => (super.noSuchMethod( - Invocation.method(#canGoForward, []), - returnValue: _i9.Future.value(false), - ) as _i9.Future); + _i9.Future canGoForward() => + (super.noSuchMethod( + Invocation.method(#canGoForward, []), + returnValue: _i9.Future.value(false), + ) + as _i9.Future); @override - _i9.Future goBack() => (super.noSuchMethod( - Invocation.method(#goBack, []), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + _i9.Future goBack() => + (super.noSuchMethod( + Invocation.method(#goBack, []), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) + as _i9.Future); @override - _i9.Future goForward() => (super.noSuchMethod( - Invocation.method(#goForward, []), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + _i9.Future goForward() => + (super.noSuchMethod( + Invocation.method(#goForward, []), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) + as _i9.Future); @override - _i9.Future reload() => (super.noSuchMethod( - Invocation.method(#reload, []), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + _i9.Future reload() => + (super.noSuchMethod( + Invocation.method(#reload, []), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) + as _i9.Future); @override - _i9.Future clearCache() => (super.noSuchMethod( - Invocation.method(#clearCache, []), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + _i9.Future clearCache() => + (super.noSuchMethod( + Invocation.method(#clearCache, []), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) + as _i9.Future); @override _i9.Future evaluateJavascript(String? javascript) => (super.noSuchMethod( - Invocation.method(#evaluateJavascript, [javascript]), - returnValue: _i9.Future.value( - _i11.dummyValue( - this, Invocation.method(#evaluateJavascript, [javascript]), - ), - ), - ) as _i9.Future); + returnValue: _i9.Future.value( + _i11.dummyValue( + this, + Invocation.method(#evaluateJavascript, [javascript]), + ), + ), + ) + as _i9.Future); @override - _i9.Future runJavascript(String? javascript) => (super.noSuchMethod( - Invocation.method(#runJavascript, [javascript]), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + _i9.Future runJavascript(String? javascript) => + (super.noSuchMethod( + Invocation.method(#runJavascript, [javascript]), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) + as _i9.Future); @override _i9.Future runJavascriptReturningResult(String? javascript) => (super.noSuchMethod( - Invocation.method(#runJavascriptReturningResult, [javascript]), - returnValue: _i9.Future.value( - _i11.dummyValue( - this, Invocation.method(#runJavascriptReturningResult, [javascript]), - ), - ), - ) as _i9.Future); + returnValue: _i9.Future.value( + _i11.dummyValue( + this, + Invocation.method(#runJavascriptReturningResult, [javascript]), + ), + ), + ) + as _i9.Future); @override _i9.Future addJavascriptChannels(Set? javascriptChannelNames) => (super.noSuchMethod( - Invocation.method(#addJavascriptChannels, [javascriptChannelNames]), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + Invocation.method(#addJavascriptChannels, [javascriptChannelNames]), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) + as _i9.Future); @override _i9.Future removeJavascriptChannels( Set? javascriptChannelNames, ) => (super.noSuchMethod( - Invocation.method(#removeJavascriptChannels, [ - javascriptChannelNames, - ]), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + Invocation.method(#removeJavascriptChannels, [ + javascriptChannelNames, + ]), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) + as _i9.Future); @override - _i9.Future getTitle() => (super.noSuchMethod( - Invocation.method(#getTitle, []), - returnValue: _i9.Future.value(), - ) as _i9.Future); + _i9.Future getTitle() => + (super.noSuchMethod( + Invocation.method(#getTitle, []), + returnValue: _i9.Future.value(), + ) + as _i9.Future); @override - _i9.Future scrollTo(int? x, int? y) => (super.noSuchMethod( - Invocation.method(#scrollTo, [x, y]), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + _i9.Future scrollTo(int? x, int? y) => + (super.noSuchMethod( + Invocation.method(#scrollTo, [x, y]), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) + as _i9.Future); @override - _i9.Future scrollBy(int? x, int? y) => (super.noSuchMethod( - Invocation.method(#scrollBy, [x, y]), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + _i9.Future scrollBy(int? x, int? y) => + (super.noSuchMethod( + Invocation.method(#scrollBy, [x, y]), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) + as _i9.Future); @override - _i9.Future getScrollX() => (super.noSuchMethod( - Invocation.method(#getScrollX, []), - returnValue: _i9.Future.value(0), - ) as _i9.Future); + _i9.Future getScrollX() => + (super.noSuchMethod( + Invocation.method(#getScrollX, []), + returnValue: _i9.Future.value(0), + ) + as _i9.Future); @override - _i9.Future getScrollY() => (super.noSuchMethod( - Invocation.method(#getScrollY, []), - returnValue: _i9.Future.value(0), - ) as _i9.Future); + _i9.Future getScrollY() => + (super.noSuchMethod( + Invocation.method(#getScrollY, []), + returnValue: _i9.Future.value(0), + ) + as _i9.Future); } diff --git a/packages/webview_flutter/webview_flutter/test/navigation_delegate_test.mocks.dart b/packages/webview_flutter/webview_flutter/test/navigation_delegate_test.mocks.dart index 4b02c37ace2..f1e0a343bee 100644 --- a/packages/webview_flutter/webview_flutter/test/navigation_delegate_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter/test/navigation_delegate_test.mocks.dart @@ -43,19 +43,19 @@ class _FakePlatformWebViewCookieManager_0 extends _i1.SmartFake class _FakePlatformNavigationDelegate_1 extends _i1.SmartFake implements _i3.PlatformNavigationDelegate { _FakePlatformNavigationDelegate_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakePlatformWebViewController_2 extends _i1.SmartFake implements _i4.PlatformWebViewController { _FakePlatformWebViewController_2(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakePlatformWebViewWidget_3 extends _i1.SmartFake implements _i5.PlatformWebViewWidget { _FakePlatformWebViewWidget_3(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakePlatformNavigationDelegateCreationParams_4 extends _i1.SmartFake @@ -79,48 +79,52 @@ class MockWebViewPlatform extends _i1.Mock implements _i7.WebViewPlatform { _i6.PlatformWebViewCookieManagerCreationParams? params, ) => (super.noSuchMethod( - Invocation.method(#createPlatformCookieManager, [params]), - returnValue: _FakePlatformWebViewCookieManager_0( - this, - Invocation.method(#createPlatformCookieManager, [params]), - ), - ) as _i2.PlatformWebViewCookieManager); + Invocation.method(#createPlatformCookieManager, [params]), + returnValue: _FakePlatformWebViewCookieManager_0( + this, + Invocation.method(#createPlatformCookieManager, [params]), + ), + ) + as _i2.PlatformWebViewCookieManager); @override _i3.PlatformNavigationDelegate createPlatformNavigationDelegate( _i6.PlatformNavigationDelegateCreationParams? params, ) => (super.noSuchMethod( - Invocation.method(#createPlatformNavigationDelegate, [params]), - returnValue: _FakePlatformNavigationDelegate_1( - this, - Invocation.method(#createPlatformNavigationDelegate, [params]), - ), - ) as _i3.PlatformNavigationDelegate); + Invocation.method(#createPlatformNavigationDelegate, [params]), + returnValue: _FakePlatformNavigationDelegate_1( + this, + Invocation.method(#createPlatformNavigationDelegate, [params]), + ), + ) + as _i3.PlatformNavigationDelegate); @override _i4.PlatformWebViewController createPlatformWebViewController( _i6.PlatformWebViewControllerCreationParams? params, ) => (super.noSuchMethod( - Invocation.method(#createPlatformWebViewController, [params]), - returnValue: _FakePlatformWebViewController_2( - this, - Invocation.method(#createPlatformWebViewController, [params]), - ), - ) as _i4.PlatformWebViewController); + Invocation.method(#createPlatformWebViewController, [params]), + returnValue: _FakePlatformWebViewController_2( + this, + Invocation.method(#createPlatformWebViewController, [params]), + ), + ) + as _i4.PlatformWebViewController); @override _i5.PlatformWebViewWidget createPlatformWebViewWidget( _i6.PlatformWebViewWidgetCreationParams? params, ) => (super.noSuchMethod( - Invocation.method(#createPlatformWebViewWidget, [params]), - returnValue: _FakePlatformWebViewWidget_3( - this, - Invocation.method(#createPlatformWebViewWidget, [params]), - ), - ) as _i5.PlatformWebViewWidget); + Invocation.method(#createPlatformWebViewWidget, [params]), + returnValue: _FakePlatformWebViewWidget_3( + this, + Invocation.method(#createPlatformWebViewWidget, [params]), + ), + ) + as _i5.PlatformWebViewWidget); } /// A class which mocks [PlatformNavigationDelegate]. @@ -135,80 +139,89 @@ class MockPlatformNavigationDelegate extends _i1.Mock @override _i6.PlatformNavigationDelegateCreationParams get params => (super.noSuchMethod( - Invocation.getter(#params), - returnValue: _FakePlatformNavigationDelegateCreationParams_4( - this, - Invocation.getter(#params), - ), - ) as _i6.PlatformNavigationDelegateCreationParams); + Invocation.getter(#params), + returnValue: _FakePlatformNavigationDelegateCreationParams_4( + this, + Invocation.getter(#params), + ), + ) + as _i6.PlatformNavigationDelegateCreationParams); @override _i8.Future setOnNavigationRequest( _i3.NavigationRequestCallback? onNavigationRequest, ) => (super.noSuchMethod( - Invocation.method(#setOnNavigationRequest, [onNavigationRequest]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setOnNavigationRequest, [onNavigationRequest]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setOnPageStarted(_i3.PageEventCallback? onPageStarted) => (super.noSuchMethod( - Invocation.method(#setOnPageStarted, [onPageStarted]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setOnPageStarted, [onPageStarted]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setOnPageFinished(_i3.PageEventCallback? onPageFinished) => (super.noSuchMethod( - Invocation.method(#setOnPageFinished, [onPageFinished]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setOnPageFinished, [onPageFinished]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setOnHttpError(_i3.HttpResponseErrorCallback? onHttpError) => (super.noSuchMethod( - Invocation.method(#setOnHttpError, [onHttpError]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setOnHttpError, [onHttpError]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setOnProgress(_i3.ProgressCallback? onProgress) => (super.noSuchMethod( - Invocation.method(#setOnProgress, [onProgress]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setOnProgress, [onProgress]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setOnWebResourceError( _i3.WebResourceErrorCallback? onWebResourceError, ) => (super.noSuchMethod( - Invocation.method(#setOnWebResourceError, [onWebResourceError]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setOnWebResourceError, [onWebResourceError]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setOnUrlChange(_i3.UrlChangeCallback? onUrlChange) => (super.noSuchMethod( - Invocation.method(#setOnUrlChange, [onUrlChange]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setOnUrlChange, [onUrlChange]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); @override _i8.Future setOnHttpAuthRequest( _i3.HttpAuthRequestCallback? onHttpAuthRequest, ) => (super.noSuchMethod( - Invocation.method(#setOnHttpAuthRequest, [onHttpAuthRequest]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) as _i8.Future); + Invocation.method(#setOnHttpAuthRequest, [onHttpAuthRequest]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) + as _i8.Future); } diff --git a/packages/webview_flutter/webview_flutter/test/webview_controller_test.mocks.dart b/packages/webview_flutter/webview_flutter/test/webview_controller_test.mocks.dart index 85ae3dda803..e71ccc180f4 100644 --- a/packages/webview_flutter/webview_flutter/test/webview_controller_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter/test/webview_controller_test.mocks.dart @@ -37,12 +37,12 @@ class _FakePlatformWebViewControllerCreationParams_0 extends _i1.SmartFake class _FakeObject_1 extends _i1.SmartFake implements Object { _FakeObject_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeOffset_2 extends _i1.SmartFake implements _i3.Offset { _FakeOffset_2(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakePlatformNavigationDelegateCreationParams_3 extends _i1.SmartFake @@ -63,311 +63,361 @@ class MockPlatformWebViewController extends _i1.Mock } @override - _i2.PlatformWebViewControllerCreationParams get params => (super.noSuchMethod( - Invocation.getter(#params), - returnValue: _FakePlatformWebViewControllerCreationParams_0( - this, - Invocation.getter(#params), - ), - ) as _i2.PlatformWebViewControllerCreationParams); + _i2.PlatformWebViewControllerCreationParams get params => + (super.noSuchMethod( + Invocation.getter(#params), + returnValue: _FakePlatformWebViewControllerCreationParams_0( + this, + Invocation.getter(#params), + ), + ) + as _i2.PlatformWebViewControllerCreationParams); @override - _i5.Future loadFile(String? absoluteFilePath) => (super.noSuchMethod( - Invocation.method(#loadFile, [absoluteFilePath]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future loadFile(String? absoluteFilePath) => + (super.noSuchMethod( + Invocation.method(#loadFile, [absoluteFilePath]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future loadFlutterAsset(String? key) => (super.noSuchMethod( - Invocation.method(#loadFlutterAsset, [key]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future loadFlutterAsset(String? key) => + (super.noSuchMethod( + Invocation.method(#loadFlutterAsset, [key]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future loadHtmlString(String? html, {String? baseUrl}) => (super.noSuchMethod( - Invocation.method(#loadHtmlString, [html], {#baseUrl: baseUrl}), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#loadHtmlString, [html], {#baseUrl: baseUrl}), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future loadRequest(_i2.LoadRequestParams? params) => (super.noSuchMethod( - Invocation.method(#loadRequest, [params]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#loadRequest, [params]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future currentUrl() => (super.noSuchMethod( - Invocation.method(#currentUrl, []), - returnValue: _i5.Future.value(), - ) as _i5.Future); + _i5.Future currentUrl() => + (super.noSuchMethod( + Invocation.method(#currentUrl, []), + returnValue: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future canGoBack() => (super.noSuchMethod( - Invocation.method(#canGoBack, []), - returnValue: _i5.Future.value(false), - ) as _i5.Future); + _i5.Future canGoBack() => + (super.noSuchMethod( + Invocation.method(#canGoBack, []), + returnValue: _i5.Future.value(false), + ) + as _i5.Future); @override - _i5.Future canGoForward() => (super.noSuchMethod( - Invocation.method(#canGoForward, []), - returnValue: _i5.Future.value(false), - ) as _i5.Future); + _i5.Future canGoForward() => + (super.noSuchMethod( + Invocation.method(#canGoForward, []), + returnValue: _i5.Future.value(false), + ) + as _i5.Future); @override - _i5.Future goBack() => (super.noSuchMethod( - Invocation.method(#goBack, []), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future goBack() => + (super.noSuchMethod( + Invocation.method(#goBack, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future goForward() => (super.noSuchMethod( - Invocation.method(#goForward, []), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future goForward() => + (super.noSuchMethod( + Invocation.method(#goForward, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future reload() => (super.noSuchMethod( - Invocation.method(#reload, []), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future reload() => + (super.noSuchMethod( + Invocation.method(#reload, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future clearCache() => (super.noSuchMethod( - Invocation.method(#clearCache, []), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future clearCache() => + (super.noSuchMethod( + Invocation.method(#clearCache, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future clearLocalStorage() => (super.noSuchMethod( - Invocation.method(#clearLocalStorage, []), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future clearLocalStorage() => + (super.noSuchMethod( + Invocation.method(#clearLocalStorage, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setPlatformNavigationDelegate( _i6.PlatformNavigationDelegate? handler, ) => (super.noSuchMethod( - Invocation.method(#setPlatformNavigationDelegate, [handler]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setPlatformNavigationDelegate, [handler]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future runJavaScript(String? javaScript) => (super.noSuchMethod( - Invocation.method(#runJavaScript, [javaScript]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future runJavaScript(String? javaScript) => + (super.noSuchMethod( + Invocation.method(#runJavaScript, [javaScript]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future runJavaScriptReturningResult(String? javaScript) => (super.noSuchMethod( - Invocation.method(#runJavaScriptReturningResult, [javaScript]), - returnValue: _i5.Future.value( - _FakeObject_1( - this, Invocation.method(#runJavaScriptReturningResult, [javaScript]), - ), - ), - ) as _i5.Future); + returnValue: _i5.Future.value( + _FakeObject_1( + this, + Invocation.method(#runJavaScriptReturningResult, [javaScript]), + ), + ), + ) + as _i5.Future); @override _i5.Future addJavaScriptChannel( _i4.JavaScriptChannelParams? javaScriptChannelParams, ) => (super.noSuchMethod( - Invocation.method(#addJavaScriptChannel, [javaScriptChannelParams]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#addJavaScriptChannel, [javaScriptChannelParams]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future removeJavaScriptChannel(String? javaScriptChannelName) => (super.noSuchMethod( - Invocation.method(#removeJavaScriptChannel, [ - javaScriptChannelName, - ]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#removeJavaScriptChannel, [ + javaScriptChannelName, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future getTitle() => (super.noSuchMethod( - Invocation.method(#getTitle, []), - returnValue: _i5.Future.value(), - ) as _i5.Future); + _i5.Future getTitle() => + (super.noSuchMethod( + Invocation.method(#getTitle, []), + returnValue: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future scrollTo(int? x, int? y) => (super.noSuchMethod( - Invocation.method(#scrollTo, [x, y]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future scrollTo(int? x, int? y) => + (super.noSuchMethod( + Invocation.method(#scrollTo, [x, y]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future scrollBy(int? x, int? y) => (super.noSuchMethod( - Invocation.method(#scrollBy, [x, y]), -<<<<<<< HEAD - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future scrollBy(int? x, int? y) => + (super.noSuchMethod( + Invocation.method(#scrollBy, [x, y]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setVerticalScrollBarEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setVerticalScrollBarEnabled, [enabled]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setVerticalScrollBarEnabled, [enabled]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setHorizontalScrollBarEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setHorizontalScrollBarEnabled, [enabled]), -======= ->>>>>>> bfb42a62a56ee53010e7c2601cbf1bac993122f2 - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setHorizontalScrollBarEnabled, [enabled]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future<_i3.Offset> getScrollPosition() => (super.noSuchMethod( - Invocation.method(#getScrollPosition, []), - returnValue: _i5.Future<_i3.Offset>.value( - _FakeOffset_2(this, Invocation.method(#getScrollPosition, [])), - ), - ) as _i5.Future<_i3.Offset>); + _i5.Future<_i3.Offset> getScrollPosition() => + (super.noSuchMethod( + Invocation.method(#getScrollPosition, []), + returnValue: _i5.Future<_i3.Offset>.value( + _FakeOffset_2(this, Invocation.method(#getScrollPosition, [])), + ), + ) + as _i5.Future<_i3.Offset>); @override - _i5.Future enableZoom(bool? enabled) => (super.noSuchMethod( - Invocation.method(#enableZoom, [enabled]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future enableZoom(bool? enabled) => + (super.noSuchMethod( + Invocation.method(#enableZoom, [enabled]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future setBackgroundColor(_i3.Color? color) => (super.noSuchMethod( - Invocation.method(#setBackgroundColor, [color]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future setBackgroundColor(_i3.Color? color) => + (super.noSuchMethod( + Invocation.method(#setBackgroundColor, [color]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setJavaScriptMode(_i2.JavaScriptMode? javaScriptMode) => (super.noSuchMethod( - Invocation.method(#setJavaScriptMode, [javaScriptMode]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setJavaScriptMode, [javaScriptMode]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future setUserAgent(String? userAgent) => (super.noSuchMethod( - Invocation.method(#setUserAgent, [userAgent]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future setUserAgent(String? userAgent) => + (super.noSuchMethod( + Invocation.method(#setUserAgent, [userAgent]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setOnPlatformPermissionRequest( void Function(_i2.PlatformWebViewPermissionRequest)? onPermissionRequest, ) => (super.noSuchMethod( - Invocation.method(#setOnPlatformPermissionRequest, [ - onPermissionRequest, - ]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setOnPlatformPermissionRequest, [ + onPermissionRequest, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future getUserAgent() => (super.noSuchMethod( - Invocation.method(#getUserAgent, []), - returnValue: _i5.Future.value(), - ) as _i5.Future); + _i5.Future getUserAgent() => + (super.noSuchMethod( + Invocation.method(#getUserAgent, []), + returnValue: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setOnConsoleMessage( void Function(_i2.JavaScriptConsoleMessage)? onConsoleMessage, ) => (super.noSuchMethod( - Invocation.method(#setOnConsoleMessage, [onConsoleMessage]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setOnConsoleMessage, [onConsoleMessage]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setOnScrollPositionChange( void Function(_i2.ScrollPositionChange)? onScrollPositionChange, ) => (super.noSuchMethod( - Invocation.method(#setOnScrollPositionChange, [ - onScrollPositionChange, - ]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setOnScrollPositionChange, [ + onScrollPositionChange, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setOnJavaScriptAlertDialog( _i5.Future Function(_i2.JavaScriptAlertDialogRequest)? - onJavaScriptAlertDialog, + onJavaScriptAlertDialog, ) => (super.noSuchMethod( - Invocation.method(#setOnJavaScriptAlertDialog, [ - onJavaScriptAlertDialog, - ]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setOnJavaScriptAlertDialog, [ + onJavaScriptAlertDialog, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setOnJavaScriptConfirmDialog( _i5.Future Function(_i2.JavaScriptConfirmDialogRequest)? - onJavaScriptConfirmDialog, + onJavaScriptConfirmDialog, ) => (super.noSuchMethod( - Invocation.method(#setOnJavaScriptConfirmDialog, [ - onJavaScriptConfirmDialog, - ]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setOnJavaScriptConfirmDialog, [ + onJavaScriptConfirmDialog, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setOnJavaScriptTextInputDialog( _i5.Future Function(_i2.JavaScriptTextInputDialogRequest)? - onJavaScriptTextInputDialog, + onJavaScriptTextInputDialog, ) => (super.noSuchMethod( - Invocation.method(#setOnJavaScriptTextInputDialog, [ - onJavaScriptTextInputDialog, - ]), -<<<<<<< HEAD -======= - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setOnJavaScriptTextInputDialog, [ + onJavaScriptTextInputDialog, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setOverScrollMode(_i2.WebViewOverScrollMode? mode) => (super.noSuchMethod( - Invocation.method(#setOverScrollMode, [mode]), ->>>>>>> bfb42a62a56ee53010e7c2601cbf1bac993122f2 - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setOverScrollMode, [mode]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); } /// A class which mocks [PlatformNavigationDelegate]. @@ -382,80 +432,89 @@ class MockPlatformNavigationDelegate extends _i1.Mock @override _i2.PlatformNavigationDelegateCreationParams get params => (super.noSuchMethod( - Invocation.getter(#params), - returnValue: _FakePlatformNavigationDelegateCreationParams_3( - this, - Invocation.getter(#params), - ), - ) as _i2.PlatformNavigationDelegateCreationParams); + Invocation.getter(#params), + returnValue: _FakePlatformNavigationDelegateCreationParams_3( + this, + Invocation.getter(#params), + ), + ) + as _i2.PlatformNavigationDelegateCreationParams); @override _i5.Future setOnNavigationRequest( _i6.NavigationRequestCallback? onNavigationRequest, ) => (super.noSuchMethod( - Invocation.method(#setOnNavigationRequest, [onNavigationRequest]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setOnNavigationRequest, [onNavigationRequest]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setOnPageStarted(_i6.PageEventCallback? onPageStarted) => (super.noSuchMethod( - Invocation.method(#setOnPageStarted, [onPageStarted]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setOnPageStarted, [onPageStarted]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setOnPageFinished(_i6.PageEventCallback? onPageFinished) => (super.noSuchMethod( - Invocation.method(#setOnPageFinished, [onPageFinished]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setOnPageFinished, [onPageFinished]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setOnHttpError(_i6.HttpResponseErrorCallback? onHttpError) => (super.noSuchMethod( - Invocation.method(#setOnHttpError, [onHttpError]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setOnHttpError, [onHttpError]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setOnProgress(_i6.ProgressCallback? onProgress) => (super.noSuchMethod( - Invocation.method(#setOnProgress, [onProgress]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setOnProgress, [onProgress]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setOnWebResourceError( _i6.WebResourceErrorCallback? onWebResourceError, ) => (super.noSuchMethod( - Invocation.method(#setOnWebResourceError, [onWebResourceError]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setOnWebResourceError, [onWebResourceError]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setOnUrlChange(_i6.UrlChangeCallback? onUrlChange) => (super.noSuchMethod( - Invocation.method(#setOnUrlChange, [onUrlChange]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setOnUrlChange, [onUrlChange]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setOnHttpAuthRequest( _i6.HttpAuthRequestCallback? onHttpAuthRequest, ) => (super.noSuchMethod( - Invocation.method(#setOnHttpAuthRequest, [onHttpAuthRequest]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setOnHttpAuthRequest, [onHttpAuthRequest]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); } diff --git a/packages/webview_flutter/webview_flutter/test/webview_cookie_manager_test.mocks.dart b/packages/webview_flutter/webview_flutter/test/webview_cookie_manager_test.mocks.dart index 31b11889cb7..c40d739926a 100644 --- a/packages/webview_flutter/webview_flutter/test/webview_cookie_manager_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter/test/webview_cookie_manager_test.mocks.dart @@ -44,23 +44,28 @@ class MockPlatformWebViewCookieManager extends _i1.Mock @override _i2.PlatformWebViewCookieManagerCreationParams get params => (super.noSuchMethod( - Invocation.getter(#params), - returnValue: _FakePlatformWebViewCookieManagerCreationParams_0( - this, - Invocation.getter(#params), - ), - ) as _i2.PlatformWebViewCookieManagerCreationParams); + Invocation.getter(#params), + returnValue: _FakePlatformWebViewCookieManagerCreationParams_0( + this, + Invocation.getter(#params), + ), + ) + as _i2.PlatformWebViewCookieManagerCreationParams); @override - _i4.Future clearCookies() => (super.noSuchMethod( - Invocation.method(#clearCookies, []), - returnValue: _i4.Future.value(false), - ) as _i4.Future); + _i4.Future clearCookies() => + (super.noSuchMethod( + Invocation.method(#clearCookies, []), + returnValue: _i4.Future.value(false), + ) + as _i4.Future); @override - _i4.Future setCookie(_i2.WebViewCookie? cookie) => (super.noSuchMethod( - Invocation.method(#setCookie, [cookie]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + _i4.Future setCookie(_i2.WebViewCookie? cookie) => + (super.noSuchMethod( + Invocation.method(#setCookie, [cookie]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) + as _i4.Future); } diff --git a/packages/webview_flutter/webview_flutter/test/webview_widget_test.mocks.dart b/packages/webview_flutter/webview_flutter/test/webview_widget_test.mocks.dart index 80d6d07a4a7..e84002fdee1 100644 --- a/packages/webview_flutter/webview_flutter/test/webview_widget_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter/test/webview_widget_test.mocks.dart @@ -41,12 +41,12 @@ class _FakePlatformWebViewControllerCreationParams_0 extends _i1.SmartFake class _FakeObject_1 extends _i1.SmartFake implements Object { _FakeObject_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeOffset_2 extends _i1.SmartFake implements _i3.Offset { _FakeOffset_2(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakePlatformWebViewWidgetCreationParams_3 extends _i1.SmartFake @@ -59,7 +59,7 @@ class _FakePlatformWebViewWidgetCreationParams_3 extends _i1.SmartFake class _FakeWidget_4 extends _i1.SmartFake implements _i4.Widget { _FakeWidget_4(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); @override String toString({_i5.DiagnosticLevel? minLevel = _i5.DiagnosticLevel.info}) => @@ -76,311 +76,361 @@ class MockPlatformWebViewController extends _i1.Mock } @override - _i2.PlatformWebViewControllerCreationParams get params => (super.noSuchMethod( - Invocation.getter(#params), - returnValue: _FakePlatformWebViewControllerCreationParams_0( - this, - Invocation.getter(#params), - ), - ) as _i2.PlatformWebViewControllerCreationParams); + _i2.PlatformWebViewControllerCreationParams get params => + (super.noSuchMethod( + Invocation.getter(#params), + returnValue: _FakePlatformWebViewControllerCreationParams_0( + this, + Invocation.getter(#params), + ), + ) + as _i2.PlatformWebViewControllerCreationParams); @override - _i7.Future loadFile(String? absoluteFilePath) => (super.noSuchMethod( - Invocation.method(#loadFile, [absoluteFilePath]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); + _i7.Future loadFile(String? absoluteFilePath) => + (super.noSuchMethod( + Invocation.method(#loadFile, [absoluteFilePath]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); @override - _i7.Future loadFlutterAsset(String? key) => (super.noSuchMethod( - Invocation.method(#loadFlutterAsset, [key]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); + _i7.Future loadFlutterAsset(String? key) => + (super.noSuchMethod( + Invocation.method(#loadFlutterAsset, [key]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); @override _i7.Future loadHtmlString(String? html, {String? baseUrl}) => (super.noSuchMethod( - Invocation.method(#loadHtmlString, [html], {#baseUrl: baseUrl}), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); + Invocation.method(#loadHtmlString, [html], {#baseUrl: baseUrl}), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); @override _i7.Future loadRequest(_i2.LoadRequestParams? params) => (super.noSuchMethod( - Invocation.method(#loadRequest, [params]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); + Invocation.method(#loadRequest, [params]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); @override - _i7.Future currentUrl() => (super.noSuchMethod( - Invocation.method(#currentUrl, []), - returnValue: _i7.Future.value(), - ) as _i7.Future); + _i7.Future currentUrl() => + (super.noSuchMethod( + Invocation.method(#currentUrl, []), + returnValue: _i7.Future.value(), + ) + as _i7.Future); @override - _i7.Future canGoBack() => (super.noSuchMethod( - Invocation.method(#canGoBack, []), - returnValue: _i7.Future.value(false), - ) as _i7.Future); + _i7.Future canGoBack() => + (super.noSuchMethod( + Invocation.method(#canGoBack, []), + returnValue: _i7.Future.value(false), + ) + as _i7.Future); @override - _i7.Future canGoForward() => (super.noSuchMethod( - Invocation.method(#canGoForward, []), - returnValue: _i7.Future.value(false), - ) as _i7.Future); + _i7.Future canGoForward() => + (super.noSuchMethod( + Invocation.method(#canGoForward, []), + returnValue: _i7.Future.value(false), + ) + as _i7.Future); @override - _i7.Future goBack() => (super.noSuchMethod( - Invocation.method(#goBack, []), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); + _i7.Future goBack() => + (super.noSuchMethod( + Invocation.method(#goBack, []), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); @override - _i7.Future goForward() => (super.noSuchMethod( - Invocation.method(#goForward, []), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); + _i7.Future goForward() => + (super.noSuchMethod( + Invocation.method(#goForward, []), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); @override - _i7.Future reload() => (super.noSuchMethod( - Invocation.method(#reload, []), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); + _i7.Future reload() => + (super.noSuchMethod( + Invocation.method(#reload, []), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); @override - _i7.Future clearCache() => (super.noSuchMethod( - Invocation.method(#clearCache, []), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); + _i7.Future clearCache() => + (super.noSuchMethod( + Invocation.method(#clearCache, []), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); @override - _i7.Future clearLocalStorage() => (super.noSuchMethod( - Invocation.method(#clearLocalStorage, []), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); + _i7.Future clearLocalStorage() => + (super.noSuchMethod( + Invocation.method(#clearLocalStorage, []), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); @override _i7.Future setPlatformNavigationDelegate( _i8.PlatformNavigationDelegate? handler, ) => (super.noSuchMethod( - Invocation.method(#setPlatformNavigationDelegate, [handler]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); + Invocation.method(#setPlatformNavigationDelegate, [handler]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); @override - _i7.Future runJavaScript(String? javaScript) => (super.noSuchMethod( - Invocation.method(#runJavaScript, [javaScript]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); + _i7.Future runJavaScript(String? javaScript) => + (super.noSuchMethod( + Invocation.method(#runJavaScript, [javaScript]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); @override _i7.Future runJavaScriptReturningResult(String? javaScript) => (super.noSuchMethod( - Invocation.method(#runJavaScriptReturningResult, [javaScript]), - returnValue: _i7.Future.value( - _FakeObject_1( - this, Invocation.method(#runJavaScriptReturningResult, [javaScript]), - ), - ), - ) as _i7.Future); + returnValue: _i7.Future.value( + _FakeObject_1( + this, + Invocation.method(#runJavaScriptReturningResult, [javaScript]), + ), + ), + ) + as _i7.Future); @override _i7.Future addJavaScriptChannel( _i6.JavaScriptChannelParams? javaScriptChannelParams, ) => (super.noSuchMethod( - Invocation.method(#addJavaScriptChannel, [javaScriptChannelParams]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); + Invocation.method(#addJavaScriptChannel, [javaScriptChannelParams]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); @override _i7.Future removeJavaScriptChannel(String? javaScriptChannelName) => (super.noSuchMethod( - Invocation.method(#removeJavaScriptChannel, [ - javaScriptChannelName, - ]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); + Invocation.method(#removeJavaScriptChannel, [ + javaScriptChannelName, + ]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); @override - _i7.Future getTitle() => (super.noSuchMethod( - Invocation.method(#getTitle, []), - returnValue: _i7.Future.value(), - ) as _i7.Future); + _i7.Future getTitle() => + (super.noSuchMethod( + Invocation.method(#getTitle, []), + returnValue: _i7.Future.value(), + ) + as _i7.Future); @override - _i7.Future scrollTo(int? x, int? y) => (super.noSuchMethod( - Invocation.method(#scrollTo, [x, y]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); + _i7.Future scrollTo(int? x, int? y) => + (super.noSuchMethod( + Invocation.method(#scrollTo, [x, y]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); @override - _i7.Future scrollBy(int? x, int? y) => (super.noSuchMethod( - Invocation.method(#scrollBy, [x, y]), -<<<<<<< HEAD - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); + _i7.Future scrollBy(int? x, int? y) => + (super.noSuchMethod( + Invocation.method(#scrollBy, [x, y]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); @override _i7.Future setVerticalScrollBarEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setVerticalScrollBarEnabled, [enabled]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); + Invocation.method(#setVerticalScrollBarEnabled, [enabled]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); @override _i7.Future setHorizontalScrollBarEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setHorizontalScrollBarEnabled, [enabled]), -======= ->>>>>>> bfb42a62a56ee53010e7c2601cbf1bac993122f2 - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); + Invocation.method(#setHorizontalScrollBarEnabled, [enabled]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); @override - _i7.Future<_i3.Offset> getScrollPosition() => (super.noSuchMethod( - Invocation.method(#getScrollPosition, []), - returnValue: _i7.Future<_i3.Offset>.value( - _FakeOffset_2(this, Invocation.method(#getScrollPosition, [])), - ), - ) as _i7.Future<_i3.Offset>); + _i7.Future<_i3.Offset> getScrollPosition() => + (super.noSuchMethod( + Invocation.method(#getScrollPosition, []), + returnValue: _i7.Future<_i3.Offset>.value( + _FakeOffset_2(this, Invocation.method(#getScrollPosition, [])), + ), + ) + as _i7.Future<_i3.Offset>); @override - _i7.Future enableZoom(bool? enabled) => (super.noSuchMethod( - Invocation.method(#enableZoom, [enabled]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); + _i7.Future enableZoom(bool? enabled) => + (super.noSuchMethod( + Invocation.method(#enableZoom, [enabled]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); @override - _i7.Future setBackgroundColor(_i3.Color? color) => (super.noSuchMethod( - Invocation.method(#setBackgroundColor, [color]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); + _i7.Future setBackgroundColor(_i3.Color? color) => + (super.noSuchMethod( + Invocation.method(#setBackgroundColor, [color]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); @override _i7.Future setJavaScriptMode(_i2.JavaScriptMode? javaScriptMode) => (super.noSuchMethod( - Invocation.method(#setJavaScriptMode, [javaScriptMode]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); + Invocation.method(#setJavaScriptMode, [javaScriptMode]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); @override - _i7.Future setUserAgent(String? userAgent) => (super.noSuchMethod( - Invocation.method(#setUserAgent, [userAgent]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); + _i7.Future setUserAgent(String? userAgent) => + (super.noSuchMethod( + Invocation.method(#setUserAgent, [userAgent]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); @override _i7.Future setOnPlatformPermissionRequest( void Function(_i2.PlatformWebViewPermissionRequest)? onPermissionRequest, ) => (super.noSuchMethod( - Invocation.method(#setOnPlatformPermissionRequest, [ - onPermissionRequest, - ]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); + Invocation.method(#setOnPlatformPermissionRequest, [ + onPermissionRequest, + ]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); @override - _i7.Future getUserAgent() => (super.noSuchMethod( - Invocation.method(#getUserAgent, []), - returnValue: _i7.Future.value(), - ) as _i7.Future); + _i7.Future getUserAgent() => + (super.noSuchMethod( + Invocation.method(#getUserAgent, []), + returnValue: _i7.Future.value(), + ) + as _i7.Future); @override _i7.Future setOnConsoleMessage( void Function(_i2.JavaScriptConsoleMessage)? onConsoleMessage, ) => (super.noSuchMethod( - Invocation.method(#setOnConsoleMessage, [onConsoleMessage]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); + Invocation.method(#setOnConsoleMessage, [onConsoleMessage]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); @override _i7.Future setOnScrollPositionChange( void Function(_i2.ScrollPositionChange)? onScrollPositionChange, ) => (super.noSuchMethod( - Invocation.method(#setOnScrollPositionChange, [ - onScrollPositionChange, - ]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); + Invocation.method(#setOnScrollPositionChange, [ + onScrollPositionChange, + ]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); @override _i7.Future setOnJavaScriptAlertDialog( _i7.Future Function(_i2.JavaScriptAlertDialogRequest)? - onJavaScriptAlertDialog, + onJavaScriptAlertDialog, ) => (super.noSuchMethod( - Invocation.method(#setOnJavaScriptAlertDialog, [ - onJavaScriptAlertDialog, - ]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); + Invocation.method(#setOnJavaScriptAlertDialog, [ + onJavaScriptAlertDialog, + ]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); @override _i7.Future setOnJavaScriptConfirmDialog( _i7.Future Function(_i2.JavaScriptConfirmDialogRequest)? - onJavaScriptConfirmDialog, + onJavaScriptConfirmDialog, ) => (super.noSuchMethod( - Invocation.method(#setOnJavaScriptConfirmDialog, [ - onJavaScriptConfirmDialog, - ]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); + Invocation.method(#setOnJavaScriptConfirmDialog, [ + onJavaScriptConfirmDialog, + ]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); @override _i7.Future setOnJavaScriptTextInputDialog( _i7.Future Function(_i2.JavaScriptTextInputDialogRequest)? - onJavaScriptTextInputDialog, + onJavaScriptTextInputDialog, ) => (super.noSuchMethod( - Invocation.method(#setOnJavaScriptTextInputDialog, [ - onJavaScriptTextInputDialog, - ]), -<<<<<<< HEAD -======= - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); + Invocation.method(#setOnJavaScriptTextInputDialog, [ + onJavaScriptTextInputDialog, + ]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); @override _i7.Future setOverScrollMode(_i2.WebViewOverScrollMode? mode) => (super.noSuchMethod( - Invocation.method(#setOverScrollMode, [mode]), ->>>>>>> bfb42a62a56ee53010e7c2601cbf1bac993122f2 - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); + Invocation.method(#setOverScrollMode, [mode]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) + as _i7.Future); } /// A class which mocks [PlatformWebViewWidget]. @@ -393,20 +443,24 @@ class MockPlatformWebViewWidget extends _i1.Mock } @override - _i2.PlatformWebViewWidgetCreationParams get params => (super.noSuchMethod( - Invocation.getter(#params), - returnValue: _FakePlatformWebViewWidgetCreationParams_3( - this, - Invocation.getter(#params), - ), - ) as _i2.PlatformWebViewWidgetCreationParams); + _i2.PlatformWebViewWidgetCreationParams get params => + (super.noSuchMethod( + Invocation.getter(#params), + returnValue: _FakePlatformWebViewWidgetCreationParams_3( + this, + Invocation.getter(#params), + ), + ) + as _i2.PlatformWebViewWidgetCreationParams); @override - _i4.Widget build(_i4.BuildContext? context) => (super.noSuchMethod( - Invocation.method(#build, [context]), - returnValue: _FakeWidget_4( - this, - Invocation.method(#build, [context]), - ), - ) as _i4.Widget); + _i4.Widget build(_i4.BuildContext? context) => + (super.noSuchMethod( + Invocation.method(#build, [context]), + returnValue: _FakeWidget_4( + this, + Invocation.method(#build, [context]), + ), + ) + as _i4.Widget); } From 0f1461e1955ac1729f1964726f14681a2c113ae7 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Mon, 21 Apr 2025 14:45:26 -0400 Subject: [PATCH 17/29] add destory method --- .../flutter/plugins/webviewflutter/AndroidWebkitLibrary.g.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/AndroidWebkitLibrary.g.kt b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/AndroidWebkitLibrary.g.kt index 227a64ef44b..d0c8781c047 100644 --- a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/AndroidWebkitLibrary.g.kt +++ b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/AndroidWebkitLibrary.g.kt @@ -127,6 +127,10 @@ class AndroidWebkitLibraryPigeonInstanceManager(private val finalizationListener */ fun remove(identifier: Long): T? { logWarningIfFinalizationListenerHasStopped() + val instance: Any? = getInstance(identifier) + if (instance is WebViewProxyApi.WebViewPlatformView) { + instance.destroy() + } return strongInstances.remove(identifier) as T? } From a6b62868798c6b350ac815510fa0dda6a2c8e6a2 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Mon, 21 Apr 2025 14:46:44 -0400 Subject: [PATCH 18/29] formatting --- .../legacy/webview_flutter_test.mocks.dart | 312 +- .../test/navigation_delegate_test.mocks.dart | 143 +- .../test/webview_controller_test.mocks.dart | 505 +- .../webview_cookie_manager_test.mocks.dart | 35 +- .../test/webview_widget_test.mocks.dart | 454 +- .../webviewflutter/AndroidWebkitLibrary.g.kt | 3994 ++++++++----- .../lib/src/android_webkit.g.dart | 208 +- ...ndroid_navigation_delegate_test.mocks.dart | 124 +- ...android_webview_controller_test.mocks.dart | 3827 ++++++------- ...oid_webview_cookie_manager_test.mocks.dart | 585 +- ...iew_android_cookie_manager_test.mocks.dart | 67 +- .../webview_android_widget_test.mocks.dart | 1215 ++-- .../WebKitLibrary.g.swift | 4956 ++++++++++------- .../lib/src/common/web_kit.g.dart | 322 +- .../web_kit_cookie_manager_test.mocks.dart | 163 +- .../web_kit_webview_widget_test.mocks.dart | 1819 +++--- ...webkit_navigation_delegate_test.mocks.dart | 257 +- .../webkit_webview_controller_test.mocks.dart | 1964 +++---- ...kit_webview_cookie_manager_test.mocks.dart | 163 +- .../webkit_webview_widget_test.mocks.dart | 361 +- 20 files changed, 11219 insertions(+), 10255 deletions(-) diff --git a/packages/webview_flutter/webview_flutter/test/legacy/webview_flutter_test.mocks.dart b/packages/webview_flutter/webview_flutter/test/legacy/webview_flutter_test.mocks.dart index 7954c2f769a..7a3c4d583a9 100644 --- a/packages/webview_flutter/webview_flutter/test/legacy/webview_flutter_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter/test/legacy/webview_flutter_test.mocks.dart @@ -37,7 +37,7 @@ import 'package:webview_flutter_platform_interface/src/legacy/types/types.dart' class _FakeWidget_0 extends _i1.SmartFake implements _i2.Widget { _FakeWidget_0(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); @override String toString({_i3.DiagnosticLevel? minLevel = _i3.DiagnosticLevel.info}) => @@ -57,42 +57,38 @@ class MockWebViewPlatform extends _i1.Mock implements _i4.WebViewPlatform { required _i2.BuildContext? context, required _i5.CreationParams? creationParams, required _i6.WebViewPlatformCallbacksHandler? - webViewPlatformCallbacksHandler, + webViewPlatformCallbacksHandler, required _i7.JavascriptChannelRegistry? javascriptChannelRegistry, _i4.WebViewPlatformCreatedCallback? onWebViewPlatformCreated, Set<_i3.Factory<_i8.OneSequenceGestureRecognizer>>? gestureRecognizers, }) => (super.noSuchMethod( - Invocation.method(#build, [], { - #context: context, - #creationParams: creationParams, - #webViewPlatformCallbacksHandler: webViewPlatformCallbacksHandler, - #javascriptChannelRegistry: javascriptChannelRegistry, - #onWebViewPlatformCreated: onWebViewPlatformCreated, - #gestureRecognizers: gestureRecognizers, - }), - returnValue: _FakeWidget_0( - this, - Invocation.method(#build, [], { - #context: context, - #creationParams: creationParams, - #webViewPlatformCallbacksHandler: - webViewPlatformCallbacksHandler, - #javascriptChannelRegistry: javascriptChannelRegistry, - #onWebViewPlatformCreated: onWebViewPlatformCreated, - #gestureRecognizers: gestureRecognizers, - }), - ), - ) - as _i2.Widget); + Invocation.method(#build, [], { + #context: context, + #creationParams: creationParams, + #webViewPlatformCallbacksHandler: webViewPlatformCallbacksHandler, + #javascriptChannelRegistry: javascriptChannelRegistry, + #onWebViewPlatformCreated: onWebViewPlatformCreated, + #gestureRecognizers: gestureRecognizers, + }), + returnValue: _FakeWidget_0( + this, + Invocation.method(#build, [], { + #context: context, + #creationParams: creationParams, + #webViewPlatformCallbacksHandler: webViewPlatformCallbacksHandler, + #javascriptChannelRegistry: javascriptChannelRegistry, + #onWebViewPlatformCreated: onWebViewPlatformCreated, + #gestureRecognizers: gestureRecognizers, + }), + ), + ) as _i2.Widget); @override - _i9.Future clearCookies() => - (super.noSuchMethod( - Invocation.method(#clearCookies, []), - returnValue: _i9.Future.value(false), - ) - as _i9.Future); + _i9.Future clearCookies() => (super.noSuchMethod( + Invocation.method(#clearCookies, []), + returnValue: _i9.Future.value(false), + ) as _i9.Future); } /// A class which mocks [WebViewPlatformController]. @@ -105,215 +101,177 @@ class MockWebViewPlatformController extends _i1.Mock } @override - _i9.Future loadFile(String? absoluteFilePath) => - (super.noSuchMethod( - Invocation.method(#loadFile, [absoluteFilePath]), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) - as _i9.Future); + _i9.Future loadFile(String? absoluteFilePath) => (super.noSuchMethod( + Invocation.method(#loadFile, [absoluteFilePath]), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) as _i9.Future); @override - _i9.Future loadFlutterAsset(String? key) => - (super.noSuchMethod( - Invocation.method(#loadFlutterAsset, [key]), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) - as _i9.Future); + _i9.Future loadFlutterAsset(String? key) => (super.noSuchMethod( + Invocation.method(#loadFlutterAsset, [key]), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) as _i9.Future); @override _i9.Future loadHtmlString(String? html, {String? baseUrl}) => (super.noSuchMethod( - Invocation.method(#loadHtmlString, [html], {#baseUrl: baseUrl}), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) - as _i9.Future); + Invocation.method(#loadHtmlString, [html], {#baseUrl: baseUrl}), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) as _i9.Future); @override _i9.Future loadUrl(String? url, Map? headers) => (super.noSuchMethod( - Invocation.method(#loadUrl, [url, headers]), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) - as _i9.Future); + Invocation.method(#loadUrl, [url, headers]), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) as _i9.Future); @override _i9.Future loadRequest(_i5.WebViewRequest? request) => (super.noSuchMethod( - Invocation.method(#loadRequest, [request]), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) - as _i9.Future); + Invocation.method(#loadRequest, [request]), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) as _i9.Future); @override _i9.Future updateSettings(_i5.WebSettings? setting) => (super.noSuchMethod( - Invocation.method(#updateSettings, [setting]), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) - as _i9.Future); + Invocation.method(#updateSettings, [setting]), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) as _i9.Future); @override - _i9.Future currentUrl() => - (super.noSuchMethod( - Invocation.method(#currentUrl, []), - returnValue: _i9.Future.value(), - ) - as _i9.Future); + _i9.Future currentUrl() => (super.noSuchMethod( + Invocation.method(#currentUrl, []), + returnValue: _i9.Future.value(), + ) as _i9.Future); @override - _i9.Future canGoBack() => - (super.noSuchMethod( - Invocation.method(#canGoBack, []), - returnValue: _i9.Future.value(false), - ) - as _i9.Future); + _i9.Future canGoBack() => (super.noSuchMethod( + Invocation.method(#canGoBack, []), + returnValue: _i9.Future.value(false), + ) as _i9.Future); @override - _i9.Future canGoForward() => - (super.noSuchMethod( - Invocation.method(#canGoForward, []), - returnValue: _i9.Future.value(false), - ) - as _i9.Future); + _i9.Future canGoForward() => (super.noSuchMethod( + Invocation.method(#canGoForward, []), + returnValue: _i9.Future.value(false), + ) as _i9.Future); @override - _i9.Future goBack() => - (super.noSuchMethod( - Invocation.method(#goBack, []), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) - as _i9.Future); + _i9.Future goBack() => (super.noSuchMethod( + Invocation.method(#goBack, []), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) as _i9.Future); @override - _i9.Future goForward() => - (super.noSuchMethod( - Invocation.method(#goForward, []), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) - as _i9.Future); + _i9.Future goForward() => (super.noSuchMethod( + Invocation.method(#goForward, []), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) as _i9.Future); @override - _i9.Future reload() => - (super.noSuchMethod( - Invocation.method(#reload, []), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) - as _i9.Future); + _i9.Future reload() => (super.noSuchMethod( + Invocation.method(#reload, []), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) as _i9.Future); @override - _i9.Future clearCache() => - (super.noSuchMethod( - Invocation.method(#clearCache, []), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) - as _i9.Future); + _i9.Future clearCache() => (super.noSuchMethod( + Invocation.method(#clearCache, []), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) as _i9.Future); @override _i9.Future evaluateJavascript(String? javascript) => (super.noSuchMethod( + Invocation.method(#evaluateJavascript, [javascript]), + returnValue: _i9.Future.value( + _i11.dummyValue( + this, Invocation.method(#evaluateJavascript, [javascript]), - returnValue: _i9.Future.value( - _i11.dummyValue( - this, - Invocation.method(#evaluateJavascript, [javascript]), - ), - ), - ) - as _i9.Future); + ), + ), + ) as _i9.Future); @override - _i9.Future runJavascript(String? javascript) => - (super.noSuchMethod( - Invocation.method(#runJavascript, [javascript]), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) - as _i9.Future); + _i9.Future runJavascript(String? javascript) => (super.noSuchMethod( + Invocation.method(#runJavascript, [javascript]), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) as _i9.Future); @override _i9.Future runJavascriptReturningResult(String? javascript) => (super.noSuchMethod( + Invocation.method(#runJavascriptReturningResult, [javascript]), + returnValue: _i9.Future.value( + _i11.dummyValue( + this, Invocation.method(#runJavascriptReturningResult, [javascript]), - returnValue: _i9.Future.value( - _i11.dummyValue( - this, - Invocation.method(#runJavascriptReturningResult, [javascript]), - ), - ), - ) - as _i9.Future); + ), + ), + ) as _i9.Future); @override _i9.Future addJavascriptChannels(Set? javascriptChannelNames) => (super.noSuchMethod( - Invocation.method(#addJavascriptChannels, [javascriptChannelNames]), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) - as _i9.Future); + Invocation.method(#addJavascriptChannels, [javascriptChannelNames]), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) as _i9.Future); @override _i9.Future removeJavascriptChannels( Set? javascriptChannelNames, ) => (super.noSuchMethod( - Invocation.method(#removeJavascriptChannels, [ - javascriptChannelNames, - ]), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) - as _i9.Future); + Invocation.method(#removeJavascriptChannels, [ + javascriptChannelNames, + ]), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) as _i9.Future); @override - _i9.Future getTitle() => - (super.noSuchMethod( - Invocation.method(#getTitle, []), - returnValue: _i9.Future.value(), - ) - as _i9.Future); + _i9.Future getTitle() => (super.noSuchMethod( + Invocation.method(#getTitle, []), + returnValue: _i9.Future.value(), + ) as _i9.Future); @override - _i9.Future scrollTo(int? x, int? y) => - (super.noSuchMethod( - Invocation.method(#scrollTo, [x, y]), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) - as _i9.Future); + _i9.Future scrollTo(int? x, int? y) => (super.noSuchMethod( + Invocation.method(#scrollTo, [x, y]), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) as _i9.Future); @override - _i9.Future scrollBy(int? x, int? y) => - (super.noSuchMethod( - Invocation.method(#scrollBy, [x, y]), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) - as _i9.Future); + _i9.Future scrollBy(int? x, int? y) => (super.noSuchMethod( + Invocation.method(#scrollBy, [x, y]), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) as _i9.Future); @override - _i9.Future getScrollX() => - (super.noSuchMethod( - Invocation.method(#getScrollX, []), - returnValue: _i9.Future.value(0), - ) - as _i9.Future); + _i9.Future getScrollX() => (super.noSuchMethod( + Invocation.method(#getScrollX, []), + returnValue: _i9.Future.value(0), + ) as _i9.Future); @override - _i9.Future getScrollY() => - (super.noSuchMethod( - Invocation.method(#getScrollY, []), - returnValue: _i9.Future.value(0), - ) - as _i9.Future); + _i9.Future getScrollY() => (super.noSuchMethod( + Invocation.method(#getScrollY, []), + returnValue: _i9.Future.value(0), + ) as _i9.Future); } diff --git a/packages/webview_flutter/webview_flutter/test/navigation_delegate_test.mocks.dart b/packages/webview_flutter/webview_flutter/test/navigation_delegate_test.mocks.dart index f1e0a343bee..4b02c37ace2 100644 --- a/packages/webview_flutter/webview_flutter/test/navigation_delegate_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter/test/navigation_delegate_test.mocks.dart @@ -43,19 +43,19 @@ class _FakePlatformWebViewCookieManager_0 extends _i1.SmartFake class _FakePlatformNavigationDelegate_1 extends _i1.SmartFake implements _i3.PlatformNavigationDelegate { _FakePlatformNavigationDelegate_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakePlatformWebViewController_2 extends _i1.SmartFake implements _i4.PlatformWebViewController { _FakePlatformWebViewController_2(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakePlatformWebViewWidget_3 extends _i1.SmartFake implements _i5.PlatformWebViewWidget { _FakePlatformWebViewWidget_3(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakePlatformNavigationDelegateCreationParams_4 extends _i1.SmartFake @@ -79,52 +79,48 @@ class MockWebViewPlatform extends _i1.Mock implements _i7.WebViewPlatform { _i6.PlatformWebViewCookieManagerCreationParams? params, ) => (super.noSuchMethod( - Invocation.method(#createPlatformCookieManager, [params]), - returnValue: _FakePlatformWebViewCookieManager_0( - this, - Invocation.method(#createPlatformCookieManager, [params]), - ), - ) - as _i2.PlatformWebViewCookieManager); + Invocation.method(#createPlatformCookieManager, [params]), + returnValue: _FakePlatformWebViewCookieManager_0( + this, + Invocation.method(#createPlatformCookieManager, [params]), + ), + ) as _i2.PlatformWebViewCookieManager); @override _i3.PlatformNavigationDelegate createPlatformNavigationDelegate( _i6.PlatformNavigationDelegateCreationParams? params, ) => (super.noSuchMethod( - Invocation.method(#createPlatformNavigationDelegate, [params]), - returnValue: _FakePlatformNavigationDelegate_1( - this, - Invocation.method(#createPlatformNavigationDelegate, [params]), - ), - ) - as _i3.PlatformNavigationDelegate); + Invocation.method(#createPlatformNavigationDelegate, [params]), + returnValue: _FakePlatformNavigationDelegate_1( + this, + Invocation.method(#createPlatformNavigationDelegate, [params]), + ), + ) as _i3.PlatformNavigationDelegate); @override _i4.PlatformWebViewController createPlatformWebViewController( _i6.PlatformWebViewControllerCreationParams? params, ) => (super.noSuchMethod( - Invocation.method(#createPlatformWebViewController, [params]), - returnValue: _FakePlatformWebViewController_2( - this, - Invocation.method(#createPlatformWebViewController, [params]), - ), - ) - as _i4.PlatformWebViewController); + Invocation.method(#createPlatformWebViewController, [params]), + returnValue: _FakePlatformWebViewController_2( + this, + Invocation.method(#createPlatformWebViewController, [params]), + ), + ) as _i4.PlatformWebViewController); @override _i5.PlatformWebViewWidget createPlatformWebViewWidget( _i6.PlatformWebViewWidgetCreationParams? params, ) => (super.noSuchMethod( - Invocation.method(#createPlatformWebViewWidget, [params]), - returnValue: _FakePlatformWebViewWidget_3( - this, - Invocation.method(#createPlatformWebViewWidget, [params]), - ), - ) - as _i5.PlatformWebViewWidget); + Invocation.method(#createPlatformWebViewWidget, [params]), + returnValue: _FakePlatformWebViewWidget_3( + this, + Invocation.method(#createPlatformWebViewWidget, [params]), + ), + ) as _i5.PlatformWebViewWidget); } /// A class which mocks [PlatformNavigationDelegate]. @@ -139,89 +135,80 @@ class MockPlatformNavigationDelegate extends _i1.Mock @override _i6.PlatformNavigationDelegateCreationParams get params => (super.noSuchMethod( - Invocation.getter(#params), - returnValue: _FakePlatformNavigationDelegateCreationParams_4( - this, - Invocation.getter(#params), - ), - ) - as _i6.PlatformNavigationDelegateCreationParams); + Invocation.getter(#params), + returnValue: _FakePlatformNavigationDelegateCreationParams_4( + this, + Invocation.getter(#params), + ), + ) as _i6.PlatformNavigationDelegateCreationParams); @override _i8.Future setOnNavigationRequest( _i3.NavigationRequestCallback? onNavigationRequest, ) => (super.noSuchMethod( - Invocation.method(#setOnNavigationRequest, [onNavigationRequest]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setOnNavigationRequest, [onNavigationRequest]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setOnPageStarted(_i3.PageEventCallback? onPageStarted) => (super.noSuchMethod( - Invocation.method(#setOnPageStarted, [onPageStarted]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setOnPageStarted, [onPageStarted]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setOnPageFinished(_i3.PageEventCallback? onPageFinished) => (super.noSuchMethod( - Invocation.method(#setOnPageFinished, [onPageFinished]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setOnPageFinished, [onPageFinished]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setOnHttpError(_i3.HttpResponseErrorCallback? onHttpError) => (super.noSuchMethod( - Invocation.method(#setOnHttpError, [onHttpError]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setOnHttpError, [onHttpError]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setOnProgress(_i3.ProgressCallback? onProgress) => (super.noSuchMethod( - Invocation.method(#setOnProgress, [onProgress]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setOnProgress, [onProgress]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setOnWebResourceError( _i3.WebResourceErrorCallback? onWebResourceError, ) => (super.noSuchMethod( - Invocation.method(#setOnWebResourceError, [onWebResourceError]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setOnWebResourceError, [onWebResourceError]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setOnUrlChange(_i3.UrlChangeCallback? onUrlChange) => (super.noSuchMethod( - Invocation.method(#setOnUrlChange, [onUrlChange]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setOnUrlChange, [onUrlChange]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setOnHttpAuthRequest( _i3.HttpAuthRequestCallback? onHttpAuthRequest, ) => (super.noSuchMethod( - Invocation.method(#setOnHttpAuthRequest, [onHttpAuthRequest]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setOnHttpAuthRequest, [onHttpAuthRequest]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); } diff --git a/packages/webview_flutter/webview_flutter/test/webview_controller_test.mocks.dart b/packages/webview_flutter/webview_flutter/test/webview_controller_test.mocks.dart index e71ccc180f4..816424a5e22 100644 --- a/packages/webview_flutter/webview_flutter/test/webview_controller_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter/test/webview_controller_test.mocks.dart @@ -37,12 +37,12 @@ class _FakePlatformWebViewControllerCreationParams_0 extends _i1.SmartFake class _FakeObject_1 extends _i1.SmartFake implements Object { _FakeObject_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeOffset_2 extends _i1.SmartFake implements _i3.Offset { _FakeOffset_2(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakePlatformNavigationDelegateCreationParams_3 extends _i1.SmartFake @@ -63,361 +63,305 @@ class MockPlatformWebViewController extends _i1.Mock } @override - _i2.PlatformWebViewControllerCreationParams get params => - (super.noSuchMethod( - Invocation.getter(#params), - returnValue: _FakePlatformWebViewControllerCreationParams_0( - this, - Invocation.getter(#params), - ), - ) - as _i2.PlatformWebViewControllerCreationParams); + _i2.PlatformWebViewControllerCreationParams get params => (super.noSuchMethod( + Invocation.getter(#params), + returnValue: _FakePlatformWebViewControllerCreationParams_0( + this, + Invocation.getter(#params), + ), + ) as _i2.PlatformWebViewControllerCreationParams); @override - _i5.Future loadFile(String? absoluteFilePath) => - (super.noSuchMethod( - Invocation.method(#loadFile, [absoluteFilePath]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future loadFile(String? absoluteFilePath) => (super.noSuchMethod( + Invocation.method(#loadFile, [absoluteFilePath]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future loadFlutterAsset(String? key) => - (super.noSuchMethod( - Invocation.method(#loadFlutterAsset, [key]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future loadFlutterAsset(String? key) => (super.noSuchMethod( + Invocation.method(#loadFlutterAsset, [key]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future loadHtmlString(String? html, {String? baseUrl}) => (super.noSuchMethod( - Invocation.method(#loadHtmlString, [html], {#baseUrl: baseUrl}), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#loadHtmlString, [html], {#baseUrl: baseUrl}), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future loadRequest(_i2.LoadRequestParams? params) => (super.noSuchMethod( - Invocation.method(#loadRequest, [params]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#loadRequest, [params]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future currentUrl() => - (super.noSuchMethod( - Invocation.method(#currentUrl, []), - returnValue: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future currentUrl() => (super.noSuchMethod( + Invocation.method(#currentUrl, []), + returnValue: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future canGoBack() => - (super.noSuchMethod( - Invocation.method(#canGoBack, []), - returnValue: _i5.Future.value(false), - ) - as _i5.Future); + _i5.Future canGoBack() => (super.noSuchMethod( + Invocation.method(#canGoBack, []), + returnValue: _i5.Future.value(false), + ) as _i5.Future); @override - _i5.Future canGoForward() => - (super.noSuchMethod( - Invocation.method(#canGoForward, []), - returnValue: _i5.Future.value(false), - ) - as _i5.Future); + _i5.Future canGoForward() => (super.noSuchMethod( + Invocation.method(#canGoForward, []), + returnValue: _i5.Future.value(false), + ) as _i5.Future); @override - _i5.Future goBack() => - (super.noSuchMethod( - Invocation.method(#goBack, []), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future goBack() => (super.noSuchMethod( + Invocation.method(#goBack, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future goForward() => - (super.noSuchMethod( - Invocation.method(#goForward, []), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future goForward() => (super.noSuchMethod( + Invocation.method(#goForward, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future reload() => - (super.noSuchMethod( - Invocation.method(#reload, []), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future reload() => (super.noSuchMethod( + Invocation.method(#reload, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future clearCache() => - (super.noSuchMethod( - Invocation.method(#clearCache, []), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future clearCache() => (super.noSuchMethod( + Invocation.method(#clearCache, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future clearLocalStorage() => - (super.noSuchMethod( - Invocation.method(#clearLocalStorage, []), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future clearLocalStorage() => (super.noSuchMethod( + Invocation.method(#clearLocalStorage, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setPlatformNavigationDelegate( _i6.PlatformNavigationDelegate? handler, ) => (super.noSuchMethod( - Invocation.method(#setPlatformNavigationDelegate, [handler]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setPlatformNavigationDelegate, [handler]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future runJavaScript(String? javaScript) => - (super.noSuchMethod( - Invocation.method(#runJavaScript, [javaScript]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future runJavaScript(String? javaScript) => (super.noSuchMethod( + Invocation.method(#runJavaScript, [javaScript]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future runJavaScriptReturningResult(String? javaScript) => (super.noSuchMethod( + Invocation.method(#runJavaScriptReturningResult, [javaScript]), + returnValue: _i5.Future.value( + _FakeObject_1( + this, Invocation.method(#runJavaScriptReturningResult, [javaScript]), - returnValue: _i5.Future.value( - _FakeObject_1( - this, - Invocation.method(#runJavaScriptReturningResult, [javaScript]), - ), - ), - ) - as _i5.Future); + ), + ), + ) as _i5.Future); @override _i5.Future addJavaScriptChannel( _i4.JavaScriptChannelParams? javaScriptChannelParams, ) => (super.noSuchMethod( - Invocation.method(#addJavaScriptChannel, [javaScriptChannelParams]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#addJavaScriptChannel, [javaScriptChannelParams]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future removeJavaScriptChannel(String? javaScriptChannelName) => (super.noSuchMethod( - Invocation.method(#removeJavaScriptChannel, [ - javaScriptChannelName, - ]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#removeJavaScriptChannel, [ + javaScriptChannelName, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future getTitle() => - (super.noSuchMethod( - Invocation.method(#getTitle, []), - returnValue: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future getTitle() => (super.noSuchMethod( + Invocation.method(#getTitle, []), + returnValue: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future scrollTo(int? x, int? y) => - (super.noSuchMethod( - Invocation.method(#scrollTo, [x, y]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future scrollTo(int? x, int? y) => (super.noSuchMethod( + Invocation.method(#scrollTo, [x, y]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future scrollBy(int? x, int? y) => - (super.noSuchMethod( - Invocation.method(#scrollBy, [x, y]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future scrollBy(int? x, int? y) => (super.noSuchMethod( + Invocation.method(#scrollBy, [x, y]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setVerticalScrollBarEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setVerticalScrollBarEnabled, [enabled]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setVerticalScrollBarEnabled, [enabled]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setHorizontalScrollBarEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setHorizontalScrollBarEnabled, [enabled]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setHorizontalScrollBarEnabled, [enabled]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future<_i3.Offset> getScrollPosition() => - (super.noSuchMethod( - Invocation.method(#getScrollPosition, []), - returnValue: _i5.Future<_i3.Offset>.value( - _FakeOffset_2(this, Invocation.method(#getScrollPosition, [])), - ), - ) - as _i5.Future<_i3.Offset>); + _i5.Future<_i3.Offset> getScrollPosition() => (super.noSuchMethod( + Invocation.method(#getScrollPosition, []), + returnValue: _i5.Future<_i3.Offset>.value( + _FakeOffset_2(this, Invocation.method(#getScrollPosition, [])), + ), + ) as _i5.Future<_i3.Offset>); @override - _i5.Future enableZoom(bool? enabled) => - (super.noSuchMethod( - Invocation.method(#enableZoom, [enabled]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future enableZoom(bool? enabled) => (super.noSuchMethod( + Invocation.method(#enableZoom, [enabled]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future setBackgroundColor(_i3.Color? color) => - (super.noSuchMethod( - Invocation.method(#setBackgroundColor, [color]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future setBackgroundColor(_i3.Color? color) => (super.noSuchMethod( + Invocation.method(#setBackgroundColor, [color]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setJavaScriptMode(_i2.JavaScriptMode? javaScriptMode) => (super.noSuchMethod( - Invocation.method(#setJavaScriptMode, [javaScriptMode]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setJavaScriptMode, [javaScriptMode]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future setUserAgent(String? userAgent) => - (super.noSuchMethod( - Invocation.method(#setUserAgent, [userAgent]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future setUserAgent(String? userAgent) => (super.noSuchMethod( + Invocation.method(#setUserAgent, [userAgent]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setOnPlatformPermissionRequest( void Function(_i2.PlatformWebViewPermissionRequest)? onPermissionRequest, ) => (super.noSuchMethod( - Invocation.method(#setOnPlatformPermissionRequest, [ - onPermissionRequest, - ]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setOnPlatformPermissionRequest, [ + onPermissionRequest, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future getUserAgent() => - (super.noSuchMethod( - Invocation.method(#getUserAgent, []), - returnValue: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future getUserAgent() => (super.noSuchMethod( + Invocation.method(#getUserAgent, []), + returnValue: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setOnConsoleMessage( void Function(_i2.JavaScriptConsoleMessage)? onConsoleMessage, ) => (super.noSuchMethod( - Invocation.method(#setOnConsoleMessage, [onConsoleMessage]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setOnConsoleMessage, [onConsoleMessage]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setOnScrollPositionChange( void Function(_i2.ScrollPositionChange)? onScrollPositionChange, ) => (super.noSuchMethod( - Invocation.method(#setOnScrollPositionChange, [ - onScrollPositionChange, - ]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setOnScrollPositionChange, [ + onScrollPositionChange, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setOnJavaScriptAlertDialog( _i5.Future Function(_i2.JavaScriptAlertDialogRequest)? - onJavaScriptAlertDialog, + onJavaScriptAlertDialog, ) => (super.noSuchMethod( - Invocation.method(#setOnJavaScriptAlertDialog, [ - onJavaScriptAlertDialog, - ]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setOnJavaScriptAlertDialog, [ + onJavaScriptAlertDialog, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setOnJavaScriptConfirmDialog( _i5.Future Function(_i2.JavaScriptConfirmDialogRequest)? - onJavaScriptConfirmDialog, + onJavaScriptConfirmDialog, ) => (super.noSuchMethod( - Invocation.method(#setOnJavaScriptConfirmDialog, [ - onJavaScriptConfirmDialog, - ]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setOnJavaScriptConfirmDialog, [ + onJavaScriptConfirmDialog, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setOnJavaScriptTextInputDialog( _i5.Future Function(_i2.JavaScriptTextInputDialogRequest)? - onJavaScriptTextInputDialog, + onJavaScriptTextInputDialog, ) => (super.noSuchMethod( - Invocation.method(#setOnJavaScriptTextInputDialog, [ - onJavaScriptTextInputDialog, - ]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setOnJavaScriptTextInputDialog, [ + onJavaScriptTextInputDialog, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setOverScrollMode(_i2.WebViewOverScrollMode? mode) => (super.noSuchMethod( - Invocation.method(#setOverScrollMode, [mode]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setOverScrollMode, [mode]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); } /// A class which mocks [PlatformNavigationDelegate]. @@ -432,89 +376,80 @@ class MockPlatformNavigationDelegate extends _i1.Mock @override _i2.PlatformNavigationDelegateCreationParams get params => (super.noSuchMethod( - Invocation.getter(#params), - returnValue: _FakePlatformNavigationDelegateCreationParams_3( - this, - Invocation.getter(#params), - ), - ) - as _i2.PlatformNavigationDelegateCreationParams); + Invocation.getter(#params), + returnValue: _FakePlatformNavigationDelegateCreationParams_3( + this, + Invocation.getter(#params), + ), + ) as _i2.PlatformNavigationDelegateCreationParams); @override _i5.Future setOnNavigationRequest( _i6.NavigationRequestCallback? onNavigationRequest, ) => (super.noSuchMethod( - Invocation.method(#setOnNavigationRequest, [onNavigationRequest]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setOnNavigationRequest, [onNavigationRequest]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setOnPageStarted(_i6.PageEventCallback? onPageStarted) => (super.noSuchMethod( - Invocation.method(#setOnPageStarted, [onPageStarted]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setOnPageStarted, [onPageStarted]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setOnPageFinished(_i6.PageEventCallback? onPageFinished) => (super.noSuchMethod( - Invocation.method(#setOnPageFinished, [onPageFinished]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setOnPageFinished, [onPageFinished]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setOnHttpError(_i6.HttpResponseErrorCallback? onHttpError) => (super.noSuchMethod( - Invocation.method(#setOnHttpError, [onHttpError]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setOnHttpError, [onHttpError]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setOnProgress(_i6.ProgressCallback? onProgress) => (super.noSuchMethod( - Invocation.method(#setOnProgress, [onProgress]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setOnProgress, [onProgress]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setOnWebResourceError( _i6.WebResourceErrorCallback? onWebResourceError, ) => (super.noSuchMethod( - Invocation.method(#setOnWebResourceError, [onWebResourceError]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setOnWebResourceError, [onWebResourceError]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setOnUrlChange(_i6.UrlChangeCallback? onUrlChange) => (super.noSuchMethod( - Invocation.method(#setOnUrlChange, [onUrlChange]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setOnUrlChange, [onUrlChange]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setOnHttpAuthRequest( _i6.HttpAuthRequestCallback? onHttpAuthRequest, ) => (super.noSuchMethod( - Invocation.method(#setOnHttpAuthRequest, [onHttpAuthRequest]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setOnHttpAuthRequest, [onHttpAuthRequest]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); } diff --git a/packages/webview_flutter/webview_flutter/test/webview_cookie_manager_test.mocks.dart b/packages/webview_flutter/webview_flutter/test/webview_cookie_manager_test.mocks.dart index c40d739926a..31b11889cb7 100644 --- a/packages/webview_flutter/webview_flutter/test/webview_cookie_manager_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter/test/webview_cookie_manager_test.mocks.dart @@ -44,28 +44,23 @@ class MockPlatformWebViewCookieManager extends _i1.Mock @override _i2.PlatformWebViewCookieManagerCreationParams get params => (super.noSuchMethod( - Invocation.getter(#params), - returnValue: _FakePlatformWebViewCookieManagerCreationParams_0( - this, - Invocation.getter(#params), - ), - ) - as _i2.PlatformWebViewCookieManagerCreationParams); + Invocation.getter(#params), + returnValue: _FakePlatformWebViewCookieManagerCreationParams_0( + this, + Invocation.getter(#params), + ), + ) as _i2.PlatformWebViewCookieManagerCreationParams); @override - _i4.Future clearCookies() => - (super.noSuchMethod( - Invocation.method(#clearCookies, []), - returnValue: _i4.Future.value(false), - ) - as _i4.Future); + _i4.Future clearCookies() => (super.noSuchMethod( + Invocation.method(#clearCookies, []), + returnValue: _i4.Future.value(false), + ) as _i4.Future); @override - _i4.Future setCookie(_i2.WebViewCookie? cookie) => - (super.noSuchMethod( - Invocation.method(#setCookie, [cookie]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future setCookie(_i2.WebViewCookie? cookie) => (super.noSuchMethod( + Invocation.method(#setCookie, [cookie]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); } diff --git a/packages/webview_flutter/webview_flutter/test/webview_widget_test.mocks.dart b/packages/webview_flutter/webview_flutter/test/webview_widget_test.mocks.dart index e84002fdee1..74b949a8590 100644 --- a/packages/webview_flutter/webview_flutter/test/webview_widget_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter/test/webview_widget_test.mocks.dart @@ -41,12 +41,12 @@ class _FakePlatformWebViewControllerCreationParams_0 extends _i1.SmartFake class _FakeObject_1 extends _i1.SmartFake implements Object { _FakeObject_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeOffset_2 extends _i1.SmartFake implements _i3.Offset { _FakeOffset_2(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakePlatformWebViewWidgetCreationParams_3 extends _i1.SmartFake @@ -59,7 +59,7 @@ class _FakePlatformWebViewWidgetCreationParams_3 extends _i1.SmartFake class _FakeWidget_4 extends _i1.SmartFake implements _i4.Widget { _FakeWidget_4(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); @override String toString({_i5.DiagnosticLevel? minLevel = _i5.DiagnosticLevel.info}) => @@ -76,361 +76,305 @@ class MockPlatformWebViewController extends _i1.Mock } @override - _i2.PlatformWebViewControllerCreationParams get params => - (super.noSuchMethod( - Invocation.getter(#params), - returnValue: _FakePlatformWebViewControllerCreationParams_0( - this, - Invocation.getter(#params), - ), - ) - as _i2.PlatformWebViewControllerCreationParams); + _i2.PlatformWebViewControllerCreationParams get params => (super.noSuchMethod( + Invocation.getter(#params), + returnValue: _FakePlatformWebViewControllerCreationParams_0( + this, + Invocation.getter(#params), + ), + ) as _i2.PlatformWebViewControllerCreationParams); @override - _i7.Future loadFile(String? absoluteFilePath) => - (super.noSuchMethod( - Invocation.method(#loadFile, [absoluteFilePath]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + _i7.Future loadFile(String? absoluteFilePath) => (super.noSuchMethod( + Invocation.method(#loadFile, [absoluteFilePath]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override - _i7.Future loadFlutterAsset(String? key) => - (super.noSuchMethod( - Invocation.method(#loadFlutterAsset, [key]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + _i7.Future loadFlutterAsset(String? key) => (super.noSuchMethod( + Invocation.method(#loadFlutterAsset, [key]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override _i7.Future loadHtmlString(String? html, {String? baseUrl}) => (super.noSuchMethod( - Invocation.method(#loadHtmlString, [html], {#baseUrl: baseUrl}), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + Invocation.method(#loadHtmlString, [html], {#baseUrl: baseUrl}), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override _i7.Future loadRequest(_i2.LoadRequestParams? params) => (super.noSuchMethod( - Invocation.method(#loadRequest, [params]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + Invocation.method(#loadRequest, [params]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override - _i7.Future currentUrl() => - (super.noSuchMethod( - Invocation.method(#currentUrl, []), - returnValue: _i7.Future.value(), - ) - as _i7.Future); + _i7.Future currentUrl() => (super.noSuchMethod( + Invocation.method(#currentUrl, []), + returnValue: _i7.Future.value(), + ) as _i7.Future); @override - _i7.Future canGoBack() => - (super.noSuchMethod( - Invocation.method(#canGoBack, []), - returnValue: _i7.Future.value(false), - ) - as _i7.Future); + _i7.Future canGoBack() => (super.noSuchMethod( + Invocation.method(#canGoBack, []), + returnValue: _i7.Future.value(false), + ) as _i7.Future); @override - _i7.Future canGoForward() => - (super.noSuchMethod( - Invocation.method(#canGoForward, []), - returnValue: _i7.Future.value(false), - ) - as _i7.Future); + _i7.Future canGoForward() => (super.noSuchMethod( + Invocation.method(#canGoForward, []), + returnValue: _i7.Future.value(false), + ) as _i7.Future); @override - _i7.Future goBack() => - (super.noSuchMethod( - Invocation.method(#goBack, []), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + _i7.Future goBack() => (super.noSuchMethod( + Invocation.method(#goBack, []), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override - _i7.Future goForward() => - (super.noSuchMethod( - Invocation.method(#goForward, []), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + _i7.Future goForward() => (super.noSuchMethod( + Invocation.method(#goForward, []), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override - _i7.Future reload() => - (super.noSuchMethod( - Invocation.method(#reload, []), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + _i7.Future reload() => (super.noSuchMethod( + Invocation.method(#reload, []), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override - _i7.Future clearCache() => - (super.noSuchMethod( - Invocation.method(#clearCache, []), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + _i7.Future clearCache() => (super.noSuchMethod( + Invocation.method(#clearCache, []), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override - _i7.Future clearLocalStorage() => - (super.noSuchMethod( - Invocation.method(#clearLocalStorage, []), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + _i7.Future clearLocalStorage() => (super.noSuchMethod( + Invocation.method(#clearLocalStorage, []), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override _i7.Future setPlatformNavigationDelegate( _i8.PlatformNavigationDelegate? handler, ) => (super.noSuchMethod( - Invocation.method(#setPlatformNavigationDelegate, [handler]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + Invocation.method(#setPlatformNavigationDelegate, [handler]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override - _i7.Future runJavaScript(String? javaScript) => - (super.noSuchMethod( - Invocation.method(#runJavaScript, [javaScript]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + _i7.Future runJavaScript(String? javaScript) => (super.noSuchMethod( + Invocation.method(#runJavaScript, [javaScript]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override _i7.Future runJavaScriptReturningResult(String? javaScript) => (super.noSuchMethod( + Invocation.method(#runJavaScriptReturningResult, [javaScript]), + returnValue: _i7.Future.value( + _FakeObject_1( + this, Invocation.method(#runJavaScriptReturningResult, [javaScript]), - returnValue: _i7.Future.value( - _FakeObject_1( - this, - Invocation.method(#runJavaScriptReturningResult, [javaScript]), - ), - ), - ) - as _i7.Future); + ), + ), + ) as _i7.Future); @override _i7.Future addJavaScriptChannel( _i6.JavaScriptChannelParams? javaScriptChannelParams, ) => (super.noSuchMethod( - Invocation.method(#addJavaScriptChannel, [javaScriptChannelParams]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + Invocation.method(#addJavaScriptChannel, [javaScriptChannelParams]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override _i7.Future removeJavaScriptChannel(String? javaScriptChannelName) => (super.noSuchMethod( - Invocation.method(#removeJavaScriptChannel, [ - javaScriptChannelName, - ]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + Invocation.method(#removeJavaScriptChannel, [ + javaScriptChannelName, + ]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override - _i7.Future getTitle() => - (super.noSuchMethod( - Invocation.method(#getTitle, []), - returnValue: _i7.Future.value(), - ) - as _i7.Future); + _i7.Future getTitle() => (super.noSuchMethod( + Invocation.method(#getTitle, []), + returnValue: _i7.Future.value(), + ) as _i7.Future); @override - _i7.Future scrollTo(int? x, int? y) => - (super.noSuchMethod( - Invocation.method(#scrollTo, [x, y]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + _i7.Future scrollTo(int? x, int? y) => (super.noSuchMethod( + Invocation.method(#scrollTo, [x, y]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override - _i7.Future scrollBy(int? x, int? y) => - (super.noSuchMethod( - Invocation.method(#scrollBy, [x, y]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + _i7.Future scrollBy(int? x, int? y) => (super.noSuchMethod( + Invocation.method(#scrollBy, [x, y]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override _i7.Future setVerticalScrollBarEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setVerticalScrollBarEnabled, [enabled]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + Invocation.method(#setVerticalScrollBarEnabled, [enabled]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override _i7.Future setHorizontalScrollBarEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setHorizontalScrollBarEnabled, [enabled]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + Invocation.method(#setHorizontalScrollBarEnabled, [enabled]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override - _i7.Future<_i3.Offset> getScrollPosition() => - (super.noSuchMethod( - Invocation.method(#getScrollPosition, []), - returnValue: _i7.Future<_i3.Offset>.value( - _FakeOffset_2(this, Invocation.method(#getScrollPosition, [])), - ), - ) - as _i7.Future<_i3.Offset>); + _i7.Future<_i3.Offset> getScrollPosition() => (super.noSuchMethod( + Invocation.method(#getScrollPosition, []), + returnValue: _i7.Future<_i3.Offset>.value( + _FakeOffset_2(this, Invocation.method(#getScrollPosition, [])), + ), + ) as _i7.Future<_i3.Offset>); @override - _i7.Future enableZoom(bool? enabled) => - (super.noSuchMethod( - Invocation.method(#enableZoom, [enabled]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + _i7.Future enableZoom(bool? enabled) => (super.noSuchMethod( + Invocation.method(#enableZoom, [enabled]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override - _i7.Future setBackgroundColor(_i3.Color? color) => - (super.noSuchMethod( - Invocation.method(#setBackgroundColor, [color]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + _i7.Future setBackgroundColor(_i3.Color? color) => (super.noSuchMethod( + Invocation.method(#setBackgroundColor, [color]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override _i7.Future setJavaScriptMode(_i2.JavaScriptMode? javaScriptMode) => (super.noSuchMethod( - Invocation.method(#setJavaScriptMode, [javaScriptMode]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + Invocation.method(#setJavaScriptMode, [javaScriptMode]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override - _i7.Future setUserAgent(String? userAgent) => - (super.noSuchMethod( - Invocation.method(#setUserAgent, [userAgent]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + _i7.Future setUserAgent(String? userAgent) => (super.noSuchMethod( + Invocation.method(#setUserAgent, [userAgent]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override _i7.Future setOnPlatformPermissionRequest( void Function(_i2.PlatformWebViewPermissionRequest)? onPermissionRequest, ) => (super.noSuchMethod( - Invocation.method(#setOnPlatformPermissionRequest, [ - onPermissionRequest, - ]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + Invocation.method(#setOnPlatformPermissionRequest, [ + onPermissionRequest, + ]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override - _i7.Future getUserAgent() => - (super.noSuchMethod( - Invocation.method(#getUserAgent, []), - returnValue: _i7.Future.value(), - ) - as _i7.Future); + _i7.Future getUserAgent() => (super.noSuchMethod( + Invocation.method(#getUserAgent, []), + returnValue: _i7.Future.value(), + ) as _i7.Future); @override _i7.Future setOnConsoleMessage( void Function(_i2.JavaScriptConsoleMessage)? onConsoleMessage, ) => (super.noSuchMethod( - Invocation.method(#setOnConsoleMessage, [onConsoleMessage]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + Invocation.method(#setOnConsoleMessage, [onConsoleMessage]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override _i7.Future setOnScrollPositionChange( void Function(_i2.ScrollPositionChange)? onScrollPositionChange, ) => (super.noSuchMethod( - Invocation.method(#setOnScrollPositionChange, [ - onScrollPositionChange, - ]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + Invocation.method(#setOnScrollPositionChange, [ + onScrollPositionChange, + ]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override _i7.Future setOnJavaScriptAlertDialog( _i7.Future Function(_i2.JavaScriptAlertDialogRequest)? - onJavaScriptAlertDialog, + onJavaScriptAlertDialog, ) => (super.noSuchMethod( - Invocation.method(#setOnJavaScriptAlertDialog, [ - onJavaScriptAlertDialog, - ]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + Invocation.method(#setOnJavaScriptAlertDialog, [ + onJavaScriptAlertDialog, + ]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override _i7.Future setOnJavaScriptConfirmDialog( _i7.Future Function(_i2.JavaScriptConfirmDialogRequest)? - onJavaScriptConfirmDialog, + onJavaScriptConfirmDialog, ) => (super.noSuchMethod( - Invocation.method(#setOnJavaScriptConfirmDialog, [ - onJavaScriptConfirmDialog, - ]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + Invocation.method(#setOnJavaScriptConfirmDialog, [ + onJavaScriptConfirmDialog, + ]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override _i7.Future setOnJavaScriptTextInputDialog( _i7.Future Function(_i2.JavaScriptTextInputDialogRequest)? - onJavaScriptTextInputDialog, + onJavaScriptTextInputDialog, ) => (super.noSuchMethod( - Invocation.method(#setOnJavaScriptTextInputDialog, [ - onJavaScriptTextInputDialog, - ]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + Invocation.method(#setOnJavaScriptTextInputDialog, [ + onJavaScriptTextInputDialog, + ]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); @override _i7.Future setOverScrollMode(_i2.WebViewOverScrollMode? mode) => (super.noSuchMethod( - Invocation.method(#setOverScrollMode, [mode]), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) - as _i7.Future); + Invocation.method(#setOverScrollMode, [mode]), + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); } /// A class which mocks [PlatformWebViewWidget]. @@ -443,24 +387,20 @@ class MockPlatformWebViewWidget extends _i1.Mock } @override - _i2.PlatformWebViewWidgetCreationParams get params => - (super.noSuchMethod( - Invocation.getter(#params), - returnValue: _FakePlatformWebViewWidgetCreationParams_3( - this, - Invocation.getter(#params), - ), - ) - as _i2.PlatformWebViewWidgetCreationParams); + _i2.PlatformWebViewWidgetCreationParams get params => (super.noSuchMethod( + Invocation.getter(#params), + returnValue: _FakePlatformWebViewWidgetCreationParams_3( + this, + Invocation.getter(#params), + ), + ) as _i2.PlatformWebViewWidgetCreationParams); @override - _i4.Widget build(_i4.BuildContext? context) => - (super.noSuchMethod( - Invocation.method(#build, [context]), - returnValue: _FakeWidget_4( - this, - Invocation.method(#build, [context]), - ), - ) - as _i4.Widget); + _i4.Widget build(_i4.BuildContext? context) => (super.noSuchMethod( + Invocation.method(#build, [context]), + returnValue: _FakeWidget_4( + this, + Invocation.method(#build, [context]), + ), + ) as _i4.Widget); } diff --git a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/AndroidWebkitLibrary.g.kt b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/AndroidWebkitLibrary.g.kt index d0c8781c047..bd1c4de2327 100644 --- a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/AndroidWebkitLibrary.g.kt +++ b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/AndroidWebkitLibrary.g.kt @@ -10,16 +10,17 @@ package io.flutter.plugins.webviewflutter import android.util.Log import io.flutter.plugin.common.BasicMessageChannel import io.flutter.plugin.common.BinaryMessenger -import io.flutter.plugin.common.EventChannel import io.flutter.plugin.common.MessageCodec -import io.flutter.plugin.common.StandardMethodCodec import io.flutter.plugin.common.StandardMessageCodec import java.io.ByteArrayOutputStream import java.nio.ByteBuffer + private object AndroidWebkitLibraryPigeonUtils { fun createConnectionError(channelName: String): AndroidWebKitError { - return AndroidWebKitError("channel-error", "Unable to establish connection on channel: '$channelName'.", "") } + return AndroidWebKitError( + "channel-error", "Unable to establish connection on channel: '$channelName'.", "") + } fun wrapResult(result: Any?): List { return listOf(result) @@ -27,50 +28,48 @@ private object AndroidWebkitLibraryPigeonUtils { fun wrapError(exception: Throwable): List { return if (exception is AndroidWebKitError) { - listOf( - exception.code, - exception.message, - exception.details - ) + listOf(exception.code, exception.message, exception.details) } else { listOf( - exception.javaClass.simpleName, - exception.toString(), - "Cause: " + exception.cause + ", Stacktrace: " + Log.getStackTraceString(exception) - ) + exception.javaClass.simpleName, + exception.toString(), + "Cause: " + exception.cause + ", Stacktrace: " + Log.getStackTraceString(exception)) } } } /** * Error class for passing custom error details to Flutter via a thrown PlatformException. + * * @property code The error code. * @property message The error message. * @property details The error details. Must be a datatype supported by the api codec. */ -class AndroidWebKitError ( - val code: String, - override val message: String? = null, - val details: Any? = null +class AndroidWebKitError( + val code: String, + override val message: String? = null, + val details: Any? = null ) : Throwable() /** * Maintains instances used to communicate with the corresponding objects in Dart. * - * Objects stored in this container are represented by an object in Dart that is also stored in - * an InstanceManager with the same identifier. + * Objects stored in this container are represented by an object in Dart that is also stored in an + * InstanceManager with the same identifier. * * When an instance is added with an identifier, either can be used to retrieve the other. * - * Added instances are added as a weak reference and a strong reference. When the strong - * reference is removed with [remove] and the weak reference is deallocated, the - * `finalizationListener.onFinalize` is called with the instance's identifier. However, if the strong - * reference is removed and then the identifier is retrieved with the intention to pass the identifier - * to Dart (e.g. calling [getIdentifierForStrongReference]), the strong reference to the instance - * is recreated. The strong reference will then need to be removed manually again. + * Added instances are added as a weak reference and a strong reference. When the strong reference + * is removed with [remove] and the weak reference is deallocated, the + * `finalizationListener.onFinalize` is called with the instance's identifier. However, if the + * strong reference is removed and then the identifier is retrieved with the intention to pass the + * identifier to Dart (e.g. calling [getIdentifierForStrongReference]), the strong reference to the + * instance is recreated. The strong reference will then need to be removed manually again. */ @Suppress("UNCHECKED_CAST", "MemberVisibilityCanBePrivate") -class AndroidWebkitLibraryPigeonInstanceManager(private val finalizationListener: PigeonFinalizationListener) { - /** Interface for listening when a weak reference of an instance is removed from the manager. */ +class AndroidWebkitLibraryPigeonInstanceManager( + private val finalizationListener: PigeonFinalizationListener +) { + /** Interface for listening when a weak reference of an instance is removed from the manager. */ interface PigeonFinalizationListener { fun onFinalize(identifier: Long) } @@ -111,19 +110,20 @@ class AndroidWebkitLibraryPigeonInstanceManager(private val finalizationListener private const val tag = "PigeonInstanceManager" /** - * Instantiate a new manager with a listener for garbage collected weak - * references. + * Instantiate a new manager with a listener for garbage collected weak references. * * When the manager is no longer needed, [stopFinalizationListener] must be called. */ - fun create(finalizationListener: PigeonFinalizationListener): AndroidWebkitLibraryPigeonInstanceManager { + fun create( + finalizationListener: PigeonFinalizationListener + ): AndroidWebkitLibraryPigeonInstanceManager { return AndroidWebkitLibraryPigeonInstanceManager(finalizationListener) } } /** - * Removes `identifier` and return its associated strongly referenced instance, if present, - * from the manager. + * Removes `identifier` and return its associated strongly referenced instance, if present, from + * the manager. */ fun remove(identifier: Long): T? { logWarningIfFinalizationListenerHasStopped() @@ -137,15 +137,13 @@ class AndroidWebkitLibraryPigeonInstanceManager(private val finalizationListener /** * Retrieves the identifier paired with an instance, if present, otherwise `null`. * - * * If the manager contains a strong reference to `instance`, it will return the identifier * associated with `instance`. If the manager contains only a weak reference to `instance`, a new * strong reference to `instance` will be added and will need to be removed again with [remove]. * - * * If this method returns a nonnull identifier, this method also expects the Dart - * `AndroidWebkitLibraryPigeonInstanceManager` to have, or recreate, a weak reference to the Dart instance the - * identifier is associated with. + * `AndroidWebkitLibraryPigeonInstanceManager` to have, or recreate, a weak reference to the Dart + * instance the identifier is associated with. */ fun getIdentifierForStrongReference(instance: Any?): Long? { logWarningIfFinalizationListenerHasStopped() @@ -159,9 +157,9 @@ class AndroidWebkitLibraryPigeonInstanceManager(private val finalizationListener /** * Adds a new instance that was instantiated from Dart. * - * The same instance can be added multiple times, but each identifier must be unique. This - * allows two objects that are equivalent (e.g. the `equals` method returns true and their - * hashcodes are equal) to both be added. + * The same instance can be added multiple times, but each identifier must be unique. This allows + * two objects that are equivalent (e.g. the `equals` method returns true and their hashcodes are + * equal) to both be added. * * [identifier] must be >= 0 and unique. */ @@ -173,13 +171,15 @@ class AndroidWebkitLibraryPigeonInstanceManager(private val finalizationListener /** * Adds a new unique instance that was instantiated from the host platform. * - * If the manager contains [instance], this returns the corresponding identifier. If the - * manager does not contain [instance], this adds the instance and returns a unique - * identifier for that [instance]. + * If the manager contains [instance], this returns the corresponding identifier. If the manager + * does not contain [instance], this adds the instance and returns a unique identifier for that + * [instance]. */ fun addHostCreatedInstance(instance: Any): Long { logWarningIfFinalizationListenerHasStopped() - require(!containsInstance(instance)) { "Instance of ${instance.javaClass} has already been added." } + require(!containsInstance(instance)) { + "Instance of ${instance.javaClass} has already been added." + } val identifier = nextIdentifier++ addInstance(instance, identifier) return identifier @@ -237,7 +237,8 @@ class AndroidWebkitLibraryPigeonInstanceManager(private val finalizationListener return } var reference: java.lang.ref.WeakReference? - while ((referenceQueue.poll() as java.lang.ref.WeakReference?).also { reference = it } != null) { + while ((referenceQueue.poll() as java.lang.ref.WeakReference?).also { reference = it } != + null) { val identifier = weakReferencesToIdentifiers.remove(reference) if (identifier != null) { weakInstances.remove(identifier) @@ -263,39 +264,43 @@ class AndroidWebkitLibraryPigeonInstanceManager(private val finalizationListener private fun logWarningIfFinalizationListenerHasStopped() { if (hasFinalizationListenerStopped()) { Log.w( - tag, - "The manager was used after calls to the PigeonFinalizationListener has been stopped." - ) + tag, + "The manager was used after calls to the PigeonFinalizationListener has been stopped.") } } } - /** Generated API for managing the Dart and native `InstanceManager`s. */ private class AndroidWebkitLibraryPigeonInstanceManagerApi(val binaryMessenger: BinaryMessenger) { companion object { /** The codec used by AndroidWebkitLibraryPigeonInstanceManagerApi. */ - val codec: MessageCodec by lazy { - AndroidWebkitLibraryPigeonCodec() - } + val codec: MessageCodec by lazy { AndroidWebkitLibraryPigeonCodec() } /** - * Sets up an instance of `AndroidWebkitLibraryPigeonInstanceManagerApi` to handle messages from the - * `binaryMessenger`. + * Sets up an instance of `AndroidWebkitLibraryPigeonInstanceManagerApi` to handle messages from + * the `binaryMessenger`. */ - fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, instanceManager: AndroidWebkitLibraryPigeonInstanceManager?) { + fun setUpMessageHandlers( + binaryMessenger: BinaryMessenger, + instanceManager: AndroidWebkitLibraryPigeonInstanceManager? + ) { run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.PigeonInternalInstanceManager.removeStrongReference", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.PigeonInternalInstanceManager.removeStrongReference", + codec) if (instanceManager != null) { channel.setMessageHandler { message, reply -> val args = message as List val identifierArg = args[0] as Long - val wrapped: List = try { - instanceManager.remove(identifierArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + instanceManager.remove(identifierArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -303,15 +308,20 @@ private class AndroidWebkitLibraryPigeonInstanceManagerApi(val binaryMessenger: } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.PigeonInternalInstanceManager.clear", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.PigeonInternalInstanceManager.clear", + codec) if (instanceManager != null) { channel.setMessageHandler { _, reply -> - val wrapped: List = try { - instanceManager.clear() - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + instanceManager.clear() + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -321,26 +331,28 @@ private class AndroidWebkitLibraryPigeonInstanceManagerApi(val binaryMessenger: } } - fun removeStrongReference(identifierArg: Long, callback: (Result) -> Unit) -{ - val channelName = "dev.flutter.pigeon.webview_flutter_android.PigeonInternalInstanceManager.removeStrongReference" + fun removeStrongReference(identifierArg: Long, callback: (Result) -> Unit) { + val channelName = + "dev.flutter.pigeon.webview_flutter_android.PigeonInternalInstanceManager.removeStrongReference" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } } /** - * Provides implementations for each ProxyApi implementation and provides access to resources - * needed by any implementation. + * Provides implementations for each ProxyApi implementation and provides access to resources needed + * by any implementation. */ abstract class AndroidWebkitLibraryPigeonProxyApiRegistrar(val binaryMessenger: BinaryMessenger) { /** Whether APIs should ignore calling to Dart. */ @@ -357,20 +369,19 @@ abstract class AndroidWebkitLibraryPigeonProxyApiRegistrar(val binaryMessenger: init { val api = AndroidWebkitLibraryPigeonInstanceManagerApi(binaryMessenger) - instanceManager = AndroidWebkitLibraryPigeonInstanceManager.create( - object : AndroidWebkitLibraryPigeonInstanceManager.PigeonFinalizationListener { - override fun onFinalize(identifier: Long) { - api.removeStrongReference(identifier) { - if (it.isFailure) { - Log.e( - "PigeonProxyApiRegistrar", - "Failed to remove Dart strong reference with identifier: $identifier" - ) - } - } - } - } - ) + instanceManager = + AndroidWebkitLibraryPigeonInstanceManager.create( + object : AndroidWebkitLibraryPigeonInstanceManager.PigeonFinalizationListener { + override fun onFinalize(identifier: Long) { + api.removeStrongReference(identifier) { + if (it.isFailure) { + Log.e( + "PigeonProxyApiRegistrar", + "Failed to remove Dart strong reference with identifier: $identifier") + } + } + } + }) } /** * An implementation of [PigeonApiWebResourceRequest] used to add a new Dart instance of @@ -397,8 +408,8 @@ abstract class AndroidWebkitLibraryPigeonProxyApiRegistrar(val binaryMessenger: abstract fun getPigeonApiWebResourceErrorCompat(): PigeonApiWebResourceErrorCompat /** - * An implementation of [PigeonApiWebViewPoint] used to add a new Dart instance of - * `WebViewPoint` to the Dart `InstanceManager`. + * An implementation of [PigeonApiWebViewPoint] used to add a new Dart instance of `WebViewPoint` + * to the Dart `InstanceManager`. */ abstract fun getPigeonApiWebViewPoint(): PigeonApiWebViewPoint @@ -415,14 +426,14 @@ abstract class AndroidWebkitLibraryPigeonProxyApiRegistrar(val binaryMessenger: abstract fun getPigeonApiCookieManager(): PigeonApiCookieManager /** - * An implementation of [PigeonApiWebView] used to add a new Dart instance of - * `WebView` to the Dart `InstanceManager`. + * An implementation of [PigeonApiWebView] used to add a new Dart instance of `WebView` to the + * Dart `InstanceManager`. */ abstract fun getPigeonApiWebView(): PigeonApiWebView /** - * An implementation of [PigeonApiWebSettings] used to add a new Dart instance of - * `WebSettings` to the Dart `InstanceManager`. + * An implementation of [PigeonApiWebSettings] used to add a new Dart instance of `WebSettings` to + * the Dart `InstanceManager`. */ abstract fun getPigeonApiWebSettings(): PigeonApiWebSettings @@ -457,8 +468,8 @@ abstract class AndroidWebkitLibraryPigeonProxyApiRegistrar(val binaryMessenger: abstract fun getPigeonApiFlutterAssetManager(): PigeonApiFlutterAssetManager /** - * An implementation of [PigeonApiWebStorage] used to add a new Dart instance of - * `WebStorage` to the Dart `InstanceManager`. + * An implementation of [PigeonApiWebStorage] used to add a new Dart instance of `WebStorage` to + * the Dart `InstanceManager`. */ abstract fun getPigeonApiWebStorage(): PigeonApiWebStorage @@ -481,14 +492,14 @@ abstract class AndroidWebkitLibraryPigeonProxyApiRegistrar(val binaryMessenger: abstract fun getPigeonApiCustomViewCallback(): PigeonApiCustomViewCallback /** - * An implementation of [PigeonApiView] used to add a new Dart instance of - * `View` to the Dart `InstanceManager`. + * An implementation of [PigeonApiView] used to add a new Dart instance of `View` to the Dart + * `InstanceManager`. */ abstract fun getPigeonApiView(): PigeonApiView /** - * An implementation of [PigeonApiGeolocationPermissionsCallback] used to add a new Dart instance of - * `GeolocationPermissionsCallback` to the Dart `InstanceManager`. + * An implementation of [PigeonApiGeolocationPermissionsCallback] used to add a new Dart instance + * of `GeolocationPermissionsCallback` to the Dart `InstanceManager`. */ abstract fun getPigeonApiGeolocationPermissionsCallback(): PigeonApiGeolocationPermissionsCallback @@ -511,11 +522,10 @@ abstract class AndroidWebkitLibraryPigeonProxyApiRegistrar(val binaryMessenger: abstract fun getPigeonApiClientCertRequest(): PigeonApiClientCertRequest /** - * An implementation of [PigeonApiPrivateKey] used to add a new Dart instance of - * `PrivateKey` to the Dart `InstanceManager`. + * An implementation of [PigeonApiPrivateKey] used to add a new Dart instance of `PrivateKey` to + * the Dart `InstanceManager`. */ - open fun getPigeonApiPrivateKey(): PigeonApiPrivateKey - { + open fun getPigeonApiPrivateKey(): PigeonApiPrivateKey { return PigeonApiPrivateKey(this) } @@ -523,8 +533,7 @@ abstract class AndroidWebkitLibraryPigeonProxyApiRegistrar(val binaryMessenger: * An implementation of [PigeonApiX509Certificate] used to add a new Dart instance of * `X509Certificate` to the Dart `InstanceManager`. */ - open fun getPigeonApiX509Certificate(): PigeonApiX509Certificate - { + open fun getPigeonApiX509Certificate(): PigeonApiX509Certificate { return PigeonApiX509Certificate(this) } @@ -535,8 +544,8 @@ abstract class AndroidWebkitLibraryPigeonProxyApiRegistrar(val binaryMessenger: abstract fun getPigeonApiSslErrorHandler(): PigeonApiSslErrorHandler /** - * An implementation of [PigeonApiSslError] used to add a new Dart instance of - * `SslError` to the Dart `InstanceManager`. + * An implementation of [PigeonApiSslError] used to add a new Dart instance of `SslError` to the + * Dart `InstanceManager`. */ abstract fun getPigeonApiSslError(): PigeonApiSslError @@ -553,28 +562,37 @@ abstract class AndroidWebkitLibraryPigeonProxyApiRegistrar(val binaryMessenger: abstract fun getPigeonApiSslCertificate(): PigeonApiSslCertificate fun setUp() { - AndroidWebkitLibraryPigeonInstanceManagerApi.setUpMessageHandlers(binaryMessenger, instanceManager) + AndroidWebkitLibraryPigeonInstanceManagerApi.setUpMessageHandlers( + binaryMessenger, instanceManager) PigeonApiCookieManager.setUpMessageHandlers(binaryMessenger, getPigeonApiCookieManager()) PigeonApiWebView.setUpMessageHandlers(binaryMessenger, getPigeonApiWebView()) PigeonApiWebSettings.setUpMessageHandlers(binaryMessenger, getPigeonApiWebSettings()) - PigeonApiJavaScriptChannel.setUpMessageHandlers(binaryMessenger, getPigeonApiJavaScriptChannel()) + PigeonApiJavaScriptChannel.setUpMessageHandlers( + binaryMessenger, getPigeonApiJavaScriptChannel()) PigeonApiWebViewClient.setUpMessageHandlers(binaryMessenger, getPigeonApiWebViewClient()) PigeonApiDownloadListener.setUpMessageHandlers(binaryMessenger, getPigeonApiDownloadListener()) PigeonApiWebChromeClient.setUpMessageHandlers(binaryMessenger, getPigeonApiWebChromeClient()) - PigeonApiFlutterAssetManager.setUpMessageHandlers(binaryMessenger, getPigeonApiFlutterAssetManager()) + PigeonApiFlutterAssetManager.setUpMessageHandlers( + binaryMessenger, getPigeonApiFlutterAssetManager()) PigeonApiWebStorage.setUpMessageHandlers(binaryMessenger, getPigeonApiWebStorage()) - PigeonApiPermissionRequest.setUpMessageHandlers(binaryMessenger, getPigeonApiPermissionRequest()) - PigeonApiCustomViewCallback.setUpMessageHandlers(binaryMessenger, getPigeonApiCustomViewCallback()) + PigeonApiPermissionRequest.setUpMessageHandlers( + binaryMessenger, getPigeonApiPermissionRequest()) + PigeonApiCustomViewCallback.setUpMessageHandlers( + binaryMessenger, getPigeonApiCustomViewCallback()) PigeonApiView.setUpMessageHandlers(binaryMessenger, getPigeonApiView()) - PigeonApiGeolocationPermissionsCallback.setUpMessageHandlers(binaryMessenger, getPigeonApiGeolocationPermissionsCallback()) + PigeonApiGeolocationPermissionsCallback.setUpMessageHandlers( + binaryMessenger, getPigeonApiGeolocationPermissionsCallback()) PigeonApiHttpAuthHandler.setUpMessageHandlers(binaryMessenger, getPigeonApiHttpAuthHandler()) PigeonApiAndroidMessage.setUpMessageHandlers(binaryMessenger, getPigeonApiAndroidMessage()) - PigeonApiClientCertRequest.setUpMessageHandlers(binaryMessenger, getPigeonApiClientCertRequest()) + PigeonApiClientCertRequest.setUpMessageHandlers( + binaryMessenger, getPigeonApiClientCertRequest()) PigeonApiSslErrorHandler.setUpMessageHandlers(binaryMessenger, getPigeonApiSslErrorHandler()) PigeonApiSslError.setUpMessageHandlers(binaryMessenger, getPigeonApiSslError()) - PigeonApiSslCertificateDName.setUpMessageHandlers(binaryMessenger, getPigeonApiSslCertificateDName()) + PigeonApiSslCertificateDName.setUpMessageHandlers( + binaryMessenger, getPigeonApiSslCertificateDName()) PigeonApiSslCertificate.setUpMessageHandlers(binaryMessenger, getPigeonApiSslCertificate()) } + fun tearDown() { AndroidWebkitLibraryPigeonInstanceManagerApi.setUpMessageHandlers(binaryMessenger, null) PigeonApiCookieManager.setUpMessageHandlers(binaryMessenger, null) @@ -599,17 +617,17 @@ abstract class AndroidWebkitLibraryPigeonProxyApiRegistrar(val binaryMessenger: PigeonApiSslCertificate.setUpMessageHandlers(binaryMessenger, null) } } -private class AndroidWebkitLibraryPigeonProxyApiBaseCodec(val registrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) : AndroidWebkitLibraryPigeonCodec() { + +private class AndroidWebkitLibraryPigeonProxyApiBaseCodec( + val registrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) : AndroidWebkitLibraryPigeonCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { 128.toByte() -> { val identifier: Long = readValue(buffer) as Long val instance: Any? = registrar.instanceManager.getInstance(identifier) if (instance == null) { - Log.e( - "PigeonProxyApiBaseCodec", - "Failed to find instance with identifier: $identifier" - ) + Log.e("PigeonProxyApiBaseCodec", "Failed to find instance with identifier: $identifier") } return instance } @@ -618,97 +636,86 @@ private class AndroidWebkitLibraryPigeonProxyApiBaseCodec(val registrar: Android } override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { - if (value is Boolean || value is ByteArray || value is Double || value is DoubleArray || value is FloatArray || value is Int || value is IntArray || value is List<*> || value is Long || value is LongArray || value is Map<*, *> || value is String || value is FileChooserMode || value is ConsoleMessageLevel || value is OverScrollMode || value is SslErrorType || value == null) { + if (value is Boolean || + value is ByteArray || + value is Double || + value is DoubleArray || + value is FloatArray || + value is Int || + value is IntArray || + value is List<*> || + value is Long || + value is LongArray || + value is Map<*, *> || + value is String || + value is FileChooserMode || + value is ConsoleMessageLevel || + value is OverScrollMode || + value is SslErrorType || + value == null) { super.writeValue(stream, value) return } if (value is android.webkit.WebResourceRequest) { - registrar.getPigeonApiWebResourceRequest().pigeon_newInstance(value) { } - } - else if (value is android.webkit.WebResourceResponse) { - registrar.getPigeonApiWebResourceResponse().pigeon_newInstance(value) { } - } - else if (android.os.Build.VERSION.SDK_INT >= 23 && value is android.webkit.WebResourceError) { - registrar.getPigeonApiWebResourceError().pigeon_newInstance(value) { } - } - else if (value is androidx.webkit.WebResourceErrorCompat) { - registrar.getPigeonApiWebResourceErrorCompat().pigeon_newInstance(value) { } - } - else if (value is WebViewPoint) { - registrar.getPigeonApiWebViewPoint().pigeon_newInstance(value) { } - } - else if (value is android.webkit.ConsoleMessage) { - registrar.getPigeonApiConsoleMessage().pigeon_newInstance(value) { } - } - else if (value is android.webkit.CookieManager) { - registrar.getPigeonApiCookieManager().pigeon_newInstance(value) { } - } - else if (value is android.webkit.WebView) { - registrar.getPigeonApiWebView().pigeon_newInstance(value) { } - } - else if (value is android.webkit.WebSettings) { - registrar.getPigeonApiWebSettings().pigeon_newInstance(value) { } - } - else if (value is JavaScriptChannel) { - registrar.getPigeonApiJavaScriptChannel().pigeon_newInstance(value) { } - } - else if (value is android.webkit.WebViewClient) { - registrar.getPigeonApiWebViewClient().pigeon_newInstance(value) { } - } - else if (value is android.webkit.DownloadListener) { - registrar.getPigeonApiDownloadListener().pigeon_newInstance(value) { } - } - else if (value is io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl) { - registrar.getPigeonApiWebChromeClient().pigeon_newInstance(value) { } - } - else if (value is io.flutter.plugins.webviewflutter.FlutterAssetManager) { - registrar.getPigeonApiFlutterAssetManager().pigeon_newInstance(value) { } - } - else if (value is android.webkit.WebStorage) { - registrar.getPigeonApiWebStorage().pigeon_newInstance(value) { } - } - else if (value is android.webkit.WebChromeClient.FileChooserParams) { - registrar.getPigeonApiFileChooserParams().pigeon_newInstance(value) { } - } - else if (value is android.webkit.PermissionRequest) { - registrar.getPigeonApiPermissionRequest().pigeon_newInstance(value) { } - } - else if (value is android.webkit.WebChromeClient.CustomViewCallback) { - registrar.getPigeonApiCustomViewCallback().pigeon_newInstance(value) { } - } - else if (value is android.view.View) { - registrar.getPigeonApiView().pigeon_newInstance(value) { } - } - else if (value is android.webkit.GeolocationPermissions.Callback) { - registrar.getPigeonApiGeolocationPermissionsCallback().pigeon_newInstance(value) { } - } - else if (value is android.webkit.HttpAuthHandler) { - registrar.getPigeonApiHttpAuthHandler().pigeon_newInstance(value) { } - } - else if (value is android.os.Message) { - registrar.getPigeonApiAndroidMessage().pigeon_newInstance(value) { } - } - else if (value is android.webkit.ClientCertRequest) { - registrar.getPigeonApiClientCertRequest().pigeon_newInstance(value) { } - } - else if (value is java.security.PrivateKey) { - registrar.getPigeonApiPrivateKey().pigeon_newInstance(value) { } - } - else if (value is java.security.cert.X509Certificate) { - registrar.getPigeonApiX509Certificate().pigeon_newInstance(value) { } - } - else if (value is android.webkit.SslErrorHandler) { - registrar.getPigeonApiSslErrorHandler().pigeon_newInstance(value) { } - } - else if (value is android.net.http.SslError) { - registrar.getPigeonApiSslError().pigeon_newInstance(value) { } - } - else if (value is android.net.http.SslCertificate.DName) { - registrar.getPigeonApiSslCertificateDName().pigeon_newInstance(value) { } - } - else if (value is android.net.http.SslCertificate) { - registrar.getPigeonApiSslCertificate().pigeon_newInstance(value) { } + registrar.getPigeonApiWebResourceRequest().pigeon_newInstance(value) {} + } else if (value is android.webkit.WebResourceResponse) { + registrar.getPigeonApiWebResourceResponse().pigeon_newInstance(value) {} + } else if (android.os.Build.VERSION.SDK_INT >= 23 && value is android.webkit.WebResourceError) { + registrar.getPigeonApiWebResourceError().pigeon_newInstance(value) {} + } else if (value is androidx.webkit.WebResourceErrorCompat) { + registrar.getPigeonApiWebResourceErrorCompat().pigeon_newInstance(value) {} + } else if (value is WebViewPoint) { + registrar.getPigeonApiWebViewPoint().pigeon_newInstance(value) {} + } else if (value is android.webkit.ConsoleMessage) { + registrar.getPigeonApiConsoleMessage().pigeon_newInstance(value) {} + } else if (value is android.webkit.CookieManager) { + registrar.getPigeonApiCookieManager().pigeon_newInstance(value) {} + } else if (value is android.webkit.WebView) { + registrar.getPigeonApiWebView().pigeon_newInstance(value) {} + } else if (value is android.webkit.WebSettings) { + registrar.getPigeonApiWebSettings().pigeon_newInstance(value) {} + } else if (value is JavaScriptChannel) { + registrar.getPigeonApiJavaScriptChannel().pigeon_newInstance(value) {} + } else if (value is android.webkit.WebViewClient) { + registrar.getPigeonApiWebViewClient().pigeon_newInstance(value) {} + } else if (value is android.webkit.DownloadListener) { + registrar.getPigeonApiDownloadListener().pigeon_newInstance(value) {} + } else if (value + is io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl) { + registrar.getPigeonApiWebChromeClient().pigeon_newInstance(value) {} + } else if (value is io.flutter.plugins.webviewflutter.FlutterAssetManager) { + registrar.getPigeonApiFlutterAssetManager().pigeon_newInstance(value) {} + } else if (value is android.webkit.WebStorage) { + registrar.getPigeonApiWebStorage().pigeon_newInstance(value) {} + } else if (value is android.webkit.WebChromeClient.FileChooserParams) { + registrar.getPigeonApiFileChooserParams().pigeon_newInstance(value) {} + } else if (value is android.webkit.PermissionRequest) { + registrar.getPigeonApiPermissionRequest().pigeon_newInstance(value) {} + } else if (value is android.webkit.WebChromeClient.CustomViewCallback) { + registrar.getPigeonApiCustomViewCallback().pigeon_newInstance(value) {} + } else if (value is android.view.View) { + registrar.getPigeonApiView().pigeon_newInstance(value) {} + } else if (value is android.webkit.GeolocationPermissions.Callback) { + registrar.getPigeonApiGeolocationPermissionsCallback().pigeon_newInstance(value) {} + } else if (value is android.webkit.HttpAuthHandler) { + registrar.getPigeonApiHttpAuthHandler().pigeon_newInstance(value) {} + } else if (value is android.os.Message) { + registrar.getPigeonApiAndroidMessage().pigeon_newInstance(value) {} + } else if (value is android.webkit.ClientCertRequest) { + registrar.getPigeonApiClientCertRequest().pigeon_newInstance(value) {} + } else if (value is java.security.PrivateKey) { + registrar.getPigeonApiPrivateKey().pigeon_newInstance(value) {} + } else if (value is java.security.cert.X509Certificate) { + registrar.getPigeonApiX509Certificate().pigeon_newInstance(value) {} + } else if (value is android.webkit.SslErrorHandler) { + registrar.getPigeonApiSslErrorHandler().pigeon_newInstance(value) {} + } else if (value is android.net.http.SslError) { + registrar.getPigeonApiSslError().pigeon_newInstance(value) {} + } else if (value is android.net.http.SslCertificate.DName) { + registrar.getPigeonApiSslCertificateDName().pigeon_newInstance(value) {} + } else if (value is android.net.http.SslCertificate) { + registrar.getPigeonApiSslCertificate().pigeon_newInstance(value) {} } when { @@ -716,7 +723,9 @@ private class AndroidWebkitLibraryPigeonProxyApiBaseCodec(val registrar: Android stream.write(128) writeValue(stream, registrar.instanceManager.getIdentifierForStrongReference(value)) } - else -> throw IllegalArgumentException("Unsupported value: '$value' of type '${value.javaClass.name}'") + else -> + throw IllegalArgumentException( + "Unsupported value: '$value' of type '${value.javaClass.name}'") } } } @@ -728,29 +737,31 @@ private class AndroidWebkitLibraryPigeonProxyApiBaseCodec(val registrar: Android */ enum class FileChooserMode(val raw: Int) { /** - * Open single file and requires that the file exists before allowing the - * user to pick it. + * Open single file and requires that the file exists before allowing the user to pick it. * - * See https://developer.android.com/reference/android/webkit/WebChromeClient.FileChooserParams#MODE_OPEN. + * See + * https://developer.android.com/reference/android/webkit/WebChromeClient.FileChooserParams#MODE_OPEN. */ OPEN(0), /** * Similar to [open] but allows multiple files to be selected. * - * See https://developer.android.com/reference/android/webkit/WebChromeClient.FileChooserParams#MODE_OPEN_MULTIPLE. + * See + * https://developer.android.com/reference/android/webkit/WebChromeClient.FileChooserParams#MODE_OPEN_MULTIPLE. */ OPEN_MULTIPLE(1), /** * Allows picking a nonexistent file and saving it. * - * See https://developer.android.com/reference/android/webkit/WebChromeClient.FileChooserParams#MODE_SAVE. + * See + * https://developer.android.com/reference/android/webkit/WebChromeClient.FileChooserParams#MODE_SAVE. */ SAVE(2), /** * Indicates a `FileChooserMode` with an unknown mode. * - * This does not represent an actual value provided by the platform and only - * indicates a value was provided that isn't currently supported. + * This does not represent an actual value provided by the platform and only indicates a value was + * provided that isn't currently supported. */ UNKNOWN(3); @@ -800,8 +811,8 @@ enum class ConsoleMessageLevel(val raw: Int) { /** * Indicates a message with an unknown level. * - * This does not represent an actual value provided by the platform and only - * indicates a value was provided that isn't currently supported. + * This does not represent an actual value provided by the platform and only indicates a value was + * provided that isn't currently supported. */ UNKNOWN(5); @@ -818,14 +829,11 @@ enum class ConsoleMessageLevel(val raw: Int) { * See https://developer.android.com/reference/android/view/View#OVER_SCROLL_ALWAYS. */ enum class OverScrollMode(val raw: Int) { - /** - * Always allow a user to over-scroll this view, provided it is a view that - * can scroll. - */ + /** Always allow a user to over-scroll this view, provided it is a view that can scroll. */ ALWAYS(0), /** - * Allow a user to over-scroll this view only if the content is large enough - * to meaningfully scroll, provided it is a view that can scroll. + * Allow a user to over-scroll this view only if the content is large enough to meaningfully + * scroll, provided it is a view that can scroll. */ IF_CONTENT_SCROLLS(1), /** Never allow a user to over-scroll this view. */ @@ -867,33 +875,27 @@ enum class SslErrorType(val raw: Int) { } } } + private open class AndroidWebkitLibraryPigeonCodec : StandardMessageCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { 129.toByte() -> { - return (readValue(buffer) as Long?)?.let { - FileChooserMode.ofRaw(it.toInt()) - } + return (readValue(buffer) as Long?)?.let { FileChooserMode.ofRaw(it.toInt()) } } 130.toByte() -> { - return (readValue(buffer) as Long?)?.let { - ConsoleMessageLevel.ofRaw(it.toInt()) - } + return (readValue(buffer) as Long?)?.let { ConsoleMessageLevel.ofRaw(it.toInt()) } } 131.toByte() -> { - return (readValue(buffer) as Long?)?.let { - OverScrollMode.ofRaw(it.toInt()) - } + return (readValue(buffer) as Long?)?.let { OverScrollMode.ofRaw(it.toInt()) } } 132.toByte() -> { - return (readValue(buffer) as Long?)?.let { - SslErrorType.ofRaw(it.toInt()) - } + return (readValue(buffer) as Long?)?.let { SslErrorType.ofRaw(it.toInt()) } } else -> super.readValueOfType(type, buffer) } } - override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { + + override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { when (value) { is FileChooserMode -> { stream.write(129) @@ -922,7 +924,9 @@ private open class AndroidWebkitLibraryPigeonCodec : StandardMessageCodec() { * See https://developer.android.com/reference/android/webkit/WebResourceRequest. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiWebResourceRequest(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiWebResourceRequest( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { /** The URL for which the resource request was made. */ abstract fun url(pigeon_instance: android.webkit.WebResourceRequest): String @@ -939,20 +943,25 @@ abstract class PigeonApiWebResourceRequest(open val pigeonRegistrar: AndroidWebk abstract fun method(pigeon_instance: android.webkit.WebResourceRequest): String /** The headers associated with the request. */ - abstract fun requestHeaders(pigeon_instance: android.webkit.WebResourceRequest): Map? + abstract fun requestHeaders( + pigeon_instance: android.webkit.WebResourceRequest + ): Map? @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of WebResourceRequest and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.webkit.WebResourceRequest, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.webkit.WebResourceRequest, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val urlArg = url(pigeon_instanceArg) val isForMainFrameArg = isForMainFrame(pigeon_instanceArg) val isRedirectArg = isRedirect(pigeon_instanceArg) @@ -961,22 +970,34 @@ abstract class PigeonApiWebResourceRequest(open val pigeonRegistrar: AndroidWebk val requestHeadersArg = requestHeaders(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.WebResourceRequest.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.WebResourceRequest.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_identifierArg, urlArg, isForMainFrameArg, isRedirectArg, hasGestureArg, methodArg, requestHeadersArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) - } else { - callback(Result.success(Unit)) + channel.send( + listOf( + pigeon_identifierArg, + urlArg, + isForMainFrameArg, + isRedirectArg, + hasGestureArg, + methodArg, + requestHeadersArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback( + Result.failure( + AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } - } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } - } } } - } /** * Encapsulates a resource response. @@ -984,50 +1005,59 @@ abstract class PigeonApiWebResourceRequest(open val pigeonRegistrar: AndroidWebk * See https://developer.android.com/reference/android/webkit/WebResourceResponse. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiWebResourceResponse(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiWebResourceResponse( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { /** The resource response's status code. */ abstract fun statusCode(pigeon_instance: android.webkit.WebResourceResponse): Long @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of WebResourceResponse and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.webkit.WebResourceResponse, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.webkit.WebResourceResponse, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val statusCodeArg = statusCode(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.WebResourceResponse.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.WebResourceResponse.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg, statusCodeArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } } } - } /** - * Encapsulates information about errors that occurred during loading of web - * resources. + * Encapsulates information about errors that occurred during loading of web resources. * * See https://developer.android.com/reference/android/webkit/WebResourceError. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiWebResourceError(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiWebResourceError( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { /** The error code of the error. */ @androidx.annotation.RequiresApi(api = 23) abstract fun errorCode(pigeon_instance: android.webkit.WebResourceError): Long @@ -1039,45 +1069,52 @@ abstract class PigeonApiWebResourceError(open val pigeonRegistrar: AndroidWebkit @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of WebResourceError and attaches it to [pigeon_instanceArg]. */ @androidx.annotation.RequiresApi(api = 23) - fun pigeon_newInstance(pigeon_instanceArg: android.webkit.WebResourceError, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.webkit.WebResourceError, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val errorCodeArg = errorCode(pigeon_instanceArg) val descriptionArg = description(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.WebResourceError.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.WebResourceError.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg, errorCodeArg, descriptionArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } } } - } /** - * Encapsulates information about errors that occurred during loading of web - * resources. + * Encapsulates information about errors that occurred during loading of web resources. * * See https://developer.android.com/reference/androidx/webkit/WebResourceErrorCompat. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiWebResourceErrorCompat(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiWebResourceErrorCompat( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { /** The error code of the error. */ abstract fun errorCode(pigeon_instance: androidx.webkit.WebResourceErrorCompat): Long @@ -1086,36 +1123,42 @@ abstract class PigeonApiWebResourceErrorCompat(open val pigeonRegistrar: Android @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of WebResourceErrorCompat and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: androidx.webkit.WebResourceErrorCompat, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: androidx.webkit.WebResourceErrorCompat, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val errorCodeArg = errorCode(pigeon_instanceArg) val descriptionArg = description(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.WebResourceErrorCompat.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.WebResourceErrorCompat.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg, errorCodeArg, descriptionArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } } } - } /** * Represents a position on a web page. @@ -1123,23 +1166,25 @@ abstract class PigeonApiWebResourceErrorCompat(open val pigeonRegistrar: Android * This is a custom class created for convenience of the wrapper. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiWebViewPoint(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiWebViewPoint( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { abstract fun x(pigeon_instance: WebViewPoint): Long abstract fun y(pigeon_instance: WebViewPoint): Long @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of WebViewPoint and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: WebViewPoint, callback: (Result) -> Unit) -{ + fun pigeon_newInstance(pigeon_instanceArg: WebViewPoint, callback: (Result) -> Unit) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val xArg = x(pigeon_instanceArg) val yArg = y(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger @@ -1149,17 +1194,19 @@ abstract class PigeonApiWebViewPoint(open val pigeonRegistrar: AndroidWebkitLibr channel.send(listOf(pigeon_identifierArg, xArg, yArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } } } - } /** * Represents a JavaScript console message from WebCore. @@ -1167,7 +1214,9 @@ abstract class PigeonApiWebViewPoint(open val pigeonRegistrar: AndroidWebkitLibr * See https://developer.android.com/reference/android/webkit/ConsoleMessage */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiConsoleMessage(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiConsoleMessage( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { abstract fun lineNumber(pigeon_instance: android.webkit.ConsoleMessage): Long abstract fun message(pigeon_instance: android.webkit.ConsoleMessage): String @@ -1178,38 +1227,44 @@ abstract class PigeonApiConsoleMessage(open val pigeonRegistrar: AndroidWebkitLi @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of ConsoleMessage and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.webkit.ConsoleMessage, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.webkit.ConsoleMessage, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val lineNumberArg = lineNumber(pigeon_instanceArg) val messageArg = message(pigeon_instanceArg) val levelArg = level(pigeon_instanceArg) val sourceIdArg = sourceId(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.ConsoleMessage.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.ConsoleMessage.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg, lineNumberArg, messageArg, levelArg, sourceIdArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } } } - } /** * Manages the cookies used by an application's `WebView` instances. @@ -1217,34 +1272,49 @@ abstract class PigeonApiConsoleMessage(open val pigeonRegistrar: AndroidWebkitLi * See https://developer.android.com/reference/android/webkit/CookieManager. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiCookieManager(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiCookieManager( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { abstract fun instance(): android.webkit.CookieManager /** Sets a single cookie (key-value pair) for the given URL. */ abstract fun setCookie(pigeon_instance: android.webkit.CookieManager, url: String, value: String) /** Removes all cookies. */ - abstract fun removeAllCookies(pigeon_instance: android.webkit.CookieManager, callback: (Result) -> Unit) + abstract fun removeAllCookies( + pigeon_instance: android.webkit.CookieManager, + callback: (Result) -> Unit + ) /** Sets whether the `WebView` should allow third party cookies to be set. */ - abstract fun setAcceptThirdPartyCookies(pigeon_instance: android.webkit.CookieManager, webView: android.webkit.WebView, accept: Boolean) + abstract fun setAcceptThirdPartyCookies( + pigeon_instance: android.webkit.CookieManager, + webView: android.webkit.WebView, + accept: Boolean + ) companion object { @Suppress("LocalVariableName") fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiCookieManager?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.CookieManager.instance", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.CookieManager.instance", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_identifierArg = args[0] as Long - val wrapped: List = try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.instance(), pigeon_identifierArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + api.instance(), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1252,19 +1322,24 @@ abstract class PigeonApiCookieManager(open val pigeonRegistrar: AndroidWebkitLib } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.CookieManager.setCookie", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.CookieManager.setCookie", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.CookieManager val urlArg = args[1] as String val valueArg = args[2] as String - val wrapped: List = try { - api.setCookie(pigeon_instanceArg, urlArg, valueArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setCookie(pigeon_instanceArg, urlArg, valueArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1272,7 +1347,11 @@ abstract class PigeonApiCookieManager(open val pigeonRegistrar: AndroidWebkitLib } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.CookieManager.removeAllCookies", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.CookieManager.removeAllCookies", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1292,19 +1371,24 @@ abstract class PigeonApiCookieManager(open val pigeonRegistrar: AndroidWebkitLib } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.CookieManager.setAcceptThirdPartyCookies", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.CookieManager.setAcceptThirdPartyCookies", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.CookieManager val webViewArg = args[1] as android.webkit.WebView val acceptArg = args[2] as Boolean - val wrapped: List = try { - api.setAcceptThirdPartyCookies(pigeon_instanceArg, webViewArg, acceptArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setAcceptThirdPartyCookies(pigeon_instanceArg, webViewArg, acceptArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1316,34 +1400,40 @@ abstract class PigeonApiCookieManager(open val pigeonRegistrar: AndroidWebkitLib @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of CookieManager and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.webkit.CookieManager, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.webkit.CookieManager, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.CookieManager.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.CookieManager.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } } } - } /** * A View that displays web pages. @@ -1351,23 +1441,38 @@ abstract class PigeonApiCookieManager(open val pigeonRegistrar: AndroidWebkitLib * See https://developer.android.com/reference/android/webkit/WebView. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiWebView( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { abstract fun pigeon_defaultConstructor(): android.webkit.WebView /** The WebSettings object used to control the settings for this WebView. */ abstract fun settings(pigeon_instance: android.webkit.WebView): android.webkit.WebSettings /** Loads the given data into this WebView using a 'data' scheme URL. */ - abstract fun loadData(pigeon_instance: android.webkit.WebView, data: String, mimeType: String?, encoding: String?) - - /** - * Loads the given data into this WebView, using baseUrl as the base URL for - * the content. - */ - abstract fun loadDataWithBaseUrl(pigeon_instance: android.webkit.WebView, baseUrl: String?, data: String, mimeType: String?, encoding: String?, historyUrl: String?) + abstract fun loadData( + pigeon_instance: android.webkit.WebView, + data: String, + mimeType: String?, + encoding: String? + ) + + /** Loads the given data into this WebView, using baseUrl as the base URL for the content. */ + abstract fun loadDataWithBaseUrl( + pigeon_instance: android.webkit.WebView, + baseUrl: String?, + data: String, + mimeType: String?, + encoding: String?, + historyUrl: String? + ) /** Loads the given URL. */ - abstract fun loadUrl(pigeon_instance: android.webkit.WebView, url: String, headers: Map) + abstract fun loadUrl( + pigeon_instance: android.webkit.WebView, + url: String, + headers: Map + ) /** Loads the URL with postData using "POST" method into this WebView. */ abstract fun postUrl(pigeon_instance: android.webkit.WebView, url: String, data: ByteArray) @@ -1393,41 +1498,51 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi /** Clears the resource cache. */ abstract fun clearCache(pigeon_instance: android.webkit.WebView, includeDiskFiles: Boolean) - /** - * Asynchronously evaluates JavaScript in the context of the currently - * displayed page. - */ - abstract fun evaluateJavascript(pigeon_instance: android.webkit.WebView, javascriptString: String, callback: (Result) -> Unit) + /** Asynchronously evaluates JavaScript in the context of the currently displayed page. */ + abstract fun evaluateJavascript( + pigeon_instance: android.webkit.WebView, + javascriptString: String, + callback: (Result) -> Unit + ) /** Gets the title for the current page. */ abstract fun getTitle(pigeon_instance: android.webkit.WebView): String? /** - * Enables debugging of web contents (HTML / CSS / JavaScript) loaded into - * any WebViews of this application. + * Enables debugging of web contents (HTML / CSS / JavaScript) loaded into any WebViews of this + * application. */ abstract fun setWebContentsDebuggingEnabled(enabled: Boolean) - /** - * Sets the WebViewClient that will receive various notifications and - * requests. - */ - abstract fun setWebViewClient(pigeon_instance: android.webkit.WebView, client: android.webkit.WebViewClient?) + /** Sets the WebViewClient that will receive various notifications and requests. */ + abstract fun setWebViewClient( + pigeon_instance: android.webkit.WebView, + client: android.webkit.WebViewClient? + ) /** Injects the supplied Java object into this WebView. */ - abstract fun addJavaScriptChannel(pigeon_instance: android.webkit.WebView, channel: JavaScriptChannel) + abstract fun addJavaScriptChannel( + pigeon_instance: android.webkit.WebView, + channel: JavaScriptChannel + ) /** Removes a previously injected Java object from this WebView. */ abstract fun removeJavaScriptChannel(pigeon_instance: android.webkit.WebView, name: String) /** - * Registers the interface to be used when content can not be handled by the - * rendering engine, and should be downloaded instead. + * Registers the interface to be used when content can not be handled by the rendering engine, and + * should be downloaded instead. */ - abstract fun setDownloadListener(pigeon_instance: android.webkit.WebView, listener: android.webkit.DownloadListener?) + abstract fun setDownloadListener( + pigeon_instance: android.webkit.WebView, + listener: android.webkit.DownloadListener? + ) /** Sets the chrome handler. */ - abstract fun setWebChromeClient(pigeon_instance: android.webkit.WebView, client: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl?) + abstract fun setWebChromeClient( + pigeon_instance: android.webkit.WebView, + client: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl? + ) /** Sets the background color for this view. */ abstract fun setBackgroundColor(pigeon_instance: android.webkit.WebView, color: Long) @@ -1440,17 +1555,23 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiWebView?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.pigeon_defaultConstructor", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.pigeon_defaultConstructor", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_identifierArg = args[0] as Long - val wrapped: List = try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.pigeon_defaultConstructor(), pigeon_identifierArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + api.pigeon_defaultConstructor(), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1458,18 +1579,24 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.settings", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.settings", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView val pigeon_identifierArg = args[1] as Long - val wrapped: List = try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.settings(pigeon_instanceArg), pigeon_identifierArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + api.settings(pigeon_instanceArg), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1477,7 +1604,11 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.loadData", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.loadData", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1485,12 +1616,13 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi val dataArg = args[1] as String val mimeTypeArg = args[2] as String? val encodingArg = args[3] as String? - val wrapped: List = try { - api.loadData(pigeon_instanceArg, dataArg, mimeTypeArg, encodingArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.loadData(pigeon_instanceArg, dataArg, mimeTypeArg, encodingArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1498,7 +1630,11 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.loadDataWithBaseUrl", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.loadDataWithBaseUrl", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1508,12 +1644,19 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi val mimeTypeArg = args[3] as String? val encodingArg = args[4] as String? val historyUrlArg = args[5] as String? - val wrapped: List = try { - api.loadDataWithBaseUrl(pigeon_instanceArg, baseUrlArg, dataArg, mimeTypeArg, encodingArg, historyUrlArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.loadDataWithBaseUrl( + pigeon_instanceArg, + baseUrlArg, + dataArg, + mimeTypeArg, + encodingArg, + historyUrlArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1521,19 +1664,24 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.loadUrl", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.loadUrl", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView val urlArg = args[1] as String val headersArg = args[2] as Map - val wrapped: List = try { - api.loadUrl(pigeon_instanceArg, urlArg, headersArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.loadUrl(pigeon_instanceArg, urlArg, headersArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1541,19 +1689,24 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.postUrl", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.postUrl", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView val urlArg = args[1] as String val dataArg = args[2] as ByteArray - val wrapped: List = try { - api.postUrl(pigeon_instanceArg, urlArg, dataArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.postUrl(pigeon_instanceArg, urlArg, dataArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1561,16 +1714,19 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.getUrl", codec) + val channel = + BasicMessageChannel( + binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.getUrl", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView - val wrapped: List = try { - listOf(api.getUrl(pigeon_instanceArg)) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + listOf(api.getUrl(pigeon_instanceArg)) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1578,16 +1734,21 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.canGoBack", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.canGoBack", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView - val wrapped: List = try { - listOf(api.canGoBack(pigeon_instanceArg)) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + listOf(api.canGoBack(pigeon_instanceArg)) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1595,16 +1756,21 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.canGoForward", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.canGoForward", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView - val wrapped: List = try { - listOf(api.canGoForward(pigeon_instanceArg)) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + listOf(api.canGoForward(pigeon_instanceArg)) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1612,17 +1778,20 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.goBack", codec) + val channel = + BasicMessageChannel( + binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.goBack", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView - val wrapped: List = try { - api.goBack(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.goBack(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1630,17 +1799,22 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.goForward", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.goForward", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView - val wrapped: List = try { - api.goForward(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.goForward(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1648,17 +1822,20 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.reload", codec) + val channel = + BasicMessageChannel( + binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.reload", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView - val wrapped: List = try { - api.reload(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.reload(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1666,18 +1843,23 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.clearCache", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.clearCache", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView val includeDiskFilesArg = args[1] as Boolean - val wrapped: List = try { - api.clearCache(pigeon_instanceArg, includeDiskFilesArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.clearCache(pigeon_instanceArg, includeDiskFilesArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1685,13 +1867,18 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.evaluateJavascript", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.evaluateJavascript", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView val javascriptStringArg = args[1] as String - api.evaluateJavascript(pigeon_instanceArg, javascriptStringArg) { result: Result -> + api.evaluateJavascript(pigeon_instanceArg, javascriptStringArg) { + result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(AndroidWebkitLibraryPigeonUtils.wrapError(error)) @@ -1706,16 +1893,21 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.getTitle", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.getTitle", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView - val wrapped: List = try { - listOf(api.getTitle(pigeon_instanceArg)) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + listOf(api.getTitle(pigeon_instanceArg)) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1723,17 +1915,22 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.setWebContentsDebuggingEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.setWebContentsDebuggingEnabled", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val enabledArg = args[0] as Boolean - val wrapped: List = try { - api.setWebContentsDebuggingEnabled(enabledArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setWebContentsDebuggingEnabled(enabledArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1741,18 +1938,23 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.setWebViewClient", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.setWebViewClient", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView val clientArg = args[1] as android.webkit.WebViewClient? - val wrapped: List = try { - api.setWebViewClient(pigeon_instanceArg, clientArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setWebViewClient(pigeon_instanceArg, clientArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1760,18 +1962,23 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.addJavaScriptChannel", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.addJavaScriptChannel", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView val channelArg = args[1] as JavaScriptChannel - val wrapped: List = try { - api.addJavaScriptChannel(pigeon_instanceArg, channelArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.addJavaScriptChannel(pigeon_instanceArg, channelArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1779,18 +1986,23 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.removeJavaScriptChannel", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.removeJavaScriptChannel", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView val nameArg = args[1] as String - val wrapped: List = try { - api.removeJavaScriptChannel(pigeon_instanceArg, nameArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.removeJavaScriptChannel(pigeon_instanceArg, nameArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1798,18 +2010,23 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.setDownloadListener", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.setDownloadListener", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView val listenerArg = args[1] as android.webkit.DownloadListener? - val wrapped: List = try { - api.setDownloadListener(pigeon_instanceArg, listenerArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setDownloadListener(pigeon_instanceArg, listenerArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1817,18 +2034,26 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.setWebChromeClient", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.setWebChromeClient", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView - val clientArg = args[1] as io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl? - val wrapped: List = try { - api.setWebChromeClient(pigeon_instanceArg, clientArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val clientArg = + args[1] + as + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl? + val wrapped: List = + try { + api.setWebChromeClient(pigeon_instanceArg, clientArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1836,18 +2061,23 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.setBackgroundColor", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.setBackgroundColor", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView val colorArg = args[1] as Long - val wrapped: List = try { - api.setBackgroundColor(pigeon_instanceArg, colorArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setBackgroundColor(pigeon_instanceArg, colorArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1855,17 +2085,22 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.destroy", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.destroy", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView - val wrapped: List = try { - api.destroy(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.destroy(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1877,16 +2112,19 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of WebView and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.webkit.WebView, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.webkit.WebView, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.webview_flutter_android.WebView.pigeon_newInstance" @@ -1894,23 +2132,32 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } } } /** - * This is called in response to an internal scroll in this view (i.e., the - * view scrolled its own contents). + * This is called in response to an internal scroll in this view (i.e., the view scrolled its own + * contents). */ - fun onScrollChanged(pigeon_instanceArg: android.webkit.WebView, leftArg: Long, topArg: Long, oldLeftArg: Long, oldTopArg: Long, callback: (Result) -> Unit) -{ + fun onScrollChanged( + pigeon_instanceArg: android.webkit.WebView, + leftArg: Long, + topArg: Long, + oldLeftArg: Long, + oldTopArg: Long, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -1924,23 +2171,23 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi channel.send(listOf(pigeon_instanceArg, leftArg, topArg, oldLeftArg, oldTopArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } @Suppress("FunctionName") /** An implementation of [PigeonApiView] used to access callback methods */ - fun pigeon_getPigeonApiView(): PigeonApiView - { + fun pigeon_getPigeonApiView(): PigeonApiView { return pigeonRegistrar.getPigeonApiView() } - } /** * Manages settings state for a `WebView`. @@ -1948,52 +2195,68 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi * See https://developer.android.com/reference/android/webkit/WebSettings. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiWebSettings( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { /** Sets whether the DOM storage API is enabled. */ abstract fun setDomStorageEnabled(pigeon_instance: android.webkit.WebSettings, flag: Boolean) /** Tells JavaScript to open windows automatically. */ - abstract fun setJavaScriptCanOpenWindowsAutomatically(pigeon_instance: android.webkit.WebSettings, flag: Boolean) + abstract fun setJavaScriptCanOpenWindowsAutomatically( + pigeon_instance: android.webkit.WebSettings, + flag: Boolean + ) /** Sets whether the WebView whether supports multiple windows. */ - abstract fun setSupportMultipleWindows(pigeon_instance: android.webkit.WebSettings, support: Boolean) + abstract fun setSupportMultipleWindows( + pigeon_instance: android.webkit.WebSettings, + support: Boolean + ) /** Tells the WebView to enable JavaScript execution. */ abstract fun setJavaScriptEnabled(pigeon_instance: android.webkit.WebSettings, flag: Boolean) /** Sets the WebView's user-agent string. */ - abstract fun setUserAgentString(pigeon_instance: android.webkit.WebSettings, userAgentString: String?) + abstract fun setUserAgentString( + pigeon_instance: android.webkit.WebSettings, + userAgentString: String? + ) /** Sets whether the WebView requires a user gesture to play media. */ - abstract fun setMediaPlaybackRequiresUserGesture(pigeon_instance: android.webkit.WebSettings, require: Boolean) + abstract fun setMediaPlaybackRequiresUserGesture( + pigeon_instance: android.webkit.WebSettings, + require: Boolean + ) /** - * Sets whether the WebView should support zooming using its on-screen zoom - * controls and gestures. + * Sets whether the WebView should support zooming using its on-screen zoom controls and gestures. */ abstract fun setSupportZoom(pigeon_instance: android.webkit.WebSettings, support: Boolean) /** - * Sets whether the WebView loads pages in overview mode, that is, zooms out - * the content to fit on screen by width. + * Sets whether the WebView loads pages in overview mode, that is, zooms out the content to fit on + * screen by width. */ - abstract fun setLoadWithOverviewMode(pigeon_instance: android.webkit.WebSettings, overview: Boolean) + abstract fun setLoadWithOverviewMode( + pigeon_instance: android.webkit.WebSettings, + overview: Boolean + ) /** - * Sets whether the WebView should enable support for the "viewport" HTML - * meta tag or should use a wide viewport. + * Sets whether the WebView should enable support for the "viewport" HTML meta tag or should use a + * wide viewport. */ abstract fun setUseWideViewPort(pigeon_instance: android.webkit.WebSettings, use: Boolean) /** - * Sets whether the WebView should display on-screen zoom controls when using - * the built-in zoom mechanisms. + * Sets whether the WebView should display on-screen zoom controls when using the built-in zoom + * mechanisms. */ abstract fun setDisplayZoomControls(pigeon_instance: android.webkit.WebSettings, enabled: Boolean) /** - * Sets whether the WebView should display on-screen zoom controls when using - * the built-in zoom mechanisms. + * Sets whether the WebView should display on-screen zoom controls when using the built-in zoom + * mechanisms. */ abstract fun setBuiltInZoomControls(pigeon_instance: android.webkit.WebSettings, enabled: Boolean) @@ -2017,18 +2280,23 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiWebSettings?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setDomStorageEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebSettings.setDomStorageEnabled", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val flagArg = args[1] as Boolean - val wrapped: List = try { - api.setDomStorageEnabled(pigeon_instanceArg, flagArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setDomStorageEnabled(pigeon_instanceArg, flagArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2036,18 +2304,23 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setJavaScriptCanOpenWindowsAutomatically", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebSettings.setJavaScriptCanOpenWindowsAutomatically", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val flagArg = args[1] as Boolean - val wrapped: List = try { - api.setJavaScriptCanOpenWindowsAutomatically(pigeon_instanceArg, flagArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setJavaScriptCanOpenWindowsAutomatically(pigeon_instanceArg, flagArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2055,18 +2328,23 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setSupportMultipleWindows", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebSettings.setSupportMultipleWindows", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val supportArg = args[1] as Boolean - val wrapped: List = try { - api.setSupportMultipleWindows(pigeon_instanceArg, supportArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setSupportMultipleWindows(pigeon_instanceArg, supportArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2074,18 +2352,23 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setJavaScriptEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebSettings.setJavaScriptEnabled", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val flagArg = args[1] as Boolean - val wrapped: List = try { - api.setJavaScriptEnabled(pigeon_instanceArg, flagArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setJavaScriptEnabled(pigeon_instanceArg, flagArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2093,18 +2376,23 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setUserAgentString", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebSettings.setUserAgentString", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val userAgentStringArg = args[1] as String? - val wrapped: List = try { - api.setUserAgentString(pigeon_instanceArg, userAgentStringArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setUserAgentString(pigeon_instanceArg, userAgentStringArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2112,18 +2400,23 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setMediaPlaybackRequiresUserGesture", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebSettings.setMediaPlaybackRequiresUserGesture", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val requireArg = args[1] as Boolean - val wrapped: List = try { - api.setMediaPlaybackRequiresUserGesture(pigeon_instanceArg, requireArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setMediaPlaybackRequiresUserGesture(pigeon_instanceArg, requireArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2131,18 +2424,23 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setSupportZoom", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebSettings.setSupportZoom", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val supportArg = args[1] as Boolean - val wrapped: List = try { - api.setSupportZoom(pigeon_instanceArg, supportArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setSupportZoom(pigeon_instanceArg, supportArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2150,18 +2448,23 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setLoadWithOverviewMode", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebSettings.setLoadWithOverviewMode", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val overviewArg = args[1] as Boolean - val wrapped: List = try { - api.setLoadWithOverviewMode(pigeon_instanceArg, overviewArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setLoadWithOverviewMode(pigeon_instanceArg, overviewArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2169,18 +2472,23 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setUseWideViewPort", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebSettings.setUseWideViewPort", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val useArg = args[1] as Boolean - val wrapped: List = try { - api.setUseWideViewPort(pigeon_instanceArg, useArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setUseWideViewPort(pigeon_instanceArg, useArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2188,18 +2496,23 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setDisplayZoomControls", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebSettings.setDisplayZoomControls", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val enabledArg = args[1] as Boolean - val wrapped: List = try { - api.setDisplayZoomControls(pigeon_instanceArg, enabledArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setDisplayZoomControls(pigeon_instanceArg, enabledArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2207,18 +2520,23 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setBuiltInZoomControls", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebSettings.setBuiltInZoomControls", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val enabledArg = args[1] as Boolean - val wrapped: List = try { - api.setBuiltInZoomControls(pigeon_instanceArg, enabledArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setBuiltInZoomControls(pigeon_instanceArg, enabledArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2226,18 +2544,23 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setAllowFileAccess", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebSettings.setAllowFileAccess", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val enabledArg = args[1] as Boolean - val wrapped: List = try { - api.setAllowFileAccess(pigeon_instanceArg, enabledArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setAllowFileAccess(pigeon_instanceArg, enabledArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2245,18 +2568,23 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setAllowContentAccess", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebSettings.setAllowContentAccess", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val enabledArg = args[1] as Boolean - val wrapped: List = try { - api.setAllowContentAccess(pigeon_instanceArg, enabledArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setAllowContentAccess(pigeon_instanceArg, enabledArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2264,18 +2592,23 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setGeolocationEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebSettings.setGeolocationEnabled", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val enabledArg = args[1] as Boolean - val wrapped: List = try { - api.setGeolocationEnabled(pigeon_instanceArg, enabledArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setGeolocationEnabled(pigeon_instanceArg, enabledArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2283,18 +2616,23 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setTextZoom", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebSettings.setTextZoom", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val textZoomArg = args[1] as Long - val wrapped: List = try { - api.setTextZoom(pigeon_instanceArg, textZoomArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setTextZoom(pigeon_instanceArg, textZoomArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2302,16 +2640,21 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.getUserAgentString", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebSettings.getUserAgentString", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings - val wrapped: List = try { - listOf(api.getUserAgentString(pigeon_instanceArg)) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + listOf(api.getUserAgentString(pigeon_instanceArg)) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2323,16 +2666,19 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of WebSettings and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.webkit.WebSettings, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.webkit.WebSettings, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.webview_flutter_android.WebSettings.pigeon_newInstance" @@ -2340,17 +2686,19 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } } } - } /** * A JavaScript interface for exposing Javascript callbacks to Dart. @@ -2359,7 +2707,9 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra * [JavascriptInterface](https://developer.android.com/reference/android/webkit/JavascriptInterface). */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiJavaScriptChannel(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiJavaScriptChannel( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { abstract fun pigeon_defaultConstructor(channelName: String): JavaScriptChannel companion object { @@ -2367,18 +2717,24 @@ abstract class PigeonApiJavaScriptChannel(open val pigeonRegistrar: AndroidWebki fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiJavaScriptChannel?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.JavaScriptChannel.pigeon_defaultConstructor", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.JavaScriptChannel.pigeon_defaultConstructor", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_identifierArg = args[0] as Long val channelNameArg = args[1] as String - val wrapped: List = try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.pigeon_defaultConstructor(channelNameArg), pigeon_identifierArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + api.pigeon_defaultConstructor(channelNameArg), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2390,24 +2746,29 @@ abstract class PigeonApiJavaScriptChannel(open val pigeonRegistrar: AndroidWebki @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of JavaScriptChannel and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: JavaScriptChannel, callback: (Result) -> Unit) -{ + fun pigeon_newInstance(pigeon_instanceArg: JavaScriptChannel, callback: (Result) -> Unit) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { + } else { callback( Result.failure( - AndroidWebKitError("new-instance-error", "Attempting to create a new Dart instance of JavaScriptChannel, but the class has a nonnull callback method.", ""))) + AndroidWebKitError( + "new-instance-error", + "Attempting to create a new Dart instance of JavaScriptChannel, but the class has a nonnull callback method.", + ""))) } } /** Handles callbacks messages from JavaScript. */ - fun postMessage(pigeon_instanceArg: JavaScriptChannel, messageArg: String, callback: (Result) -> Unit) -{ + fun postMessage( + pigeon_instanceArg: JavaScriptChannel, + messageArg: String, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2421,16 +2782,17 @@ abstract class PigeonApiJavaScriptChannel(open val pigeonRegistrar: AndroidWebki channel.send(listOf(pigeon_instanceArg, messageArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } - } /** * Receives various notifications and requests from a `WebView`. @@ -2438,41 +2800,51 @@ abstract class PigeonApiJavaScriptChannel(open val pigeonRegistrar: AndroidWebki * See https://developer.android.com/reference/android/webkit/WebViewClient. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiWebViewClient( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { abstract fun pigeon_defaultConstructor(): android.webkit.WebViewClient /** * Sets the required synchronous return value for the Java method, * `WebViewClient.shouldOverrideUrlLoading(...)`. * - * The Java method, `WebViewClient.shouldOverrideUrlLoading(...)`, requires - * a boolean to be returned and this method sets the returned value for all - * calls to the Java method. + * The Java method, `WebViewClient.shouldOverrideUrlLoading(...)`, requires a boolean to be + * returned and this method sets the returned value for all calls to the Java method. * - * Setting this to true causes the current [WebView] to abort loading any URL - * received by [requestLoading] or [urlLoading], while setting this to false - * causes the [WebView] to continue loading a URL as usual. + * Setting this to true causes the current [WebView] to abort loading any URL received by + * [requestLoading] or [urlLoading], while setting this to false causes the [WebView] to continue + * loading a URL as usual. * * Defaults to false. */ - abstract fun setSynchronousReturnValueForShouldOverrideUrlLoading(pigeon_instance: android.webkit.WebViewClient, value: Boolean) + abstract fun setSynchronousReturnValueForShouldOverrideUrlLoading( + pigeon_instance: android.webkit.WebViewClient, + value: Boolean + ) companion object { @Suppress("LocalVariableName") fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiWebViewClient?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebViewClient.pigeon_defaultConstructor", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebViewClient.pigeon_defaultConstructor", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_identifierArg = args[0] as Long - val wrapped: List = try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.pigeon_defaultConstructor(), pigeon_identifierArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + api.pigeon_defaultConstructor(), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2480,18 +2852,24 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebViewClient.setSynchronousReturnValueForShouldOverrideUrlLoading", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebViewClient.setSynchronousReturnValueForShouldOverrideUrlLoading", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebViewClient val valueArg = args[1] as Boolean - val wrapped: List = try { - api.setSynchronousReturnValueForShouldOverrideUrlLoading(pigeon_instanceArg, valueArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setSynchronousReturnValueForShouldOverrideUrlLoading( + pigeon_instanceArg, valueArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2503,37 +2881,48 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of WebViewClient and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.webkit.WebViewClient, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.webkit.WebViewClient, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.WebViewClient.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.WebViewClient.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } } } /** Notify the host application that a page has started loading. */ - fun onPageStarted(pigeon_instanceArg: android.webkit.WebViewClient, webViewArg: android.webkit.WebView, urlArg: String, callback: (Result) -> Unit) -{ + fun onPageStarted( + pigeon_instanceArg: android.webkit.WebViewClient, + webViewArg: android.webkit.WebView, + urlArg: String, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2547,19 +2936,25 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib channel.send(listOf(pigeon_instanceArg, webViewArg, urlArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } /** Notify the host application that a page has finished loading. */ - fun onPageFinished(pigeon_instanceArg: android.webkit.WebViewClient, webViewArg: android.webkit.WebView, urlArg: String, callback: (Result) -> Unit) -{ + fun onPageFinished( + pigeon_instanceArg: android.webkit.WebViewClient, + webViewArg: android.webkit.WebView, + urlArg: String, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2573,22 +2968,29 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib channel.send(listOf(pigeon_instanceArg, webViewArg, urlArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } /** - * Notify the host application that an HTTP error has been received from the - * server while loading a resource. + * Notify the host application that an HTTP error has been received from the server while loading + * a resource. */ - fun onReceivedHttpError(pigeon_instanceArg: android.webkit.WebViewClient, webViewArg: android.webkit.WebView, requestArg: android.webkit.WebResourceRequest, responseArg: android.webkit.WebResourceResponse, callback: (Result) -> Unit) -{ + fun onReceivedHttpError( + pigeon_instanceArg: android.webkit.WebViewClient, + webViewArg: android.webkit.WebView, + requestArg: android.webkit.WebResourceRequest, + responseArg: android.webkit.WebResourceResponse, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2602,20 +3004,27 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib channel.send(listOf(pigeon_instanceArg, webViewArg, requestArg, responseArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } /** Report web resource loading error to the host application. */ @androidx.annotation.RequiresApi(api = 23) - fun onReceivedRequestError(pigeon_instanceArg: android.webkit.WebViewClient, webViewArg: android.webkit.WebView, requestArg: android.webkit.WebResourceRequest, errorArg: android.webkit.WebResourceError, callback: (Result) -> Unit) -{ + fun onReceivedRequestError( + pigeon_instanceArg: android.webkit.WebViewClient, + webViewArg: android.webkit.WebView, + requestArg: android.webkit.WebResourceRequest, + errorArg: android.webkit.WebResourceError, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2624,24 +3033,32 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedRequestError" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedRequestError" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, webViewArg, requestArg, errorArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } /** Report web resource loading error to the host application. */ - fun onReceivedRequestErrorCompat(pigeon_instanceArg: android.webkit.WebViewClient, webViewArg: android.webkit.WebView, requestArg: android.webkit.WebResourceRequest, errorArg: androidx.webkit.WebResourceErrorCompat, callback: (Result) -> Unit) -{ + fun onReceivedRequestErrorCompat( + pigeon_instanceArg: android.webkit.WebViewClient, + webViewArg: android.webkit.WebView, + requestArg: android.webkit.WebResourceRequest, + errorArg: androidx.webkit.WebResourceErrorCompat, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2650,24 +3067,33 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedRequestErrorCompat" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedRequestErrorCompat" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, webViewArg, requestArg, errorArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } /** Report an error to the host application. */ - fun onReceivedError(pigeon_instanceArg: android.webkit.WebViewClient, webViewArg: android.webkit.WebView, errorCodeArg: Long, descriptionArg: String, failingUrlArg: String, callback: (Result) -> Unit) -{ + fun onReceivedError( + pigeon_instanceArg: android.webkit.WebViewClient, + webViewArg: android.webkit.WebView, + errorCodeArg: Long, + descriptionArg: String, + failingUrlArg: String, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2678,25 +3104,33 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedError" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_instanceArg, webViewArg, errorCodeArg, descriptionArg, failingUrlArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) - } else { - callback(Result.success(Unit)) + channel.send( + listOf(pigeon_instanceArg, webViewArg, errorCodeArg, descriptionArg, failingUrlArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } - } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } - } } /** - * Give the host application a chance to take control when a URL is about to - * be loaded in the current WebView. + * Give the host application a chance to take control when a URL is about to be loaded in the + * current WebView. */ - fun requestLoading(pigeon_instanceArg: android.webkit.WebViewClient, webViewArg: android.webkit.WebView, requestArg: android.webkit.WebResourceRequest, callback: (Result) -> Unit) -{ + fun requestLoading( + pigeon_instanceArg: android.webkit.WebViewClient, + webViewArg: android.webkit.WebView, + requestArg: android.webkit.WebResourceRequest, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2710,22 +3144,28 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib channel.send(listOf(pigeon_instanceArg, webViewArg, requestArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } /** - * Give the host application a chance to take control when a URL is about to - * be loaded in the current WebView. + * Give the host application a chance to take control when a URL is about to be loaded in the + * current WebView. */ - fun urlLoading(pigeon_instanceArg: android.webkit.WebViewClient, webViewArg: android.webkit.WebView, urlArg: String, callback: (Result) -> Unit) -{ + fun urlLoading( + pigeon_instanceArg: android.webkit.WebViewClient, + webViewArg: android.webkit.WebView, + urlArg: String, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2739,19 +3179,26 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib channel.send(listOf(pigeon_instanceArg, webViewArg, urlArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } /** Notify the host application to update its visited links database. */ - fun doUpdateVisitedHistory(pigeon_instanceArg: android.webkit.WebViewClient, webViewArg: android.webkit.WebView, urlArg: String, isReloadArg: Boolean, callback: (Result) -> Unit) -{ + fun doUpdateVisitedHistory( + pigeon_instanceArg: android.webkit.WebViewClient, + webViewArg: android.webkit.WebView, + urlArg: String, + isReloadArg: Boolean, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2760,27 +3207,33 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.WebViewClient.doUpdateVisitedHistory" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.WebViewClient.doUpdateVisitedHistory" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, webViewArg, urlArg, isReloadArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } - /** - * Notifies the host application that the WebView received an HTTP - * authentication request. - */ - fun onReceivedHttpAuthRequest(pigeon_instanceArg: android.webkit.WebViewClient, webViewArg: android.webkit.WebView, handlerArg: android.webkit.HttpAuthHandler, hostArg: String, realmArg: String, callback: (Result) -> Unit) -{ + /** Notifies the host application that the WebView received an HTTP authentication request. */ + fun onReceivedHttpAuthRequest( + pigeon_instanceArg: android.webkit.WebViewClient, + webViewArg: android.webkit.WebView, + handlerArg: android.webkit.HttpAuthHandler, + hostArg: String, + realmArg: String, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2789,27 +3242,35 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedHttpAuthRequest" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedHttpAuthRequest" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, webViewArg, handlerArg, hostArg, realmArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } /** - * Ask the host application if the browser should resend data as the - * requested page was a result of a POST. + * Ask the host application if the browser should resend data as the requested page was a result + * of a POST. */ - fun onFormResubmission(pigeon_instanceArg: android.webkit.WebViewClient, viewArg: android.webkit.WebView, dontResendArg: android.os.Message, resendArg: android.os.Message, callback: (Result) -> Unit) -{ + fun onFormResubmission( + pigeon_instanceArg: android.webkit.WebViewClient, + viewArg: android.webkit.WebView, + dontResendArg: android.os.Message, + resendArg: android.os.Message, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2823,22 +3284,27 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib channel.send(listOf(pigeon_instanceArg, viewArg, dontResendArg, resendArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } /** - * Notify the host application that the WebView will load the resource - * specified by the given url. + * Notify the host application that the WebView will load the resource specified by the given url. */ - fun onLoadResource(pigeon_instanceArg: android.webkit.WebViewClient, viewArg: android.webkit.WebView, urlArg: String, callback: (Result) -> Unit) -{ + fun onLoadResource( + pigeon_instanceArg: android.webkit.WebViewClient, + viewArg: android.webkit.WebView, + urlArg: String, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2852,22 +3318,28 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib channel.send(listOf(pigeon_instanceArg, viewArg, urlArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } /** - * Notify the host application that WebView content left over from previous - * page navigations will no longer be drawn. + * Notify the host application that WebView content left over from previous page navigations will + * no longer be drawn. */ - fun onPageCommitVisible(pigeon_instanceArg: android.webkit.WebViewClient, viewArg: android.webkit.WebView, urlArg: String, callback: (Result) -> Unit) -{ + fun onPageCommitVisible( + pigeon_instanceArg: android.webkit.WebViewClient, + viewArg: android.webkit.WebView, + urlArg: String, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2881,19 +3353,25 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib channel.send(listOf(pigeon_instanceArg, viewArg, urlArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } /** Notify the host application to handle a SSL client certificate request. */ - fun onReceivedClientCertRequest(pigeon_instanceArg: android.webkit.WebViewClient, viewArg: android.webkit.WebView, requestArg: android.webkit.ClientCertRequest, callback: (Result) -> Unit) -{ + fun onReceivedClientCertRequest( + pigeon_instanceArg: android.webkit.WebViewClient, + viewArg: android.webkit.WebView, + requestArg: android.webkit.ClientCertRequest, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2902,27 +3380,35 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedClientCertRequest" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedClientCertRequest" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, viewArg, requestArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } /** - * Notify the host application that a request to automatically log in the - * user has been processed. + * Notify the host application that a request to automatically log in the user has been processed. */ - fun onReceivedLoginRequest(pigeon_instanceArg: android.webkit.WebViewClient, viewArg: android.webkit.WebView, realmArg: String, accountArg: String?, argsArg: String, callback: (Result) -> Unit) -{ + fun onReceivedLoginRequest( + pigeon_instanceArg: android.webkit.WebViewClient, + viewArg: android.webkit.WebView, + realmArg: String, + accountArg: String?, + argsArg: String, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2931,27 +3417,32 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedLoginRequest" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedLoginRequest" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, viewArg, realmArg, accountArg, argsArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } - /** - * Notifies the host application that an SSL error occurred while loading a - * resource. - */ - fun onReceivedSslError(pigeon_instanceArg: android.webkit.WebViewClient, viewArg: android.webkit.WebView, handlerArg: android.webkit.SslErrorHandler, errorArg: android.net.http.SslError, callback: (Result) -> Unit) -{ + /** Notifies the host application that an SSL error occurred while loading a resource. */ + fun onReceivedSslError( + pigeon_instanceArg: android.webkit.WebViewClient, + viewArg: android.webkit.WebView, + handlerArg: android.webkit.SslErrorHandler, + errorArg: android.net.http.SslError, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2965,22 +3456,26 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib channel.send(listOf(pigeon_instanceArg, viewArg, handlerArg, errorArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } - /** - * Notify the host application that the scale applied to the WebView has - * changed. - */ - fun onScaleChanged(pigeon_instanceArg: android.webkit.WebViewClient, viewArg: android.webkit.WebView, oldScaleArg: Double, newScaleArg: Double, callback: (Result) -> Unit) -{ + /** Notify the host application that the scale applied to the WebView has changed. */ + fun onScaleChanged( + pigeon_instanceArg: android.webkit.WebViewClient, + viewArg: android.webkit.WebView, + oldScaleArg: Double, + newScaleArg: Double, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2994,16 +3489,17 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib channel.send(listOf(pigeon_instanceArg, viewArg, oldScaleArg, newScaleArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } - } /** * Handles notifications that a file should be downloaded. @@ -3011,7 +3507,9 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib * See https://developer.android.com/reference/android/webkit/DownloadListener. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiDownloadListener(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiDownloadListener( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { abstract fun pigeon_defaultConstructor(): android.webkit.DownloadListener companion object { @@ -3019,17 +3517,23 @@ abstract class PigeonApiDownloadListener(open val pigeonRegistrar: AndroidWebkit fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiDownloadListener?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.DownloadListener.pigeon_defaultConstructor", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.DownloadListener.pigeon_defaultConstructor", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_identifierArg = args[0] as Long - val wrapped: List = try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.pigeon_defaultConstructor(), pigeon_identifierArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + api.pigeon_defaultConstructor(), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3041,24 +3545,36 @@ abstract class PigeonApiDownloadListener(open val pigeonRegistrar: AndroidWebkit @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of DownloadListener and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.webkit.DownloadListener, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.webkit.DownloadListener, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { + } else { callback( Result.failure( - AndroidWebKitError("new-instance-error", "Attempting to create a new Dart instance of DownloadListener, but the class has a nonnull callback method.", ""))) + AndroidWebKitError( + "new-instance-error", + "Attempting to create a new Dart instance of DownloadListener, but the class has a nonnull callback method.", + ""))) } } /** Notify the host application that a file should be downloaded. */ - fun onDownloadStart(pigeon_instanceArg: android.webkit.DownloadListener, urlArg: String, userAgentArg: String, contentDispositionArg: String, mimetypeArg: String, contentLengthArg: Long, callback: (Result) -> Unit) -{ + fun onDownloadStart( + pigeon_instanceArg: android.webkit.DownloadListener, + urlArg: String, + userAgentArg: String, + contentDispositionArg: String, + mimetypeArg: String, + contentLengthArg: Long, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3069,133 +3585,161 @@ abstract class PigeonApiDownloadListener(open val pigeonRegistrar: AndroidWebkit val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.webview_flutter_android.DownloadListener.onDownloadStart" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_instanceArg, urlArg, userAgentArg, contentDispositionArg, mimetypeArg, contentLengthArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) - } else { - callback(Result.success(Unit)) + channel.send( + listOf( + pigeon_instanceArg, + urlArg, + userAgentArg, + contentDispositionArg, + mimetypeArg, + contentLengthArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } - } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } - } } - } /** - * Handles notification of JavaScript dialogs, favicons, titles, and the - * progress. + * Handles notification of JavaScript dialogs, favicons, titles, and the progress. * * See https://developer.android.com/reference/android/webkit/WebChromeClient. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { - abstract fun pigeon_defaultConstructor(): io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl +abstract class PigeonApiWebChromeClient( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { + abstract fun pigeon_defaultConstructor(): + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl /** * Sets the required synchronous return value for the Java method, * `WebChromeClient.onShowFileChooser(...)`. * - * The Java method, `WebChromeClient.onShowFileChooser(...)`, requires - * a boolean to be returned and this method sets the returned value for all - * calls to the Java method. + * The Java method, `WebChromeClient.onShowFileChooser(...)`, requires a boolean to be returned + * and this method sets the returned value for all calls to the Java method. * - * Setting this to true indicates that all file chooser requests should be - * handled by `onShowFileChooser` and the returned list of Strings will be - * returned to the WebView. Otherwise, the client will use the default - * handling and the returned value in `onShowFileChooser` will be ignored. + * Setting this to true indicates that all file chooser requests should be handled by + * `onShowFileChooser` and the returned list of Strings will be returned to the WebView. + * Otherwise, the client will use the default handling and the returned value in + * `onShowFileChooser` will be ignored. * * Requires `onShowFileChooser` to be nonnull. * * Defaults to false. */ - abstract fun setSynchronousReturnValueForOnShowFileChooser(pigeon_instance: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, value: Boolean) + abstract fun setSynchronousReturnValueForOnShowFileChooser( + pigeon_instance: + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, + value: Boolean + ) /** * Sets the required synchronous return value for the Java method, * `WebChromeClient.onConsoleMessage(...)`. * - * The Java method, `WebChromeClient.onConsoleMessage(...)`, requires - * a boolean to be returned and this method sets the returned value for all - * calls to the Java method. + * The Java method, `WebChromeClient.onConsoleMessage(...)`, requires a boolean to be returned and + * this method sets the returned value for all calls to the Java method. * - * Setting this to true indicates that the client is handling all console - * messages. + * Setting this to true indicates that the client is handling all console messages. * * Requires `onConsoleMessage` to be nonnull. * * Defaults to false. */ - abstract fun setSynchronousReturnValueForOnConsoleMessage(pigeon_instance: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, value: Boolean) + abstract fun setSynchronousReturnValueForOnConsoleMessage( + pigeon_instance: + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, + value: Boolean + ) /** * Sets the required synchronous return value for the Java method, * `WebChromeClient.onJsAlert(...)`. * - * The Java method, `WebChromeClient.onJsAlert(...)`, requires a boolean to - * be returned and this method sets the returned value for all calls to the - * Java method. + * The Java method, `WebChromeClient.onJsAlert(...)`, requires a boolean to be returned and this + * method sets the returned value for all calls to the Java method. * - * Setting this to true indicates that the client is handling all console - * messages. + * Setting this to true indicates that the client is handling all console messages. * * Requires `onJsAlert` to be nonnull. * * Defaults to false. */ - abstract fun setSynchronousReturnValueForOnJsAlert(pigeon_instance: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, value: Boolean) + abstract fun setSynchronousReturnValueForOnJsAlert( + pigeon_instance: + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, + value: Boolean + ) /** * Sets the required synchronous return value for the Java method, * `WebChromeClient.onJsConfirm(...)`. * - * The Java method, `WebChromeClient.onJsConfirm(...)`, requires a boolean to - * be returned and this method sets the returned value for all calls to the - * Java method. + * The Java method, `WebChromeClient.onJsConfirm(...)`, requires a boolean to be returned and this + * method sets the returned value for all calls to the Java method. * - * Setting this to true indicates that the client is handling all console - * messages. + * Setting this to true indicates that the client is handling all console messages. * * Requires `onJsConfirm` to be nonnull. * * Defaults to false. */ - abstract fun setSynchronousReturnValueForOnJsConfirm(pigeon_instance: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, value: Boolean) + abstract fun setSynchronousReturnValueForOnJsConfirm( + pigeon_instance: + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, + value: Boolean + ) /** * Sets the required synchronous return value for the Java method, * `WebChromeClient.onJsPrompt(...)`. * - * The Java method, `WebChromeClient.onJsPrompt(...)`, requires a boolean to - * be returned and this method sets the returned value for all calls to the - * Java method. + * The Java method, `WebChromeClient.onJsPrompt(...)`, requires a boolean to be returned and this + * method sets the returned value for all calls to the Java method. * - * Setting this to true indicates that the client is handling all console - * messages. + * Setting this to true indicates that the client is handling all console messages. * * Requires `onJsPrompt` to be nonnull. * * Defaults to false. */ - abstract fun setSynchronousReturnValueForOnJsPrompt(pigeon_instance: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, value: Boolean) + abstract fun setSynchronousReturnValueForOnJsPrompt( + pigeon_instance: + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, + value: Boolean + ) companion object { @Suppress("LocalVariableName") fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiWebChromeClient?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.pigeon_defaultConstructor", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.pigeon_defaultConstructor", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_identifierArg = args[0] as Long - val wrapped: List = try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.pigeon_defaultConstructor(), pigeon_identifierArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + api.pigeon_defaultConstructor(), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3203,18 +3747,25 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.setSynchronousReturnValueForOnShowFileChooser", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.setSynchronousReturnValueForOnShowFileChooser", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_instanceArg = args[0] as io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl + val pigeon_instanceArg = + args[0] + as io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl val valueArg = args[1] as Boolean - val wrapped: List = try { - api.setSynchronousReturnValueForOnShowFileChooser(pigeon_instanceArg, valueArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setSynchronousReturnValueForOnShowFileChooser(pigeon_instanceArg, valueArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3222,18 +3773,25 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.setSynchronousReturnValueForOnConsoleMessage", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.setSynchronousReturnValueForOnConsoleMessage", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_instanceArg = args[0] as io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl + val pigeon_instanceArg = + args[0] + as io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl val valueArg = args[1] as Boolean - val wrapped: List = try { - api.setSynchronousReturnValueForOnConsoleMessage(pigeon_instanceArg, valueArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setSynchronousReturnValueForOnConsoleMessage(pigeon_instanceArg, valueArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3241,18 +3799,25 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.setSynchronousReturnValueForOnJsAlert", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.setSynchronousReturnValueForOnJsAlert", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_instanceArg = args[0] as io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl + val pigeon_instanceArg = + args[0] + as io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl val valueArg = args[1] as Boolean - val wrapped: List = try { - api.setSynchronousReturnValueForOnJsAlert(pigeon_instanceArg, valueArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setSynchronousReturnValueForOnJsAlert(pigeon_instanceArg, valueArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3260,18 +3825,25 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.setSynchronousReturnValueForOnJsConfirm", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.setSynchronousReturnValueForOnJsConfirm", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_instanceArg = args[0] as io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl + val pigeon_instanceArg = + args[0] + as io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl val valueArg = args[1] as Boolean - val wrapped: List = try { - api.setSynchronousReturnValueForOnJsConfirm(pigeon_instanceArg, valueArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setSynchronousReturnValueForOnJsConfirm(pigeon_instanceArg, valueArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3279,18 +3851,25 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.setSynchronousReturnValueForOnJsPrompt", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.setSynchronousReturnValueForOnJsPrompt", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_instanceArg = args[0] as io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl + val pigeon_instanceArg = + args[0] + as io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl val valueArg = args[1] as Boolean - val wrapped: List = try { - api.setSynchronousReturnValueForOnJsPrompt(pigeon_instanceArg, valueArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setSynchronousReturnValueForOnJsPrompt(pigeon_instanceArg, valueArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3302,24 +3881,35 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of WebChromeClient and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { + } else { callback( Result.failure( - AndroidWebKitError("new-instance-error", "Attempting to create a new Dart instance of WebChromeClient, but the class has a nonnull callback method.", ""))) + AndroidWebKitError( + "new-instance-error", + "Attempting to create a new Dart instance of WebChromeClient, but the class has a nonnull callback method.", + ""))) } } /** Tell the host application the current progress of loading a page. */ - fun onProgressChanged(pigeon_instanceArg: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, webViewArg: android.webkit.WebView, progressArg: Long, callback: (Result) -> Unit) -{ + fun onProgressChanged( + pigeon_instanceArg: + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, + webViewArg: android.webkit.WebView, + progressArg: Long, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3333,19 +3923,26 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL channel.send(listOf(pigeon_instanceArg, webViewArg, progressArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } /** Tell the client to show a file chooser. */ - fun onShowFileChooser(pigeon_instanceArg: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, webViewArg: android.webkit.WebView, paramsArg: android.webkit.WebChromeClient.FileChooserParams, callback: (Result>) -> Unit) -{ + fun onShowFileChooser( + pigeon_instanceArg: + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, + webViewArg: android.webkit.WebView, + paramsArg: android.webkit.WebChromeClient.FileChooserParams, + callback: (Result>) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3359,26 +3956,36 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL channel.send(listOf(pigeon_instanceArg, webViewArg, paramsArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback(Result.failure(AndroidWebKitError("null-error", "Flutter api returned null value for non-null return value.", ""))) + callback( + Result.failure( + AndroidWebKitError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) } else { val output = it[0] as List callback(Result.success(output)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } /** - * Notify the host application that web content is requesting permission to - * access the specified resources and the permission currently isn't granted - * or denied. + * Notify the host application that web content is requesting permission to access the specified + * resources and the permission currently isn't granted or denied. */ - fun onPermissionRequest(pigeon_instanceArg: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, requestArg: android.webkit.PermissionRequest, callback: (Result) -> Unit) -{ + fun onPermissionRequest( + pigeon_instanceArg: + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, + requestArg: android.webkit.PermissionRequest, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3387,24 +3994,32 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.onPermissionRequest" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.onPermissionRequest" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, requestArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } /** Callback to Dart function `WebChromeClient.onShowCustomView`. */ - fun onShowCustomView(pigeon_instanceArg: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, viewArg: android.view.View, callbackArg: android.webkit.WebChromeClient.CustomViewCallback, callback: (Result) -> Unit) -{ + fun onShowCustomView( + pigeon_instanceArg: + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, + viewArg: android.view.View, + callbackArg: android.webkit.WebChromeClient.CustomViewCallback, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3418,22 +4033,24 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL channel.send(listOf(pigeon_instanceArg, viewArg, callbackArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } - /** - * Notify the host application that the current page has entered full screen - * mode. - */ - fun onHideCustomView(pigeon_instanceArg: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, callback: (Result) -> Unit) -{ + /** Notify the host application that the current page has entered full screen mode. */ + fun onHideCustomView( + pigeon_instanceArg: + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3447,23 +4064,29 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL channel.send(listOf(pigeon_instanceArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } /** - * Notify the host application that web content from the specified origin is - * attempting to use the Geolocation API, but no permission state is - * currently set for that origin. + * Notify the host application that web content from the specified origin is attempting to use the + * Geolocation API, but no permission state is currently set for that origin. */ - fun onGeolocationPermissionsShowPrompt(pigeon_instanceArg: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, originArg: String, callbackArg: android.webkit.GeolocationPermissions.Callback, callback: (Result) -> Unit) -{ + fun onGeolocationPermissionsShowPrompt( + pigeon_instanceArg: + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, + originArg: String, + callbackArg: android.webkit.GeolocationPermissions.Callback, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3472,28 +4095,33 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.onGeolocationPermissionsShowPrompt" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.onGeolocationPermissionsShowPrompt" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, originArg, callbackArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } /** - * Notify the host application that a request for Geolocation permissions, - * made with a previous call to `onGeolocationPermissionsShowPrompt` has been - * canceled. + * Notify the host application that a request for Geolocation permissions, made with a previous + * call to `onGeolocationPermissionsShowPrompt` has been canceled. */ - fun onGeolocationPermissionsHidePrompt(pigeon_instanceArg: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, callback: (Result) -> Unit) -{ + fun onGeolocationPermissionsHidePrompt( + pigeon_instanceArg: + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3502,24 +4130,31 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.onGeolocationPermissionsHidePrompt" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.onGeolocationPermissionsHidePrompt" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } /** Report a JavaScript console message to the host application. */ - fun onConsoleMessage(pigeon_instanceArg: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, messageArg: android.webkit.ConsoleMessage, callback: (Result) -> Unit) -{ + fun onConsoleMessage( + pigeon_instanceArg: + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, + messageArg: android.webkit.ConsoleMessage, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3533,22 +4168,29 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL channel.send(listOf(pigeon_instanceArg, messageArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } /** - * Notify the host application that the web page wants to display a - * JavaScript `alert()` dialog. + * Notify the host application that the web page wants to display a JavaScript `alert()` dialog. */ - fun onJsAlert(pigeon_instanceArg: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, webViewArg: android.webkit.WebView, urlArg: String, messageArg: String, callback: (Result) -> Unit) -{ + fun onJsAlert( + pigeon_instanceArg: + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, + webViewArg: android.webkit.WebView, + urlArg: String, + messageArg: String, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3562,22 +4204,29 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL channel.send(listOf(pigeon_instanceArg, webViewArg, urlArg, messageArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } /** - * Notify the host application that the web page wants to display a - * JavaScript `confirm()` dialog. + * Notify the host application that the web page wants to display a JavaScript `confirm()` dialog. */ - fun onJsConfirm(pigeon_instanceArg: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, webViewArg: android.webkit.WebView, urlArg: String, messageArg: String, callback: (Result) -> Unit) -{ + fun onJsConfirm( + pigeon_instanceArg: + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, + webViewArg: android.webkit.WebView, + urlArg: String, + messageArg: String, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3591,25 +4240,38 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL channel.send(listOf(pigeon_instanceArg, webViewArg, urlArg, messageArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback(Result.failure(AndroidWebKitError("null-error", "Flutter api returned null value for non-null return value.", ""))) + callback( + Result.failure( + AndroidWebKitError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) } else { val output = it[0] as Boolean callback(Result.success(output)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } /** - * Notify the host application that the web page wants to display a - * JavaScript `prompt()` dialog. + * Notify the host application that the web page wants to display a JavaScript `prompt()` dialog. */ - fun onJsPrompt(pigeon_instanceArg: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, webViewArg: android.webkit.WebView, urlArg: String, messageArg: String, defaultValueArg: String, callback: (Result) -> Unit) -{ + fun onJsPrompt( + pigeon_instanceArg: + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, + webViewArg: android.webkit.WebView, + urlArg: String, + messageArg: String, + defaultValueArg: String, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3623,17 +4285,18 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL channel.send(listOf(pigeon_instanceArg, webViewArg, urlArg, messageArg, defaultValueArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { val output = it[0] as String? callback(Result.success(output)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } - } /** * Provides access to the assets registered as part of the App bundle. @@ -3641,7 +4304,9 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL * Convenience class for accessing Flutter asset resources. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiFlutterAssetManager(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiFlutterAssetManager( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { /** The global instance of the `FlutterAssetManager`. */ abstract fun instance(): io.flutter.plugins.webviewflutter.FlutterAssetManager @@ -3650,35 +4315,46 @@ abstract class PigeonApiFlutterAssetManager(open val pigeonRegistrar: AndroidWeb * * Throws an IOException in case I/O operations were interrupted. */ - abstract fun list(pigeon_instance: io.flutter.plugins.webviewflutter.FlutterAssetManager, path: String): List + abstract fun list( + pigeon_instance: io.flutter.plugins.webviewflutter.FlutterAssetManager, + path: String + ): List /** * Gets the relative file path to the Flutter asset with the given name, including the file's * extension, e.g., "myImage.jpg". * - * The returned file path is relative to the Android app's standard asset's - * directory. Therefore, the returned path is appropriate to pass to - * Android's AssetManager, but the path is not appropriate to load as an - * absolute path. + * The returned file path is relative to the Android app's standard asset's directory. Therefore, + * the returned path is appropriate to pass to Android's AssetManager, but the path is not + * appropriate to load as an absolute path. */ - abstract fun getAssetFilePathByName(pigeon_instance: io.flutter.plugins.webviewflutter.FlutterAssetManager, name: String): String + abstract fun getAssetFilePathByName( + pigeon_instance: io.flutter.plugins.webviewflutter.FlutterAssetManager, + name: String + ): String companion object { @Suppress("LocalVariableName") fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiFlutterAssetManager?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.FlutterAssetManager.instance", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.FlutterAssetManager.instance", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_identifierArg = args[0] as Long - val wrapped: List = try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.instance(), pigeon_identifierArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + api.instance(), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3686,17 +4362,23 @@ abstract class PigeonApiFlutterAssetManager(open val pigeonRegistrar: AndroidWeb } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.FlutterAssetManager.list", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.FlutterAssetManager.list", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_instanceArg = args[0] as io.flutter.plugins.webviewflutter.FlutterAssetManager + val pigeon_instanceArg = + args[0] as io.flutter.plugins.webviewflutter.FlutterAssetManager val pathArg = args[1] as String - val wrapped: List = try { - listOf(api.list(pigeon_instanceArg, pathArg)) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + listOf(api.list(pigeon_instanceArg, pathArg)) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3704,17 +4386,23 @@ abstract class PigeonApiFlutterAssetManager(open val pigeonRegistrar: AndroidWeb } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.FlutterAssetManager.getAssetFilePathByName", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.FlutterAssetManager.getAssetFilePathByName", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_instanceArg = args[0] as io.flutter.plugins.webviewflutter.FlutterAssetManager + val pigeon_instanceArg = + args[0] as io.flutter.plugins.webviewflutter.FlutterAssetManager val nameArg = args[1] as String - val wrapped: List = try { - listOf(api.getAssetFilePathByName(pigeon_instanceArg, nameArg)) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + listOf(api.getAssetFilePathByName(pigeon_instanceArg, nameArg)) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3726,43 +4414,50 @@ abstract class PigeonApiFlutterAssetManager(open val pigeonRegistrar: AndroidWeb @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of FlutterAssetManager and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: io.flutter.plugins.webviewflutter.FlutterAssetManager, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: io.flutter.plugins.webviewflutter.FlutterAssetManager, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.FlutterAssetManager.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.FlutterAssetManager.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } } } - } /** - * This class is used to manage the JavaScript storage APIs provided by the - * WebView. + * This class is used to manage the JavaScript storage APIs provided by the WebView. * * See https://developer.android.com/reference/android/webkit/WebStorage. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiWebStorage(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiWebStorage( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { abstract fun instance(): android.webkit.WebStorage /** Clears all storage currently being used by the JavaScript storage APIs. */ @@ -3773,17 +4468,23 @@ abstract class PigeonApiWebStorage(open val pigeonRegistrar: AndroidWebkitLibrar fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiWebStorage?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebStorage.instance", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebStorage.instance", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_identifierArg = args[0] as Long - val wrapped: List = try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.instance(), pigeon_identifierArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + api.instance(), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3791,17 +4492,22 @@ abstract class PigeonApiWebStorage(open val pigeonRegistrar: AndroidWebkitLibrar } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebStorage.deleteAllData", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebStorage.deleteAllData", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebStorage - val wrapped: List = try { - api.deleteAllData(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.deleteAllData(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3813,16 +4519,19 @@ abstract class PigeonApiWebStorage(open val pigeonRegistrar: AndroidWebkitLibrar @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of WebStorage and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.webkit.WebStorage, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.webkit.WebStorage, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.webview_flutter_android.WebStorage.pigeon_newInstance" @@ -3830,17 +4539,19 @@ abstract class PigeonApiWebStorage(open val pigeonRegistrar: AndroidWebkitLibrar channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } } } - } /** * Parameters used in the `WebChromeClient.onShowFileChooser` method. @@ -3848,68 +4559,90 @@ abstract class PigeonApiWebStorage(open val pigeonRegistrar: AndroidWebkitLibrar * See https://developer.android.com/reference/android/webkit/WebChromeClient.FileChooserParams. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiFileChooserParams(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiFileChooserParams( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { /** Preference for a live media captured value (e.g. Camera, Microphone). */ - abstract fun isCaptureEnabled(pigeon_instance: android.webkit.WebChromeClient.FileChooserParams): Boolean + abstract fun isCaptureEnabled( + pigeon_instance: android.webkit.WebChromeClient.FileChooserParams + ): Boolean /** An array of acceptable MIME types. */ - abstract fun acceptTypes(pigeon_instance: android.webkit.WebChromeClient.FileChooserParams): List + abstract fun acceptTypes( + pigeon_instance: android.webkit.WebChromeClient.FileChooserParams + ): List /** File chooser mode. */ - abstract fun mode(pigeon_instance: android.webkit.WebChromeClient.FileChooserParams): FileChooserMode + abstract fun mode( + pigeon_instance: android.webkit.WebChromeClient.FileChooserParams + ): FileChooserMode /** File name of a default selection if specified, or null. */ - abstract fun filenameHint(pigeon_instance: android.webkit.WebChromeClient.FileChooserParams): String? + abstract fun filenameHint( + pigeon_instance: android.webkit.WebChromeClient.FileChooserParams + ): String? @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of FileChooserParams and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.webkit.WebChromeClient.FileChooserParams, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.webkit.WebChromeClient.FileChooserParams, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val isCaptureEnabledArg = isCaptureEnabled(pigeon_instanceArg) val acceptTypesArg = acceptTypes(pigeon_instanceArg) val modeArg = mode(pigeon_instanceArg) val filenameHintArg = filenameHint(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.FileChooserParams.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.FileChooserParams.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_identifierArg, isCaptureEnabledArg, acceptTypesArg, modeArg, filenameHintArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) - } else { - callback(Result.success(Unit)) + channel.send( + listOf( + pigeon_identifierArg, + isCaptureEnabledArg, + acceptTypesArg, + modeArg, + filenameHintArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback( + Result.failure( + AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } - } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } - } } } - } /** - * This class defines a permission request and is used when web content - * requests access to protected resources. + * This class defines a permission request and is used when web content requests access to protected + * resources. * * See https://developer.android.com/reference/android/webkit/PermissionRequest. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiPermissionRequest(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiPermissionRequest( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { abstract fun resources(pigeon_instance: android.webkit.PermissionRequest): List - /** - * Call this method to grant origin the permission to access the given - * resources. - */ + /** Call this method to grant origin the permission to access the given resources. */ abstract fun grant(pigeon_instance: android.webkit.PermissionRequest, resources: List) /** Call this method to deny the request. */ @@ -3920,18 +4653,23 @@ abstract class PigeonApiPermissionRequest(open val pigeonRegistrar: AndroidWebki fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiPermissionRequest?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.PermissionRequest.grant", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.PermissionRequest.grant", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.PermissionRequest val resourcesArg = args[1] as List - val wrapped: List = try { - api.grant(pigeon_instanceArg, resourcesArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.grant(pigeon_instanceArg, resourcesArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3939,17 +4677,22 @@ abstract class PigeonApiPermissionRequest(open val pigeonRegistrar: AndroidWebki } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.PermissionRequest.deny", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.PermissionRequest.deny", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.PermissionRequest - val wrapped: List = try { - api.deny(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.deny(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3961,63 +4704,78 @@ abstract class PigeonApiPermissionRequest(open val pigeonRegistrar: AndroidWebki @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of PermissionRequest and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.webkit.PermissionRequest, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.webkit.PermissionRequest, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val resourcesArg = resources(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.PermissionRequest.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.PermissionRequest.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg, resourcesArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } } } - } /** - * A callback interface used by the host application to notify the current page - * that its custom view has been dismissed. + * A callback interface used by the host application to notify the current page that its custom view + * has been dismissed. * * See https://developer.android.com/reference/android/webkit/WebChromeClient.CustomViewCallback. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiCustomViewCallback(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiCustomViewCallback( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { /** Invoked when the host application dismisses the custom view. */ - abstract fun onCustomViewHidden(pigeon_instance: android.webkit.WebChromeClient.CustomViewCallback) + abstract fun onCustomViewHidden( + pigeon_instance: android.webkit.WebChromeClient.CustomViewCallback + ) companion object { @Suppress("LocalVariableName") fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiCustomViewCallback?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.CustomViewCallback.onCustomViewHidden", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.CustomViewCallback.onCustomViewHidden", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebChromeClient.CustomViewCallback - val wrapped: List = try { - api.onCustomViewHidden(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.onCustomViewHidden(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4029,43 +4787,50 @@ abstract class PigeonApiCustomViewCallback(open val pigeonRegistrar: AndroidWebk @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of CustomViewCallback and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.webkit.WebChromeClient.CustomViewCallback, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.webkit.WebChromeClient.CustomViewCallback, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.CustomViewCallback.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.CustomViewCallback.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } } } - } /** - * This class represents the basic building block for user interface - * components. + * This class represents the basic building block for user interface components. * * See https://developer.android.com/reference/android/view/View. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiView(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiView( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { /** Set the scrolled position of your view. */ abstract fun scrollTo(pigeon_instance: android.view.View, x: Long, y: Long) @@ -4097,19 +4862,22 @@ abstract class PigeonApiView(open val pigeonRegistrar: AndroidWebkitLibraryPigeo fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiView?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.View.scrollTo", codec) + val channel = + BasicMessageChannel( + binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.View.scrollTo", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.view.View val xArg = args[1] as Long val yArg = args[2] as Long - val wrapped: List = try { - api.scrollTo(pigeon_instanceArg, xArg, yArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.scrollTo(pigeon_instanceArg, xArg, yArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4117,19 +4885,22 @@ abstract class PigeonApiView(open val pigeonRegistrar: AndroidWebkitLibraryPigeo } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.View.scrollBy", codec) + val channel = + BasicMessageChannel( + binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.View.scrollBy", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.view.View val xArg = args[1] as Long val yArg = args[2] as Long - val wrapped: List = try { - api.scrollBy(pigeon_instanceArg, xArg, yArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.scrollBy(pigeon_instanceArg, xArg, yArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4137,16 +4908,21 @@ abstract class PigeonApiView(open val pigeonRegistrar: AndroidWebkitLibraryPigeo } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.View.getScrollPosition", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.View.getScrollPosition", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.view.View - val wrapped: List = try { - listOf(api.getScrollPosition(pigeon_instanceArg)) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + listOf(api.getScrollPosition(pigeon_instanceArg)) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4154,18 +4930,23 @@ abstract class PigeonApiView(open val pigeonRegistrar: AndroidWebkitLibraryPigeo } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.View.setVerticalScrollBarEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.View.setVerticalScrollBarEnabled", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.view.View val enabledArg = args[1] as Boolean - val wrapped: List = try { - api.setVerticalScrollBarEnabled(pigeon_instanceArg, enabledArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setVerticalScrollBarEnabled(pigeon_instanceArg, enabledArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4173,18 +4954,23 @@ abstract class PigeonApiView(open val pigeonRegistrar: AndroidWebkitLibraryPigeo } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.View.setHorizontalScrollBarEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.View.setHorizontalScrollBarEnabled", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.view.View val enabledArg = args[1] as Boolean - val wrapped: List = try { - api.setHorizontalScrollBarEnabled(pigeon_instanceArg, enabledArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setHorizontalScrollBarEnabled(pigeon_instanceArg, enabledArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4192,18 +4978,23 @@ abstract class PigeonApiView(open val pigeonRegistrar: AndroidWebkitLibraryPigeo } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.View.setOverScrollMode", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.View.setOverScrollMode", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.view.View val modeArg = args[1] as OverScrollMode - val wrapped: List = try { - api.setOverScrollMode(pigeon_instanceArg, modeArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setOverScrollMode(pigeon_instanceArg, modeArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4215,16 +5006,16 @@ abstract class PigeonApiView(open val pigeonRegistrar: AndroidWebkitLibraryPigeo @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of View and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.view.View, callback: (Result) -> Unit) -{ + fun pigeon_newInstance(pigeon_instanceArg: android.view.View, callback: (Result) -> Unit) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.webview_flutter_android.View.pigeon_newInstance" @@ -4232,35 +5023,51 @@ abstract class PigeonApiView(open val pigeonRegistrar: AndroidWebkitLibraryPigeo channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } } } - } /** - * A callback interface used by the host application to set the Geolocation - * permission state for an origin. + * A callback interface used by the host application to set the Geolocation permission state for an + * origin. * * See https://developer.android.com/reference/android/webkit/GeolocationPermissions.Callback. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiGeolocationPermissionsCallback(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiGeolocationPermissionsCallback( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { /** Sets the Geolocation permission state for the supplied origin. */ - abstract fun invoke(pigeon_instance: android.webkit.GeolocationPermissions.Callback, origin: String, allow: Boolean, retain: Boolean) + abstract fun invoke( + pigeon_instance: android.webkit.GeolocationPermissions.Callback, + origin: String, + allow: Boolean, + retain: Boolean + ) companion object { @Suppress("LocalVariableName") - fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiGeolocationPermissionsCallback?) { + fun setUpMessageHandlers( + binaryMessenger: BinaryMessenger, + api: PigeonApiGeolocationPermissionsCallback? + ) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.GeolocationPermissionsCallback.invoke", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.GeolocationPermissionsCallback.invoke", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -4268,12 +5075,13 @@ abstract class PigeonApiGeolocationPermissionsCallback(open val pigeonRegistrar: val originArg = args[1] as String val allowArg = args[2] as Boolean val retainArg = args[3] as Boolean - val wrapped: List = try { - api.invoke(pigeon_instanceArg, originArg, allowArg, retainArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.invoke(pigeon_instanceArg, originArg, allowArg, retainArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4284,35 +5092,44 @@ abstract class PigeonApiGeolocationPermissionsCallback(open val pigeonRegistrar: } @Suppress("LocalVariableName", "FunctionName") - /** Creates a Dart instance of GeolocationPermissionsCallback and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.webkit.GeolocationPermissions.Callback, callback: (Result) -> Unit) -{ + /** + * Creates a Dart instance of GeolocationPermissionsCallback and attaches it to + * [pigeon_instanceArg]. + */ + fun pigeon_newInstance( + pigeon_instanceArg: android.webkit.GeolocationPermissions.Callback, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.GeolocationPermissionsCallback.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.GeolocationPermissionsCallback.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } } } - } /** * Represents a request for HTTP authentication. @@ -4320,38 +5137,45 @@ abstract class PigeonApiGeolocationPermissionsCallback(open val pigeonRegistrar: * See https://developer.android.com/reference/android/webkit/HttpAuthHandler. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiHttpAuthHandler(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiHttpAuthHandler( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { /** - * Gets whether the credentials stored for the current host (i.e. the host - * for which `WebViewClient.onReceivedHttpAuthRequest` was called) are - * suitable for use. + * Gets whether the credentials stored for the current host (i.e. the host for which + * `WebViewClient.onReceivedHttpAuthRequest` was called) are suitable for use. */ abstract fun useHttpAuthUsernamePassword(pigeon_instance: android.webkit.HttpAuthHandler): Boolean /** Instructs the WebView to cancel the authentication request.. */ abstract fun cancel(pigeon_instance: android.webkit.HttpAuthHandler) - /** - * Instructs the WebView to proceed with the authentication with the given - * credentials. - */ - abstract fun proceed(pigeon_instance: android.webkit.HttpAuthHandler, username: String, password: String) + /** Instructs the WebView to proceed with the authentication with the given credentials. */ + abstract fun proceed( + pigeon_instance: android.webkit.HttpAuthHandler, + username: String, + password: String + ) companion object { @Suppress("LocalVariableName") fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiHttpAuthHandler?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.HttpAuthHandler.useHttpAuthUsernamePassword", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.HttpAuthHandler.useHttpAuthUsernamePassword", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.HttpAuthHandler - val wrapped: List = try { - listOf(api.useHttpAuthUsernamePassword(pigeon_instanceArg)) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + listOf(api.useHttpAuthUsernamePassword(pigeon_instanceArg)) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4359,17 +5183,22 @@ abstract class PigeonApiHttpAuthHandler(open val pigeonRegistrar: AndroidWebkitL } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.HttpAuthHandler.cancel", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.HttpAuthHandler.cancel", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.HttpAuthHandler - val wrapped: List = try { - api.cancel(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.cancel(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4377,19 +5206,24 @@ abstract class PigeonApiHttpAuthHandler(open val pigeonRegistrar: AndroidWebkitL } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.HttpAuthHandler.proceed", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.HttpAuthHandler.proceed", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.HttpAuthHandler val usernameArg = args[1] as String val passwordArg = args[2] as String - val wrapped: List = try { - api.proceed(pigeon_instanceArg, usernameArg, passwordArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.proceed(pigeon_instanceArg, usernameArg, passwordArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4401,46 +5235,53 @@ abstract class PigeonApiHttpAuthHandler(open val pigeonRegistrar: AndroidWebkitL @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of HttpAuthHandler and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.webkit.HttpAuthHandler, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.webkit.HttpAuthHandler, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.HttpAuthHandler.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.HttpAuthHandler.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } } } - } /** - * Defines a message containing a description and arbitrary data object that - * can be sent to a `Handler`. + * Defines a message containing a description and arbitrary data object that can be sent to a + * `Handler`. * * See https://developer.android.com/reference/android/os/Message. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiAndroidMessage(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiAndroidMessage( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { /** - * Sends this message to the Android native `Handler` specified by - * getTarget(). + * Sends this message to the Android native `Handler` specified by getTarget(). * * Throws a null pointer exception if this field has not been set. */ @@ -4451,17 +5292,22 @@ abstract class PigeonApiAndroidMessage(open val pigeonRegistrar: AndroidWebkitLi fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiAndroidMessage?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.AndroidMessage.sendToTarget", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.AndroidMessage.sendToTarget", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.os.Message - val wrapped: List = try { - api.sendToTarget(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.sendToTarget(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4473,43 +5319,48 @@ abstract class PigeonApiAndroidMessage(open val pigeonRegistrar: AndroidWebkitLi @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of AndroidMessage and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.os.Message, callback: (Result) -> Unit) -{ + fun pigeon_newInstance(pigeon_instanceArg: android.os.Message, callback: (Result) -> Unit) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.AndroidMessage.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.AndroidMessage.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } } } - } /** - * Defines a message containing a description and arbitrary data object that - * can be sent to a `Handler`. + * Defines a message containing a description and arbitrary data object that can be sent to a + * `Handler`. * * See https://developer.android.com/reference/android/webkit/ClientCertRequest. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiClientCertRequest(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiClientCertRequest( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { /** Cancel this request. */ abstract fun cancel(pigeon_instance: android.webkit.ClientCertRequest) @@ -4517,24 +5368,33 @@ abstract class PigeonApiClientCertRequest(open val pigeonRegistrar: AndroidWebki abstract fun ignore(pigeon_instance: android.webkit.ClientCertRequest) /** Proceed with the specified private key and client certificate chain. */ - abstract fun proceed(pigeon_instance: android.webkit.ClientCertRequest, privateKey: java.security.PrivateKey, chain: List) + abstract fun proceed( + pigeon_instance: android.webkit.ClientCertRequest, + privateKey: java.security.PrivateKey, + chain: List + ) companion object { @Suppress("LocalVariableName") fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiClientCertRequest?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.ClientCertRequest.cancel", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.ClientCertRequest.cancel", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.ClientCertRequest - val wrapped: List = try { - api.cancel(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.cancel(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4542,17 +5402,22 @@ abstract class PigeonApiClientCertRequest(open val pigeonRegistrar: AndroidWebki } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.ClientCertRequest.ignore", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.ClientCertRequest.ignore", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.ClientCertRequest - val wrapped: List = try { - api.ignore(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.ignore(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4560,19 +5425,24 @@ abstract class PigeonApiClientCertRequest(open val pigeonRegistrar: AndroidWebki } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.ClientCertRequest.proceed", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.ClientCertRequest.proceed", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.ClientCertRequest val privateKeyArg = args[1] as java.security.PrivateKey val chainArg = args[2] as List - val wrapped: List = try { - api.proceed(pigeon_instanceArg, privateKeyArg, chainArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.proceed(pigeon_instanceArg, privateKeyArg, chainArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4584,57 +5454,68 @@ abstract class PigeonApiClientCertRequest(open val pigeonRegistrar: AndroidWebki @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of ClientCertRequest and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.webkit.ClientCertRequest, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.webkit.ClientCertRequest, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.ClientCertRequest.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.ClientCertRequest.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } } } - } /** * A private key. * - * The purpose of this interface is to group (and provide type safety for) all - * private key interfaces. + * The purpose of this interface is to group (and provide type safety for) all private key + * interfaces. * * See https://developer.android.com/reference/java/security/PrivateKey. */ @Suppress("UNCHECKED_CAST") -open class PigeonApiPrivateKey(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +open class PigeonApiPrivateKey( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of PrivateKey and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: java.security.PrivateKey, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: java.security.PrivateKey, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.webview_flutter_android.PrivateKey.pigeon_newInstance" @@ -4642,58 +5523,67 @@ open class PigeonApiPrivateKey(open val pigeonRegistrar: AndroidWebkitLibraryPig channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } } } - } /** * Abstract class for X.509 certificates. * - * This provides a standard way to access all the attributes of an X.509 - * certificate. + * This provides a standard way to access all the attributes of an X.509 certificate. * * See https://developer.android.com/reference/java/security/cert/X509Certificate. */ @Suppress("UNCHECKED_CAST") -open class PigeonApiX509Certificate(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +open class PigeonApiX509Certificate( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of X509Certificate and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: java.security.cert.X509Certificate, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: java.security.cert.X509Certificate, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.X509Certificate.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.X509Certificate.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } } } - } /** * Represents a request for handling an SSL error. @@ -4701,16 +5591,18 @@ open class PigeonApiX509Certificate(open val pigeonRegistrar: AndroidWebkitLibra * See https://developer.android.com/reference/android/webkit/SslErrorHandler. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiSslErrorHandler(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiSslErrorHandler( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { /** - * Instructs the WebView that encountered the SSL certificate error to - * terminate communication with the server. + * Instructs the WebView that encountered the SSL certificate error to terminate communication + * with the server. */ abstract fun cancel(pigeon_instance: android.webkit.SslErrorHandler) /** - * Instructs the WebView that encountered the SSL certificate error to ignore - * the error and continue communicating with the server. + * Instructs the WebView that encountered the SSL certificate error to ignore the error and + * continue communicating with the server. */ abstract fun proceed(pigeon_instance: android.webkit.SslErrorHandler) @@ -4719,17 +5611,22 @@ abstract class PigeonApiSslErrorHandler(open val pigeonRegistrar: AndroidWebkitL fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiSslErrorHandler?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.SslErrorHandler.cancel", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.SslErrorHandler.cancel", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.SslErrorHandler - val wrapped: List = try { - api.cancel(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.cancel(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4737,17 +5634,22 @@ abstract class PigeonApiSslErrorHandler(open val pigeonRegistrar: AndroidWebkitL } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.SslErrorHandler.proceed", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.SslErrorHandler.proceed", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.SslErrorHandler - val wrapped: List = try { - api.proceed(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.proceed(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4759,45 +5661,54 @@ abstract class PigeonApiSslErrorHandler(open val pigeonRegistrar: AndroidWebkitL @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of SslErrorHandler and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.webkit.SslErrorHandler, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.webkit.SslErrorHandler, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.SslErrorHandler.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.SslErrorHandler.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } } } - } /** - * This class represents a set of one or more SSL errors and the associated SSL - * certificate. + * This class represents a set of one or more SSL errors and the associated SSL certificate. * * See https://developer.android.com/reference/android/net/http/SslError. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiSslError(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiSslError( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { /** Gets the SSL certificate associated with this object. */ - abstract fun certificate(pigeon_instance: android.net.http.SslError): android.net.http.SslCertificate + abstract fun certificate( + pigeon_instance: android.net.http.SslError + ): android.net.http.SslCertificate /** Gets the URL associated with this object. */ abstract fun url(pigeon_instance: android.net.http.SslError): String @@ -4813,16 +5724,21 @@ abstract class PigeonApiSslError(open val pigeonRegistrar: AndroidWebkitLibraryP fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiSslError?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.SslError.getPrimaryError", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.SslError.getPrimaryError", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.net.http.SslError - val wrapped: List = try { - listOf(api.getPrimaryError(pigeon_instanceArg)) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + listOf(api.getPrimaryError(pigeon_instanceArg)) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4830,17 +5746,22 @@ abstract class PigeonApiSslError(open val pigeonRegistrar: AndroidWebkitLibraryP } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.SslError.hasError", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.SslError.hasError", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.net.http.SslError val errorArg = args[1] as SslErrorType - val wrapped: List = try { - listOf(api.hasError(pigeon_instanceArg, errorArg)) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + listOf(api.hasError(pigeon_instanceArg, errorArg)) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4852,16 +5773,19 @@ abstract class PigeonApiSslError(open val pigeonRegistrar: AndroidWebkitLibraryP @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of SslError and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.net.http.SslError, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.net.http.SslError, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val certificateArg = certificate(pigeon_instanceArg) val urlArg = url(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger @@ -4871,28 +5795,30 @@ abstract class PigeonApiSslError(open val pigeonRegistrar: AndroidWebkitLibraryP channel.send(listOf(pigeon_identifierArg, certificateArg, urlArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } } } - } /** * A distinguished name helper class. * - * A 3-tuple of: - * the most specific common name (CN) - * the most specific organization (O) - * the most specific organizational unit (OU) + * A 3-tuple of: the most specific common name (CN) the most specific organization (O) the most + * specific organizational unit (OU) */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiSslCertificateDName(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiSslCertificateDName( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { /** The most specific Common-name (CN) component of this name. */ abstract fun getCName(pigeon_instance: android.net.http.SslCertificate.DName): String @@ -4910,16 +5836,21 @@ abstract class PigeonApiSslCertificateDName(open val pigeonRegistrar: AndroidWeb fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiSslCertificateDName?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.SslCertificateDName.getCName", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.SslCertificateDName.getCName", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.net.http.SslCertificate.DName - val wrapped: List = try { - listOf(api.getCName(pigeon_instanceArg)) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + listOf(api.getCName(pigeon_instanceArg)) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4927,16 +5858,21 @@ abstract class PigeonApiSslCertificateDName(open val pigeonRegistrar: AndroidWeb } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.SslCertificateDName.getDName", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.SslCertificateDName.getDName", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.net.http.SslCertificate.DName - val wrapped: List = try { - listOf(api.getDName(pigeon_instanceArg)) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + listOf(api.getDName(pigeon_instanceArg)) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4944,16 +5880,21 @@ abstract class PigeonApiSslCertificateDName(open val pigeonRegistrar: AndroidWeb } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.SslCertificateDName.getOName", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.SslCertificateDName.getOName", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.net.http.SslCertificate.DName - val wrapped: List = try { - listOf(api.getOName(pigeon_instanceArg)) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + listOf(api.getOName(pigeon_instanceArg)) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4961,16 +5902,21 @@ abstract class PigeonApiSslCertificateDName(open val pigeonRegistrar: AndroidWeb } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.SslCertificateDName.getUName", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.SslCertificateDName.getUName", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.net.http.SslCertificate.DName - val wrapped: List = try { - listOf(api.getUName(pigeon_instanceArg)) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + listOf(api.getUName(pigeon_instanceArg)) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4982,34 +5928,40 @@ abstract class PigeonApiSslCertificateDName(open val pigeonRegistrar: AndroidWeb @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of SslCertificateDName and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.net.http.SslCertificate.DName, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.net.http.SslCertificate.DName, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.SslCertificateDName.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.SslCertificateDName.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } } } - } /** * SSL certificate info (certificate details) class. @@ -5017,48 +5969,56 @@ abstract class PigeonApiSslCertificateDName(open val pigeonRegistrar: AndroidWeb * See https://developer.android.com/reference/android/net/http/SslCertificate. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiSslCertificate(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiSslCertificate( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { /** Issued-by distinguished name or null if none has been set. */ - abstract fun getIssuedBy(pigeon_instance: android.net.http.SslCertificate): android.net.http.SslCertificate.DName? + abstract fun getIssuedBy( + pigeon_instance: android.net.http.SslCertificate + ): android.net.http.SslCertificate.DName? /** Issued-to distinguished name or null if none has been set. */ - abstract fun getIssuedTo(pigeon_instance: android.net.http.SslCertificate): android.net.http.SslCertificate.DName? + abstract fun getIssuedTo( + pigeon_instance: android.net.http.SslCertificate + ): android.net.http.SslCertificate.DName? - /** - * Not-after date from the certificate validity period or null if none has been - * set. - */ + /** Not-after date from the certificate validity period or null if none has been set. */ abstract fun getValidNotAfterMsSinceEpoch(pigeon_instance: android.net.http.SslCertificate): Long? - /** - * Not-before date from the certificate validity period or null if none has - * been set. - */ - abstract fun getValidNotBeforeMsSinceEpoch(pigeon_instance: android.net.http.SslCertificate): Long? + /** Not-before date from the certificate validity period or null if none has been set. */ + abstract fun getValidNotBeforeMsSinceEpoch( + pigeon_instance: android.net.http.SslCertificate + ): Long? /** - * The X509Certificate used to create this SslCertificate or null if no - * certificate was provided. + * The X509Certificate used to create this SslCertificate or null if no certificate was provided. * * Always returns null on Android versions below Q. */ - abstract fun getX509Certificate(pigeon_instance: android.net.http.SslCertificate): java.security.cert.X509Certificate? + abstract fun getX509Certificate( + pigeon_instance: android.net.http.SslCertificate + ): java.security.cert.X509Certificate? companion object { @Suppress("LocalVariableName") fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiSslCertificate?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.SslCertificate.getIssuedBy", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.SslCertificate.getIssuedBy", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.net.http.SslCertificate - val wrapped: List = try { - listOf(api.getIssuedBy(pigeon_instanceArg)) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + listOf(api.getIssuedBy(pigeon_instanceArg)) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -5066,16 +6026,21 @@ abstract class PigeonApiSslCertificate(open val pigeonRegistrar: AndroidWebkitLi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.SslCertificate.getIssuedTo", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.SslCertificate.getIssuedTo", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.net.http.SslCertificate - val wrapped: List = try { - listOf(api.getIssuedTo(pigeon_instanceArg)) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + listOf(api.getIssuedTo(pigeon_instanceArg)) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -5083,16 +6048,21 @@ abstract class PigeonApiSslCertificate(open val pigeonRegistrar: AndroidWebkitLi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.SslCertificate.getValidNotAfterMsSinceEpoch", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.SslCertificate.getValidNotAfterMsSinceEpoch", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.net.http.SslCertificate - val wrapped: List = try { - listOf(api.getValidNotAfterMsSinceEpoch(pigeon_instanceArg)) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + listOf(api.getValidNotAfterMsSinceEpoch(pigeon_instanceArg)) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -5100,16 +6070,21 @@ abstract class PigeonApiSslCertificate(open val pigeonRegistrar: AndroidWebkitLi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.SslCertificate.getValidNotBeforeMsSinceEpoch", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.SslCertificate.getValidNotBeforeMsSinceEpoch", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.net.http.SslCertificate - val wrapped: List = try { - listOf(api.getValidNotBeforeMsSinceEpoch(pigeon_instanceArg)) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + listOf(api.getValidNotBeforeMsSinceEpoch(pigeon_instanceArg)) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -5117,16 +6092,21 @@ abstract class PigeonApiSslCertificate(open val pigeonRegistrar: AndroidWebkitLi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.SslCertificate.getX509Certificate", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.SslCertificate.getX509Certificate", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.net.http.SslCertificate - val wrapped: List = try { - listOf(api.getX509Certificate(pigeon_instanceArg)) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + listOf(api.getX509Certificate(pigeon_instanceArg)) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -5138,32 +6118,38 @@ abstract class PigeonApiSslCertificate(open val pigeonRegistrar: AndroidWebkitLi @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of SslCertificate and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.net.http.SslCertificate, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.net.http.SslCertificate, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.SslCertificate.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.SslCertificate.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } } } - } diff --git a/packages/webview_flutter/webview_flutter_android/lib/src/android_webkit.g.dart b/packages/webview_flutter/webview_flutter_android/lib/src/android_webkit.g.dart index 3c9e692929a..93a23f43161 100644 --- a/packages/webview_flutter/webview_flutter_android/lib/src/android_webkit.g.dart +++ b/packages/webview_flutter/webview_flutter_android/lib/src/android_webkit.g.dart @@ -8,7 +8,8 @@ import 'dart:async'; import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; -import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer, immutable, protected; +import 'package:flutter/foundation.dart' + show ReadBuffer, WriteBuffer, immutable, protected; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart' show WidgetsFlutterBinding; @@ -19,7 +20,8 @@ PlatformException _createConnectionError(String channelName) { ); } -List wrapResponse({Object? result, PlatformException? error, bool empty = false}) { +List wrapResponse( + {Object? result, PlatformException? error, bool empty = false}) { if (empty) { return []; } @@ -28,6 +30,7 @@ List wrapResponse({Object? result, PlatformException? error, bool empty } return [error.code, error.message, error.details]; } + /// An immutable object that serves as the base class for all ProxyApis and /// can provide functional copies of itself. /// @@ -110,9 +113,10 @@ class PigeonInstanceManager { // by calling instanceManager.getIdentifier() inside of `==` while this was a // HashMap). final Expando _identifiers = Expando(); - final Map> _weakInstances = - >{}; - final Map _strongInstances = {}; + final Map> + _weakInstances = >{}; + final Map _strongInstances = + {}; late final Finalizer _finalizer; int _nextIdentifier = 0; @@ -122,7 +126,8 @@ class PigeonInstanceManager { static PigeonInstanceManager _initInstance() { WidgetsFlutterBinding.ensureInitialized(); - final _PigeonInternalInstanceManagerApi api = _PigeonInternalInstanceManagerApi(); + final _PigeonInternalInstanceManagerApi api = + _PigeonInternalInstanceManagerApi(); // Clears the native `PigeonInstanceManager` on the initial use of the Dart one. api.clear(); final PigeonInstanceManager instanceManager = PigeonInstanceManager( @@ -130,36 +135,65 @@ class PigeonInstanceManager { api.removeStrongReference(identifier); }, ); - _PigeonInternalInstanceManagerApi.setUpMessageHandlers(instanceManager: instanceManager); - WebResourceRequest.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WebResourceResponse.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WebResourceError.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WebResourceErrorCompat.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WebViewPoint.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - ConsoleMessage.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - CookieManager.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WebView.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WebSettings.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - JavaScriptChannel.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WebViewClient.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - DownloadListener.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WebChromeClient.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - FlutterAssetManager.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WebStorage.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - FileChooserParams.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - PermissionRequest.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - CustomViewCallback.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + _PigeonInternalInstanceManagerApi.setUpMessageHandlers( + instanceManager: instanceManager); + WebResourceRequest.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WebResourceResponse.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WebResourceError.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WebResourceErrorCompat.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WebViewPoint.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + ConsoleMessage.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + CookieManager.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WebView.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WebSettings.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + JavaScriptChannel.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WebViewClient.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + DownloadListener.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WebChromeClient.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + FlutterAssetManager.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WebStorage.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + FileChooserParams.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + PermissionRequest.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + CustomViewCallback.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); View.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - GeolocationPermissionsCallback.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - HttpAuthHandler.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - AndroidMessage.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - ClientCertRequest.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - PrivateKey.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - X509Certificate.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - SslErrorHandler.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - SslError.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - SslCertificateDName.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - SslCertificate.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + GeolocationPermissionsCallback.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + HttpAuthHandler.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + AndroidMessage.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + ClientCertRequest.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + PrivateKey.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + X509Certificate.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + SslErrorHandler.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + SslError.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + SslCertificateDName.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + SslCertificate.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); return instanceManager; } @@ -223,15 +257,20 @@ class PigeonInstanceManager { /// /// This method also expects the host `InstanceManager` to have a strong /// reference to the instance the identifier is associated with. - T? getInstanceWithWeakReference(int identifier) { - final PigeonInternalProxyApiBaseClass? weakInstance = _weakInstances[identifier]?.target; + T? getInstanceWithWeakReference( + int identifier) { + final PigeonInternalProxyApiBaseClass? weakInstance = + _weakInstances[identifier]?.target; if (weakInstance == null) { - final PigeonInternalProxyApiBaseClass? strongInstance = _strongInstances[identifier]; + final PigeonInternalProxyApiBaseClass? strongInstance = + _strongInstances[identifier]; if (strongInstance != null) { - final PigeonInternalProxyApiBaseClass copy = strongInstance.pigeon_copy(); + final PigeonInternalProxyApiBaseClass copy = + strongInstance.pigeon_copy(); _identifiers[copy] = identifier; - _weakInstances[identifier] = WeakReference(copy); + _weakInstances[identifier] = + WeakReference(copy); _finalizer.attach(copy, identifier, detach: copy); return copy as T; } @@ -255,17 +294,20 @@ class PigeonInstanceManager { /// added. /// /// Returns unique identifier of the [instance] added. - void addHostCreatedInstance(PigeonInternalProxyApiBaseClass instance, int identifier) { + void addHostCreatedInstance( + PigeonInternalProxyApiBaseClass instance, int identifier) { _addInstanceWithIdentifier(instance, identifier); } - void _addInstanceWithIdentifier(PigeonInternalProxyApiBaseClass instance, int identifier) { + void _addInstanceWithIdentifier( + PigeonInternalProxyApiBaseClass instance, int identifier) { assert(!containsIdentifier(identifier)); assert(getIdentifier(instance) == null); assert(identifier >= 0); _identifiers[instance] = identifier; - _weakInstances[identifier] = WeakReference(instance); + _weakInstances[identifier] = + WeakReference(instance); _finalizer.attach(instance, identifier, detach: instance); final PigeonInternalProxyApiBaseClass copy = instance.pigeon_copy(); @@ -392,29 +434,29 @@ class _PigeonInternalInstanceManagerApi { } class _PigeonInternalProxyApiBaseCodec extends _PigeonCodec { - const _PigeonInternalProxyApiBaseCodec(this.instanceManager); - final PigeonInstanceManager instanceManager; - @override - void writeValue(WriteBuffer buffer, Object? value) { - if (value is PigeonInternalProxyApiBaseClass) { - buffer.putUint8(128); - writeValue(buffer, instanceManager.getIdentifier(value)); - } else { - super.writeValue(buffer, value); - } - } - @override - Object? readValueOfType(int type, ReadBuffer buffer) { - switch (type) { - case 128: - return instanceManager - .getInstanceWithWeakReference(readValue(buffer)! as int); - default: - return super.readValueOfType(type, buffer); - } - } -} + const _PigeonInternalProxyApiBaseCodec(this.instanceManager); + final PigeonInstanceManager instanceManager; + @override + void writeValue(WriteBuffer buffer, Object? value) { + if (value is PigeonInternalProxyApiBaseClass) { + buffer.putUint8(128); + writeValue(buffer, instanceManager.getIdentifier(value)); + } else { + super.writeValue(buffer, value); + } + } + @override + Object? readValueOfType(int type, ReadBuffer buffer) { + switch (type) { + case 128: + return instanceManager + .getInstanceWithWeakReference(readValue(buffer)! as int); + default: + return super.readValueOfType(type, buffer); + } + } +} /// Mode of how to select files for a file chooser. /// @@ -425,14 +467,17 @@ enum FileChooserMode { /// /// See https://developer.android.com/reference/android/webkit/WebChromeClient.FileChooserParams#MODE_OPEN. open, + /// Similar to [open] but allows multiple files to be selected. /// /// See https://developer.android.com/reference/android/webkit/WebChromeClient.FileChooserParams#MODE_OPEN_MULTIPLE. openMultiple, + /// Allows picking a nonexistent file and saving it. /// /// See https://developer.android.com/reference/android/webkit/WebChromeClient.FileChooserParams#MODE_SAVE. save, + /// Indicates a `FileChooserMode` with an unknown mode. /// /// This does not represent an actual value provided by the platform and only @@ -448,22 +493,27 @@ enum ConsoleMessageLevel { /// /// See https://developer.android.com/reference/android/webkit/ConsoleMessage.MessageLevel#DEBUG. debug, + /// Indicates a message is provided as an error. /// /// See https://developer.android.com/reference/android/webkit/ConsoleMessage.MessageLevel#ERROR. error, + /// Indicates a message is provided as a basic log message. /// /// See https://developer.android.com/reference/android/webkit/ConsoleMessage.MessageLevel#LOG. log, + /// Indicates a message is provided as a tip. /// /// See https://developer.android.com/reference/android/webkit/ConsoleMessage.MessageLevel#TIP. tip, + /// Indicates a message is provided as a warning. /// /// See https://developer.android.com/reference/android/webkit/ConsoleMessage.MessageLevel#WARNING. warning, + /// Indicates a message with an unknown level. /// /// This does not represent an actual value provided by the platform and only @@ -478,11 +528,14 @@ enum OverScrollMode { /// Always allow a user to over-scroll this view, provided it is a view that /// can scroll. always, + /// Allow a user to over-scroll this view only if the content is large enough /// to meaningfully scroll, provided it is a view that can scroll. ifContentScrolls, + /// Never allow a user to over-scroll this view. never, + /// The type is not recognized by this wrapper. unknown, } @@ -493,21 +546,26 @@ enum OverScrollMode { enum SslErrorType { /// The date of the certificate is invalid. dateInvalid, + /// The certificate has expired. expired, + /// Hostname mismatch. idMismatch, + /// A generic error occurred. invalid, + /// The certificate is not yet valid. notYetValid, + /// The certificate authority is not trusted. untrusted, + /// The type is not recognized by this wrapper. unknown, } - class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override @@ -515,16 +573,16 @@ class _PigeonCodec extends StandardMessageCodec { if (value is int) { buffer.putUint8(4); buffer.putInt64(value); - } else if (value is FileChooserMode) { + } else if (value is FileChooserMode) { buffer.putUint8(129); writeValue(buffer, value.index); - } else if (value is ConsoleMessageLevel) { + } else if (value is ConsoleMessageLevel) { buffer.putUint8(130); writeValue(buffer, value.index); - } else if (value is OverScrollMode) { + } else if (value is OverScrollMode) { buffer.putUint8(131); writeValue(buffer, value.index); - } else if (value is SslErrorType) { + } else if (value is SslErrorType) { buffer.putUint8(132); writeValue(buffer, value.index); } else { @@ -535,16 +593,16 @@ class _PigeonCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 129: + case 129: final int? value = readValue(buffer) as int?; return value == null ? null : FileChooserMode.values[value]; - case 130: + case 130: final int? value = readValue(buffer) as int?; return value == null ? null : ConsoleMessageLevel.values[value]; - case 131: + case 131: final int? value = readValue(buffer) as int?; return value == null ? null : OverScrollMode.values[value]; - case 132: + case 132: final int? value = readValue(buffer) as int?; return value == null ? null : SslErrorType.values[value]; default: @@ -552,6 +610,7 @@ class _PigeonCodec extends StandardMessageCodec { } } } + /// Encompasses parameters to the `WebViewClient.shouldInterceptRequest` method. /// /// See https://developer.android.com/reference/android/webkit/WebResourceRequest. @@ -8123,4 +8182,3 @@ class SslCertificate extends PigeonInternalProxyApiBaseClass { ); } } - diff --git a/packages/webview_flutter/webview_flutter_android/test/android_navigation_delegate_test.mocks.dart b/packages/webview_flutter/webview_flutter_android/test/android_navigation_delegate_test.mocks.dart index 52363b1bd59..7d84c4694a1 100644 --- a/packages/webview_flutter/webview_flutter_android/test/android_navigation_delegate_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_android/test/android_navigation_delegate_test.mocks.dart @@ -25,19 +25,19 @@ import 'package:webview_flutter_android/src/android_webkit.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 _FakeHttpAuthHandler_1 extends _i1.SmartFake implements _i2.HttpAuthHandler { _FakeHttpAuthHandler_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeDownloadListener_2 extends _i1.SmartFake implements _i2.DownloadListener { _FakeDownloadListener_2(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } /// A class which mocks [HttpAuthHandler]. @@ -49,52 +49,43 @@ class MockHttpAuthHandler extends _i1.Mock implements _i2.HttpAuthHandler { } @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 useHttpAuthUsernamePassword() => - (super.noSuchMethod( - Invocation.method(#useHttpAuthUsernamePassword, []), - returnValue: _i3.Future.value(false), - ) - as _i3.Future); + _i3.Future useHttpAuthUsernamePassword() => (super.noSuchMethod( + Invocation.method(#useHttpAuthUsernamePassword, []), + returnValue: _i3.Future.value(false), + ) as _i3.Future); @override - _i3.Future cancel() => - (super.noSuchMethod( - Invocation.method(#cancel, []), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + _i3.Future cancel() => (super.noSuchMethod( + Invocation.method(#cancel, []), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future proceed(String? username, String? password) => (super.noSuchMethod( - Invocation.method(#proceed, [username, password]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#proceed, [username, password]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override - _i2.HttpAuthHandler pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeHttpAuthHandler_1( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.HttpAuthHandler); + _i2.HttpAuthHandler pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeHttpAuthHandler_1( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.HttpAuthHandler); } /// A class which mocks [DownloadListener]. @@ -107,20 +98,17 @@ class MockDownloadListener extends _i1.Mock implements _i2.DownloadListener { @override void Function(_i2.DownloadListener, String, String, String, String, int) - get onDownloadStart => - (super.noSuchMethod( + get onDownloadStart => (super.noSuchMethod( Invocation.getter(#onDownloadStart), - returnValue: - ( - _i2.DownloadListener pigeon_instance, - String url, - String userAgent, - String contentDisposition, - String mimetype, - int contentLength, - ) {}, - ) - as void Function( + returnValue: ( + _i2.DownloadListener pigeon_instance, + String url, + String userAgent, + String contentDisposition, + String mimetype, + int contentLength, + ) {}, + ) as void Function( _i2.DownloadListener, String, String, @@ -130,24 +118,20 @@ class MockDownloadListener extends _i1.Mock implements _i2.DownloadListener { )); @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.DownloadListener pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeDownloadListener_2( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.DownloadListener); + _i2.DownloadListener pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeDownloadListener_2( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.DownloadListener); } diff --git a/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.mocks.dart b/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.mocks.dart index 00b24c67bba..124fff5220f 100644 --- a/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.mocks.dart @@ -38,18 +38,18 @@ import 'package:webview_flutter_platform_interface/webview_flutter_platform_inte class _FakeWebChromeClient_0 extends _i1.SmartFake implements _i2.WebChromeClient { _FakeWebChromeClient_0(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWebViewClient_1 extends _i1.SmartFake implements _i2.WebViewClient { _FakeWebViewClient_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeDownloadListener_2 extends _i1.SmartFake implements _i2.DownloadListener { _FakeDownloadListener_2(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakePlatformNavigationDelegateCreationParams_3 extends _i1.SmartFake @@ -70,62 +70,62 @@ class _FakePlatformWebViewControllerCreationParams_4 extends _i1.SmartFake class _FakeObject_5 extends _i1.SmartFake implements Object { _FakeObject_5(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeOffset_6 extends _i1.SmartFake implements _i4.Offset { _FakeOffset_6(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWebView_7 extends _i1.SmartFake implements _i2.WebView { _FakeWebView_7(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeJavaScriptChannel_8 extends _i1.SmartFake implements _i2.JavaScriptChannel { _FakeJavaScriptChannel_8(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeCookieManager_9 extends _i1.SmartFake implements _i2.CookieManager { _FakeCookieManager_9(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeFlutterAssetManager_10 extends _i1.SmartFake implements _i2.FlutterAssetManager { _FakeFlutterAssetManager_10(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWebStorage_11 extends _i1.SmartFake implements _i2.WebStorage { _FakeWebStorage_11(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakePigeonInstanceManager_12 extends _i1.SmartFake implements _i2.PigeonInstanceManager { _FakePigeonInstanceManager_12(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakePlatformViewsServiceProxy_13 extends _i1.SmartFake implements _i5.PlatformViewsServiceProxy { _FakePlatformViewsServiceProxy_13(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakePlatformWebViewController_14 extends _i1.SmartFake implements _i3.PlatformWebViewController { _FakePlatformWebViewController_14(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeSize_15 extends _i1.SmartFake implements _i4.Size { _FakeSize_15(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeGeolocationPermissionsCallback_16 extends _i1.SmartFake @@ -139,7 +139,7 @@ class _FakeGeolocationPermissionsCallback_16 extends _i1.SmartFake class _FakePermissionRequest_17 extends _i1.SmartFake implements _i2.PermissionRequest { _FakePermissionRequest_17(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeExpensiveAndroidViewController_18 extends _i1.SmartFake @@ -160,12 +160,12 @@ class _FakeSurfaceAndroidViewController_19 extends _i1.SmartFake class _FakeWebSettings_20 extends _i1.SmartFake implements _i2.WebSettings { _FakeWebSettings_20(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWebViewPoint_21 extends _i1.SmartFake implements _i2.WebViewPoint { _FakeWebViewPoint_21(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } /// A class which mocks [AndroidNavigationDelegate]. @@ -174,152 +174,136 @@ class _FakeWebViewPoint_21 extends _i1.SmartFake implements _i2.WebViewPoint { class MockAndroidNavigationDelegate extends _i1.Mock implements _i7.AndroidNavigationDelegate { @override - _i2.WebChromeClient get androidWebChromeClient => - (super.noSuchMethod( - Invocation.getter(#androidWebChromeClient), - returnValue: _FakeWebChromeClient_0( - this, - Invocation.getter(#androidWebChromeClient), - ), - returnValueForMissingStub: _FakeWebChromeClient_0( - this, - Invocation.getter(#androidWebChromeClient), - ), - ) - as _i2.WebChromeClient); - - @override - _i2.WebViewClient get androidWebViewClient => - (super.noSuchMethod( - Invocation.getter(#androidWebViewClient), - returnValue: _FakeWebViewClient_1( - this, - Invocation.getter(#androidWebViewClient), - ), - returnValueForMissingStub: _FakeWebViewClient_1( - this, - Invocation.getter(#androidWebViewClient), - ), - ) - as _i2.WebViewClient); - - @override - _i2.DownloadListener get androidDownloadListener => - (super.noSuchMethod( - Invocation.getter(#androidDownloadListener), - returnValue: _FakeDownloadListener_2( - this, - Invocation.getter(#androidDownloadListener), - ), - returnValueForMissingStub: _FakeDownloadListener_2( - this, - Invocation.getter(#androidDownloadListener), - ), - ) - as _i2.DownloadListener); + _i2.WebChromeClient get androidWebChromeClient => (super.noSuchMethod( + Invocation.getter(#androidWebChromeClient), + returnValue: _FakeWebChromeClient_0( + this, + Invocation.getter(#androidWebChromeClient), + ), + returnValueForMissingStub: _FakeWebChromeClient_0( + this, + Invocation.getter(#androidWebChromeClient), + ), + ) as _i2.WebChromeClient); + + @override + _i2.WebViewClient get androidWebViewClient => (super.noSuchMethod( + Invocation.getter(#androidWebViewClient), + returnValue: _FakeWebViewClient_1( + this, + Invocation.getter(#androidWebViewClient), + ), + returnValueForMissingStub: _FakeWebViewClient_1( + this, + Invocation.getter(#androidWebViewClient), + ), + ) as _i2.WebViewClient); + + @override + _i2.DownloadListener get androidDownloadListener => (super.noSuchMethod( + Invocation.getter(#androidDownloadListener), + returnValue: _FakeDownloadListener_2( + this, + Invocation.getter(#androidDownloadListener), + ), + returnValueForMissingStub: _FakeDownloadListener_2( + this, + Invocation.getter(#androidDownloadListener), + ), + ) as _i2.DownloadListener); @override _i3.PlatformNavigationDelegateCreationParams get params => (super.noSuchMethod( - Invocation.getter(#params), - returnValue: _FakePlatformNavigationDelegateCreationParams_3( - this, - Invocation.getter(#params), - ), - returnValueForMissingStub: - _FakePlatformNavigationDelegateCreationParams_3( - this, - Invocation.getter(#params), - ), - ) - as _i3.PlatformNavigationDelegateCreationParams); + Invocation.getter(#params), + returnValue: _FakePlatformNavigationDelegateCreationParams_3( + this, + Invocation.getter(#params), + ), + returnValueForMissingStub: + _FakePlatformNavigationDelegateCreationParams_3( + this, + Invocation.getter(#params), + ), + ) as _i3.PlatformNavigationDelegateCreationParams); @override _i8.Future setOnLoadRequest(_i7.LoadRequestCallback? onLoadRequest) => (super.noSuchMethod( - Invocation.method(#setOnLoadRequest, [onLoadRequest]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setOnLoadRequest, [onLoadRequest]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setOnNavigationRequest( _i3.NavigationRequestCallback? onNavigationRequest, ) => (super.noSuchMethod( - Invocation.method(#setOnNavigationRequest, [onNavigationRequest]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setOnNavigationRequest, [onNavigationRequest]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setOnPageStarted(_i3.PageEventCallback? onPageStarted) => (super.noSuchMethod( - Invocation.method(#setOnPageStarted, [onPageStarted]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setOnPageStarted, [onPageStarted]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setOnPageFinished(_i3.PageEventCallback? onPageFinished) => (super.noSuchMethod( - Invocation.method(#setOnPageFinished, [onPageFinished]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setOnPageFinished, [onPageFinished]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setOnHttpError(_i3.HttpResponseErrorCallback? onHttpError) => (super.noSuchMethod( - Invocation.method(#setOnHttpError, [onHttpError]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setOnHttpError, [onHttpError]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setOnProgress(_i3.ProgressCallback? onProgress) => (super.noSuchMethod( - Invocation.method(#setOnProgress, [onProgress]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setOnProgress, [onProgress]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setOnWebResourceError( _i3.WebResourceErrorCallback? onWebResourceError, ) => (super.noSuchMethod( - Invocation.method(#setOnWebResourceError, [onWebResourceError]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setOnWebResourceError, [onWebResourceError]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setOnUrlChange(_i3.UrlChangeCallback? onUrlChange) => (super.noSuchMethod( - Invocation.method(#setOnUrlChange, [onUrlChange]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setOnUrlChange, [onUrlChange]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setOnHttpAuthRequest( _i3.HttpAuthRequestCallback? onHttpAuthRequest, ) => (super.noSuchMethod( - Invocation.method(#setOnHttpAuthRequest, [onHttpAuthRequest]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setOnHttpAuthRequest, [onHttpAuthRequest]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); } /// A class which mocks [AndroidWebViewController]. @@ -328,357 +312,298 @@ class MockAndroidNavigationDelegate extends _i1.Mock class MockAndroidWebViewController extends _i1.Mock implements _i7.AndroidWebViewController { @override - int get webViewIdentifier => - (super.noSuchMethod( - Invocation.getter(#webViewIdentifier), - returnValue: 0, - returnValueForMissingStub: 0, - ) - as int); + int get webViewIdentifier => (super.noSuchMethod( + Invocation.getter(#webViewIdentifier), + returnValue: 0, + returnValueForMissingStub: 0, + ) as int); @override - _i3.PlatformWebViewControllerCreationParams get params => - (super.noSuchMethod( - Invocation.getter(#params), - returnValue: _FakePlatformWebViewControllerCreationParams_4( - this, - Invocation.getter(#params), - ), - returnValueForMissingStub: - _FakePlatformWebViewControllerCreationParams_4( - this, - Invocation.getter(#params), - ), - ) - as _i3.PlatformWebViewControllerCreationParams); + _i3.PlatformWebViewControllerCreationParams get params => (super.noSuchMethod( + Invocation.getter(#params), + returnValue: _FakePlatformWebViewControllerCreationParams_4( + this, + Invocation.getter(#params), + ), + returnValueForMissingStub: + _FakePlatformWebViewControllerCreationParams_4( + this, + Invocation.getter(#params), + ), + ) as _i3.PlatformWebViewControllerCreationParams); @override - _i8.Future setAllowFileAccess(bool? allow) => - (super.noSuchMethod( - Invocation.method(#setAllowFileAccess, [allow]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future setAllowFileAccess(bool? allow) => (super.noSuchMethod( + Invocation.method(#setAllowFileAccess, [allow]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future loadFile(String? absoluteFilePath) => - (super.noSuchMethod( - Invocation.method(#loadFile, [absoluteFilePath]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future loadFile(String? absoluteFilePath) => (super.noSuchMethod( + Invocation.method(#loadFile, [absoluteFilePath]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future loadFlutterAsset(String? key) => - (super.noSuchMethod( - Invocation.method(#loadFlutterAsset, [key]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future loadFlutterAsset(String? key) => (super.noSuchMethod( + Invocation.method(#loadFlutterAsset, [key]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future loadHtmlString(String? html, {String? baseUrl}) => (super.noSuchMethod( - Invocation.method(#loadHtmlString, [html], {#baseUrl: baseUrl}), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#loadHtmlString, [html], {#baseUrl: baseUrl}), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future loadRequest(_i3.LoadRequestParams? params) => (super.noSuchMethod( - Invocation.method(#loadRequest, [params]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#loadRequest, [params]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future currentUrl() => - (super.noSuchMethod( - Invocation.method(#currentUrl, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future currentUrl() => (super.noSuchMethod( + Invocation.method(#currentUrl, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future canGoBack() => - (super.noSuchMethod( - Invocation.method(#canGoBack, []), - returnValue: _i8.Future.value(false), - returnValueForMissingStub: _i8.Future.value(false), - ) - as _i8.Future); + _i8.Future canGoBack() => (super.noSuchMethod( + Invocation.method(#canGoBack, []), + returnValue: _i8.Future.value(false), + returnValueForMissingStub: _i8.Future.value(false), + ) as _i8.Future); @override - _i8.Future canGoForward() => - (super.noSuchMethod( - Invocation.method(#canGoForward, []), - returnValue: _i8.Future.value(false), - returnValueForMissingStub: _i8.Future.value(false), - ) - as _i8.Future); + _i8.Future canGoForward() => (super.noSuchMethod( + Invocation.method(#canGoForward, []), + returnValue: _i8.Future.value(false), + returnValueForMissingStub: _i8.Future.value(false), + ) as _i8.Future); @override - _i8.Future goBack() => - (super.noSuchMethod( - Invocation.method(#goBack, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future goBack() => (super.noSuchMethod( + Invocation.method(#goBack, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future goForward() => - (super.noSuchMethod( - Invocation.method(#goForward, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future goForward() => (super.noSuchMethod( + Invocation.method(#goForward, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future reload() => - (super.noSuchMethod( - Invocation.method(#reload, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future reload() => (super.noSuchMethod( + Invocation.method(#reload, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future clearCache() => - (super.noSuchMethod( - Invocation.method(#clearCache, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future clearCache() => (super.noSuchMethod( + Invocation.method(#clearCache, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future clearLocalStorage() => - (super.noSuchMethod( - Invocation.method(#clearLocalStorage, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future clearLocalStorage() => (super.noSuchMethod( + Invocation.method(#clearLocalStorage, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setPlatformNavigationDelegate( _i3.PlatformNavigationDelegate? handler, ) => (super.noSuchMethod( - Invocation.method(#setPlatformNavigationDelegate, [handler]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setPlatformNavigationDelegate, [handler]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future runJavaScript(String? javaScript) => - (super.noSuchMethod( - Invocation.method(#runJavaScript, [javaScript]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future runJavaScript(String? javaScript) => (super.noSuchMethod( + Invocation.method(#runJavaScript, [javaScript]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future runJavaScriptReturningResult(String? javaScript) => (super.noSuchMethod( + Invocation.method(#runJavaScriptReturningResult, [javaScript]), + returnValue: _i8.Future.value( + _FakeObject_5( + this, + Invocation.method(#runJavaScriptReturningResult, [javaScript]), + ), + ), + returnValueForMissingStub: _i8.Future.value( + _FakeObject_5( + this, Invocation.method(#runJavaScriptReturningResult, [javaScript]), - returnValue: _i8.Future.value( - _FakeObject_5( - this, - Invocation.method(#runJavaScriptReturningResult, [javaScript]), - ), - ), - returnValueForMissingStub: _i8.Future.value( - _FakeObject_5( - this, - Invocation.method(#runJavaScriptReturningResult, [javaScript]), - ), - ), - ) - as _i8.Future); + ), + ), + ) as _i8.Future); @override _i8.Future addJavaScriptChannel( _i3.JavaScriptChannelParams? javaScriptChannelParams, ) => (super.noSuchMethod( - Invocation.method(#addJavaScriptChannel, [javaScriptChannelParams]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#addJavaScriptChannel, [javaScriptChannelParams]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future removeJavaScriptChannel(String? javaScriptChannelName) => (super.noSuchMethod( - Invocation.method(#removeJavaScriptChannel, [ - javaScriptChannelName, - ]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#removeJavaScriptChannel, [ + javaScriptChannelName, + ]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future getTitle() => - (super.noSuchMethod( - Invocation.method(#getTitle, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future getTitle() => (super.noSuchMethod( + Invocation.method(#getTitle, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future scrollTo(int? x, int? y) => - (super.noSuchMethod( - Invocation.method(#scrollTo, [x, y]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future scrollTo(int? x, int? y) => (super.noSuchMethod( + Invocation.method(#scrollTo, [x, y]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future scrollBy(int? x, int? y) => - (super.noSuchMethod( - Invocation.method(#scrollBy, [x, y]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future scrollBy(int? x, int? y) => (super.noSuchMethod( + Invocation.method(#scrollBy, [x, y]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future<_i4.Offset> getScrollPosition() => - (super.noSuchMethod( - Invocation.method(#getScrollPosition, []), - returnValue: _i8.Future<_i4.Offset>.value( - _FakeOffset_6(this, Invocation.method(#getScrollPosition, [])), - ), - returnValueForMissingStub: _i8.Future<_i4.Offset>.value( - _FakeOffset_6(this, Invocation.method(#getScrollPosition, [])), - ), - ) - as _i8.Future<_i4.Offset>); + _i8.Future<_i4.Offset> getScrollPosition() => (super.noSuchMethod( + Invocation.method(#getScrollPosition, []), + returnValue: _i8.Future<_i4.Offset>.value( + _FakeOffset_6(this, Invocation.method(#getScrollPosition, [])), + ), + returnValueForMissingStub: _i8.Future<_i4.Offset>.value( + _FakeOffset_6(this, Invocation.method(#getScrollPosition, [])), + ), + ) as _i8.Future<_i4.Offset>); @override - _i8.Future enableZoom(bool? enabled) => - (super.noSuchMethod( - Invocation.method(#enableZoom, [enabled]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future enableZoom(bool? enabled) => (super.noSuchMethod( + Invocation.method(#enableZoom, [enabled]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future setBackgroundColor(_i4.Color? color) => - (super.noSuchMethod( - Invocation.method(#setBackgroundColor, [color]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future setBackgroundColor(_i4.Color? color) => (super.noSuchMethod( + Invocation.method(#setBackgroundColor, [color]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setJavaScriptMode(_i3.JavaScriptMode? javaScriptMode) => (super.noSuchMethod( - Invocation.method(#setJavaScriptMode, [javaScriptMode]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setJavaScriptMode, [javaScriptMode]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future setUserAgent(String? userAgent) => - (super.noSuchMethod( - Invocation.method(#setUserAgent, [userAgent]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future setUserAgent(String? userAgent) => (super.noSuchMethod( + Invocation.method(#setUserAgent, [userAgent]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setOnScrollPositionChange( void Function(_i3.ScrollPositionChange)? onScrollPositionChange, ) => (super.noSuchMethod( - Invocation.method(#setOnScrollPositionChange, [ - onScrollPositionChange, - ]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setOnScrollPositionChange, [ + onScrollPositionChange, + ]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setMediaPlaybackRequiresUserGesture(bool? require) => (super.noSuchMethod( - Invocation.method(#setMediaPlaybackRequiresUserGesture, [require]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setMediaPlaybackRequiresUserGesture, [require]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future setTextZoom(int? textZoom) => - (super.noSuchMethod( - Invocation.method(#setTextZoom, [textZoom]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future setTextZoom(int? textZoom) => (super.noSuchMethod( + Invocation.method(#setTextZoom, [textZoom]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future setAllowContentAccess(bool? enabled) => - (super.noSuchMethod( - Invocation.method(#setAllowContentAccess, [enabled]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future setAllowContentAccess(bool? enabled) => (super.noSuchMethod( + Invocation.method(#setAllowContentAccess, [enabled]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future setGeolocationEnabled(bool? enabled) => - (super.noSuchMethod( - Invocation.method(#setGeolocationEnabled, [enabled]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future setGeolocationEnabled(bool? enabled) => (super.noSuchMethod( + Invocation.method(#setGeolocationEnabled, [enabled]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setOnShowFileSelector( _i8.Future> Function(_i7.FileSelectorParams)? - onShowFileSelector, + onShowFileSelector, ) => (super.noSuchMethod( - Invocation.method(#setOnShowFileSelector, [onShowFileSelector]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setOnShowFileSelector, [onShowFileSelector]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setOnPlatformPermissionRequest( void Function(_i3.PlatformWebViewPermissionRequest)? onPermissionRequest, ) => (super.noSuchMethod( - Invocation.method(#setOnPlatformPermissionRequest, [ - onPermissionRequest, - ]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setOnPlatformPermissionRequest, [ + onPermissionRequest, + ]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setGeolocationPermissionsPromptCallbacks({ @@ -686,14 +611,13 @@ class MockAndroidWebViewController extends _i1.Mock _i7.OnGeolocationPermissionsHidePrompt? onHidePrompt, }) => (super.noSuchMethod( - Invocation.method(#setGeolocationPermissionsPromptCallbacks, [], { - #onShowPrompt: onShowPrompt, - #onHidePrompt: onHidePrompt, - }), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setGeolocationPermissionsPromptCallbacks, [], { + #onShowPrompt: onShowPrompt, + #onHidePrompt: onHidePrompt, + }), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setCustomWidgetCallbacks({ @@ -701,103 +625,93 @@ class MockAndroidWebViewController extends _i1.Mock required _i7.OnHideCustomWidgetCallback? onHideCustomWidget, }) => (super.noSuchMethod( - Invocation.method(#setCustomWidgetCallbacks, [], { - #onShowCustomWidget: onShowCustomWidget, - #onHideCustomWidget: onHideCustomWidget, - }), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setCustomWidgetCallbacks, [], { + #onShowCustomWidget: onShowCustomWidget, + #onHideCustomWidget: onHideCustomWidget, + }), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setOnConsoleMessage( void Function(_i3.JavaScriptConsoleMessage)? onConsoleMessage, ) => (super.noSuchMethod( - Invocation.method(#setOnConsoleMessage, [onConsoleMessage]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setOnConsoleMessage, [onConsoleMessage]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future getUserAgent() => - (super.noSuchMethod( - Invocation.method(#getUserAgent, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future getUserAgent() => (super.noSuchMethod( + Invocation.method(#getUserAgent, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setOnJavaScriptAlertDialog( _i8.Future Function(_i3.JavaScriptAlertDialogRequest)? - onJavaScriptAlertDialog, + onJavaScriptAlertDialog, ) => (super.noSuchMethod( - Invocation.method(#setOnJavaScriptAlertDialog, [ - onJavaScriptAlertDialog, - ]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setOnJavaScriptAlertDialog, [ + onJavaScriptAlertDialog, + ]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setOnJavaScriptConfirmDialog( _i8.Future Function(_i3.JavaScriptConfirmDialogRequest)? - onJavaScriptConfirmDialog, + onJavaScriptConfirmDialog, ) => (super.noSuchMethod( - Invocation.method(#setOnJavaScriptConfirmDialog, [ - onJavaScriptConfirmDialog, - ]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setOnJavaScriptConfirmDialog, [ + onJavaScriptConfirmDialog, + ]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setOnJavaScriptTextInputDialog( _i8.Future Function(_i3.JavaScriptTextInputDialogRequest)? - onJavaScriptTextInputDialog, + onJavaScriptTextInputDialog, ) => (super.noSuchMethod( - Invocation.method(#setOnJavaScriptTextInputDialog, [ - onJavaScriptTextInputDialog, - ]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setOnJavaScriptTextInputDialog, [ + onJavaScriptTextInputDialog, + ]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setVerticalScrollBarEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setVerticalScrollBarEnabled, [enabled]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setVerticalScrollBarEnabled, [enabled]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setHorizontalScrollBarEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setHorizontalScrollBarEnabled, [enabled]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setHorizontalScrollBarEnabled, [enabled]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setOverScrollMode(_i3.WebViewOverScrollMode? mode) => (super.noSuchMethod( - Invocation.method(#setOverScrollMode, [mode]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setOverScrollMode, [mode]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); } /// A class which mocks [AndroidWebViewProxy]. @@ -808,386 +722,327 @@ class MockAndroidWebViewProxy extends _i1.Mock @override _i2.WebView Function({ void Function(_i2.WebView, int, int, int, int)? onScrollChanged, - }) - get newWebView => - (super.noSuchMethod( - Invocation.getter(#newWebView), - returnValue: - ({ - void Function(_i2.WebView, int, int, int, int)? - onScrollChanged, - }) => _FakeWebView_7(this, Invocation.getter(#newWebView)), - returnValueForMissingStub: - ({ - void Function(_i2.WebView, int, int, int, int)? - onScrollChanged, - }) => _FakeWebView_7(this, Invocation.getter(#newWebView)), - ) - as _i2.WebView Function({ - void Function(_i2.WebView, int, int, int, int)? onScrollChanged, - })); + }) get newWebView => (super.noSuchMethod( + Invocation.getter(#newWebView), + returnValue: ({ + void Function(_i2.WebView, int, int, int, int)? onScrollChanged, + }) => + _FakeWebView_7(this, Invocation.getter(#newWebView)), + returnValueForMissingStub: ({ + void Function(_i2.WebView, int, int, int, int)? onScrollChanged, + }) => + _FakeWebView_7(this, Invocation.getter(#newWebView)), + ) as _i2.WebView Function({ + void Function(_i2.WebView, int, int, int, int)? onScrollChanged, + })); @override _i2.JavaScriptChannel Function({ required String channelName, required void Function(_i2.JavaScriptChannel, String) postMessage, - }) - get newJavaScriptChannel => - (super.noSuchMethod( - Invocation.getter(#newJavaScriptChannel), - returnValue: - ({ - required String channelName, - required void Function(_i2.JavaScriptChannel, String) - postMessage, - }) => _FakeJavaScriptChannel_8( - this, - Invocation.getter(#newJavaScriptChannel), - ), - returnValueForMissingStub: - ({ - required String channelName, - required void Function(_i2.JavaScriptChannel, String) - postMessage, - }) => _FakeJavaScriptChannel_8( - this, - Invocation.getter(#newJavaScriptChannel), - ), - ) - as _i2.JavaScriptChannel Function({ - required String channelName, - required void Function(_i2.JavaScriptChannel, String) postMessage, - })); + }) get newJavaScriptChannel => (super.noSuchMethod( + Invocation.getter(#newJavaScriptChannel), + returnValue: ({ + required String channelName, + required void Function(_i2.JavaScriptChannel, String) postMessage, + }) => + _FakeJavaScriptChannel_8( + this, + Invocation.getter(#newJavaScriptChannel), + ), + returnValueForMissingStub: ({ + required String channelName, + required void Function(_i2.JavaScriptChannel, String) postMessage, + }) => + _FakeJavaScriptChannel_8( + this, + Invocation.getter(#newJavaScriptChannel), + ), + ) as _i2.JavaScriptChannel Function({ + required String channelName, + required void Function(_i2.JavaScriptChannel, String) postMessage, + })); @override _i2.WebViewClient Function({ void Function(_i2.WebViewClient, _i2.WebView, String, bool)? - doUpdateVisitedHistory, + doUpdateVisitedHistory, void Function( _i2.WebViewClient, _i2.WebView, _i2.AndroidMessage, _i2.AndroidMessage, - )? - onFormResubmission, + )? onFormResubmission, void Function(_i2.WebViewClient, _i2.WebView, String)? onLoadResource, void Function(_i2.WebViewClient, _i2.WebView, String)? onPageCommitVisible, void Function(_i2.WebViewClient, _i2.WebView, String)? onPageFinished, void Function(_i2.WebViewClient, _i2.WebView, String)? onPageStarted, void Function(_i2.WebViewClient, _i2.WebView, _i2.ClientCertRequest)? - onReceivedClientCertRequest, + onReceivedClientCertRequest, void Function(_i2.WebViewClient, _i2.WebView, int, String, String)? - onReceivedError, + onReceivedError, void Function( _i2.WebViewClient, _i2.WebView, _i2.HttpAuthHandler, String, String, - )? - onReceivedHttpAuthRequest, + )? onReceivedHttpAuthRequest, void Function( _i2.WebViewClient, _i2.WebView, _i2.WebResourceRequest, _i2.WebResourceResponse, - )? - onReceivedHttpError, + )? onReceivedHttpError, void Function(_i2.WebViewClient, _i2.WebView, String, String?, String)? - onReceivedLoginRequest, + onReceivedLoginRequest, void Function( _i2.WebViewClient, _i2.WebView, _i2.WebResourceRequest, _i2.WebResourceError, - )? - onReceivedRequestError, + )? onReceivedRequestError, void Function( _i2.WebViewClient, _i2.WebView, _i2.WebResourceRequest, _i2.WebResourceErrorCompat, - )? - onReceivedRequestErrorCompat, + )? onReceivedRequestErrorCompat, void Function( _i2.WebViewClient, _i2.WebView, _i2.SslErrorHandler, _i2.SslError, - )? - onReceivedSslError, + )? onReceivedSslError, void Function(_i2.WebViewClient, _i2.WebView, double, double)? - onScaleChanged, + onScaleChanged, void Function(_i2.WebViewClient, _i2.WebView, _i2.WebResourceRequest)? - requestLoading, + requestLoading, void Function(_i2.WebViewClient, _i2.WebView, String)? urlLoading, - }) - get newWebViewClient => - (super.noSuchMethod( - Invocation.getter(#newWebViewClient), - returnValue: - ({ - void Function(_i2.WebViewClient, _i2.WebView, String, bool)? - doUpdateVisitedHistory, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.AndroidMessage, - _i2.AndroidMessage, - )? - onFormResubmission, - void Function(_i2.WebViewClient, _i2.WebView, String)? - onLoadResource, - void Function(_i2.WebViewClient, _i2.WebView, String)? - onPageCommitVisible, - void Function(_i2.WebViewClient, _i2.WebView, String)? - onPageFinished, - void Function(_i2.WebViewClient, _i2.WebView, String)? - onPageStarted, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.ClientCertRequest, - )? - onReceivedClientCertRequest, - void Function( - _i2.WebViewClient, - _i2.WebView, - int, - String, - String, - )? - onReceivedError, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.HttpAuthHandler, - String, - String, - )? - onReceivedHttpAuthRequest, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.WebResourceRequest, - _i2.WebResourceResponse, - )? - onReceivedHttpError, - void Function( - _i2.WebViewClient, - _i2.WebView, - String, - String?, - String, - )? - onReceivedLoginRequest, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.WebResourceRequest, - _i2.WebResourceError, - )? - onReceivedRequestError, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.WebResourceRequest, - _i2.WebResourceErrorCompat, - )? - onReceivedRequestErrorCompat, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.SslErrorHandler, - _i2.SslError, - )? - onReceivedSslError, - void Function(_i2.WebViewClient, _i2.WebView, double, double)? - onScaleChanged, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.WebResourceRequest, - )? - requestLoading, - void Function(_i2.WebViewClient, _i2.WebView, String)? - urlLoading, - }) => _FakeWebViewClient_1( - this, - Invocation.getter(#newWebViewClient), - ), - returnValueForMissingStub: - ({ - void Function(_i2.WebViewClient, _i2.WebView, String, bool)? - doUpdateVisitedHistory, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.AndroidMessage, - _i2.AndroidMessage, - )? - onFormResubmission, - void Function(_i2.WebViewClient, _i2.WebView, String)? - onLoadResource, - void Function(_i2.WebViewClient, _i2.WebView, String)? - onPageCommitVisible, - void Function(_i2.WebViewClient, _i2.WebView, String)? - onPageFinished, - void Function(_i2.WebViewClient, _i2.WebView, String)? - onPageStarted, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.ClientCertRequest, - )? - onReceivedClientCertRequest, - void Function( - _i2.WebViewClient, - _i2.WebView, - int, - String, - String, - )? - onReceivedError, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.HttpAuthHandler, - String, - String, - )? - onReceivedHttpAuthRequest, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.WebResourceRequest, - _i2.WebResourceResponse, - )? - onReceivedHttpError, - void Function( - _i2.WebViewClient, - _i2.WebView, - String, - String?, - String, - )? - onReceivedLoginRequest, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.WebResourceRequest, - _i2.WebResourceError, - )? - onReceivedRequestError, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.WebResourceRequest, - _i2.WebResourceErrorCompat, - )? - onReceivedRequestErrorCompat, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.SslErrorHandler, - _i2.SslError, - )? - onReceivedSslError, - void Function(_i2.WebViewClient, _i2.WebView, double, double)? - onScaleChanged, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.WebResourceRequest, - )? - requestLoading, - void Function(_i2.WebViewClient, _i2.WebView, String)? - urlLoading, - }) => _FakeWebViewClient_1( - this, - Invocation.getter(#newWebViewClient), - ), - ) - as _i2.WebViewClient Function({ - void Function(_i2.WebViewClient, _i2.WebView, String, bool)? + }) get newWebViewClient => (super.noSuchMethod( + Invocation.getter(#newWebViewClient), + returnValue: ({ + void Function(_i2.WebViewClient, _i2.WebView, String, bool)? + doUpdateVisitedHistory, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.AndroidMessage, + _i2.AndroidMessage, + )? onFormResubmission, + void Function(_i2.WebViewClient, _i2.WebView, String)? onLoadResource, + void Function(_i2.WebViewClient, _i2.WebView, String)? + onPageCommitVisible, + void Function(_i2.WebViewClient, _i2.WebView, String)? onPageFinished, + void Function(_i2.WebViewClient, _i2.WebView, String)? onPageStarted, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.ClientCertRequest, + )? onReceivedClientCertRequest, + void Function( + _i2.WebViewClient, + _i2.WebView, + int, + String, + String, + )? onReceivedError, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.HttpAuthHandler, + String, + String, + )? onReceivedHttpAuthRequest, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.WebResourceRequest, + _i2.WebResourceResponse, + )? onReceivedHttpError, + void Function( + _i2.WebViewClient, + _i2.WebView, + String, + String?, + String, + )? onReceivedLoginRequest, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.WebResourceRequest, + _i2.WebResourceError, + )? onReceivedRequestError, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.WebResourceRequest, + _i2.WebResourceErrorCompat, + )? onReceivedRequestErrorCompat, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.SslErrorHandler, + _i2.SslError, + )? onReceivedSslError, + void Function(_i2.WebViewClient, _i2.WebView, double, double)? + onScaleChanged, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.WebResourceRequest, + )? requestLoading, + void Function(_i2.WebViewClient, _i2.WebView, String)? urlLoading, + }) => + _FakeWebViewClient_1( + this, + Invocation.getter(#newWebViewClient), + ), + returnValueForMissingStub: ({ + void Function(_i2.WebViewClient, _i2.WebView, String, bool)? + doUpdateVisitedHistory, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.AndroidMessage, + _i2.AndroidMessage, + )? onFormResubmission, + void Function(_i2.WebViewClient, _i2.WebView, String)? onLoadResource, + void Function(_i2.WebViewClient, _i2.WebView, String)? + onPageCommitVisible, + void Function(_i2.WebViewClient, _i2.WebView, String)? onPageFinished, + void Function(_i2.WebViewClient, _i2.WebView, String)? onPageStarted, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.ClientCertRequest, + )? onReceivedClientCertRequest, + void Function( + _i2.WebViewClient, + _i2.WebView, + int, + String, + String, + )? onReceivedError, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.HttpAuthHandler, + String, + String, + )? onReceivedHttpAuthRequest, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.WebResourceRequest, + _i2.WebResourceResponse, + )? onReceivedHttpError, + void Function( + _i2.WebViewClient, + _i2.WebView, + String, + String?, + String, + )? onReceivedLoginRequest, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.WebResourceRequest, + _i2.WebResourceError, + )? onReceivedRequestError, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.WebResourceRequest, + _i2.WebResourceErrorCompat, + )? onReceivedRequestErrorCompat, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.SslErrorHandler, + _i2.SslError, + )? onReceivedSslError, + void Function(_i2.WebViewClient, _i2.WebView, double, double)? + onScaleChanged, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.WebResourceRequest, + )? requestLoading, + void Function(_i2.WebViewClient, _i2.WebView, String)? urlLoading, + }) => + _FakeWebViewClient_1( + this, + Invocation.getter(#newWebViewClient), + ), + ) as _i2.WebViewClient Function({ + void Function(_i2.WebViewClient, _i2.WebView, String, bool)? doUpdateVisitedHistory, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.AndroidMessage, - _i2.AndroidMessage, - )? - onFormResubmission, - void Function(_i2.WebViewClient, _i2.WebView, String)? - onLoadResource, - void Function(_i2.WebViewClient, _i2.WebView, String)? + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.AndroidMessage, + _i2.AndroidMessage, + )? onFormResubmission, + void Function(_i2.WebViewClient, _i2.WebView, String)? onLoadResource, + void Function(_i2.WebViewClient, _i2.WebView, String)? onPageCommitVisible, - void Function(_i2.WebViewClient, _i2.WebView, String)? - onPageFinished, - void Function(_i2.WebViewClient, _i2.WebView, String)? - onPageStarted, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.ClientCertRequest, - )? - onReceivedClientCertRequest, - void Function(_i2.WebViewClient, _i2.WebView, int, String, String)? + void Function(_i2.WebViewClient, _i2.WebView, String)? onPageFinished, + void Function(_i2.WebViewClient, _i2.WebView, String)? onPageStarted, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.ClientCertRequest, + )? onReceivedClientCertRequest, + void Function(_i2.WebViewClient, _i2.WebView, int, String, String)? onReceivedError, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.HttpAuthHandler, - String, - String, - )? - onReceivedHttpAuthRequest, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.WebResourceRequest, - _i2.WebResourceResponse, - )? - onReceivedHttpError, - void Function( - _i2.WebViewClient, - _i2.WebView, - String, - String?, - String, - )? - onReceivedLoginRequest, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.WebResourceRequest, - _i2.WebResourceError, - )? - onReceivedRequestError, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.WebResourceRequest, - _i2.WebResourceErrorCompat, - )? - onReceivedRequestErrorCompat, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.SslErrorHandler, - _i2.SslError, - )? - onReceivedSslError, - void Function(_i2.WebViewClient, _i2.WebView, double, double)? + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.HttpAuthHandler, + String, + String, + )? onReceivedHttpAuthRequest, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.WebResourceRequest, + _i2.WebResourceResponse, + )? onReceivedHttpError, + void Function( + _i2.WebViewClient, + _i2.WebView, + String, + String?, + String, + )? onReceivedLoginRequest, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.WebResourceRequest, + _i2.WebResourceError, + )? onReceivedRequestError, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.WebResourceRequest, + _i2.WebResourceErrorCompat, + )? onReceivedRequestErrorCompat, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.SslErrorHandler, + _i2.SslError, + )? onReceivedSslError, + void Function(_i2.WebViewClient, _i2.WebView, double, double)? onScaleChanged, - void Function( - _i2.WebViewClient, - _i2.WebView, - _i2.WebResourceRequest, - )? - requestLoading, - void Function(_i2.WebViewClient, _i2.WebView, String)? urlLoading, - })); + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.WebResourceRequest, + )? requestLoading, + void Function(_i2.WebViewClient, _i2.WebView, String)? urlLoading, + })); @override _i2.DownloadListener Function({ @@ -1198,54 +1053,47 @@ class MockAndroidWebViewProxy extends _i1.Mock String, String, int, - ) - onDownloadStart, - }) - get newDownloadListener => - (super.noSuchMethod( - Invocation.getter(#newDownloadListener), - returnValue: - ({ - required void Function( - _i2.DownloadListener, - String, - String, - String, - String, - int, - ) - onDownloadStart, - }) => _FakeDownloadListener_2( - this, - Invocation.getter(#newDownloadListener), - ), - returnValueForMissingStub: - ({ - required void Function( - _i2.DownloadListener, - String, - String, - String, - String, - int, - ) - onDownloadStart, - }) => _FakeDownloadListener_2( - this, - Invocation.getter(#newDownloadListener), - ), - ) - as _i2.DownloadListener Function({ - required void Function( - _i2.DownloadListener, - String, - String, - String, - String, - int, - ) - onDownloadStart, - })); + ) onDownloadStart, + }) get newDownloadListener => (super.noSuchMethod( + Invocation.getter(#newDownloadListener), + returnValue: ({ + required void Function( + _i2.DownloadListener, + String, + String, + String, + String, + int, + ) onDownloadStart, + }) => + _FakeDownloadListener_2( + this, + Invocation.getter(#newDownloadListener), + ), + returnValueForMissingStub: ({ + required void Function( + _i2.DownloadListener, + String, + String, + String, + String, + int, + ) onDownloadStart, + }) => + _FakeDownloadListener_2( + this, + Invocation.getter(#newDownloadListener), + ), + ) as _i2.DownloadListener Function({ + required void Function( + _i2.DownloadListener, + String, + String, + String, + String, + int, + ) onDownloadStart, + })); @override _i2.WebChromeClient Function({ @@ -1254,264 +1102,225 @@ class MockAndroidWebViewProxy extends _i1.Mock _i2.WebView, String, String, - ) - onJsConfirm, + ) onJsConfirm, required _i8.Future> Function( _i2.WebChromeClient, _i2.WebView, _i2.FileChooserParams, - ) - onShowFileChooser, + ) onShowFileChooser, void Function(_i2.WebChromeClient, _i2.ConsoleMessage)? onConsoleMessage, void Function(_i2.WebChromeClient)? onGeolocationPermissionsHidePrompt, void Function( _i2.WebChromeClient, String, _i2.GeolocationPermissionsCallback, - )? - onGeolocationPermissionsShowPrompt, + )? onGeolocationPermissionsShowPrompt, void Function(_i2.WebChromeClient)? onHideCustomView, _i8.Future Function(_i2.WebChromeClient, _i2.WebView, String, String)? - onJsAlert, + onJsAlert, _i8.Future Function( _i2.WebChromeClient, _i2.WebView, String, String, String, - )? - onJsPrompt, + )? onJsPrompt, void Function(_i2.WebChromeClient, _i2.PermissionRequest)? - onPermissionRequest, + onPermissionRequest, void Function(_i2.WebChromeClient, _i2.WebView, int)? onProgressChanged, void Function(_i2.WebChromeClient, _i2.View, _i2.CustomViewCallback)? - onShowCustomView, - }) - get newWebChromeClient => - (super.noSuchMethod( - Invocation.getter(#newWebChromeClient), - returnValue: - ({ - void Function(_i2.WebChromeClient, _i2.ConsoleMessage)? - onConsoleMessage, - void Function(_i2.WebChromeClient)? - onGeolocationPermissionsHidePrompt, - void Function( - _i2.WebChromeClient, - String, - _i2.GeolocationPermissionsCallback, - )? - onGeolocationPermissionsShowPrompt, - void Function(_i2.WebChromeClient)? onHideCustomView, - _i8.Future Function( - _i2.WebChromeClient, - _i2.WebView, - String, - String, - )? - onJsAlert, - required _i8.Future Function( - _i2.WebChromeClient, - _i2.WebView, - String, - String, - ) - onJsConfirm, - _i8.Future Function( - _i2.WebChromeClient, - _i2.WebView, - String, - String, - String, - )? - onJsPrompt, - void Function(_i2.WebChromeClient, _i2.PermissionRequest)? - onPermissionRequest, - void Function(_i2.WebChromeClient, _i2.WebView, int)? - onProgressChanged, - void Function( - _i2.WebChromeClient, - _i2.View, - _i2.CustomViewCallback, - )? - onShowCustomView, - required _i8.Future> Function( - _i2.WebChromeClient, - _i2.WebView, - _i2.FileChooserParams, - ) - onShowFileChooser, - }) => _FakeWebChromeClient_0( - this, - Invocation.getter(#newWebChromeClient), - ), - returnValueForMissingStub: - ({ - void Function(_i2.WebChromeClient, _i2.ConsoleMessage)? - onConsoleMessage, - void Function(_i2.WebChromeClient)? - onGeolocationPermissionsHidePrompt, - void Function( - _i2.WebChromeClient, - String, - _i2.GeolocationPermissionsCallback, - )? - onGeolocationPermissionsShowPrompt, - void Function(_i2.WebChromeClient)? onHideCustomView, - _i8.Future Function( - _i2.WebChromeClient, - _i2.WebView, - String, - String, - )? - onJsAlert, - required _i8.Future Function( - _i2.WebChromeClient, - _i2.WebView, - String, - String, - ) - onJsConfirm, - _i8.Future Function( - _i2.WebChromeClient, - _i2.WebView, - String, - String, - String, - )? - onJsPrompt, - void Function(_i2.WebChromeClient, _i2.PermissionRequest)? - onPermissionRequest, - void Function(_i2.WebChromeClient, _i2.WebView, int)? - onProgressChanged, - void Function( - _i2.WebChromeClient, - _i2.View, - _i2.CustomViewCallback, - )? - onShowCustomView, - required _i8.Future> Function( - _i2.WebChromeClient, - _i2.WebView, - _i2.FileChooserParams, - ) - onShowFileChooser, - }) => _FakeWebChromeClient_0( - this, - Invocation.getter(#newWebChromeClient), - ), - ) - as _i2.WebChromeClient Function({ - required _i8.Future Function( - _i2.WebChromeClient, - _i2.WebView, - String, - String, - ) - onJsConfirm, - required _i8.Future> Function( - _i2.WebChromeClient, - _i2.WebView, - _i2.FileChooserParams, - ) - onShowFileChooser, - void Function(_i2.WebChromeClient, _i2.ConsoleMessage)? + onShowCustomView, + }) get newWebChromeClient => (super.noSuchMethod( + Invocation.getter(#newWebChromeClient), + returnValue: ({ + void Function(_i2.WebChromeClient, _i2.ConsoleMessage)? + onConsoleMessage, + void Function(_i2.WebChromeClient)? + onGeolocationPermissionsHidePrompt, + void Function( + _i2.WebChromeClient, + String, + _i2.GeolocationPermissionsCallback, + )? onGeolocationPermissionsShowPrompt, + void Function(_i2.WebChromeClient)? onHideCustomView, + _i8.Future Function( + _i2.WebChromeClient, + _i2.WebView, + String, + String, + )? onJsAlert, + required _i8.Future Function( + _i2.WebChromeClient, + _i2.WebView, + String, + String, + ) onJsConfirm, + _i8.Future Function( + _i2.WebChromeClient, + _i2.WebView, + String, + String, + String, + )? onJsPrompt, + void Function(_i2.WebChromeClient, _i2.PermissionRequest)? + onPermissionRequest, + void Function(_i2.WebChromeClient, _i2.WebView, int)? + onProgressChanged, + void Function( + _i2.WebChromeClient, + _i2.View, + _i2.CustomViewCallback, + )? onShowCustomView, + required _i8.Future> Function( + _i2.WebChromeClient, + _i2.WebView, + _i2.FileChooserParams, + ) onShowFileChooser, + }) => + _FakeWebChromeClient_0( + this, + Invocation.getter(#newWebChromeClient), + ), + returnValueForMissingStub: ({ + void Function(_i2.WebChromeClient, _i2.ConsoleMessage)? + onConsoleMessage, + void Function(_i2.WebChromeClient)? + onGeolocationPermissionsHidePrompt, + void Function( + _i2.WebChromeClient, + String, + _i2.GeolocationPermissionsCallback, + )? onGeolocationPermissionsShowPrompt, + void Function(_i2.WebChromeClient)? onHideCustomView, + _i8.Future Function( + _i2.WebChromeClient, + _i2.WebView, + String, + String, + )? onJsAlert, + required _i8.Future Function( + _i2.WebChromeClient, + _i2.WebView, + String, + String, + ) onJsConfirm, + _i8.Future Function( + _i2.WebChromeClient, + _i2.WebView, + String, + String, + String, + )? onJsPrompt, + void Function(_i2.WebChromeClient, _i2.PermissionRequest)? + onPermissionRequest, + void Function(_i2.WebChromeClient, _i2.WebView, int)? + onProgressChanged, + void Function( + _i2.WebChromeClient, + _i2.View, + _i2.CustomViewCallback, + )? onShowCustomView, + required _i8.Future> Function( + _i2.WebChromeClient, + _i2.WebView, + _i2.FileChooserParams, + ) onShowFileChooser, + }) => + _FakeWebChromeClient_0( + this, + Invocation.getter(#newWebChromeClient), + ), + ) as _i2.WebChromeClient Function({ + required _i8.Future Function( + _i2.WebChromeClient, + _i2.WebView, + String, + String, + ) onJsConfirm, + required _i8.Future> Function( + _i2.WebChromeClient, + _i2.WebView, + _i2.FileChooserParams, + ) onShowFileChooser, + void Function(_i2.WebChromeClient, _i2.ConsoleMessage)? onConsoleMessage, - void Function(_i2.WebChromeClient)? - onGeolocationPermissionsHidePrompt, - void Function( - _i2.WebChromeClient, - String, - _i2.GeolocationPermissionsCallback, - )? - onGeolocationPermissionsShowPrompt, - void Function(_i2.WebChromeClient)? onHideCustomView, - _i8.Future Function( - _i2.WebChromeClient, - _i2.WebView, - String, - String, - )? - onJsAlert, - _i8.Future Function( - _i2.WebChromeClient, - _i2.WebView, - String, - String, - String, - )? - onJsPrompt, - void Function(_i2.WebChromeClient, _i2.PermissionRequest)? + void Function(_i2.WebChromeClient)? onGeolocationPermissionsHidePrompt, + void Function( + _i2.WebChromeClient, + String, + _i2.GeolocationPermissionsCallback, + )? onGeolocationPermissionsShowPrompt, + void Function(_i2.WebChromeClient)? onHideCustomView, + _i8.Future Function( + _i2.WebChromeClient, + _i2.WebView, + String, + String, + )? onJsAlert, + _i8.Future Function( + _i2.WebChromeClient, + _i2.WebView, + String, + String, + String, + )? onJsPrompt, + void Function(_i2.WebChromeClient, _i2.PermissionRequest)? onPermissionRequest, - void Function(_i2.WebChromeClient, _i2.WebView, int)? - onProgressChanged, - void Function( - _i2.WebChromeClient, - _i2.View, - _i2.CustomViewCallback, - )? - onShowCustomView, - })); + void Function(_i2.WebChromeClient, _i2.WebView, int)? onProgressChanged, + void Function( + _i2.WebChromeClient, + _i2.View, + _i2.CustomViewCallback, + )? onShowCustomView, + })); @override _i8.Future Function(bool) get setWebContentsDebuggingEnabledWebView => (super.noSuchMethod( - Invocation.getter(#setWebContentsDebuggingEnabledWebView), - returnValue: (bool __p0) => _i8.Future.value(), - returnValueForMissingStub: (bool __p0) => _i8.Future.value(), - ) - as _i8.Future Function(bool)); + Invocation.getter(#setWebContentsDebuggingEnabledWebView), + returnValue: (bool __p0) => _i8.Future.value(), + returnValueForMissingStub: (bool __p0) => _i8.Future.value(), + ) as _i8.Future Function(bool)); @override - _i2.CookieManager Function() get instanceCookieManager => - (super.noSuchMethod( - Invocation.getter(#instanceCookieManager), - returnValue: - () => _FakeCookieManager_9( - this, - Invocation.getter(#instanceCookieManager), - ), - returnValueForMissingStub: - () => _FakeCookieManager_9( - this, - Invocation.getter(#instanceCookieManager), - ), - ) - as _i2.CookieManager Function()); + _i2.CookieManager Function() get instanceCookieManager => (super.noSuchMethod( + Invocation.getter(#instanceCookieManager), + returnValue: () => _FakeCookieManager_9( + this, + Invocation.getter(#instanceCookieManager), + ), + returnValueForMissingStub: () => _FakeCookieManager_9( + this, + Invocation.getter(#instanceCookieManager), + ), + ) as _i2.CookieManager Function()); @override _i2.FlutterAssetManager Function() get instanceFlutterAssetManager => (super.noSuchMethod( - Invocation.getter(#instanceFlutterAssetManager), - returnValue: - () => _FakeFlutterAssetManager_10( - this, - Invocation.getter(#instanceFlutterAssetManager), - ), - returnValueForMissingStub: - () => _FakeFlutterAssetManager_10( - this, - Invocation.getter(#instanceFlutterAssetManager), - ), - ) - as _i2.FlutterAssetManager Function()); - - @override - _i2.WebStorage Function() get instanceWebStorage => - (super.noSuchMethod( - Invocation.getter(#instanceWebStorage), - returnValue: - () => _FakeWebStorage_11( - this, - Invocation.getter(#instanceWebStorage), - ), - returnValueForMissingStub: - () => _FakeWebStorage_11( - this, - Invocation.getter(#instanceWebStorage), - ), - ) - as _i2.WebStorage Function()); + Invocation.getter(#instanceFlutterAssetManager), + returnValue: () => _FakeFlutterAssetManager_10( + this, + Invocation.getter(#instanceFlutterAssetManager), + ), + returnValueForMissingStub: () => _FakeFlutterAssetManager_10( + this, + Invocation.getter(#instanceFlutterAssetManager), + ), + ) as _i2.FlutterAssetManager Function()); + + @override + _i2.WebStorage Function() get instanceWebStorage => (super.noSuchMethod( + Invocation.getter(#instanceWebStorage), + returnValue: () => _FakeWebStorage_11( + this, + Invocation.getter(#instanceWebStorage), + ), + returnValueForMissingStub: () => _FakeWebStorage_11( + this, + Invocation.getter(#instanceWebStorage), + ), + ) as _i2.WebStorage Function()); } /// A class which mocks [AndroidWebViewWidgetCreationParams]. @@ -1521,77 +1330,67 @@ class MockAndroidWebViewProxy extends _i1.Mock class MockAndroidWebViewWidgetCreationParams extends _i1.Mock implements _i7.AndroidWebViewWidgetCreationParams { @override - _i2.PigeonInstanceManager get instanceManager => - (super.noSuchMethod( - Invocation.getter(#instanceManager), - returnValue: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#instanceManager), - ), - ) - as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get instanceManager => (super.noSuchMethod( + Invocation.getter(#instanceManager), + returnValue: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#instanceManager), + ), + ) as _i2.PigeonInstanceManager); @override _i5.PlatformViewsServiceProxy get platformViewsServiceProxy => (super.noSuchMethod( - Invocation.getter(#platformViewsServiceProxy), - returnValue: _FakePlatformViewsServiceProxy_13( - this, - Invocation.getter(#platformViewsServiceProxy), - ), - returnValueForMissingStub: _FakePlatformViewsServiceProxy_13( - this, - Invocation.getter(#platformViewsServiceProxy), - ), - ) - as _i5.PlatformViewsServiceProxy); - - @override - bool get displayWithHybridComposition => - (super.noSuchMethod( - Invocation.getter(#displayWithHybridComposition), - returnValue: false, - returnValueForMissingStub: false, - ) - as bool); - - @override - _i3.PlatformWebViewController get controller => - (super.noSuchMethod( - Invocation.getter(#controller), - returnValue: _FakePlatformWebViewController_14( - this, - Invocation.getter(#controller), - ), - returnValueForMissingStub: _FakePlatformWebViewController_14( - this, - Invocation.getter(#controller), - ), - ) - as _i3.PlatformWebViewController); - - @override - _i4.TextDirection get layoutDirection => - (super.noSuchMethod( - Invocation.getter(#layoutDirection), - returnValue: _i4.TextDirection.rtl, - returnValueForMissingStub: _i4.TextDirection.rtl, - ) - as _i4.TextDirection); + Invocation.getter(#platformViewsServiceProxy), + returnValue: _FakePlatformViewsServiceProxy_13( + this, + Invocation.getter(#platformViewsServiceProxy), + ), + returnValueForMissingStub: _FakePlatformViewsServiceProxy_13( + this, + Invocation.getter(#platformViewsServiceProxy), + ), + ) as _i5.PlatformViewsServiceProxy); + + @override + bool get displayWithHybridComposition => (super.noSuchMethod( + Invocation.getter(#displayWithHybridComposition), + returnValue: false, + returnValueForMissingStub: false, + ) as bool); + + @override + _i3.PlatformWebViewController get controller => (super.noSuchMethod( + Invocation.getter(#controller), + returnValue: _FakePlatformWebViewController_14( + this, + Invocation.getter(#controller), + ), + returnValueForMissingStub: _FakePlatformWebViewController_14( + this, + Invocation.getter(#controller), + ), + ) as _i3.PlatformWebViewController); + + @override + _i4.TextDirection get layoutDirection => (super.noSuchMethod( + Invocation.getter(#layoutDirection), + returnValue: _i4.TextDirection.rtl, + returnValueForMissingStub: _i4.TextDirection.rtl, + ) as _i4.TextDirection); @override Set<_i10.Factory<_i11.OneSequenceGestureRecognizer>> get gestureRecognizers => (super.noSuchMethod( - Invocation.getter(#gestureRecognizers), - returnValue: <_i10.Factory<_i11.OneSequenceGestureRecognizer>>{}, - returnValueForMissingStub: - <_i10.Factory<_i11.OneSequenceGestureRecognizer>>{}, - ) - as Set<_i10.Factory<_i11.OneSequenceGestureRecognizer>>); + Invocation.getter(#gestureRecognizers), + returnValue: <_i10.Factory<_i11.OneSequenceGestureRecognizer>>{}, + returnValueForMissingStub: <_i10 + .Factory<_i11.OneSequenceGestureRecognizer>>{}, + ) as Set<_i10.Factory<_i11.OneSequenceGestureRecognizer>>); } /// A class which mocks [ExpensiveAndroidViewController]. @@ -1600,160 +1399,137 @@ class MockAndroidWebViewWidgetCreationParams extends _i1.Mock class MockExpensiveAndroidViewController extends _i1.Mock implements _i6.ExpensiveAndroidViewController { @override - bool get requiresViewComposition => - (super.noSuchMethod( - Invocation.getter(#requiresViewComposition), - returnValue: false, - returnValueForMissingStub: false, - ) - as bool); + bool get requiresViewComposition => (super.noSuchMethod( + Invocation.getter(#requiresViewComposition), + returnValue: false, + returnValueForMissingStub: false, + ) as bool); @override - int get viewId => - (super.noSuchMethod( - Invocation.getter(#viewId), - returnValue: 0, - returnValueForMissingStub: 0, - ) - as int); + int get viewId => (super.noSuchMethod( + Invocation.getter(#viewId), + returnValue: 0, + returnValueForMissingStub: 0, + ) as int); @override - bool get awaitingCreation => - (super.noSuchMethod( - Invocation.getter(#awaitingCreation), - returnValue: false, - returnValueForMissingStub: false, - ) - as bool); + bool get awaitingCreation => (super.noSuchMethod( + Invocation.getter(#awaitingCreation), + returnValue: false, + returnValueForMissingStub: false, + ) as bool); @override - _i6.PointTransformer get pointTransformer => - (super.noSuchMethod( - Invocation.getter(#pointTransformer), - returnValue: - (_i4.Offset position) => - _FakeOffset_6(this, Invocation.getter(#pointTransformer)), - returnValueForMissingStub: - (_i4.Offset position) => - _FakeOffset_6(this, Invocation.getter(#pointTransformer)), - ) - as _i6.PointTransformer); + _i6.PointTransformer get pointTransformer => (super.noSuchMethod( + Invocation.getter(#pointTransformer), + returnValue: (_i4.Offset position) => + _FakeOffset_6(this, Invocation.getter(#pointTransformer)), + returnValueForMissingStub: (_i4.Offset position) => + _FakeOffset_6(this, Invocation.getter(#pointTransformer)), + ) as _i6.PointTransformer); @override set pointTransformer(_i6.PointTransformer? transformer) => super.noSuchMethod( - Invocation.setter(#pointTransformer, transformer), - returnValueForMissingStub: null, - ); + Invocation.setter(#pointTransformer, transformer), + returnValueForMissingStub: null, + ); @override - bool get isCreated => - (super.noSuchMethod( - Invocation.getter(#isCreated), - returnValue: false, - returnValueForMissingStub: false, - ) - as bool); + bool get isCreated => (super.noSuchMethod( + Invocation.getter(#isCreated), + returnValue: false, + returnValueForMissingStub: false, + ) as bool); @override List<_i6.PlatformViewCreatedCallback> get createdCallbacks => (super.noSuchMethod( - Invocation.getter(#createdCallbacks), - returnValue: <_i6.PlatformViewCreatedCallback>[], - returnValueForMissingStub: <_i6.PlatformViewCreatedCallback>[], - ) - as List<_i6.PlatformViewCreatedCallback>); + Invocation.getter(#createdCallbacks), + returnValue: <_i6.PlatformViewCreatedCallback>[], + returnValueForMissingStub: <_i6.PlatformViewCreatedCallback>[], + ) as List<_i6.PlatformViewCreatedCallback>); @override - _i8.Future setOffset(_i4.Offset? off) => - (super.noSuchMethod( - Invocation.method(#setOffset, [off]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future setOffset(_i4.Offset? off) => (super.noSuchMethod( + Invocation.method(#setOffset, [off]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future create({_i4.Size? size, _i4.Offset? position}) => (super.noSuchMethod( - Invocation.method(#create, [], {#size: size, #position: position}), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#create, [], {#size: size, #position: position}), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future<_i4.Size> setSize(_i4.Size? size) => - (super.noSuchMethod( - Invocation.method(#setSize, [size]), - returnValue: _i8.Future<_i4.Size>.value( - _FakeSize_15(this, Invocation.method(#setSize, [size])), - ), - returnValueForMissingStub: _i8.Future<_i4.Size>.value( - _FakeSize_15(this, Invocation.method(#setSize, [size])), - ), - ) - as _i8.Future<_i4.Size>); + _i8.Future<_i4.Size> setSize(_i4.Size? size) => (super.noSuchMethod( + Invocation.method(#setSize, [size]), + returnValue: _i8.Future<_i4.Size>.value( + _FakeSize_15(this, Invocation.method(#setSize, [size])), + ), + returnValueForMissingStub: _i8.Future<_i4.Size>.value( + _FakeSize_15(this, Invocation.method(#setSize, [size])), + ), + ) as _i8.Future<_i4.Size>); @override _i8.Future sendMotionEvent(_i6.AndroidMotionEvent? event) => (super.noSuchMethod( - Invocation.method(#sendMotionEvent, [event]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#sendMotionEvent, [event]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override void addOnPlatformViewCreatedListener( _i6.PlatformViewCreatedCallback? listener, - ) => super.noSuchMethod( - Invocation.method(#addOnPlatformViewCreatedListener, [listener]), - returnValueForMissingStub: null, - ); + ) => + super.noSuchMethod( + Invocation.method(#addOnPlatformViewCreatedListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeOnPlatformViewCreatedListener( _i6.PlatformViewCreatedCallback? listener, - ) => super.noSuchMethod( - Invocation.method(#removeOnPlatformViewCreatedListener, [listener]), - returnValueForMissingStub: null, - ); + ) => + super.noSuchMethod( + Invocation.method(#removeOnPlatformViewCreatedListener, [listener]), + returnValueForMissingStub: null, + ); @override _i8.Future setLayoutDirection(_i4.TextDirection? layoutDirection) => (super.noSuchMethod( - Invocation.method(#setLayoutDirection, [layoutDirection]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setLayoutDirection, [layoutDirection]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future dispatchPointerEvent(_i11.PointerEvent? event) => (super.noSuchMethod( - Invocation.method(#dispatchPointerEvent, [event]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#dispatchPointerEvent, [event]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future clearFocus() => - (super.noSuchMethod( - Invocation.method(#clearFocus, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future clearFocus() => (super.noSuchMethod( + Invocation.method(#clearFocus, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future dispose() => - (super.noSuchMethod( - Invocation.method(#dispose, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future dispose() => (super.noSuchMethod( + Invocation.method(#dispose, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); } /// A class which mocks [FlutterAssetManager]. @@ -1762,64 +1538,57 @@ class MockExpensiveAndroidViewController extends _i1.Mock class MockFlutterAssetManager extends _i1.Mock implements _i2.FlutterAssetManager { @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); @override - _i8.Future> list(String? path) => - (super.noSuchMethod( - Invocation.method(#list, [path]), - returnValue: _i8.Future>.value([]), - returnValueForMissingStub: _i8.Future>.value( - [], - ), - ) - as _i8.Future>); + _i8.Future> list(String? path) => (super.noSuchMethod( + Invocation.method(#list, [path]), + returnValue: _i8.Future>.value([]), + returnValueForMissingStub: _i8.Future>.value( + [], + ), + ) as _i8.Future>); @override _i8.Future getAssetFilePathByName(String? name) => (super.noSuchMethod( + Invocation.method(#getAssetFilePathByName, [name]), + returnValue: _i8.Future.value( + _i12.dummyValue( + this, Invocation.method(#getAssetFilePathByName, [name]), - returnValue: _i8.Future.value( - _i12.dummyValue( - this, - Invocation.method(#getAssetFilePathByName, [name]), - ), - ), - returnValueForMissingStub: _i8.Future.value( - _i12.dummyValue( - this, - Invocation.method(#getAssetFilePathByName, [name]), - ), - ), - ) - as _i8.Future); - - @override - _i2.FlutterAssetManager pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeFlutterAssetManager_10( - this, - Invocation.method(#pigeon_copy, []), - ), - returnValueForMissingStub: _FakeFlutterAssetManager_10( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.FlutterAssetManager); + ), + ), + returnValueForMissingStub: _i8.Future.value( + _i12.dummyValue( + this, + Invocation.method(#getAssetFilePathByName, [name]), + ), + ), + ) as _i8.Future); + + @override + _i2.FlutterAssetManager pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeFlutterAssetManager_10( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeFlutterAssetManager_10( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.FlutterAssetManager); } /// A class which mocks [GeolocationPermissionsCallback]. @@ -1828,43 +1597,38 @@ class MockFlutterAssetManager extends _i1.Mock class MockGeolocationPermissionsCallback extends _i1.Mock implements _i2.GeolocationPermissionsCallback { @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); @override _i8.Future invoke(String? origin, bool? allow, bool? retain) => (super.noSuchMethod( - Invocation.method(#invoke, [origin, allow, retain]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); - - @override - _i2.GeolocationPermissionsCallback pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeGeolocationPermissionsCallback_16( - this, - Invocation.method(#pigeon_copy, []), - ), - returnValueForMissingStub: _FakeGeolocationPermissionsCallback_16( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.GeolocationPermissionsCallback); + Invocation.method(#invoke, [origin, allow, retain]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); + + @override + _i2.GeolocationPermissionsCallback pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeGeolocationPermissionsCallback_16( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeGeolocationPermissionsCallback_16( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.GeolocationPermissionsCallback); } /// A class which mocks [JavaScriptChannel]. @@ -1872,60 +1636,52 @@ class MockGeolocationPermissionsCallback extends _i1.Mock /// See the documentation for Mockito's code generation for more information. class MockJavaScriptChannel extends _i1.Mock implements _i2.JavaScriptChannel { @override - String get channelName => - (super.noSuchMethod( - Invocation.getter(#channelName), - returnValue: _i12.dummyValue( - this, - Invocation.getter(#channelName), - ), - returnValueForMissingStub: _i12.dummyValue( - this, - Invocation.getter(#channelName), - ), - ) - as String); + String get channelName => (super.noSuchMethod( + Invocation.getter(#channelName), + returnValue: _i12.dummyValue( + this, + Invocation.getter(#channelName), + ), + returnValueForMissingStub: _i12.dummyValue( + this, + Invocation.getter(#channelName), + ), + ) as String); @override void Function(_i2.JavaScriptChannel, String) get postMessage => (super.noSuchMethod( - Invocation.getter(#postMessage), - returnValue: - (_i2.JavaScriptChannel pigeon_instance, String message) {}, - returnValueForMissingStub: - (_i2.JavaScriptChannel pigeon_instance, String message) {}, - ) - as void Function(_i2.JavaScriptChannel, String)); - - @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); - - @override - _i2.JavaScriptChannel pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeJavaScriptChannel_8( - this, - Invocation.method(#pigeon_copy, []), - ), - returnValueForMissingStub: _FakeJavaScriptChannel_8( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.JavaScriptChannel); + Invocation.getter(#postMessage), + returnValue: (_i2.JavaScriptChannel pigeon_instance, String message) {}, + returnValueForMissingStub: + (_i2.JavaScriptChannel pigeon_instance, String message) {}, + ) as void Function(_i2.JavaScriptChannel, String)); + + @override + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); + + @override + _i2.JavaScriptChannel pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeJavaScriptChannel_8( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeJavaScriptChannel_8( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.JavaScriptChannel); } /// A class which mocks [PermissionRequest]. @@ -1933,61 +1689,51 @@ class MockJavaScriptChannel extends _i1.Mock implements _i2.JavaScriptChannel { /// See the documentation for Mockito's code generation for more information. class MockPermissionRequest extends _i1.Mock implements _i2.PermissionRequest { @override - List get resources => - (super.noSuchMethod( - Invocation.getter(#resources), - returnValue: [], - returnValueForMissingStub: [], - ) - as List); - - @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); - - @override - _i8.Future grant(List? resources) => - (super.noSuchMethod( - Invocation.method(#grant, [resources]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); - - @override - _i8.Future deny() => - (super.noSuchMethod( - Invocation.method(#deny, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); - - @override - _i2.PermissionRequest pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakePermissionRequest_17( - this, - Invocation.method(#pigeon_copy, []), - ), - returnValueForMissingStub: _FakePermissionRequest_17( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.PermissionRequest); + List get resources => (super.noSuchMethod( + Invocation.getter(#resources), + returnValue: [], + returnValueForMissingStub: [], + ) as List); + + @override + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); + + @override + _i8.Future grant(List? resources) => (super.noSuchMethod( + Invocation.method(#grant, [resources]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); + + @override + _i8.Future deny() => (super.noSuchMethod( + Invocation.method(#deny, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); + + @override + _i2.PermissionRequest pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakePermissionRequest_17( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakePermissionRequest_17( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.PermissionRequest); } /// A class which mocks [PlatformViewsServiceProxy]. @@ -2006,38 +1752,37 @@ class MockPlatformViewsServiceProxy extends _i1.Mock _i4.VoidCallback? onFocus, }) => (super.noSuchMethod( - Invocation.method(#initExpensiveAndroidView, [], { - #id: id, - #viewType: viewType, - #layoutDirection: layoutDirection, - #creationParams: creationParams, - #creationParamsCodec: creationParamsCodec, - #onFocus: onFocus, - }), - returnValue: _FakeExpensiveAndroidViewController_18( - this, - Invocation.method(#initExpensiveAndroidView, [], { - #id: id, - #viewType: viewType, - #layoutDirection: layoutDirection, - #creationParams: creationParams, - #creationParamsCodec: creationParamsCodec, - #onFocus: onFocus, - }), - ), - returnValueForMissingStub: _FakeExpensiveAndroidViewController_18( - this, - Invocation.method(#initExpensiveAndroidView, [], { - #id: id, - #viewType: viewType, - #layoutDirection: layoutDirection, - #creationParams: creationParams, - #creationParamsCodec: creationParamsCodec, - #onFocus: onFocus, - }), - ), - ) - as _i6.ExpensiveAndroidViewController); + Invocation.method(#initExpensiveAndroidView, [], { + #id: id, + #viewType: viewType, + #layoutDirection: layoutDirection, + #creationParams: creationParams, + #creationParamsCodec: creationParamsCodec, + #onFocus: onFocus, + }), + returnValue: _FakeExpensiveAndroidViewController_18( + this, + Invocation.method(#initExpensiveAndroidView, [], { + #id: id, + #viewType: viewType, + #layoutDirection: layoutDirection, + #creationParams: creationParams, + #creationParamsCodec: creationParamsCodec, + #onFocus: onFocus, + }), + ), + returnValueForMissingStub: _FakeExpensiveAndroidViewController_18( + this, + Invocation.method(#initExpensiveAndroidView, [], { + #id: id, + #viewType: viewType, + #layoutDirection: layoutDirection, + #creationParams: creationParams, + #creationParamsCodec: creationParamsCodec, + #onFocus: onFocus, + }), + ), + ) as _i6.ExpensiveAndroidViewController); @override _i6.SurfaceAndroidViewController initSurfaceAndroidView({ @@ -2049,38 +1794,37 @@ class MockPlatformViewsServiceProxy extends _i1.Mock _i4.VoidCallback? onFocus, }) => (super.noSuchMethod( - Invocation.method(#initSurfaceAndroidView, [], { - #id: id, - #viewType: viewType, - #layoutDirection: layoutDirection, - #creationParams: creationParams, - #creationParamsCodec: creationParamsCodec, - #onFocus: onFocus, - }), - returnValue: _FakeSurfaceAndroidViewController_19( - this, - Invocation.method(#initSurfaceAndroidView, [], { - #id: id, - #viewType: viewType, - #layoutDirection: layoutDirection, - #creationParams: creationParams, - #creationParamsCodec: creationParamsCodec, - #onFocus: onFocus, - }), - ), - returnValueForMissingStub: _FakeSurfaceAndroidViewController_19( - this, - Invocation.method(#initSurfaceAndroidView, [], { - #id: id, - #viewType: viewType, - #layoutDirection: layoutDirection, - #creationParams: creationParams, - #creationParamsCodec: creationParamsCodec, - #onFocus: onFocus, - }), - ), - ) - as _i6.SurfaceAndroidViewController); + Invocation.method(#initSurfaceAndroidView, [], { + #id: id, + #viewType: viewType, + #layoutDirection: layoutDirection, + #creationParams: creationParams, + #creationParamsCodec: creationParamsCodec, + #onFocus: onFocus, + }), + returnValue: _FakeSurfaceAndroidViewController_19( + this, + Invocation.method(#initSurfaceAndroidView, [], { + #id: id, + #viewType: viewType, + #layoutDirection: layoutDirection, + #creationParams: creationParams, + #creationParamsCodec: creationParamsCodec, + #onFocus: onFocus, + }), + ), + returnValueForMissingStub: _FakeSurfaceAndroidViewController_19( + this, + Invocation.method(#initSurfaceAndroidView, [], { + #id: id, + #viewType: viewType, + #layoutDirection: layoutDirection, + #creationParams: creationParams, + #creationParamsCodec: creationParamsCodec, + #onFocus: onFocus, + }), + ), + ) as _i6.SurfaceAndroidViewController); } /// A class which mocks [SurfaceAndroidViewController]. @@ -2089,160 +1833,137 @@ class MockPlatformViewsServiceProxy extends _i1.Mock class MockSurfaceAndroidViewController extends _i1.Mock implements _i6.SurfaceAndroidViewController { @override - bool get requiresViewComposition => - (super.noSuchMethod( - Invocation.getter(#requiresViewComposition), - returnValue: false, - returnValueForMissingStub: false, - ) - as bool); + bool get requiresViewComposition => (super.noSuchMethod( + Invocation.getter(#requiresViewComposition), + returnValue: false, + returnValueForMissingStub: false, + ) as bool); @override - int get viewId => - (super.noSuchMethod( - Invocation.getter(#viewId), - returnValue: 0, - returnValueForMissingStub: 0, - ) - as int); + int get viewId => (super.noSuchMethod( + Invocation.getter(#viewId), + returnValue: 0, + returnValueForMissingStub: 0, + ) as int); @override - bool get awaitingCreation => - (super.noSuchMethod( - Invocation.getter(#awaitingCreation), - returnValue: false, - returnValueForMissingStub: false, - ) - as bool); + bool get awaitingCreation => (super.noSuchMethod( + Invocation.getter(#awaitingCreation), + returnValue: false, + returnValueForMissingStub: false, + ) as bool); @override - _i6.PointTransformer get pointTransformer => - (super.noSuchMethod( - Invocation.getter(#pointTransformer), - returnValue: - (_i4.Offset position) => - _FakeOffset_6(this, Invocation.getter(#pointTransformer)), - returnValueForMissingStub: - (_i4.Offset position) => - _FakeOffset_6(this, Invocation.getter(#pointTransformer)), - ) - as _i6.PointTransformer); + _i6.PointTransformer get pointTransformer => (super.noSuchMethod( + Invocation.getter(#pointTransformer), + returnValue: (_i4.Offset position) => + _FakeOffset_6(this, Invocation.getter(#pointTransformer)), + returnValueForMissingStub: (_i4.Offset position) => + _FakeOffset_6(this, Invocation.getter(#pointTransformer)), + ) as _i6.PointTransformer); @override set pointTransformer(_i6.PointTransformer? transformer) => super.noSuchMethod( - Invocation.setter(#pointTransformer, transformer), - returnValueForMissingStub: null, - ); + Invocation.setter(#pointTransformer, transformer), + returnValueForMissingStub: null, + ); @override - bool get isCreated => - (super.noSuchMethod( - Invocation.getter(#isCreated), - returnValue: false, - returnValueForMissingStub: false, - ) - as bool); + bool get isCreated => (super.noSuchMethod( + Invocation.getter(#isCreated), + returnValue: false, + returnValueForMissingStub: false, + ) as bool); @override List<_i6.PlatformViewCreatedCallback> get createdCallbacks => (super.noSuchMethod( - Invocation.getter(#createdCallbacks), - returnValue: <_i6.PlatformViewCreatedCallback>[], - returnValueForMissingStub: <_i6.PlatformViewCreatedCallback>[], - ) - as List<_i6.PlatformViewCreatedCallback>); + Invocation.getter(#createdCallbacks), + returnValue: <_i6.PlatformViewCreatedCallback>[], + returnValueForMissingStub: <_i6.PlatformViewCreatedCallback>[], + ) as List<_i6.PlatformViewCreatedCallback>); @override - _i8.Future setOffset(_i4.Offset? off) => - (super.noSuchMethod( - Invocation.method(#setOffset, [off]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future setOffset(_i4.Offset? off) => (super.noSuchMethod( + Invocation.method(#setOffset, [off]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future create({_i4.Size? size, _i4.Offset? position}) => (super.noSuchMethod( - Invocation.method(#create, [], {#size: size, #position: position}), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#create, [], {#size: size, #position: position}), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future<_i4.Size> setSize(_i4.Size? size) => - (super.noSuchMethod( - Invocation.method(#setSize, [size]), - returnValue: _i8.Future<_i4.Size>.value( - _FakeSize_15(this, Invocation.method(#setSize, [size])), - ), - returnValueForMissingStub: _i8.Future<_i4.Size>.value( - _FakeSize_15(this, Invocation.method(#setSize, [size])), - ), - ) - as _i8.Future<_i4.Size>); + _i8.Future<_i4.Size> setSize(_i4.Size? size) => (super.noSuchMethod( + Invocation.method(#setSize, [size]), + returnValue: _i8.Future<_i4.Size>.value( + _FakeSize_15(this, Invocation.method(#setSize, [size])), + ), + returnValueForMissingStub: _i8.Future<_i4.Size>.value( + _FakeSize_15(this, Invocation.method(#setSize, [size])), + ), + ) as _i8.Future<_i4.Size>); @override _i8.Future sendMotionEvent(_i6.AndroidMotionEvent? event) => (super.noSuchMethod( - Invocation.method(#sendMotionEvent, [event]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#sendMotionEvent, [event]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override void addOnPlatformViewCreatedListener( _i6.PlatformViewCreatedCallback? listener, - ) => super.noSuchMethod( - Invocation.method(#addOnPlatformViewCreatedListener, [listener]), - returnValueForMissingStub: null, - ); + ) => + super.noSuchMethod( + Invocation.method(#addOnPlatformViewCreatedListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeOnPlatformViewCreatedListener( _i6.PlatformViewCreatedCallback? listener, - ) => super.noSuchMethod( - Invocation.method(#removeOnPlatformViewCreatedListener, [listener]), - returnValueForMissingStub: null, - ); + ) => + super.noSuchMethod( + Invocation.method(#removeOnPlatformViewCreatedListener, [listener]), + returnValueForMissingStub: null, + ); @override _i8.Future setLayoutDirection(_i4.TextDirection? layoutDirection) => (super.noSuchMethod( - Invocation.method(#setLayoutDirection, [layoutDirection]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setLayoutDirection, [layoutDirection]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future dispatchPointerEvent(_i11.PointerEvent? event) => (super.noSuchMethod( - Invocation.method(#dispatchPointerEvent, [event]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#dispatchPointerEvent, [event]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future clearFocus() => - (super.noSuchMethod( - Invocation.method(#clearFocus, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future clearFocus() => (super.noSuchMethod( + Invocation.method(#clearFocus, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future dispose() => - (super.noSuchMethod( - Invocation.method(#dispose, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future dispose() => (super.noSuchMethod( + Invocation.method(#dispose, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); } /// A class which mocks [WebChromeClient]. @@ -2254,50 +1975,45 @@ class MockWebChromeClient extends _i1.Mock implements _i2.WebChromeClient { _i2.WebChromeClient, _i2.WebView, _i2.FileChooserParams, - ) - get onShowFileChooser => - (super.noSuchMethod( - Invocation.getter(#onShowFileChooser), - returnValue: - ( - _i2.WebChromeClient pigeon_instance, - _i2.WebView webView, - _i2.FileChooserParams params, - ) => _i8.Future>.value([]), - returnValueForMissingStub: - ( - _i2.WebChromeClient pigeon_instance, - _i2.WebView webView, - _i2.FileChooserParams params, - ) => _i8.Future>.value([]), - ) - as _i8.Future> Function( - _i2.WebChromeClient, - _i2.WebView, - _i2.FileChooserParams, - )); + ) get onShowFileChooser => (super.noSuchMethod( + Invocation.getter(#onShowFileChooser), + returnValue: ( + _i2.WebChromeClient pigeon_instance, + _i2.WebView webView, + _i2.FileChooserParams params, + ) => + _i8.Future>.value([]), + returnValueForMissingStub: ( + _i2.WebChromeClient pigeon_instance, + _i2.WebView webView, + _i2.FileChooserParams params, + ) => + _i8.Future>.value([]), + ) as _i8.Future> Function( + _i2.WebChromeClient, + _i2.WebView, + _i2.FileChooserParams, + )); @override _i8.Future Function(_i2.WebChromeClient, _i2.WebView, String, String) - get onJsConfirm => - (super.noSuchMethod( + get onJsConfirm => (super.noSuchMethod( Invocation.getter(#onJsConfirm), - returnValue: - ( - _i2.WebChromeClient pigeon_instance, - _i2.WebView webView, - String url, - String message, - ) => _i8.Future.value(false), - returnValueForMissingStub: - ( - _i2.WebChromeClient pigeon_instance, - _i2.WebView webView, - String url, - String message, - ) => _i8.Future.value(false), - ) - as _i8.Future Function( + returnValue: ( + _i2.WebChromeClient pigeon_instance, + _i2.WebView webView, + String url, + String message, + ) => + _i8.Future.value(false), + returnValueForMissingStub: ( + _i2.WebChromeClient pigeon_instance, + _i2.WebView webView, + String url, + String message, + ) => + _i8.Future.value(false), + ) as _i8.Future Function( _i2.WebChromeClient, _i2.WebView, String, @@ -2305,85 +2021,76 @@ class MockWebChromeClient extends _i1.Mock implements _i2.WebChromeClient { )); @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); @override _i8.Future setSynchronousReturnValueForOnShowFileChooser(bool? value) => (super.noSuchMethod( - Invocation.method(#setSynchronousReturnValueForOnShowFileChooser, [ - value, - ]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setSynchronousReturnValueForOnShowFileChooser, [ + value, + ]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setSynchronousReturnValueForOnConsoleMessage(bool? value) => (super.noSuchMethod( - Invocation.method(#setSynchronousReturnValueForOnConsoleMessage, [ - value, - ]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setSynchronousReturnValueForOnConsoleMessage, [ + value, + ]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setSynchronousReturnValueForOnJsAlert(bool? value) => (super.noSuchMethod( - Invocation.method(#setSynchronousReturnValueForOnJsAlert, [value]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setSynchronousReturnValueForOnJsAlert, [value]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setSynchronousReturnValueForOnJsConfirm(bool? value) => (super.noSuchMethod( - Invocation.method(#setSynchronousReturnValueForOnJsConfirm, [ - value, - ]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setSynchronousReturnValueForOnJsConfirm, [ + value, + ]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setSynchronousReturnValueForOnJsPrompt(bool? value) => (super.noSuchMethod( - Invocation.method(#setSynchronousReturnValueForOnJsPrompt, [value]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); - - @override - _i2.WebChromeClient pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWebChromeClient_0( - this, - Invocation.method(#pigeon_copy, []), - ), - returnValueForMissingStub: _FakeWebChromeClient_0( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WebChromeClient); + Invocation.method(#setSynchronousReturnValueForOnJsPrompt, [value]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); + + @override + _i2.WebChromeClient pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWebChromeClient_0( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeWebChromeClient_0( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WebChromeClient); } /// A class which mocks [WebSettings]. @@ -2391,190 +2098,159 @@ class MockWebChromeClient extends _i1.Mock implements _i2.WebChromeClient { /// See the documentation for Mockito's code generation for more information. class MockWebSettings extends _i1.Mock implements _i2.WebSettings { @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); @override - _i8.Future setDomStorageEnabled(bool? flag) => - (super.noSuchMethod( - Invocation.method(#setDomStorageEnabled, [flag]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future setDomStorageEnabled(bool? flag) => (super.noSuchMethod( + Invocation.method(#setDomStorageEnabled, [flag]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setJavaScriptCanOpenWindowsAutomatically(bool? flag) => (super.noSuchMethod( - Invocation.method(#setJavaScriptCanOpenWindowsAutomatically, [ - flag, - ]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setJavaScriptCanOpenWindowsAutomatically, [ + flag, + ]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setSupportMultipleWindows(bool? support) => (super.noSuchMethod( - Invocation.method(#setSupportMultipleWindows, [support]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setSupportMultipleWindows, [support]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future setJavaScriptEnabled(bool? flag) => - (super.noSuchMethod( - Invocation.method(#setJavaScriptEnabled, [flag]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future setJavaScriptEnabled(bool? flag) => (super.noSuchMethod( + Invocation.method(#setJavaScriptEnabled, [flag]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setUserAgentString(String? userAgentString) => (super.noSuchMethod( - Invocation.method(#setUserAgentString, [userAgentString]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setUserAgentString, [userAgentString]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setMediaPlaybackRequiresUserGesture(bool? require) => (super.noSuchMethod( - Invocation.method(#setMediaPlaybackRequiresUserGesture, [require]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setMediaPlaybackRequiresUserGesture, [require]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future setSupportZoom(bool? support) => - (super.noSuchMethod( - Invocation.method(#setSupportZoom, [support]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future setSupportZoom(bool? support) => (super.noSuchMethod( + Invocation.method(#setSupportZoom, [support]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setLoadWithOverviewMode(bool? overview) => (super.noSuchMethod( - Invocation.method(#setLoadWithOverviewMode, [overview]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setLoadWithOverviewMode, [overview]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future setUseWideViewPort(bool? use) => - (super.noSuchMethod( - Invocation.method(#setUseWideViewPort, [use]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future setUseWideViewPort(bool? use) => (super.noSuchMethod( + Invocation.method(#setUseWideViewPort, [use]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future setDisplayZoomControls(bool? enabled) => - (super.noSuchMethod( - Invocation.method(#setDisplayZoomControls, [enabled]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future setDisplayZoomControls(bool? enabled) => (super.noSuchMethod( + Invocation.method(#setDisplayZoomControls, [enabled]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future setBuiltInZoomControls(bool? enabled) => - (super.noSuchMethod( - Invocation.method(#setBuiltInZoomControls, [enabled]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future setBuiltInZoomControls(bool? enabled) => (super.noSuchMethod( + Invocation.method(#setBuiltInZoomControls, [enabled]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future setAllowFileAccess(bool? enabled) => - (super.noSuchMethod( - Invocation.method(#setAllowFileAccess, [enabled]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future setAllowFileAccess(bool? enabled) => (super.noSuchMethod( + Invocation.method(#setAllowFileAccess, [enabled]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future setAllowContentAccess(bool? enabled) => - (super.noSuchMethod( - Invocation.method(#setAllowContentAccess, [enabled]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future setAllowContentAccess(bool? enabled) => (super.noSuchMethod( + Invocation.method(#setAllowContentAccess, [enabled]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future setGeolocationEnabled(bool? enabled) => - (super.noSuchMethod( - Invocation.method(#setGeolocationEnabled, [enabled]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future setGeolocationEnabled(bool? enabled) => (super.noSuchMethod( + Invocation.method(#setGeolocationEnabled, [enabled]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future setTextZoom(int? textZoom) => - (super.noSuchMethod( - Invocation.method(#setTextZoom, [textZoom]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future setTextZoom(int? textZoom) => (super.noSuchMethod( + Invocation.method(#setTextZoom, [textZoom]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future getUserAgentString() => - (super.noSuchMethod( + _i8.Future getUserAgentString() => (super.noSuchMethod( + Invocation.method(#getUserAgentString, []), + returnValue: _i8.Future.value( + _i12.dummyValue( + this, Invocation.method(#getUserAgentString, []), - returnValue: _i8.Future.value( - _i12.dummyValue( - this, - Invocation.method(#getUserAgentString, []), - ), - ), - returnValueForMissingStub: _i8.Future.value( - _i12.dummyValue( - this, - Invocation.method(#getUserAgentString, []), - ), - ), - ) - as _i8.Future); - - @override - _i2.WebSettings pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWebSettings_20( - this, - Invocation.method(#pigeon_copy, []), - ), - returnValueForMissingStub: _FakeWebSettings_20( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WebSettings); + ), + ), + returnValueForMissingStub: _i8.Future.value( + _i12.dummyValue( + this, + Invocation.method(#getUserAgentString, []), + ), + ), + ) as _i8.Future); + + @override + _i2.WebSettings pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWebSettings_20( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeWebSettings_20( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WebSettings); } /// A class which mocks [WebView]. @@ -2582,58 +2258,51 @@ class MockWebSettings extends _i1.Mock implements _i2.WebSettings { /// See the documentation for Mockito's code generation for more information. class MockWebView extends _i1.Mock implements _i2.WebView { @override - _i2.WebSettings get settings => - (super.noSuchMethod( - Invocation.getter(#settings), - returnValue: _FakeWebSettings_20( - this, - Invocation.getter(#settings), - ), - returnValueForMissingStub: _FakeWebSettings_20( - this, - Invocation.getter(#settings), - ), - ) - as _i2.WebSettings); - - @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); - - @override - _i2.WebSettings pigeonVar_settings() => - (super.noSuchMethod( - Invocation.method(#pigeonVar_settings, []), - returnValue: _FakeWebSettings_20( - this, - Invocation.method(#pigeonVar_settings, []), - ), - returnValueForMissingStub: _FakeWebSettings_20( - this, - Invocation.method(#pigeonVar_settings, []), - ), - ) - as _i2.WebSettings); + _i2.WebSettings get settings => (super.noSuchMethod( + Invocation.getter(#settings), + returnValue: _FakeWebSettings_20( + this, + Invocation.getter(#settings), + ), + returnValueForMissingStub: _FakeWebSettings_20( + this, + Invocation.getter(#settings), + ), + ) as _i2.WebSettings); + + @override + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); + + @override + _i2.WebSettings pigeonVar_settings() => (super.noSuchMethod( + Invocation.method(#pigeonVar_settings, []), + returnValue: _FakeWebSettings_20( + this, + Invocation.method(#pigeonVar_settings, []), + ), + returnValueForMissingStub: _FakeWebSettings_20( + this, + Invocation.method(#pigeonVar_settings, []), + ), + ) as _i2.WebSettings); @override _i8.Future loadData(String? data, String? mimeType, String? encoding) => (super.noSuchMethod( - Invocation.method(#loadData, [data, mimeType, encoding]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#loadData, [data, mimeType, encoding]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future loadDataWithBaseUrl( @@ -2644,258 +2313,217 @@ class MockWebView extends _i1.Mock implements _i2.WebView { String? historyUrl, ) => (super.noSuchMethod( - Invocation.method(#loadDataWithBaseUrl, [ - baseUrl, - data, - mimeType, - encoding, - historyUrl, - ]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#loadDataWithBaseUrl, [ + baseUrl, + data, + mimeType, + encoding, + historyUrl, + ]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future loadUrl(String? url, Map? headers) => (super.noSuchMethod( - Invocation.method(#loadUrl, [url, headers]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#loadUrl, [url, headers]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future postUrl(String? url, _i13.Uint8List? data) => (super.noSuchMethod( - Invocation.method(#postUrl, [url, data]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#postUrl, [url, data]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future getUrl() => - (super.noSuchMethod( - Invocation.method(#getUrl, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future getUrl() => (super.noSuchMethod( + Invocation.method(#getUrl, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future canGoBack() => - (super.noSuchMethod( - Invocation.method(#canGoBack, []), - returnValue: _i8.Future.value(false), - returnValueForMissingStub: _i8.Future.value(false), - ) - as _i8.Future); + _i8.Future canGoBack() => (super.noSuchMethod( + Invocation.method(#canGoBack, []), + returnValue: _i8.Future.value(false), + returnValueForMissingStub: _i8.Future.value(false), + ) as _i8.Future); @override - _i8.Future canGoForward() => - (super.noSuchMethod( - Invocation.method(#canGoForward, []), - returnValue: _i8.Future.value(false), - returnValueForMissingStub: _i8.Future.value(false), - ) - as _i8.Future); + _i8.Future canGoForward() => (super.noSuchMethod( + Invocation.method(#canGoForward, []), + returnValue: _i8.Future.value(false), + returnValueForMissingStub: _i8.Future.value(false), + ) as _i8.Future); @override - _i8.Future goBack() => - (super.noSuchMethod( - Invocation.method(#goBack, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future goBack() => (super.noSuchMethod( + Invocation.method(#goBack, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future goForward() => - (super.noSuchMethod( - Invocation.method(#goForward, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future goForward() => (super.noSuchMethod( + Invocation.method(#goForward, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future reload() => - (super.noSuchMethod( - Invocation.method(#reload, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future reload() => (super.noSuchMethod( + Invocation.method(#reload, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future clearCache(bool? includeDiskFiles) => - (super.noSuchMethod( - Invocation.method(#clearCache, [includeDiskFiles]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future clearCache(bool? includeDiskFiles) => (super.noSuchMethod( + Invocation.method(#clearCache, [includeDiskFiles]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future evaluateJavascript(String? javascriptString) => (super.noSuchMethod( - Invocation.method(#evaluateJavascript, [javascriptString]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#evaluateJavascript, [javascriptString]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future getTitle() => - (super.noSuchMethod( - Invocation.method(#getTitle, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future getTitle() => (super.noSuchMethod( + Invocation.method(#getTitle, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setWebViewClient(_i2.WebViewClient? client) => (super.noSuchMethod( - Invocation.method(#setWebViewClient, [client]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setWebViewClient, [client]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future addJavaScriptChannel(_i2.JavaScriptChannel? channel) => (super.noSuchMethod( - Invocation.method(#addJavaScriptChannel, [channel]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#addJavaScriptChannel, [channel]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future removeJavaScriptChannel(String? name) => - (super.noSuchMethod( - Invocation.method(#removeJavaScriptChannel, [name]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future removeJavaScriptChannel(String? name) => (super.noSuchMethod( + Invocation.method(#removeJavaScriptChannel, [name]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setDownloadListener(_i2.DownloadListener? listener) => (super.noSuchMethod( - Invocation.method(#setDownloadListener, [listener]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setDownloadListener, [listener]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setWebChromeClient(_i2.WebChromeClient? client) => (super.noSuchMethod( - Invocation.method(#setWebChromeClient, [client]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setWebChromeClient, [client]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future setBackgroundColor(int? color) => - (super.noSuchMethod( - Invocation.method(#setBackgroundColor, [color]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future setBackgroundColor(int? color) => (super.noSuchMethod( + Invocation.method(#setBackgroundColor, [color]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future destroy() => - (super.noSuchMethod( - Invocation.method(#destroy, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future destroy() => (super.noSuchMethod( + Invocation.method(#destroy, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i2.WebView pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWebView_7( - this, - Invocation.method(#pigeon_copy, []), - ), - returnValueForMissingStub: _FakeWebView_7( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WebView); + _i2.WebView pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWebView_7( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeWebView_7( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WebView); @override - _i8.Future scrollTo(int? x, int? y) => - (super.noSuchMethod( - Invocation.method(#scrollTo, [x, y]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future scrollTo(int? x, int? y) => (super.noSuchMethod( + Invocation.method(#scrollTo, [x, y]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future scrollBy(int? x, int? y) => - (super.noSuchMethod( - Invocation.method(#scrollBy, [x, y]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + _i8.Future scrollBy(int? x, int? y) => (super.noSuchMethod( + Invocation.method(#scrollBy, [x, y]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i8.Future<_i2.WebViewPoint> getScrollPosition() => - (super.noSuchMethod( + _i8.Future<_i2.WebViewPoint> getScrollPosition() => (super.noSuchMethod( + Invocation.method(#getScrollPosition, []), + returnValue: _i8.Future<_i2.WebViewPoint>.value( + _FakeWebViewPoint_21( + this, + Invocation.method(#getScrollPosition, []), + ), + ), + returnValueForMissingStub: _i8.Future<_i2.WebViewPoint>.value( + _FakeWebViewPoint_21( + this, Invocation.method(#getScrollPosition, []), - returnValue: _i8.Future<_i2.WebViewPoint>.value( - _FakeWebViewPoint_21( - this, - Invocation.method(#getScrollPosition, []), - ), - ), - returnValueForMissingStub: _i8.Future<_i2.WebViewPoint>.value( - _FakeWebViewPoint_21( - this, - Invocation.method(#getScrollPosition, []), - ), - ), - ) - as _i8.Future<_i2.WebViewPoint>); + ), + ), + ) as _i8.Future<_i2.WebViewPoint>); @override _i8.Future setVerticalScrollBarEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setVerticalScrollBarEnabled, [enabled]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setVerticalScrollBarEnabled, [enabled]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setHorizontalScrollBarEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setHorizontalScrollBarEnabled, [enabled]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setHorizontalScrollBarEnabled, [enabled]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override _i8.Future setOverScrollMode(_i2.OverScrollMode? mode) => (super.noSuchMethod( - Invocation.method(#setOverScrollMode, [mode]), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); + Invocation.method(#setOverScrollMode, [mode]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); } /// A class which mocks [WebViewClient]. @@ -2903,48 +2531,43 @@ class MockWebView extends _i1.Mock implements _i2.WebView { /// See the documentation for Mockito's code generation for more information. class MockWebViewClient extends _i1.Mock implements _i2.WebViewClient { @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); @override _i8.Future setSynchronousReturnValueForShouldOverrideUrlLoading( bool? value, ) => (super.noSuchMethod( - Invocation.method( - #setSynchronousReturnValueForShouldOverrideUrlLoading, - [value], - ), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); - - @override - _i2.WebViewClient pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWebViewClient_1( - this, - Invocation.method(#pigeon_copy, []), - ), - returnValueForMissingStub: _FakeWebViewClient_1( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WebViewClient); + Invocation.method( + #setSynchronousReturnValueForShouldOverrideUrlLoading, + [value], + ), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); + + @override + _i2.WebViewClient pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWebViewClient_1( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeWebViewClient_1( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WebViewClient); } /// A class which mocks [WebStorage]. @@ -2952,41 +2575,35 @@ class MockWebViewClient extends _i1.Mock implements _i2.WebViewClient { /// See the documentation for Mockito's code generation for more information. class MockWebStorage extends _i1.Mock implements _i2.WebStorage { @override - _i2.PigeonInstanceManager get pigeon_instanceManager => - (super.noSuchMethod( - Invocation.getter(#pigeon_instanceManager), - returnValue: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - returnValueForMissingStub: _FakePigeonInstanceManager_12( - this, - Invocation.getter(#pigeon_instanceManager), - ), - ) - as _i2.PigeonInstanceManager); - - @override - _i8.Future deleteAllData() => - (super.noSuchMethod( - Invocation.method(#deleteAllData, []), - returnValue: _i8.Future.value(), - returnValueForMissingStub: _i8.Future.value(), - ) - as _i8.Future); - - @override - _i2.WebStorage pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWebStorage_11( - this, - Invocation.method(#pigeon_copy, []), - ), - returnValueForMissingStub: _FakeWebStorage_11( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WebStorage); + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_12( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); + + @override + _i8.Future deleteAllData() => (super.noSuchMethod( + Invocation.method(#deleteAllData, []), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); + + @override + _i2.WebStorage pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWebStorage_11( + this, + Invocation.method(#pigeon_copy, []), + ), + returnValueForMissingStub: _FakeWebStorage_11( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WebStorage); } diff --git a/packages/webview_flutter/webview_flutter_android/test/android_webview_cookie_manager_test.mocks.dart b/packages/webview_flutter/webview_flutter_android/test/android_webview_cookie_manager_test.mocks.dart index e7f4624138d..0bbed84ea8f 100644 --- a/packages/webview_flutter/webview_flutter_android/test/android_webview_cookie_manager_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_android/test/android_webview_cookie_manager_test.mocks.dart @@ -30,12 +30,12 @@ import 'package:webview_flutter_platform_interface/webview_flutter_platform_inte class _FakePigeonInstanceManager_0 extends _i1.SmartFake implements _i2.PigeonInstanceManager { _FakePigeonInstanceManager_0(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeCookieManager_1 extends _i1.SmartFake implements _i2.CookieManager { _FakeCookieManager_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakePlatformWebViewControllerCreationParams_2 extends _i1.SmartFake @@ -48,12 +48,12 @@ class _FakePlatformWebViewControllerCreationParams_2 extends _i1.SmartFake class _FakeObject_3 extends _i1.SmartFake implements Object { _FakeObject_3(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeOffset_4 extends _i1.SmartFake implements _i4.Offset { _FakeOffset_4(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } /// A class which mocks [CookieManager]. @@ -65,32 +65,26 @@ class MockCookieManager extends _i1.Mock implements _i2.CookieManager { } @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 - _i5.Future setCookie(String? url, String? value) => - (super.noSuchMethod( - Invocation.method(#setCookie, [url, value]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future setCookie(String? url, String? value) => (super.noSuchMethod( + Invocation.method(#setCookie, [url, value]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future removeAllCookies() => - (super.noSuchMethod( - Invocation.method(#removeAllCookies, []), - returnValue: _i5.Future.value(false), - ) - as _i5.Future); + _i5.Future removeAllCookies() => (super.noSuchMethod( + Invocation.method(#removeAllCookies, []), + returnValue: _i5.Future.value(false), + ) as _i5.Future); @override _i5.Future setAcceptThirdPartyCookies( @@ -98,22 +92,19 @@ class MockCookieManager extends _i1.Mock implements _i2.CookieManager { bool? accept, ) => (super.noSuchMethod( - Invocation.method(#setAcceptThirdPartyCookies, [webView, accept]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setAcceptThirdPartyCookies, [webView, accept]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i2.CookieManager pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeCookieManager_1( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.CookieManager); + _i2.CookieManager pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeCookieManager_1( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.CookieManager); } /// A class which mocks [AndroidWebViewController]. @@ -131,330 +122,273 @@ class MockAndroidWebViewController extends _i1.Mock as int); @override - _i3.PlatformWebViewControllerCreationParams get params => - (super.noSuchMethod( - Invocation.getter(#params), - returnValue: _FakePlatformWebViewControllerCreationParams_2( - this, - Invocation.getter(#params), - ), - ) - as _i3.PlatformWebViewControllerCreationParams); + _i3.PlatformWebViewControllerCreationParams get params => (super.noSuchMethod( + Invocation.getter(#params), + returnValue: _FakePlatformWebViewControllerCreationParams_2( + this, + Invocation.getter(#params), + ), + ) as _i3.PlatformWebViewControllerCreationParams); @override - _i5.Future setAllowFileAccess(bool? allow) => - (super.noSuchMethod( - Invocation.method(#setAllowFileAccess, [allow]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future setAllowFileAccess(bool? allow) => (super.noSuchMethod( + Invocation.method(#setAllowFileAccess, [allow]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future loadFile(String? absoluteFilePath) => - (super.noSuchMethod( - Invocation.method(#loadFile, [absoluteFilePath]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future loadFile(String? absoluteFilePath) => (super.noSuchMethod( + Invocation.method(#loadFile, [absoluteFilePath]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future loadFlutterAsset(String? key) => - (super.noSuchMethod( - Invocation.method(#loadFlutterAsset, [key]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future loadFlutterAsset(String? key) => (super.noSuchMethod( + Invocation.method(#loadFlutterAsset, [key]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future loadHtmlString(String? html, {String? baseUrl}) => (super.noSuchMethod( - Invocation.method(#loadHtmlString, [html], {#baseUrl: baseUrl}), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#loadHtmlString, [html], {#baseUrl: baseUrl}), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future loadRequest(_i3.LoadRequestParams? params) => (super.noSuchMethod( - Invocation.method(#loadRequest, [params]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#loadRequest, [params]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future currentUrl() => - (super.noSuchMethod( - Invocation.method(#currentUrl, []), - returnValue: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future currentUrl() => (super.noSuchMethod( + Invocation.method(#currentUrl, []), + returnValue: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future canGoBack() => - (super.noSuchMethod( - Invocation.method(#canGoBack, []), - returnValue: _i5.Future.value(false), - ) - as _i5.Future); + _i5.Future canGoBack() => (super.noSuchMethod( + Invocation.method(#canGoBack, []), + returnValue: _i5.Future.value(false), + ) as _i5.Future); @override - _i5.Future canGoForward() => - (super.noSuchMethod( - Invocation.method(#canGoForward, []), - returnValue: _i5.Future.value(false), - ) - as _i5.Future); + _i5.Future canGoForward() => (super.noSuchMethod( + Invocation.method(#canGoForward, []), + returnValue: _i5.Future.value(false), + ) as _i5.Future); @override - _i5.Future goBack() => - (super.noSuchMethod( - Invocation.method(#goBack, []), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future goBack() => (super.noSuchMethod( + Invocation.method(#goBack, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future goForward() => - (super.noSuchMethod( - Invocation.method(#goForward, []), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future goForward() => (super.noSuchMethod( + Invocation.method(#goForward, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future reload() => - (super.noSuchMethod( - Invocation.method(#reload, []), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future reload() => (super.noSuchMethod( + Invocation.method(#reload, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future clearCache() => - (super.noSuchMethod( - Invocation.method(#clearCache, []), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future clearCache() => (super.noSuchMethod( + Invocation.method(#clearCache, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future clearLocalStorage() => - (super.noSuchMethod( - Invocation.method(#clearLocalStorage, []), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future clearLocalStorage() => (super.noSuchMethod( + Invocation.method(#clearLocalStorage, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setPlatformNavigationDelegate( _i3.PlatformNavigationDelegate? handler, ) => (super.noSuchMethod( - Invocation.method(#setPlatformNavigationDelegate, [handler]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setPlatformNavigationDelegate, [handler]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future runJavaScript(String? javaScript) => - (super.noSuchMethod( - Invocation.method(#runJavaScript, [javaScript]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future runJavaScript(String? javaScript) => (super.noSuchMethod( + Invocation.method(#runJavaScript, [javaScript]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future runJavaScriptReturningResult(String? javaScript) => (super.noSuchMethod( + Invocation.method(#runJavaScriptReturningResult, [javaScript]), + returnValue: _i5.Future.value( + _FakeObject_3( + this, Invocation.method(#runJavaScriptReturningResult, [javaScript]), - returnValue: _i5.Future.value( - _FakeObject_3( - this, - Invocation.method(#runJavaScriptReturningResult, [javaScript]), - ), - ), - ) - as _i5.Future); + ), + ), + ) as _i5.Future); @override _i5.Future addJavaScriptChannel( _i3.JavaScriptChannelParams? javaScriptChannelParams, ) => (super.noSuchMethod( - Invocation.method(#addJavaScriptChannel, [javaScriptChannelParams]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#addJavaScriptChannel, [javaScriptChannelParams]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future removeJavaScriptChannel(String? javaScriptChannelName) => (super.noSuchMethod( - Invocation.method(#removeJavaScriptChannel, [ - javaScriptChannelName, - ]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#removeJavaScriptChannel, [ + javaScriptChannelName, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future getTitle() => - (super.noSuchMethod( - Invocation.method(#getTitle, []), - returnValue: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future getTitle() => (super.noSuchMethod( + Invocation.method(#getTitle, []), + returnValue: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future scrollTo(int? x, int? y) => - (super.noSuchMethod( - Invocation.method(#scrollTo, [x, y]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future scrollTo(int? x, int? y) => (super.noSuchMethod( + Invocation.method(#scrollTo, [x, y]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future scrollBy(int? x, int? y) => - (super.noSuchMethod( - Invocation.method(#scrollBy, [x, y]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future scrollBy(int? x, int? y) => (super.noSuchMethod( + Invocation.method(#scrollBy, [x, y]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future<_i4.Offset> getScrollPosition() => - (super.noSuchMethod( - Invocation.method(#getScrollPosition, []), - returnValue: _i5.Future<_i4.Offset>.value( - _FakeOffset_4(this, Invocation.method(#getScrollPosition, [])), - ), - ) - as _i5.Future<_i4.Offset>); + _i5.Future<_i4.Offset> getScrollPosition() => (super.noSuchMethod( + Invocation.method(#getScrollPosition, []), + returnValue: _i5.Future<_i4.Offset>.value( + _FakeOffset_4(this, Invocation.method(#getScrollPosition, [])), + ), + ) as _i5.Future<_i4.Offset>); @override - _i5.Future enableZoom(bool? enabled) => - (super.noSuchMethod( - Invocation.method(#enableZoom, [enabled]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future enableZoom(bool? enabled) => (super.noSuchMethod( + Invocation.method(#enableZoom, [enabled]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future setBackgroundColor(_i4.Color? color) => - (super.noSuchMethod( - Invocation.method(#setBackgroundColor, [color]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future setBackgroundColor(_i4.Color? color) => (super.noSuchMethod( + Invocation.method(#setBackgroundColor, [color]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setJavaScriptMode(_i3.JavaScriptMode? javaScriptMode) => (super.noSuchMethod( - Invocation.method(#setJavaScriptMode, [javaScriptMode]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setJavaScriptMode, [javaScriptMode]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future setUserAgent(String? userAgent) => - (super.noSuchMethod( - Invocation.method(#setUserAgent, [userAgent]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future setUserAgent(String? userAgent) => (super.noSuchMethod( + Invocation.method(#setUserAgent, [userAgent]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setOnScrollPositionChange( void Function(_i3.ScrollPositionChange)? onScrollPositionChange, ) => (super.noSuchMethod( - Invocation.method(#setOnScrollPositionChange, [ - onScrollPositionChange, - ]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setOnScrollPositionChange, [ + onScrollPositionChange, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setMediaPlaybackRequiresUserGesture(bool? require) => (super.noSuchMethod( - Invocation.method(#setMediaPlaybackRequiresUserGesture, [require]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setMediaPlaybackRequiresUserGesture, [require]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future setTextZoom(int? textZoom) => - (super.noSuchMethod( - Invocation.method(#setTextZoom, [textZoom]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future setTextZoom(int? textZoom) => (super.noSuchMethod( + Invocation.method(#setTextZoom, [textZoom]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future setAllowContentAccess(bool? enabled) => - (super.noSuchMethod( - Invocation.method(#setAllowContentAccess, [enabled]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future setAllowContentAccess(bool? enabled) => (super.noSuchMethod( + Invocation.method(#setAllowContentAccess, [enabled]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future setGeolocationEnabled(bool? enabled) => - (super.noSuchMethod( - Invocation.method(#setGeolocationEnabled, [enabled]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future setGeolocationEnabled(bool? enabled) => (super.noSuchMethod( + Invocation.method(#setGeolocationEnabled, [enabled]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setOnShowFileSelector( _i5.Future> Function(_i6.FileSelectorParams)? - onShowFileSelector, + onShowFileSelector, ) => (super.noSuchMethod( - Invocation.method(#setOnShowFileSelector, [onShowFileSelector]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setOnShowFileSelector, [onShowFileSelector]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setOnPlatformPermissionRequest( void Function(_i3.PlatformWebViewPermissionRequest)? onPermissionRequest, ) => (super.noSuchMethod( - Invocation.method(#setOnPlatformPermissionRequest, [ - onPermissionRequest, - ]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setOnPlatformPermissionRequest, [ + onPermissionRequest, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setGeolocationPermissionsPromptCallbacks({ @@ -462,14 +396,13 @@ class MockAndroidWebViewController extends _i1.Mock _i6.OnGeolocationPermissionsHidePrompt? onHidePrompt, }) => (super.noSuchMethod( - Invocation.method(#setGeolocationPermissionsPromptCallbacks, [], { - #onShowPrompt: onShowPrompt, - #onHidePrompt: onHidePrompt, - }), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setGeolocationPermissionsPromptCallbacks, [], { + #onShowPrompt: onShowPrompt, + #onHidePrompt: onHidePrompt, + }), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setCustomWidgetCallbacks({ @@ -477,100 +410,90 @@ class MockAndroidWebViewController extends _i1.Mock required _i6.OnHideCustomWidgetCallback? onHideCustomWidget, }) => (super.noSuchMethod( - Invocation.method(#setCustomWidgetCallbacks, [], { - #onShowCustomWidget: onShowCustomWidget, - #onHideCustomWidget: onHideCustomWidget, - }), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setCustomWidgetCallbacks, [], { + #onShowCustomWidget: onShowCustomWidget, + #onHideCustomWidget: onHideCustomWidget, + }), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setOnConsoleMessage( void Function(_i3.JavaScriptConsoleMessage)? onConsoleMessage, ) => (super.noSuchMethod( - Invocation.method(#setOnConsoleMessage, [onConsoleMessage]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setOnConsoleMessage, [onConsoleMessage]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future getUserAgent() => - (super.noSuchMethod( - Invocation.method(#getUserAgent, []), - returnValue: _i5.Future.value(), - ) - as _i5.Future); + _i5.Future getUserAgent() => (super.noSuchMethod( + Invocation.method(#getUserAgent, []), + returnValue: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setOnJavaScriptAlertDialog( _i5.Future Function(_i3.JavaScriptAlertDialogRequest)? - onJavaScriptAlertDialog, + onJavaScriptAlertDialog, ) => (super.noSuchMethod( - Invocation.method(#setOnJavaScriptAlertDialog, [ - onJavaScriptAlertDialog, - ]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setOnJavaScriptAlertDialog, [ + onJavaScriptAlertDialog, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setOnJavaScriptConfirmDialog( _i5.Future Function(_i3.JavaScriptConfirmDialogRequest)? - onJavaScriptConfirmDialog, + onJavaScriptConfirmDialog, ) => (super.noSuchMethod( - Invocation.method(#setOnJavaScriptConfirmDialog, [ - onJavaScriptConfirmDialog, - ]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setOnJavaScriptConfirmDialog, [ + onJavaScriptConfirmDialog, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setOnJavaScriptTextInputDialog( _i5.Future Function(_i3.JavaScriptTextInputDialogRequest)? - onJavaScriptTextInputDialog, + onJavaScriptTextInputDialog, ) => (super.noSuchMethod( - Invocation.method(#setOnJavaScriptTextInputDialog, [ - onJavaScriptTextInputDialog, - ]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setOnJavaScriptTextInputDialog, [ + onJavaScriptTextInputDialog, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setVerticalScrollBarEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setVerticalScrollBarEnabled, [enabled]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setVerticalScrollBarEnabled, [enabled]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setHorizontalScrollBarEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setHorizontalScrollBarEnabled, [enabled]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setHorizontalScrollBarEnabled, [enabled]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future setOverScrollMode(_i3.WebViewOverScrollMode? mode) => (super.noSuchMethod( - Invocation.method(#setOverScrollMode, [mode]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) - as _i5.Future); + Invocation.method(#setOverScrollMode, [mode]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); } diff --git a/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_cookie_manager_test.mocks.dart b/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_cookie_manager_test.mocks.dart index 74d4075c1b5..68d1d82b29c 100644 --- a/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_cookie_manager_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_cookie_manager_test.mocks.dart @@ -25,12 +25,12 @@ import 'package:webview_flutter_android/src/android_webkit.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 _FakeCookieManager_1 extends _i1.SmartFake implements _i2.CookieManager { _FakeCookieManager_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } /// A class which mocks [CookieManager]. @@ -42,32 +42,26 @@ class MockCookieManager extends _i1.Mock implements _i2.CookieManager { } @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(String? url, String? value) => - (super.noSuchMethod( - Invocation.method(#setCookie, [url, value]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + _i3.Future setCookie(String? url, String? value) => (super.noSuchMethod( + Invocation.method(#setCookie, [url, value]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override - _i3.Future removeAllCookies() => - (super.noSuchMethod( - Invocation.method(#removeAllCookies, []), - returnValue: _i3.Future.value(false), - ) - as _i3.Future); + _i3.Future removeAllCookies() => (super.noSuchMethod( + Invocation.method(#removeAllCookies, []), + returnValue: _i3.Future.value(false), + ) as _i3.Future); @override _i3.Future setAcceptThirdPartyCookies( @@ -75,20 +69,17 @@ class MockCookieManager extends _i1.Mock implements _i2.CookieManager { bool? accept, ) => (super.noSuchMethod( - Invocation.method(#setAcceptThirdPartyCookies, [webView, accept]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#setAcceptThirdPartyCookies, [webView, accept]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override - _i2.CookieManager pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeCookieManager_1( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.CookieManager); + _i2.CookieManager pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeCookieManager_1( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.CookieManager); } diff --git a/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_widget_test.mocks.dart b/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_widget_test.mocks.dart index d60a80b7501..8ad932452cc 100644 --- a/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_widget_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_widget_test.mocks.dart @@ -31,68 +31,68 @@ import 'package:webview_flutter_platform_interface/src/webview_flutter_platform_ class _FakePigeonInstanceManager_0 extends _i1.SmartFake implements _i2.PigeonInstanceManager { _FakePigeonInstanceManager_0(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeFlutterAssetManager_1 extends _i1.SmartFake implements _i2.FlutterAssetManager { _FakeFlutterAssetManager_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWebSettings_2 extends _i1.SmartFake implements _i2.WebSettings { _FakeWebSettings_2(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWebStorage_3 extends _i1.SmartFake implements _i2.WebStorage { _FakeWebStorage_3(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWebView_4 extends _i1.SmartFake implements _i2.WebView { _FakeWebView_4(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWebViewPoint_5 extends _i1.SmartFake implements _i2.WebViewPoint { _FakeWebViewPoint_5(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWebResourceRequest_6 extends _i1.SmartFake implements _i2.WebResourceRequest { _FakeWebResourceRequest_6(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeDownloadListener_7 extends _i1.SmartFake implements _i2.DownloadListener { _FakeDownloadListener_7(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeJavascriptChannelRegistry_8 extends _i1.SmartFake implements _i3.JavascriptChannelRegistry { _FakeJavascriptChannelRegistry_8(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeJavaScriptChannel_9 extends _i1.SmartFake implements _i2.JavaScriptChannel { _FakeJavaScriptChannel_9(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWebChromeClient_10 extends _i1.SmartFake implements _i2.WebChromeClient { _FakeWebChromeClient_10(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWebViewClient_11 extends _i1.SmartFake implements _i2.WebViewClient { _FakeWebViewClient_11(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } /// A class which mocks [FlutterAssetManager]. @@ -105,47 +105,40 @@ class MockFlutterAssetManager 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> list(String? path) => - (super.noSuchMethod( - Invocation.method(#list, [path]), - returnValue: _i4.Future>.value([]), - ) - as _i4.Future>); + _i4.Future> list(String? path) => (super.noSuchMethod( + Invocation.method(#list, [path]), + returnValue: _i4.Future>.value([]), + ) as _i4.Future>); @override _i4.Future getAssetFilePathByName(String? name) => (super.noSuchMethod( + Invocation.method(#getAssetFilePathByName, [name]), + returnValue: _i4.Future.value( + _i5.dummyValue( + this, Invocation.method(#getAssetFilePathByName, [name]), - returnValue: _i4.Future.value( - _i5.dummyValue( - this, - Invocation.method(#getAssetFilePathByName, [name]), - ), - ), - ) - as _i4.Future); - - @override - _i2.FlutterAssetManager pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeFlutterAssetManager_1( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.FlutterAssetManager); + ), + ), + ) as _i4.Future); + + @override + _i2.FlutterAssetManager pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeFlutterAssetManager_1( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.FlutterAssetManager); } /// A class which mocks [WebSettings]. @@ -157,176 +150,145 @@ class MockWebSettings extends _i1.Mock implements _i2.WebSettings { } @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 setDomStorageEnabled(bool? flag) => - (super.noSuchMethod( - Invocation.method(#setDomStorageEnabled, [flag]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future setDomStorageEnabled(bool? flag) => (super.noSuchMethod( + Invocation.method(#setDomStorageEnabled, [flag]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future setJavaScriptCanOpenWindowsAutomatically(bool? flag) => (super.noSuchMethod( - Invocation.method(#setJavaScriptCanOpenWindowsAutomatically, [ - flag, - ]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#setJavaScriptCanOpenWindowsAutomatically, [ + flag, + ]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future setSupportMultipleWindows(bool? support) => (super.noSuchMethod( - Invocation.method(#setSupportMultipleWindows, [support]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#setSupportMultipleWindows, [support]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future setJavaScriptEnabled(bool? flag) => - (super.noSuchMethod( - Invocation.method(#setJavaScriptEnabled, [flag]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future setJavaScriptEnabled(bool? flag) => (super.noSuchMethod( + Invocation.method(#setJavaScriptEnabled, [flag]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future setUserAgentString(String? userAgentString) => (super.noSuchMethod( - Invocation.method(#setUserAgentString, [userAgentString]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#setUserAgentString, [userAgentString]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future setMediaPlaybackRequiresUserGesture(bool? require) => (super.noSuchMethod( - Invocation.method(#setMediaPlaybackRequiresUserGesture, [require]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#setMediaPlaybackRequiresUserGesture, [require]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future setSupportZoom(bool? support) => - (super.noSuchMethod( - Invocation.method(#setSupportZoom, [support]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future setSupportZoom(bool? support) => (super.noSuchMethod( + Invocation.method(#setSupportZoom, [support]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future setLoadWithOverviewMode(bool? overview) => (super.noSuchMethod( - Invocation.method(#setLoadWithOverviewMode, [overview]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#setLoadWithOverviewMode, [overview]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future setUseWideViewPort(bool? use) => - (super.noSuchMethod( - Invocation.method(#setUseWideViewPort, [use]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future setUseWideViewPort(bool? use) => (super.noSuchMethod( + Invocation.method(#setUseWideViewPort, [use]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future setDisplayZoomControls(bool? enabled) => - (super.noSuchMethod( - Invocation.method(#setDisplayZoomControls, [enabled]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future setDisplayZoomControls(bool? enabled) => (super.noSuchMethod( + Invocation.method(#setDisplayZoomControls, [enabled]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future setBuiltInZoomControls(bool? enabled) => - (super.noSuchMethod( - Invocation.method(#setBuiltInZoomControls, [enabled]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future setBuiltInZoomControls(bool? enabled) => (super.noSuchMethod( + Invocation.method(#setBuiltInZoomControls, [enabled]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future setAllowFileAccess(bool? enabled) => - (super.noSuchMethod( - Invocation.method(#setAllowFileAccess, [enabled]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future setAllowFileAccess(bool? enabled) => (super.noSuchMethod( + Invocation.method(#setAllowFileAccess, [enabled]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future setAllowContentAccess(bool? enabled) => - (super.noSuchMethod( - Invocation.method(#setAllowContentAccess, [enabled]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future setAllowContentAccess(bool? enabled) => (super.noSuchMethod( + Invocation.method(#setAllowContentAccess, [enabled]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future setGeolocationEnabled(bool? enabled) => - (super.noSuchMethod( - Invocation.method(#setGeolocationEnabled, [enabled]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future setGeolocationEnabled(bool? enabled) => (super.noSuchMethod( + Invocation.method(#setGeolocationEnabled, [enabled]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future setTextZoom(int? textZoom) => - (super.noSuchMethod( - Invocation.method(#setTextZoom, [textZoom]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future setTextZoom(int? textZoom) => (super.noSuchMethod( + Invocation.method(#setTextZoom, [textZoom]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future getUserAgentString() => - (super.noSuchMethod( + _i4.Future getUserAgentString() => (super.noSuchMethod( + Invocation.method(#getUserAgentString, []), + returnValue: _i4.Future.value( + _i5.dummyValue( + this, Invocation.method(#getUserAgentString, []), - returnValue: _i4.Future.value( - _i5.dummyValue( - this, - Invocation.method(#getUserAgentString, []), - ), - ), - ) - as _i4.Future); - - @override - _i2.WebSettings pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWebSettings_2( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WebSettings); + ), + ), + ) as _i4.Future); + + @override + _i2.WebSettings pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWebSettings_2( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WebSettings); } /// A class which mocks [WebStorage]. @@ -338,35 +300,29 @@ class MockWebStorage extends _i1.Mock implements _i2.WebStorage { } @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 deleteAllData() => - (super.noSuchMethod( - Invocation.method(#deleteAllData, []), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future deleteAllData() => (super.noSuchMethod( + Invocation.method(#deleteAllData, []), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i2.WebStorage pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWebStorage_3( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WebStorage); + _i2.WebStorage pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWebStorage_3( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WebStorage); } /// A class which mocks [WebView]. @@ -378,43 +334,36 @@ class MockWebView extends _i1.Mock implements _i2.WebView { } @override - _i2.WebSettings get settings => - (super.noSuchMethod( - Invocation.getter(#settings), - returnValue: _FakeWebSettings_2(this, Invocation.getter(#settings)), - ) - as _i2.WebSettings); + _i2.WebSettings get settings => (super.noSuchMethod( + Invocation.getter(#settings), + returnValue: _FakeWebSettings_2(this, Invocation.getter(#settings)), + ) as _i2.WebSettings); @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.WebSettings pigeonVar_settings() => - (super.noSuchMethod( - Invocation.method(#pigeonVar_settings, []), - returnValue: _FakeWebSettings_2( - this, - Invocation.method(#pigeonVar_settings, []), - ), - ) - as _i2.WebSettings); + _i2.WebSettings pigeonVar_settings() => (super.noSuchMethod( + Invocation.method(#pigeonVar_settings, []), + returnValue: _FakeWebSettings_2( + this, + Invocation.method(#pigeonVar_settings, []), + ), + ) as _i2.WebSettings); @override _i4.Future loadData(String? data, String? mimeType, String? encoding) => (super.noSuchMethod( - Invocation.method(#loadData, [data, mimeType, encoding]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#loadData, [data, mimeType, encoding]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future loadDataWithBaseUrl( @@ -425,243 +374,202 @@ class MockWebView extends _i1.Mock implements _i2.WebView { String? historyUrl, ) => (super.noSuchMethod( - Invocation.method(#loadDataWithBaseUrl, [ - baseUrl, - data, - mimeType, - encoding, - historyUrl, - ]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#loadDataWithBaseUrl, [ + baseUrl, + data, + mimeType, + encoding, + historyUrl, + ]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future loadUrl(String? url, Map? headers) => (super.noSuchMethod( - Invocation.method(#loadUrl, [url, headers]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#loadUrl, [url, headers]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future postUrl(String? url, _i6.Uint8List? data) => (super.noSuchMethod( - Invocation.method(#postUrl, [url, data]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#postUrl, [url, data]), + 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 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 clearCache(bool? includeDiskFiles) => - (super.noSuchMethod( - Invocation.method(#clearCache, [includeDiskFiles]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future clearCache(bool? includeDiskFiles) => (super.noSuchMethod( + Invocation.method(#clearCache, [includeDiskFiles]), + 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 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 setWebViewClient(_i2.WebViewClient? client) => (super.noSuchMethod( - Invocation.method(#setWebViewClient, [client]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#setWebViewClient, [client]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future addJavaScriptChannel(_i2.JavaScriptChannel? channel) => (super.noSuchMethod( - Invocation.method(#addJavaScriptChannel, [channel]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#addJavaScriptChannel, [channel]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future removeJavaScriptChannel(String? name) => - (super.noSuchMethod( - Invocation.method(#removeJavaScriptChannel, [name]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future removeJavaScriptChannel(String? name) => (super.noSuchMethod( + Invocation.method(#removeJavaScriptChannel, [name]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future setDownloadListener(_i2.DownloadListener? listener) => (super.noSuchMethod( - Invocation.method(#setDownloadListener, [listener]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#setDownloadListener, [listener]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future setWebChromeClient(_i2.WebChromeClient? client) => (super.noSuchMethod( - Invocation.method(#setWebChromeClient, [client]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#setWebChromeClient, [client]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future setBackgroundColor(int? color) => - (super.noSuchMethod( - Invocation.method(#setBackgroundColor, [color]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future setBackgroundColor(int? color) => (super.noSuchMethod( + Invocation.method(#setBackgroundColor, [color]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future destroy() => - (super.noSuchMethod( - Invocation.method(#destroy, []), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future destroy() => (super.noSuchMethod( + Invocation.method(#destroy, []), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i2.WebView pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWebView_4( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WebView); + _i2.WebView pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWebView_4( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WebView); @override - _i4.Future scrollTo(int? x, int? y) => - (super.noSuchMethod( - Invocation.method(#scrollTo, [x, y]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future scrollTo(int? x, int? y) => (super.noSuchMethod( + Invocation.method(#scrollTo, [x, y]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future scrollBy(int? x, int? y) => - (super.noSuchMethod( - Invocation.method(#scrollBy, [x, y]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future scrollBy(int? x, int? y) => (super.noSuchMethod( + Invocation.method(#scrollBy, [x, y]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future<_i2.WebViewPoint> getScrollPosition() => - (super.noSuchMethod( + _i4.Future<_i2.WebViewPoint> getScrollPosition() => (super.noSuchMethod( + Invocation.method(#getScrollPosition, []), + returnValue: _i4.Future<_i2.WebViewPoint>.value( + _FakeWebViewPoint_5( + this, Invocation.method(#getScrollPosition, []), - returnValue: _i4.Future<_i2.WebViewPoint>.value( - _FakeWebViewPoint_5( - this, - Invocation.method(#getScrollPosition, []), - ), - ), - ) - as _i4.Future<_i2.WebViewPoint>); + ), + ), + ) as _i4.Future<_i2.WebViewPoint>); @override _i4.Future setVerticalScrollBarEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setVerticalScrollBarEnabled, [enabled]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#setVerticalScrollBarEnabled, [enabled]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future setHorizontalScrollBarEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setHorizontalScrollBarEnabled, [enabled]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#setHorizontalScrollBarEnabled, [enabled]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future setOverScrollMode(_i2.OverScrollMode? mode) => (super.noSuchMethod( - Invocation.method(#setOverScrollMode, [mode]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#setOverScrollMode, [mode]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); } /// A class which mocks [WebResourceRequest]. @@ -674,20 +582,16 @@ class MockWebResourceRequest extends _i1.Mock } @override - String get url => - (super.noSuchMethod( - Invocation.getter(#url), - returnValue: _i5.dummyValue(this, Invocation.getter(#url)), - ) - as String); + String get url => (super.noSuchMethod( + Invocation.getter(#url), + returnValue: _i5.dummyValue(this, Invocation.getter(#url)), + ) as String); @override - bool get isForMainFrame => - (super.noSuchMethod( - Invocation.getter(#isForMainFrame), - returnValue: false, - ) - as bool); + bool get isForMainFrame => (super.noSuchMethod( + Invocation.getter(#isForMainFrame), + returnValue: false, + ) as bool); @override bool get hasGesture => @@ -695,37 +599,31 @@ class MockWebResourceRequest extends _i1.Mock as bool); @override - String get method => - (super.noSuchMethod( - Invocation.getter(#method), - returnValue: _i5.dummyValue( - this, - Invocation.getter(#method), - ), - ) - as String); + String get method => (super.noSuchMethod( + Invocation.getter(#method), + returnValue: _i5.dummyValue( + this, + Invocation.getter(#method), + ), + ) as String); @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.WebResourceRequest pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWebResourceRequest_6( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WebResourceRequest); + _i2.WebResourceRequest pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWebResourceRequest_6( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WebResourceRequest); } /// A class which mocks [DownloadListener]. @@ -738,20 +636,17 @@ class MockDownloadListener extends _i1.Mock implements _i2.DownloadListener { @override void Function(_i2.DownloadListener, String, String, String, String, int) - get onDownloadStart => - (super.noSuchMethod( + get onDownloadStart => (super.noSuchMethod( Invocation.getter(#onDownloadStart), - returnValue: - ( - _i2.DownloadListener pigeon_instance, - String url, - String userAgent, - String contentDisposition, - String mimetype, - int contentLength, - ) {}, - ) - as void Function( + returnValue: ( + _i2.DownloadListener pigeon_instance, + String url, + String userAgent, + String contentDisposition, + String mimetype, + int contentLength, + ) {}, + ) as void Function( _i2.DownloadListener, String, String, @@ -761,26 +656,22 @@ class MockDownloadListener extends _i1.Mock implements _i2.DownloadListener { )); @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.DownloadListener pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeDownloadListener_7( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.DownloadListener); + _i2.DownloadListener pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeDownloadListener_7( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.DownloadListener); } /// A class which mocks [WebViewAndroidJavaScriptChannel]. @@ -795,55 +686,46 @@ class MockWebViewAndroidJavaScriptChannel extends _i1.Mock @override _i3.JavascriptChannelRegistry get javascriptChannelRegistry => (super.noSuchMethod( - Invocation.getter(#javascriptChannelRegistry), - returnValue: _FakeJavascriptChannelRegistry_8( - this, - Invocation.getter(#javascriptChannelRegistry), - ), - ) - as _i3.JavascriptChannelRegistry); + Invocation.getter(#javascriptChannelRegistry), + returnValue: _FakeJavascriptChannelRegistry_8( + this, + Invocation.getter(#javascriptChannelRegistry), + ), + ) as _i3.JavascriptChannelRegistry); @override - String get channelName => - (super.noSuchMethod( - Invocation.getter(#channelName), - returnValue: _i5.dummyValue( - this, - Invocation.getter(#channelName), - ), - ) - as String); + String get channelName => (super.noSuchMethod( + Invocation.getter(#channelName), + returnValue: _i5.dummyValue( + this, + Invocation.getter(#channelName), + ), + ) as String); @override void Function(_i2.JavaScriptChannel, String) get postMessage => (super.noSuchMethod( - Invocation.getter(#postMessage), - returnValue: - (_i2.JavaScriptChannel pigeon_instance, String message) {}, - ) - as void Function(_i2.JavaScriptChannel, String)); + Invocation.getter(#postMessage), + returnValue: (_i2.JavaScriptChannel pigeon_instance, String message) {}, + ) as void Function(_i2.JavaScriptChannel, String)); @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.JavaScriptChannel pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeJavaScriptChannel_9( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.JavaScriptChannel); + _i2.JavaScriptChannel pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeJavaScriptChannel_9( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.JavaScriptChannel); } /// A class which mocks [WebChromeClient]. @@ -859,37 +741,32 @@ class MockWebChromeClient extends _i1.Mock implements _i2.WebChromeClient { _i2.WebChromeClient, _i2.WebView, _i2.FileChooserParams, - ) - get onShowFileChooser => - (super.noSuchMethod( - Invocation.getter(#onShowFileChooser), - returnValue: - ( - _i2.WebChromeClient pigeon_instance, - _i2.WebView webView, - _i2.FileChooserParams params, - ) => _i4.Future>.value([]), - ) - as _i4.Future> Function( - _i2.WebChromeClient, - _i2.WebView, - _i2.FileChooserParams, - )); + ) get onShowFileChooser => (super.noSuchMethod( + Invocation.getter(#onShowFileChooser), + returnValue: ( + _i2.WebChromeClient pigeon_instance, + _i2.WebView webView, + _i2.FileChooserParams params, + ) => + _i4.Future>.value([]), + ) as _i4.Future> Function( + _i2.WebChromeClient, + _i2.WebView, + _i2.FileChooserParams, + )); @override _i4.Future Function(_i2.WebChromeClient, _i2.WebView, String, String) - get onJsConfirm => - (super.noSuchMethod( + get onJsConfirm => (super.noSuchMethod( Invocation.getter(#onJsConfirm), - returnValue: - ( - _i2.WebChromeClient pigeon_instance, - _i2.WebView webView, - String url, - String message, - ) => _i4.Future.value(false), - ) - as _i4.Future Function( + returnValue: ( + _i2.WebChromeClient pigeon_instance, + _i2.WebView webView, + String url, + String message, + ) => + _i4.Future.value(false), + ) as _i4.Future Function( _i2.WebChromeClient, _i2.WebView, String, @@ -897,77 +774,68 @@ class MockWebChromeClient extends _i1.Mock implements _i2.WebChromeClient { )); @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 setSynchronousReturnValueForOnShowFileChooser(bool? value) => (super.noSuchMethod( - Invocation.method(#setSynchronousReturnValueForOnShowFileChooser, [ - value, - ]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#setSynchronousReturnValueForOnShowFileChooser, [ + value, + ]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future setSynchronousReturnValueForOnConsoleMessage(bool? value) => (super.noSuchMethod( - Invocation.method(#setSynchronousReturnValueForOnConsoleMessage, [ - value, - ]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#setSynchronousReturnValueForOnConsoleMessage, [ + value, + ]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future setSynchronousReturnValueForOnJsAlert(bool? value) => (super.noSuchMethod( - Invocation.method(#setSynchronousReturnValueForOnJsAlert, [value]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#setSynchronousReturnValueForOnJsAlert, [value]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future setSynchronousReturnValueForOnJsConfirm(bool? value) => (super.noSuchMethod( - Invocation.method(#setSynchronousReturnValueForOnJsConfirm, [ - value, - ]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#setSynchronousReturnValueForOnJsConfirm, [ + value, + ]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future setSynchronousReturnValueForOnJsPrompt(bool? value) => (super.noSuchMethod( - Invocation.method(#setSynchronousReturnValueForOnJsPrompt, [value]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#setSynchronousReturnValueForOnJsPrompt, [value]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i2.WebChromeClient pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWebChromeClient_10( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WebChromeClient); + _i2.WebChromeClient pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWebChromeClient_10( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WebChromeClient); } /// A class which mocks [WebViewClient]. @@ -979,40 +847,35 @@ class MockWebViewClient extends _i1.Mock implements _i2.WebViewClient { } @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 setSynchronousReturnValueForShouldOverrideUrlLoading( bool? value, ) => (super.noSuchMethod( - Invocation.method( - #setSynchronousReturnValueForShouldOverrideUrlLoading, - [value], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); - - @override - _i2.WebViewClient pigeon_copy() => - (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWebViewClient_11( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WebViewClient); + Invocation.method( + #setSynchronousReturnValueForShouldOverrideUrlLoading, + [value], + ), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); + + @override + _i2.WebViewClient pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWebViewClient_11( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WebViewClient); } /// A class which mocks [JavascriptChannelRegistry]. @@ -1025,12 +888,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) => @@ -1062,37 +923,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(_i3.WebResourceError? error) => super.noSuchMethod( - Invocation.method(#onWebResourceError, [error]), - returnValueForMissingStub: null, - ); + Invocation.method(#onWebResourceError, [error]), + returnValueForMissingStub: null, + ); } /// A class which mocks [WebViewProxy]. @@ -1104,15 +964,13 @@ class MockWebViewProxy extends _i1.Mock implements _i7.WebViewProxy { } @override - _i2.WebView createWebView() => - (super.noSuchMethod( - Invocation.method(#createWebView, []), - returnValue: _FakeWebView_4( - this, - Invocation.method(#createWebView, []), - ), - ) - as _i2.WebView); + _i2.WebView createWebView() => (super.noSuchMethod( + Invocation.method(#createWebView, []), + returnValue: _FakeWebView_4( + this, + Invocation.method(#createWebView, []), + ), + ) as _i2.WebView); @override _i2.WebViewClient createWebViewClient({ @@ -1123,65 +981,60 @@ class MockWebViewProxy extends _i1.Mock implements _i7.WebViewProxy { _i2.WebView, _i2.WebResourceRequest, _i2.WebResourceError, - )? - onReceivedRequestError, + )? onReceivedRequestError, void Function(_i2.WebViewClient, _i2.WebView, int, String, String)? - onReceivedError, + onReceivedError, void Function(_i2.WebViewClient, _i2.WebView, _i2.WebResourceRequest)? - requestLoading, + requestLoading, void Function( _i2.WebViewClient, _i2.WebView, _i2.AndroidMessage, _i2.AndroidMessage, - )? - onFormResubmission, + )? onFormResubmission, void Function(_i2.WebViewClient, _i2.WebView, _i2.ClientCertRequest)? - onReceivedClientCertRequest, + onReceivedClientCertRequest, void Function( _i2.WebViewClient, _i2.WebView, _i2.SslErrorHandler, _i2.SslError, - )? - onReceivedSslError, + )? onReceivedSslError, void Function(_i2.WebViewClient, _i2.WebView, String)? urlLoading, }) => (super.noSuchMethod( - Invocation.method(#createWebViewClient, [], { - #onPageStarted: onPageStarted, - #onPageFinished: onPageFinished, - #onReceivedRequestError: onReceivedRequestError, - #onReceivedError: onReceivedError, - #requestLoading: requestLoading, - #onFormResubmission: onFormResubmission, - #onReceivedClientCertRequest: onReceivedClientCertRequest, - #onReceivedSslError: onReceivedSslError, - #urlLoading: urlLoading, - }), - returnValue: _FakeWebViewClient_11( - this, - Invocation.method(#createWebViewClient, [], { - #onPageStarted: onPageStarted, - #onPageFinished: onPageFinished, - #onReceivedRequestError: onReceivedRequestError, - #onReceivedError: onReceivedError, - #requestLoading: requestLoading, - #onFormResubmission: onFormResubmission, - #onReceivedClientCertRequest: onReceivedClientCertRequest, - #onReceivedSslError: onReceivedSslError, - #urlLoading: urlLoading, - }), - ), - ) - as _i2.WebViewClient); + Invocation.method(#createWebViewClient, [], { + #onPageStarted: onPageStarted, + #onPageFinished: onPageFinished, + #onReceivedRequestError: onReceivedRequestError, + #onReceivedError: onReceivedError, + #requestLoading: requestLoading, + #onFormResubmission: onFormResubmission, + #onReceivedClientCertRequest: onReceivedClientCertRequest, + #onReceivedSslError: onReceivedSslError, + #urlLoading: urlLoading, + }), + returnValue: _FakeWebViewClient_11( + this, + Invocation.method(#createWebViewClient, [], { + #onPageStarted: onPageStarted, + #onPageFinished: onPageFinished, + #onReceivedRequestError: onReceivedRequestError, + #onReceivedError: onReceivedError, + #requestLoading: requestLoading, + #onFormResubmission: onFormResubmission, + #onReceivedClientCertRequest: onReceivedClientCertRequest, + #onReceivedSslError: onReceivedSslError, + #urlLoading: urlLoading, + }), + ), + ) as _i2.WebViewClient); @override _i4.Future setWebContentsDebuggingEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setWebContentsDebuggingEnabled, [enabled]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#setWebContentsDebuggingEnabled, [enabled]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); } 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 e4e4b0956c6..74b4fecc955 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 @@ -6,8 +6,9 @@ import Foundation import WebKit + #if !os(macOS) -import UIKit + import UIKit #endif #if os(iOS) @@ -63,7 +64,9 @@ private func wrapError(_ error: Any) -> [Any?] { } private func createConnectionError(withChannelName channelName: String) -> PigeonError { - return PigeonError(code: "channel-error", message: "Unable to establish connection on channel: '\(channelName)'.", details: "") + return PigeonError( + code: "channel-error", message: "Unable to establish connection on channel: '\(channelName)'.", + details: "") } private func isNullish(_ value: Any?) -> Bool { @@ -81,7 +84,6 @@ protocol WebKitLibraryPigeonInternalFinalizerDelegate: AnyObject { func onDeinit(identifier: Int64) } - // Attaches to an object to receive a callback when the object is deallocated. internal final class WebKitLibraryPigeonInternalFinalizer { private static let associatedObjectKey = malloc(1)! @@ -97,7 +99,8 @@ internal final class WebKitLibraryPigeonInternalFinalizer { } internal static func attach( - to instance: AnyObject, identifier: Int64, delegate: WebKitLibraryPigeonInternalFinalizerDelegate + to instance: AnyObject, identifier: Int64, + delegate: WebKitLibraryPigeonInternalFinalizerDelegate ) { let finalizer = WebKitLibraryPigeonInternalFinalizer(identifier: identifier, delegate: delegate) objc_setAssociatedObject(instance, associatedObjectKey, finalizer, .OBJC_ASSOCIATION_RETAIN) @@ -112,7 +115,6 @@ internal final class WebKitLibraryPigeonInternalFinalizer { } } - /// Maintains instances used to communicate with the corresponding objects in Dart. /// /// Objects stored in this container are represented by an object in Dart that is also stored in @@ -216,7 +218,8 @@ final class WebKitLibraryPigeonInstanceManager { identifiers.setObject(NSNumber(value: identifier), forKey: instance) weakInstances.setObject(instance, forKey: NSNumber(value: identifier)) strongInstances.setObject(instance, forKey: NSNumber(value: identifier)) - WebKitLibraryPigeonInternalFinalizer.attach(to: instance, identifier: identifier, delegate: finalizerDelegate) + WebKitLibraryPigeonInternalFinalizer.attach( + to: instance, identifier: identifier, delegate: finalizerDelegate) } /// Retrieves the identifier paired with an instance. @@ -293,7 +296,6 @@ final class WebKitLibraryPigeonInstanceManager { } } - private class WebKitLibraryPigeonInstanceManagerApi { /// The codec used for serializing messages. var codec: FlutterStandardMessageCodec { WebKitLibraryPigeonCodec.shared } @@ -306,9 +308,14 @@ private class WebKitLibraryPigeonInstanceManagerApi { } /// Sets up an instance of `WebKitLibraryPigeonInstanceManagerApi` to handle messages through the `binaryMessenger`. - static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, instanceManager: WebKitLibraryPigeonInstanceManager?) { + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, instanceManager: WebKitLibraryPigeonInstanceManager? + ) { let codec = WebKitLibraryPigeonCodec.shared - let removeStrongReferenceChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.PigeonInternalInstanceManager.removeStrongReference", binaryMessenger: binaryMessenger, codec: codec) + let removeStrongReferenceChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.PigeonInternalInstanceManager.removeStrongReference", + binaryMessenger: binaryMessenger, codec: codec) if let instanceManager = instanceManager { removeStrongReferenceChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -323,7 +330,9 @@ private class WebKitLibraryPigeonInstanceManagerApi { } else { removeStrongReferenceChannel.setMessageHandler(nil) } - let clearChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.PigeonInternalInstanceManager.clear", binaryMessenger: binaryMessenger, codec: codec) + let clearChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.PigeonInternalInstanceManager.clear", + binaryMessenger: binaryMessenger, codec: codec) if let instanceManager = instanceManager { clearChannel.setMessageHandler { _, reply in do { @@ -339,9 +348,13 @@ private class WebKitLibraryPigeonInstanceManagerApi { } /// Sends a message to the Dart `InstanceManager` to remove the strong reference of the instance associated with `identifier`. - func removeStrongReference(identifier identifierArg: Int64, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.PigeonInternalInstanceManager.removeStrongReference" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func removeStrongReference( + identifier identifierArg: Int64, completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.PigeonInternalInstanceManager.removeStrongReference" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([identifierArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -364,111 +377,141 @@ protocol WebKitLibraryPigeonProxyApiDelegate { func pigeonApiURLRequest(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiURLRequest /// An implementation of [PigeonApiHTTPURLResponse] used to add a new Dart instance of /// `HTTPURLResponse` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiHTTPURLResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiHTTPURLResponse + func pigeonApiHTTPURLResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiHTTPURLResponse /// An implementation of [PigeonApiURLResponse] used to add a new Dart instance of /// `URLResponse` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiURLResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiURLResponse + func pigeonApiURLResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiURLResponse /// An implementation of [PigeonApiWKUserScript] used to add a new Dart instance of /// `WKUserScript` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKUserScript(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKUserScript + func pigeonApiWKUserScript(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKUserScript /// An implementation of [PigeonApiWKNavigationAction] used to add a new Dart instance of /// `WKNavigationAction` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKNavigationAction(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKNavigationAction + func pigeonApiWKNavigationAction(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKNavigationAction /// An implementation of [PigeonApiWKNavigationResponse] used to add a new Dart instance of /// `WKNavigationResponse` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKNavigationResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKNavigationResponse + func pigeonApiWKNavigationResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKNavigationResponse /// An implementation of [PigeonApiWKFrameInfo] used to add a new Dart instance of /// `WKFrameInfo` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKFrameInfo(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKFrameInfo + func pigeonApiWKFrameInfo(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKFrameInfo /// An implementation of [PigeonApiNSError] used to add a new Dart instance of /// `NSError` to the Dart `InstanceManager` and make calls to Dart. func pigeonApiNSError(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiNSError /// An implementation of [PigeonApiWKScriptMessage] used to add a new Dart instance of /// `WKScriptMessage` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKScriptMessage(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKScriptMessage + func pigeonApiWKScriptMessage(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKScriptMessage /// An implementation of [PigeonApiWKSecurityOrigin] used to add a new Dart instance of /// `WKSecurityOrigin` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKSecurityOrigin(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKSecurityOrigin + func pigeonApiWKSecurityOrigin(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKSecurityOrigin /// An implementation of [PigeonApiHTTPCookie] used to add a new Dart instance of /// `HTTPCookie` to the Dart `InstanceManager` and make calls to Dart. func pigeonApiHTTPCookie(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiHTTPCookie /// An implementation of [PigeonApiAuthenticationChallengeResponse] used to add a new Dart instance of /// `AuthenticationChallengeResponse` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiAuthenticationChallengeResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiAuthenticationChallengeResponse + func pigeonApiAuthenticationChallengeResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiAuthenticationChallengeResponse /// An implementation of [PigeonApiWKWebsiteDataStore] used to add a new Dart instance of /// `WKWebsiteDataStore` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKWebsiteDataStore(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKWebsiteDataStore + func pigeonApiWKWebsiteDataStore(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKWebsiteDataStore /// An implementation of [PigeonApiUIView] used to add a new Dart instance of /// `UIView` to the Dart `InstanceManager` and make calls to Dart. func pigeonApiUIView(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiUIView /// An implementation of [PigeonApiUIScrollView] used to add a new Dart instance of /// `UIScrollView` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiUIScrollView(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiUIScrollView + func pigeonApiUIScrollView(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiUIScrollView /// An implementation of [PigeonApiWKWebViewConfiguration] used to add a new Dart instance of /// `WKWebViewConfiguration` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKWebViewConfiguration(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKWebViewConfiguration + func pigeonApiWKWebViewConfiguration(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKWebViewConfiguration /// An implementation of [PigeonApiWKUserContentController] used to add a new Dart instance of /// `WKUserContentController` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKUserContentController(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKUserContentController + func pigeonApiWKUserContentController(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKUserContentController /// An implementation of [PigeonApiWKPreferences] used to add a new Dart instance of /// `WKPreferences` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKPreferences(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKPreferences + func pigeonApiWKPreferences(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKPreferences /// An implementation of [PigeonApiWKScriptMessageHandler] used to add a new Dart instance of /// `WKScriptMessageHandler` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKScriptMessageHandler(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKScriptMessageHandler + func pigeonApiWKScriptMessageHandler(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKScriptMessageHandler /// An implementation of [PigeonApiWKNavigationDelegate] used to add a new Dart instance of /// `WKNavigationDelegate` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKNavigationDelegate(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKNavigationDelegate + func pigeonApiWKNavigationDelegate(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKNavigationDelegate /// An implementation of [PigeonApiNSObject] used to add a new Dart instance of /// `NSObject` to the Dart `InstanceManager` and make calls to Dart. func pigeonApiNSObject(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiNSObject /// An implementation of [PigeonApiUIViewWKWebView] used to add a new Dart instance of /// `UIViewWKWebView` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiUIViewWKWebView(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiUIViewWKWebView + func pigeonApiUIViewWKWebView(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiUIViewWKWebView /// An implementation of [PigeonApiNSViewWKWebView] used to add a new Dart instance of /// `NSViewWKWebView` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiNSViewWKWebView(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiNSViewWKWebView + func pigeonApiNSViewWKWebView(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiNSViewWKWebView /// An implementation of [PigeonApiWKWebView] used to add a new Dart instance of /// `WKWebView` to the Dart `InstanceManager` and make calls to Dart. func pigeonApiWKWebView(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKWebView /// An implementation of [PigeonApiWKUIDelegate] used to add a new Dart instance of /// `WKUIDelegate` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKUIDelegate(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKUIDelegate + func pigeonApiWKUIDelegate(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKUIDelegate /// An implementation of [PigeonApiWKHTTPCookieStore] used to add a new Dart instance of /// `WKHTTPCookieStore` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiWKHTTPCookieStore(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKHTTPCookieStore + func pigeonApiWKHTTPCookieStore(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKHTTPCookieStore /// An implementation of [PigeonApiUIScrollViewDelegate] used to add a new Dart instance of /// `UIScrollViewDelegate` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiUIScrollViewDelegate(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiUIScrollViewDelegate + func pigeonApiUIScrollViewDelegate(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiUIScrollViewDelegate /// An implementation of [PigeonApiURLCredential] used to add a new Dart instance of /// `URLCredential` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiURLCredential(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiURLCredential + func pigeonApiURLCredential(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiURLCredential /// An implementation of [PigeonApiURLProtectionSpace] used to add a new Dart instance of /// `URLProtectionSpace` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiURLProtectionSpace(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiURLProtectionSpace + func pigeonApiURLProtectionSpace(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiURLProtectionSpace /// An implementation of [PigeonApiURLAuthenticationChallenge] used to add a new Dart instance of /// `URLAuthenticationChallenge` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiURLAuthenticationChallenge(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiURLAuthenticationChallenge + func pigeonApiURLAuthenticationChallenge(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiURLAuthenticationChallenge /// 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 + func pigeonApiWKWebpagePreferences(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiWKWebpagePreferences /// An implementation of [PigeonApiGetTrustResultResponse] used to add a new Dart instance of /// `GetTrustResultResponse` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiGetTrustResultResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiGetTrustResultResponse + func pigeonApiGetTrustResultResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiGetTrustResultResponse /// An implementation of [PigeonApiSecTrust] used to add a new Dart instance of /// `SecTrust` to the Dart `InstanceManager` and make calls to Dart. func pigeonApiSecTrust(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiSecTrust /// An implementation of [PigeonApiSecCertificate] used to add a new Dart instance of /// `SecCertificate` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiSecCertificate(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiSecCertificate + func pigeonApiSecCertificate(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiSecCertificate } extension WebKitLibraryPigeonProxyApiDelegate { - func pigeonApiURLResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiURLResponse { - return PigeonApiURLResponse(pigeonRegistrar: registrar, delegate: PigeonApiDelegateURLResponse()) + func pigeonApiURLResponse(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) + -> PigeonApiURLResponse + { + return PigeonApiURLResponse( + pigeonRegistrar: registrar, delegate: PigeonApiDelegateURLResponse()) } func pigeonApiWKWebView(_ registrar: WebKitLibraryPigeonProxyApiRegistrar) -> PigeonApiWKWebView { return PigeonApiWKWebView(pigeonRegistrar: registrar, delegate: PigeonApiDelegateWKWebView()) @@ -513,43 +556,72 @@ open class WebKitLibraryPigeonProxyApiRegistrar { } func setUp() { - WebKitLibraryPigeonInstanceManagerApi.setUpMessageHandlers(binaryMessenger: binaryMessenger, instanceManager: instanceManager) - PigeonApiURLRequest.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiURLRequest(self)) - PigeonApiWKUserScript.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKUserScript(self)) - PigeonApiHTTPCookie.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiHTTPCookie(self)) - PigeonApiAuthenticationChallengeResponse.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiAuthenticationChallengeResponse(self)) - PigeonApiWKWebsiteDataStore.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKWebsiteDataStore(self)) - PigeonApiUIView.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiUIView(self)) - PigeonApiUIScrollView.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiUIScrollView(self)) - PigeonApiWKWebViewConfiguration.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKWebViewConfiguration(self)) - PigeonApiWKUserContentController.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKUserContentController(self)) - PigeonApiWKPreferences.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKPreferences(self)) - PigeonApiWKScriptMessageHandler.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKScriptMessageHandler(self)) - PigeonApiWKNavigationDelegate.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKNavigationDelegate(self)) - PigeonApiNSObject.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiNSObject(self)) - PigeonApiUIViewWKWebView.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiUIViewWKWebView(self)) - PigeonApiNSViewWKWebView.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiNSViewWKWebView(self)) - PigeonApiWKUIDelegate.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKUIDelegate(self)) - PigeonApiWKHTTPCookieStore.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKHTTPCookieStore(self)) - PigeonApiUIScrollViewDelegate.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiUIScrollViewDelegate(self)) - PigeonApiURLCredential.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiURLCredential(self)) - PigeonApiURLAuthenticationChallenge.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiURLAuthenticationChallenge(self)) - PigeonApiURL.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiURL(self)) - PigeonApiWKWebpagePreferences.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKWebpagePreferences(self)) - PigeonApiSecTrust.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiSecTrust(self)) - PigeonApiSecCertificate.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiSecCertificate(self)) + WebKitLibraryPigeonInstanceManagerApi.setUpMessageHandlers( + binaryMessenger: binaryMessenger, instanceManager: instanceManager) + PigeonApiURLRequest.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiURLRequest(self)) + PigeonApiWKUserScript.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKUserScript(self)) + PigeonApiHTTPCookie.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiHTTPCookie(self)) + PigeonApiAuthenticationChallengeResponse.setUpMessageHandlers( + binaryMessenger: binaryMessenger, + api: apiDelegate.pigeonApiAuthenticationChallengeResponse(self)) + PigeonApiWKWebsiteDataStore.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKWebsiteDataStore(self)) + PigeonApiUIView.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiUIView(self)) + PigeonApiUIScrollView.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiUIScrollView(self)) + PigeonApiWKWebViewConfiguration.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKWebViewConfiguration(self)) + PigeonApiWKUserContentController.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKUserContentController(self)) + PigeonApiWKPreferences.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKPreferences(self)) + PigeonApiWKScriptMessageHandler.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKScriptMessageHandler(self)) + PigeonApiWKNavigationDelegate.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKNavigationDelegate(self)) + PigeonApiNSObject.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiNSObject(self)) + PigeonApiUIViewWKWebView.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiUIViewWKWebView(self)) + PigeonApiNSViewWKWebView.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiNSViewWKWebView(self)) + PigeonApiWKUIDelegate.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKUIDelegate(self)) + PigeonApiWKHTTPCookieStore.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKHTTPCookieStore(self)) + PigeonApiUIScrollViewDelegate.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiUIScrollViewDelegate(self)) + PigeonApiURLCredential.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiURLCredential(self)) + PigeonApiURLAuthenticationChallenge.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiURLAuthenticationChallenge(self)) + PigeonApiURL.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiURL(self)) + PigeonApiWKWebpagePreferences.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiWKWebpagePreferences(self)) + PigeonApiSecTrust.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiSecTrust(self)) + PigeonApiSecCertificate.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiSecCertificate(self)) } func tearDown() { - WebKitLibraryPigeonInstanceManagerApi.setUpMessageHandlers(binaryMessenger: binaryMessenger, instanceManager: nil) + WebKitLibraryPigeonInstanceManagerApi.setUpMessageHandlers( + binaryMessenger: binaryMessenger, instanceManager: nil) PigeonApiURLRequest.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiWKUserScript.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiHTTPCookie.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) - PigeonApiAuthenticationChallengeResponse.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) + PigeonApiAuthenticationChallengeResponse.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: nil) PigeonApiWKWebsiteDataStore.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiUIView.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiUIScrollView.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiWKWebViewConfiguration.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) - PigeonApiWKUserContentController.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) + PigeonApiWKUserContentController.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: nil) PigeonApiWKPreferences.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiWKScriptMessageHandler.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiWKNavigationDelegate.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) @@ -560,7 +632,8 @@ open class WebKitLibraryPigeonProxyApiRegistrar { PigeonApiWKHTTPCookieStore.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiUIScrollViewDelegate.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiURLCredential.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) - PigeonApiURLAuthenticationChallenge.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) + PigeonApiURLAuthenticationChallenge.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: nil) PigeonApiURL.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiWKWebpagePreferences.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiSecTrust.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) @@ -603,252 +676,272 @@ private class WebKitLibraryPigeonInternalProxyApiCodecReaderWriter: FlutterStand } override func writeValue(_ value: Any) { - if value is [Any] || value is Bool || value is Data || value is [AnyHashable: Any] || value is Double || value is FlutterStandardTypedData || value is Int64 || value is String || value is KeyValueObservingOptions || value is KeyValueChange || value is KeyValueChangeKey || value is UserScriptInjectionTime || value is AudiovisualMediaType || value is WebsiteDataType || value is NavigationActionPolicy || value is NavigationResponsePolicy || value is HttpCookiePropertyKey || value is NavigationType || value is PermissionDecision || value is MediaCaptureType || value is UrlSessionAuthChallengeDisposition || value is UrlCredentialPersistence || value is DartSecTrustResultType { + if value is [Any] || value is Bool || value is Data || value is [AnyHashable: Any] + || value is Double || value is FlutterStandardTypedData || value is Int64 || value is String + || value is KeyValueObservingOptions || value is KeyValueChange + || value is KeyValueChangeKey || value is UserScriptInjectionTime + || value is AudiovisualMediaType || value is WebsiteDataType + || value is NavigationActionPolicy || value is NavigationResponsePolicy + || value is HttpCookiePropertyKey || value is NavigationType || value is PermissionDecision + || value is MediaCaptureType || value is UrlSessionAuthChallengeDisposition + || value is UrlCredentialPersistence || value is DartSecTrustResultType + { super.writeValue(value) return } - if let instance = value as? URLRequestWrapper { pigeonRegistrar.apiDelegate.pigeonApiURLRequest(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } - if let instance = value as? HTTPURLResponse { pigeonRegistrar.apiDelegate.pigeonApiHTTPURLResponse(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } - if let instance = value as? URLResponse { pigeonRegistrar.apiDelegate.pigeonApiURLResponse(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } - if let instance = value as? WKUserScript { pigeonRegistrar.apiDelegate.pigeonApiWKUserScript(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } - if let instance = value as? WKNavigationAction { pigeonRegistrar.apiDelegate.pigeonApiWKNavigationAction(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } - if let instance = value as? WKNavigationResponse { - pigeonRegistrar.apiDelegate.pigeonApiWKNavigationResponse(pigeonRegistrar).pigeonNewInstance( - pigeonInstance: instance - ) { _ in } + pigeonRegistrar.apiDelegate.pigeonApiWKNavigationResponse(pigeonRegistrar) + .pigeonNewInstance( + pigeonInstance: instance + ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } - if let instance = value as? WKFrameInfo { pigeonRegistrar.apiDelegate.pigeonApiWKFrameInfo(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } - if let instance = value as? NSError { pigeonRegistrar.apiDelegate.pigeonApiNSError(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } - if let instance = value as? WKScriptMessage { pigeonRegistrar.apiDelegate.pigeonApiWKScriptMessage(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } - if let instance = value as? WKSecurityOrigin { pigeonRegistrar.apiDelegate.pigeonApiWKSecurityOrigin(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } - if let instance = value as? HTTPCookie { pigeonRegistrar.apiDelegate.pigeonApiHTTPCookie(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } - if let instance = value as? AuthenticationChallengeResponse { - pigeonRegistrar.apiDelegate.pigeonApiAuthenticationChallengeResponse(pigeonRegistrar).pigeonNewInstance( - pigeonInstance: instance - ) { _ in } + pigeonRegistrar.apiDelegate.pigeonApiAuthenticationChallengeResponse(pigeonRegistrar) + .pigeonNewInstance( + pigeonInstance: instance + ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } - if let instance = value as? WKWebsiteDataStore { pigeonRegistrar.apiDelegate.pigeonApiWKWebsiteDataStore(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } #if !os(macOS) - if let instance = value as? UIScrollView { - pigeonRegistrar.apiDelegate.pigeonApiUIScrollView(pigeonRegistrar).pigeonNewInstance( - pigeonInstance: instance - ) { _ in } - super.writeByte(128) - super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) - return - } + if let instance = value as? UIScrollView { + pigeonRegistrar.apiDelegate.pigeonApiUIScrollView(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + return + } #endif if let instance = value as? WKWebViewConfiguration { - pigeonRegistrar.apiDelegate.pigeonApiWKWebViewConfiguration(pigeonRegistrar).pigeonNewInstance( - pigeonInstance: instance - ) { _ in } + pigeonRegistrar.apiDelegate.pigeonApiWKWebViewConfiguration(pigeonRegistrar) + .pigeonNewInstance( + pigeonInstance: instance + ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } - if let instance = value as? WKUserContentController { - pigeonRegistrar.apiDelegate.pigeonApiWKUserContentController(pigeonRegistrar).pigeonNewInstance( - pigeonInstance: instance - ) { _ in } + pigeonRegistrar.apiDelegate.pigeonApiWKUserContentController(pigeonRegistrar) + .pigeonNewInstance( + pigeonInstance: instance + ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } - if let instance = value as? WKPreferences { pigeonRegistrar.apiDelegate.pigeonApiWKPreferences(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } - if let instance = value as? WKScriptMessageHandler { - pigeonRegistrar.apiDelegate.pigeonApiWKScriptMessageHandler(pigeonRegistrar).pigeonNewInstance( - pigeonInstance: instance - ) { _ in } + pigeonRegistrar.apiDelegate.pigeonApiWKScriptMessageHandler(pigeonRegistrar) + .pigeonNewInstance( + pigeonInstance: instance + ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } - if let instance = value as? WKNavigationDelegate { - pigeonRegistrar.apiDelegate.pigeonApiWKNavigationDelegate(pigeonRegistrar).pigeonNewInstance( - pigeonInstance: instance - ) { _ in } + pigeonRegistrar.apiDelegate.pigeonApiWKNavigationDelegate(pigeonRegistrar) + .pigeonNewInstance( + pigeonInstance: instance + ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } #if !os(macOS) - if let instance = value as? WKWebView { - pigeonRegistrar.apiDelegate.pigeonApiUIViewWKWebView(pigeonRegistrar).pigeonNewInstance( - pigeonInstance: instance - ) { _ in } - super.writeByte(128) - super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) - return - } + if let instance = value as? WKWebView { + pigeonRegistrar.apiDelegate.pigeonApiUIViewWKWebView(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + return + } #endif #if !os(macOS) - if let instance = value as? UIView { - pigeonRegistrar.apiDelegate.pigeonApiUIView(pigeonRegistrar).pigeonNewInstance( - pigeonInstance: instance - ) { _ in } - super.writeByte(128) - super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) - return - } + if let instance = value as? UIView { + pigeonRegistrar.apiDelegate.pigeonApiUIView(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + return + } #endif #if !os(iOS) - if let instance = value as? WKWebView { - pigeonRegistrar.apiDelegate.pigeonApiNSViewWKWebView(pigeonRegistrar).pigeonNewInstance( - pigeonInstance: instance - ) { _ in } - super.writeByte(128) - super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) - return - } + if let instance = value as? WKWebView { + pigeonRegistrar.apiDelegate.pigeonApiNSViewWKWebView(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + return + } #endif if let instance = value as? WKWebView { @@ -857,42 +950,45 @@ private class WebKitLibraryPigeonInternalProxyApiCodecReaderWriter: FlutterStand ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } - if let instance = value as? WKUIDelegate { pigeonRegistrar.apiDelegate.pigeonApiWKUIDelegate(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } - if let instance = value as? WKHTTPCookieStore { pigeonRegistrar.apiDelegate.pigeonApiWKHTTPCookieStore(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } #if !os(macOS) - if let instance = value as? UIScrollViewDelegate { - pigeonRegistrar.apiDelegate.pigeonApiUIScrollViewDelegate(pigeonRegistrar).pigeonNewInstance( - pigeonInstance: instance - ) { _ in } - super.writeByte(128) - super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) - return - } + if let instance = value as? UIScrollViewDelegate { + pigeonRegistrar.apiDelegate.pigeonApiUIScrollViewDelegate(pigeonRegistrar) + .pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + return + } #endif if let instance = value as? URLCredential { @@ -901,100 +997,104 @@ private class WebKitLibraryPigeonInternalProxyApiCodecReaderWriter: FlutterStand ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } - if let instance = value as? URLProtectionSpace { pigeonRegistrar.apiDelegate.pigeonApiURLProtectionSpace(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } - if let instance = value as? URLAuthenticationChallenge { - pigeonRegistrar.apiDelegate.pigeonApiURLAuthenticationChallenge(pigeonRegistrar).pigeonNewInstance( - pigeonInstance: instance - ) { _ in } + pigeonRegistrar.apiDelegate.pigeonApiURLAuthenticationChallenge(pigeonRegistrar) + .pigeonNewInstance( + pigeonInstance: instance + ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } - if let instance = value as? URL { pigeonRegistrar.apiDelegate.pigeonApiURL(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } - if #available(iOS 13.0.0, macOS 10.15.0, *), let instance = value as? WKWebpagePreferences { - pigeonRegistrar.apiDelegate.pigeonApiWKWebpagePreferences(pigeonRegistrar).pigeonNewInstance( - pigeonInstance: instance - ) { _ in } + pigeonRegistrar.apiDelegate.pigeonApiWKWebpagePreferences(pigeonRegistrar) + .pigeonNewInstance( + pigeonInstance: instance + ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } - if let instance = value as? GetTrustResultResponse { - pigeonRegistrar.apiDelegate.pigeonApiGetTrustResultResponse(pigeonRegistrar).pigeonNewInstance( - pigeonInstance: instance - ) { _ in } + pigeonRegistrar.apiDelegate.pigeonApiGetTrustResultResponse(pigeonRegistrar) + .pigeonNewInstance( + pigeonInstance: instance + ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } - if let instance = value as? SecTrustWrapper { pigeonRegistrar.apiDelegate.pigeonApiSecTrust(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } - if let instance = value as? SecCertificateWrapper { pigeonRegistrar.apiDelegate.pigeonApiSecCertificate(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } - if let instance = value as? NSObject { pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance ) { _ in } super.writeByte(128) super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) return } - - if let instance = value as AnyObject?, pigeonRegistrar.instanceManager.containsInstance(instance) + if let instance = value as AnyObject?, + pigeonRegistrar.instanceManager.containsInstance(instance) { super.writeByte(128) super.writeValue( @@ -1012,11 +1112,13 @@ private class WebKitLibraryPigeonInternalProxyApiCodecReaderWriter: FlutterStand } override func reader(with data: Data) -> FlutterStandardReader { - return WebKitLibraryPigeonInternalProxyApiCodecReader(data: data, pigeonRegistrar: pigeonRegistrar) + return WebKitLibraryPigeonInternalProxyApiCodecReader( + data: data, pigeonRegistrar: pigeonRegistrar) } override func writer(with data: NSMutableData) -> FlutterStandardWriter { - return WebKitLibraryPigeonInternalProxyApiCodecWriter(data: data, pigeonRegistrar: pigeonRegistrar) + return WebKitLibraryPigeonInternalProxyApiCodecWriter( + data: data, pigeonRegistrar: pigeonRegistrar) } } @@ -1477,27 +1579,36 @@ class WebKitLibraryPigeonCodec: FlutterStandardMessageCodec, @unchecked Sendable } protocol PigeonApiDelegateURLRequest { - func pigeonDefaultConstructor(pigeonApi: PigeonApiURLRequest, url: String) throws -> URLRequestWrapper + func pigeonDefaultConstructor(pigeonApi: PigeonApiURLRequest, url: String) throws + -> URLRequestWrapper /// The URL being requested. func getUrl(pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper) throws -> String? /// The HTTP request method. - func setHttpMethod(pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper, method: String?) throws + func setHttpMethod( + pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper, method: String?) throws /// The HTTP request method. - func getHttpMethod(pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper) throws -> String? + func getHttpMethod(pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper) throws + -> String? /// The request body. - func setHttpBody(pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper, body: FlutterStandardTypedData?) throws + func setHttpBody( + pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper, + body: FlutterStandardTypedData?) throws /// The request body. - func getHttpBody(pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper) throws -> FlutterStandardTypedData? + func getHttpBody(pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper) throws + -> FlutterStandardTypedData? /// A dictionary containing all of the HTTP header fields for a request. - func setAllHttpHeaderFields(pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper, fields: [String: String]?) throws + func setAllHttpHeaderFields( + pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper, fields: [String: String]?) + throws /// A dictionary containing all of the HTTP header fields for a request. - func getAllHttpHeaderFields(pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper) throws -> [String: String]? + func getAllHttpHeaderFields(pigeonApi: PigeonApiURLRequest, pigeonInstance: URLRequestWrapper) + throws -> [String: String]? } protocol PigeonApiProtocolURLRequest { } -final class PigeonApiURLRequest: PigeonApiProtocolURLRequest { +final class PigeonApiURLRequest: PigeonApiProtocolURLRequest { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateURLRequest ///An implementation of [NSObject] used to access callback methods @@ -1505,17 +1616,23 @@ final class PigeonApiURLRequest: PigeonApiProtocolURLRequest { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateURLRequest) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateURLRequest) + { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiURLRequest?) { + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiURLRequest? + ) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.pigeon_defaultConstructor", binaryMessenger: binaryMessenger, codec: codec) + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.pigeon_defaultConstructor", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { pigeonDefaultConstructorChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1523,8 +1640,8 @@ final class PigeonApiURLRequest: PigeonApiProtocolURLRequest { let urlArg = args[1] as! String do { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( -try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api, url: urlArg), -withIdentifier: pigeonIdentifierArg) + try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api, url: urlArg), + withIdentifier: pigeonIdentifierArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -1533,13 +1650,16 @@ withIdentifier: pigeonIdentifierArg) } else { pigeonDefaultConstructorChannel.setMessageHandler(nil) } - let getUrlChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.getUrl", binaryMessenger: binaryMessenger, codec: codec) + let getUrlChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.getUrl", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { getUrlChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! URLRequestWrapper do { - let result = try api.pigeonDelegate.getUrl(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + let result = try api.pigeonDelegate.getUrl( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -1548,14 +1668,17 @@ withIdentifier: pigeonIdentifierArg) } else { getUrlChannel.setMessageHandler(nil) } - let setHttpMethodChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.setHttpMethod", binaryMessenger: binaryMessenger, codec: codec) + let setHttpMethodChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.setHttpMethod", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { setHttpMethodChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! URLRequestWrapper let methodArg: String? = nilOrValue(args[1]) do { - try api.pigeonDelegate.setHttpMethod(pigeonApi: api, pigeonInstance: pigeonInstanceArg, method: methodArg) + try api.pigeonDelegate.setHttpMethod( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, method: methodArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -1564,13 +1687,16 @@ withIdentifier: pigeonIdentifierArg) } else { setHttpMethodChannel.setMessageHandler(nil) } - let getHttpMethodChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.getHttpMethod", binaryMessenger: binaryMessenger, codec: codec) + let getHttpMethodChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.getHttpMethod", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { getHttpMethodChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! URLRequestWrapper do { - let result = try api.pigeonDelegate.getHttpMethod(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + let result = try api.pigeonDelegate.getHttpMethod( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -1579,14 +1705,17 @@ withIdentifier: pigeonIdentifierArg) } else { getHttpMethodChannel.setMessageHandler(nil) } - let setHttpBodyChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.setHttpBody", binaryMessenger: binaryMessenger, codec: codec) + let setHttpBodyChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.setHttpBody", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { setHttpBodyChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! URLRequestWrapper let bodyArg: FlutterStandardTypedData? = nilOrValue(args[1]) do { - try api.pigeonDelegate.setHttpBody(pigeonApi: api, pigeonInstance: pigeonInstanceArg, body: bodyArg) + try api.pigeonDelegate.setHttpBody( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, body: bodyArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -1595,13 +1724,16 @@ withIdentifier: pigeonIdentifierArg) } else { setHttpBodyChannel.setMessageHandler(nil) } - let getHttpBodyChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.getHttpBody", binaryMessenger: binaryMessenger, codec: codec) + let getHttpBodyChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.getHttpBody", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { getHttpBodyChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! URLRequestWrapper do { - let result = try api.pigeonDelegate.getHttpBody(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + let result = try api.pigeonDelegate.getHttpBody( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -1610,14 +1742,17 @@ withIdentifier: pigeonIdentifierArg) } else { getHttpBodyChannel.setMessageHandler(nil) } - let setAllHttpHeaderFieldsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.setAllHttpHeaderFields", binaryMessenger: binaryMessenger, codec: codec) + let setAllHttpHeaderFieldsChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.setAllHttpHeaderFields", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { setAllHttpHeaderFieldsChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! URLRequestWrapper let fieldsArg: [String: String]? = nilOrValue(args[1]) do { - try api.pigeonDelegate.setAllHttpHeaderFields(pigeonApi: api, pigeonInstance: pigeonInstanceArg, fields: fieldsArg) + try api.pigeonDelegate.setAllHttpHeaderFields( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, fields: fieldsArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -1626,13 +1761,16 @@ withIdentifier: pigeonIdentifierArg) } else { setAllHttpHeaderFieldsChannel.setMessageHandler(nil) } - let getAllHttpHeaderFieldsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.getAllHttpHeaderFields", binaryMessenger: binaryMessenger, codec: codec) + let getAllHttpHeaderFieldsChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLRequest.getAllHttpHeaderFields", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { getAllHttpHeaderFieldsChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! URLRequestWrapper do { - let result = try api.pigeonDelegate.getAllHttpHeaderFields(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + let result = try api.pigeonDelegate.getAllHttpHeaderFields( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -1644,21 +1782,26 @@ withIdentifier: pigeonIdentifierArg) } ///Creates a Dart instance of URLRequest and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: URLRequestWrapper, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: URLRequestWrapper, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeonInstance as AnyObject) + } 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) + 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))) @@ -1678,13 +1821,14 @@ withIdentifier: pigeonIdentifierArg) } protocol PigeonApiDelegateHTTPURLResponse { /// The response’s HTTP status code. - func statusCode(pigeonApi: PigeonApiHTTPURLResponse, pigeonInstance: HTTPURLResponse) throws -> Int64 + func statusCode(pigeonApi: PigeonApiHTTPURLResponse, pigeonInstance: HTTPURLResponse) throws + -> Int64 } protocol PigeonApiProtocolHTTPURLResponse { } -final class PigeonApiHTTPURLResponse: PigeonApiProtocolHTTPURLResponse { +final class PigeonApiHTTPURLResponse: PigeonApiProtocolHTTPURLResponse { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateHTTPURLResponse ///An implementation of [URLResponse] used to access callback methods @@ -1692,27 +1836,36 @@ final class PigeonApiHTTPURLResponse: PigeonApiProtocolHTTPURLResponse { return pigeonRegistrar.apiDelegate.pigeonApiURLResponse(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateHTTPURLResponse) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateHTTPURLResponse + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } ///Creates a Dart instance of HTTPURLResponse and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: HTTPURLResponse, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: HTTPURLResponse, 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) { + } 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) + } 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) + 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))) @@ -1736,7 +1889,7 @@ open class PigeonApiDelegateURLResponse { protocol PigeonApiProtocolURLResponse { } -final class PigeonApiURLResponse: PigeonApiProtocolURLResponse { +final class PigeonApiURLResponse: PigeonApiProtocolURLResponse { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateURLResponse ///An implementation of [NSObject] used to access callback methods @@ -1744,26 +1897,33 @@ final class PigeonApiURLResponse: PigeonApiProtocolURLResponse { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateURLResponse) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateURLResponse + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } ///Creates a Dart instance of URLResponse and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: URLResponse, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: URLResponse, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeonInstance as AnyObject) + } 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) + 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))) @@ -1784,20 +1944,25 @@ final class PigeonApiURLResponse: PigeonApiProtocolURLResponse { protocol PigeonApiDelegateWKUserScript { /// Creates a user script object that contains the specified source code and /// attributes. - func pigeonDefaultConstructor(pigeonApi: PigeonApiWKUserScript, source: String, injectionTime: UserScriptInjectionTime, isForMainFrameOnly: Bool) throws -> WKUserScript + func pigeonDefaultConstructor( + pigeonApi: PigeonApiWKUserScript, source: String, injectionTime: UserScriptInjectionTime, + isForMainFrameOnly: Bool + ) throws -> WKUserScript /// The script’s source code. func source(pigeonApi: PigeonApiWKUserScript, pigeonInstance: WKUserScript) throws -> String /// The time at which to inject the script into the webpage. - func injectionTime(pigeonApi: PigeonApiWKUserScript, pigeonInstance: WKUserScript) throws -> UserScriptInjectionTime + func injectionTime(pigeonApi: PigeonApiWKUserScript, pigeonInstance: WKUserScript) throws + -> UserScriptInjectionTime /// A Boolean value that indicates whether to inject the script into the main /// frame or all frames. - func isForMainFrameOnly(pigeonApi: PigeonApiWKUserScript, pigeonInstance: WKUserScript) throws -> Bool + func isForMainFrameOnly(pigeonApi: PigeonApiWKUserScript, pigeonInstance: WKUserScript) throws + -> Bool } protocol PigeonApiProtocolWKUserScript { } -final class PigeonApiWKUserScript: PigeonApiProtocolWKUserScript { +final class PigeonApiWKUserScript: PigeonApiProtocolWKUserScript { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKUserScript ///An implementation of [NSObject] used to access callback methods @@ -1805,17 +1970,24 @@ final class PigeonApiWKUserScript: PigeonApiProtocolWKUserScript { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKUserScript) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKUserScript + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKUserScript?) { + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKUserScript? + ) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserScript.pigeon_defaultConstructor", binaryMessenger: binaryMessenger, codec: codec) + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserScript.pigeon_defaultConstructor", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { pigeonDefaultConstructorChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1825,8 +1997,10 @@ final class PigeonApiWKUserScript: PigeonApiProtocolWKUserScript { let isForMainFrameOnlyArg = args[3] as! Bool do { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( -try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api, source: sourceArg, injectionTime: injectionTimeArg, isForMainFrameOnly: isForMainFrameOnlyArg), -withIdentifier: pigeonIdentifierArg) + try api.pigeonDelegate.pigeonDefaultConstructor( + pigeonApi: api, source: sourceArg, injectionTime: injectionTimeArg, + isForMainFrameOnly: isForMainFrameOnlyArg), + withIdentifier: pigeonIdentifierArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -1838,25 +2012,34 @@ withIdentifier: pigeonIdentifierArg) } ///Creates a Dart instance of WKUserScript and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: WKUserScript, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: WKUserScript, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeonInstance as AnyObject) + } 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 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 + 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 @@ -1875,19 +2058,22 @@ withIdentifier: pigeonIdentifierArg) } protocol PigeonApiDelegateWKNavigationAction { /// The URL request object associated with the navigation action. - func request(pigeonApi: PigeonApiWKNavigationAction, pigeonInstance: WKNavigationAction) throws -> URLRequestWrapper + func request(pigeonApi: PigeonApiWKNavigationAction, pigeonInstance: WKNavigationAction) throws + -> URLRequestWrapper /// The frame in which to display the new content. /// /// If the target of the navigation is a new window, this property is nil. - func targetFrame(pigeonApi: PigeonApiWKNavigationAction, pigeonInstance: WKNavigationAction) throws -> WKFrameInfo? + func targetFrame(pigeonApi: PigeonApiWKNavigationAction, pigeonInstance: WKNavigationAction) + throws -> WKFrameInfo? /// The type of action that triggered the navigation. - func navigationType(pigeonApi: PigeonApiWKNavigationAction, pigeonInstance: WKNavigationAction) throws -> NavigationType + func navigationType(pigeonApi: PigeonApiWKNavigationAction, pigeonInstance: WKNavigationAction) + throws -> NavigationType } protocol PigeonApiProtocolWKNavigationAction { } -final class PigeonApiWKNavigationAction: PigeonApiProtocolWKNavigationAction { +final class PigeonApiWKNavigationAction: PigeonApiProtocolWKNavigationAction { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKNavigationAction ///An implementation of [NSObject] used to access callback methods @@ -1895,30 +2081,42 @@ final class PigeonApiWKNavigationAction: PigeonApiProtocolWKNavigationAction { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKNavigationAction) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateWKNavigationAction + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } ///Creates a Dart instance of WKNavigationAction and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: WKNavigationAction, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: WKNavigationAction, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeonInstance as AnyObject) + } 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 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 + 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 @@ -1937,16 +2135,19 @@ final class PigeonApiWKNavigationAction: PigeonApiProtocolWKNavigationAction { } protocol PigeonApiDelegateWKNavigationResponse { /// The frame’s response. - func response(pigeonApi: PigeonApiWKNavigationResponse, pigeonInstance: WKNavigationResponse) throws -> URLResponse + func response(pigeonApi: PigeonApiWKNavigationResponse, pigeonInstance: WKNavigationResponse) + throws -> URLResponse /// A Boolean value that indicates whether the response targets the web view’s /// main frame. - func isForMainFrame(pigeonApi: PigeonApiWKNavigationResponse, pigeonInstance: WKNavigationResponse) throws -> Bool + func isForMainFrame( + pigeonApi: PigeonApiWKNavigationResponse, pigeonInstance: WKNavigationResponse + ) throws -> Bool } protocol PigeonApiProtocolWKNavigationResponse { } -final class PigeonApiWKNavigationResponse: PigeonApiProtocolWKNavigationResponse { +final class PigeonApiWKNavigationResponse: PigeonApiProtocolWKNavigationResponse { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKNavigationResponse ///An implementation of [NSObject] used to access callback methods @@ -1954,29 +2155,40 @@ final class PigeonApiWKNavigationResponse: PigeonApiProtocolWKNavigationResponse return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKNavigationResponse) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateWKNavigationResponse + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } ///Creates a Dart instance of WKNavigationResponse and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: WKNavigationResponse, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: WKNavigationResponse, 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) { + } 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) + } 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 + 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 @@ -1998,13 +2210,14 @@ protocol PigeonApiDelegateWKFrameInfo { /// or a subframe. func isMainFrame(pigeonApi: PigeonApiWKFrameInfo, pigeonInstance: WKFrameInfo) throws -> Bool /// The frame’s current request. - func request(pigeonApi: PigeonApiWKFrameInfo, pigeonInstance: WKFrameInfo) throws -> URLRequestWrapper? + func request(pigeonApi: PigeonApiWKFrameInfo, pigeonInstance: WKFrameInfo) throws + -> URLRequestWrapper? } protocol PigeonApiProtocolWKFrameInfo { } -final class PigeonApiWKFrameInfo: PigeonApiProtocolWKFrameInfo { +final class PigeonApiWKFrameInfo: PigeonApiProtocolWKFrameInfo { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKFrameInfo ///An implementation of [NSObject] used to access callback methods @@ -2012,28 +2225,36 @@ final class PigeonApiWKFrameInfo: PigeonApiProtocolWKFrameInfo { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKFrameInfo) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKFrameInfo + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } ///Creates a Dart instance of WKFrameInfo and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: WKFrameInfo, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: WKFrameInfo, 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) { + } 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) + } 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) + 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))) @@ -2063,7 +2284,7 @@ protocol PigeonApiDelegateNSError { protocol PigeonApiProtocolNSError { } -final class PigeonApiNSError: PigeonApiProtocolNSError { +final class PigeonApiNSError: PigeonApiProtocolNSError { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateNSError ///An implementation of [NSObject] used to access callback methods @@ -2076,25 +2297,32 @@ final class PigeonApiNSError: PigeonApiProtocolNSError { self.pigeonDelegate = delegate } ///Creates a Dart instance of NSError and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: NSError, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: NSError, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeonInstance as AnyObject) + } 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 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 + 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 @@ -2121,7 +2349,7 @@ protocol PigeonApiDelegateWKScriptMessage { protocol PigeonApiProtocolWKScriptMessage { } -final class PigeonApiWKScriptMessage: PigeonApiProtocolWKScriptMessage { +final class PigeonApiWKScriptMessage: PigeonApiProtocolWKScriptMessage { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKScriptMessage ///An implementation of [NSObject] used to access callback methods @@ -2129,28 +2357,36 @@ final class PigeonApiWKScriptMessage: PigeonApiProtocolWKScriptMessage { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKScriptMessage) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateWKScriptMessage + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } ///Creates a Dart instance of WKScriptMessage and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: WKScriptMessage, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: WKScriptMessage, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeonInstance as AnyObject) + } 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) + 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))) @@ -2174,13 +2410,14 @@ protocol PigeonApiDelegateWKSecurityOrigin { /// The security origin's port. func port(pigeonApi: PigeonApiWKSecurityOrigin, pigeonInstance: WKSecurityOrigin) throws -> Int64 /// The security origin's protocol. - func securityProtocol(pigeonApi: PigeonApiWKSecurityOrigin, pigeonInstance: WKSecurityOrigin) throws -> String + func securityProtocol(pigeonApi: PigeonApiWKSecurityOrigin, pigeonInstance: WKSecurityOrigin) + throws -> String } protocol PigeonApiProtocolWKSecurityOrigin { } -final class PigeonApiWKSecurityOrigin: PigeonApiProtocolWKSecurityOrigin { +final class PigeonApiWKSecurityOrigin: PigeonApiProtocolWKSecurityOrigin { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKSecurityOrigin ///An implementation of [NSObject] used to access callback methods @@ -2188,30 +2425,40 @@ final class PigeonApiWKSecurityOrigin: PigeonApiProtocolWKSecurityOrigin { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKSecurityOrigin) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateWKSecurityOrigin + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } ///Creates a Dart instance of WKSecurityOrigin and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: WKSecurityOrigin, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: WKSecurityOrigin, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeonInstance as AnyObject) + } 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 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 + 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 @@ -2229,15 +2476,18 @@ final class PigeonApiWKSecurityOrigin: PigeonApiProtocolWKSecurityOrigin { } } protocol PigeonApiDelegateHTTPCookie { - func pigeonDefaultConstructor(pigeonApi: PigeonApiHTTPCookie, properties: [HttpCookiePropertyKey: Any]) throws -> HTTPCookie + func pigeonDefaultConstructor( + pigeonApi: PigeonApiHTTPCookie, properties: [HttpCookiePropertyKey: Any] + ) throws -> HTTPCookie /// The cookie’s properties. - func getProperties(pigeonApi: PigeonApiHTTPCookie, pigeonInstance: HTTPCookie) throws -> [HttpCookiePropertyKey: Any]? + func getProperties(pigeonApi: PigeonApiHTTPCookie, pigeonInstance: HTTPCookie) throws + -> [HttpCookiePropertyKey: Any]? } protocol PigeonApiProtocolHTTPCookie { } -final class PigeonApiHTTPCookie: PigeonApiProtocolHTTPCookie { +final class PigeonApiHTTPCookie: PigeonApiProtocolHTTPCookie { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateHTTPCookie ///An implementation of [NSObject] used to access callback methods @@ -2245,17 +2495,23 @@ final class PigeonApiHTTPCookie: PigeonApiProtocolHTTPCookie { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateHTTPCookie) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateHTTPCookie) + { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiHTTPCookie?) { + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiHTTPCookie? + ) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.HTTPCookie.pigeon_defaultConstructor", binaryMessenger: binaryMessenger, codec: codec) + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.HTTPCookie.pigeon_defaultConstructor", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { pigeonDefaultConstructorChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2263,8 +2519,9 @@ final class PigeonApiHTTPCookie: PigeonApiProtocolHTTPCookie { let propertiesArg = args[1] as? [HttpCookiePropertyKey: Any] do { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( -try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api, properties: propertiesArg!), -withIdentifier: pigeonIdentifierArg) + try api.pigeonDelegate.pigeonDefaultConstructor( + pigeonApi: api, properties: propertiesArg!), + withIdentifier: pigeonIdentifierArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -2273,13 +2530,16 @@ withIdentifier: pigeonIdentifierArg) } else { pigeonDefaultConstructorChannel.setMessageHandler(nil) } - let getPropertiesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.HTTPCookie.getProperties", binaryMessenger: binaryMessenger, codec: codec) + let getPropertiesChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.HTTPCookie.getProperties", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { getPropertiesChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! HTTPCookie do { - let result = try api.pigeonDelegate.getProperties(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + let result = try api.pigeonDelegate.getProperties( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -2291,21 +2551,26 @@ withIdentifier: pigeonIdentifierArg) } ///Creates a Dart instance of HTTPCookie and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: HTTPCookie, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: HTTPCookie, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeonInstance as AnyObject) + } 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) + 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))) @@ -2324,31 +2589,51 @@ withIdentifier: pigeonIdentifierArg) } } protocol PigeonApiDelegateAuthenticationChallengeResponse { - func pigeonDefaultConstructor(pigeonApi: PigeonApiAuthenticationChallengeResponse, disposition: UrlSessionAuthChallengeDisposition, credential: URLCredential?) throws -> AuthenticationChallengeResponse + func pigeonDefaultConstructor( + pigeonApi: PigeonApiAuthenticationChallengeResponse, + disposition: UrlSessionAuthChallengeDisposition, credential: URLCredential? + ) throws -> AuthenticationChallengeResponse /// The option to use to handle the challenge. - func disposition(pigeonApi: PigeonApiAuthenticationChallengeResponse, pigeonInstance: AuthenticationChallengeResponse) throws -> UrlSessionAuthChallengeDisposition + func disposition( + pigeonApi: PigeonApiAuthenticationChallengeResponse, + pigeonInstance: AuthenticationChallengeResponse + ) throws -> UrlSessionAuthChallengeDisposition /// The credential to use for authentication when the disposition parameter /// contains the value URLSession.AuthChallengeDisposition.useCredential. - func credential(pigeonApi: PigeonApiAuthenticationChallengeResponse, pigeonInstance: AuthenticationChallengeResponse) throws -> URLCredential? + func credential( + pigeonApi: PigeonApiAuthenticationChallengeResponse, + pigeonInstance: AuthenticationChallengeResponse + ) throws -> URLCredential? } protocol PigeonApiProtocolAuthenticationChallengeResponse { } -final class PigeonApiAuthenticationChallengeResponse: PigeonApiProtocolAuthenticationChallengeResponse { +final class PigeonApiAuthenticationChallengeResponse: + PigeonApiProtocolAuthenticationChallengeResponse +{ unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateAuthenticationChallengeResponse - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateAuthenticationChallengeResponse) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateAuthenticationChallengeResponse + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiAuthenticationChallengeResponse?) { + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiAuthenticationChallengeResponse? + ) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.AuthenticationChallengeResponse.pigeon_defaultConstructor", binaryMessenger: binaryMessenger, codec: codec) + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.AuthenticationChallengeResponse.pigeon_defaultConstructor", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { pigeonDefaultConstructorChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2357,8 +2642,9 @@ final class PigeonApiAuthenticationChallengeResponse: PigeonApiProtocolAuthentic let credentialArg: URLCredential? = nilOrValue(args[2]) do { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( -try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api, disposition: dispositionArg, credential: credentialArg), -withIdentifier: pigeonIdentifierArg) + try api.pigeonDelegate.pigeonDefaultConstructor( + pigeonApi: api, disposition: dispositionArg, credential: credentialArg), + withIdentifier: pigeonIdentifierArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -2370,24 +2656,33 @@ withIdentifier: pigeonIdentifierArg) } ///Creates a Dart instance of AuthenticationChallengeResponse and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: AuthenticationChallengeResponse, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: AuthenticationChallengeResponse, + 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) { + } 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) + } 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 + 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 @@ -2408,15 +2703,19 @@ protocol PigeonApiDelegateWKWebsiteDataStore { /// The default data store, which stores data persistently to disk. func defaultDataStore(pigeonApi: PigeonApiWKWebsiteDataStore) throws -> WKWebsiteDataStore /// The object that manages the HTTP cookies for your website. - func httpCookieStore(pigeonApi: PigeonApiWKWebsiteDataStore, pigeonInstance: WKWebsiteDataStore) throws -> WKHTTPCookieStore + func httpCookieStore(pigeonApi: PigeonApiWKWebsiteDataStore, pigeonInstance: WKWebsiteDataStore) + throws -> WKHTTPCookieStore /// Removes the specified types of website data from one or more data records. - func removeDataOfTypes(pigeonApi: PigeonApiWKWebsiteDataStore, pigeonInstance: WKWebsiteDataStore, dataTypes: [WebsiteDataType], modificationTimeInSecondsSinceEpoch: Double, completion: @escaping (Result) -> Void) + func removeDataOfTypes( + pigeonApi: PigeonApiWKWebsiteDataStore, pigeonInstance: WKWebsiteDataStore, + dataTypes: [WebsiteDataType], modificationTimeInSecondsSinceEpoch: Double, + completion: @escaping (Result) -> Void) } protocol PigeonApiProtocolWKWebsiteDataStore { } -final class PigeonApiWKWebsiteDataStore: PigeonApiProtocolWKWebsiteDataStore { +final class PigeonApiWKWebsiteDataStore: PigeonApiProtocolWKWebsiteDataStore { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKWebsiteDataStore ///An implementation of [NSObject] used to access callback methods @@ -2424,23 +2723,33 @@ final class PigeonApiWKWebsiteDataStore: PigeonApiProtocolWKWebsiteDataStore { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKWebsiteDataStore) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateWKWebsiteDataStore + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKWebsiteDataStore?) { + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKWebsiteDataStore? + ) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let defaultDataStoreChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStore.defaultDataStore", binaryMessenger: binaryMessenger, codec: codec) + let defaultDataStoreChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStore.defaultDataStore", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { defaultDataStoreChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonIdentifierArg = args[0] as! Int64 do { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance(try api.pigeonDelegate.defaultDataStore(pigeonApi: api), withIdentifier: pigeonIdentifierArg) + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + try api.pigeonDelegate.defaultDataStore(pigeonApi: api), + withIdentifier: pigeonIdentifierArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -2449,14 +2758,19 @@ final class PigeonApiWKWebsiteDataStore: PigeonApiProtocolWKWebsiteDataStore { } else { defaultDataStoreChannel.setMessageHandler(nil) } - let httpCookieStoreChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStore.httpCookieStore", binaryMessenger: binaryMessenger, codec: codec) + let httpCookieStoreChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStore.httpCookieStore", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { httpCookieStoreChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKWebsiteDataStore let pigeonIdentifierArg = args[1] as! Int64 do { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance(try api.pigeonDelegate.httpCookieStore(pigeonApi: api, pigeonInstance: pigeonInstanceArg), withIdentifier: pigeonIdentifierArg) + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + try api.pigeonDelegate.httpCookieStore( + pigeonApi: api, pigeonInstance: pigeonInstanceArg), + withIdentifier: pigeonIdentifierArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -2465,14 +2779,19 @@ final class PigeonApiWKWebsiteDataStore: PigeonApiProtocolWKWebsiteDataStore { } else { httpCookieStoreChannel.setMessageHandler(nil) } - let removeDataOfTypesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStore.removeDataOfTypes", binaryMessenger: binaryMessenger, codec: codec) + let removeDataOfTypesChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStore.removeDataOfTypes", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { removeDataOfTypesChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKWebsiteDataStore let dataTypesArg = args[1] as! [WebsiteDataType] let modificationTimeInSecondsSinceEpochArg = args[2] as! Double - api.pigeonDelegate.removeDataOfTypes(pigeonApi: api, pigeonInstance: pigeonInstanceArg, dataTypes: dataTypesArg, modificationTimeInSecondsSinceEpoch: modificationTimeInSecondsSinceEpochArg) { result in + api.pigeonDelegate.removeDataOfTypes( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, dataTypes: dataTypesArg, + modificationTimeInSecondsSinceEpoch: modificationTimeInSecondsSinceEpochArg + ) { result in switch result { case .success(let res): reply(wrapResult(res)) @@ -2487,21 +2806,26 @@ final class PigeonApiWKWebsiteDataStore: PigeonApiProtocolWKWebsiteDataStore { } ///Creates a Dart instance of WKWebsiteDataStore and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: WKWebsiteDataStore, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: WKWebsiteDataStore, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeonInstance as AnyObject) + } 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) + 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))) @@ -2521,19 +2845,20 @@ final class PigeonApiWKWebsiteDataStore: PigeonApiProtocolWKWebsiteDataStore { } protocol PigeonApiDelegateUIView { #if !os(macOS) - /// The view’s background color. - func setBackgroundColor(pigeonApi: PigeonApiUIView, pigeonInstance: UIView, value: Int64?) throws + /// The view’s background color. + func setBackgroundColor(pigeonApi: PigeonApiUIView, pigeonInstance: UIView, value: Int64?) + throws #endif #if !os(macOS) - /// A Boolean value that determines whether the view is opaque. - func setOpaque(pigeonApi: PigeonApiUIView, pigeonInstance: UIView, opaque: Bool) throws + /// A Boolean value that determines whether the view is opaque. + func setOpaque(pigeonApi: PigeonApiUIView, pigeonInstance: UIView, opaque: Bool) throws #endif } protocol PigeonApiProtocolUIView { } -final class PigeonApiUIView: PigeonApiProtocolUIView { +final class PigeonApiUIView: PigeonApiProtocolUIView { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateUIView ///An implementation of [NSObject] used to access callback methods @@ -2549,152 +2874,176 @@ final class PigeonApiUIView: PigeonApiProtocolUIView { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() #if !os(macOS) - let setBackgroundColorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIView.setBackgroundColor", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setBackgroundColorChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! UIView - let valueArg: Int64? = nilOrValue(args[1]) - do { - try api.pigeonDelegate.setBackgroundColor(pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let setBackgroundColorChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIView.setBackgroundColor", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setBackgroundColorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIView + let valueArg: Int64? = nilOrValue(args[1]) + do { + try api.pigeonDelegate.setBackgroundColor( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + setBackgroundColorChannel.setMessageHandler(nil) } - } else { - setBackgroundColorChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let setOpaqueChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIView.setOpaque", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setOpaqueChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! UIView - let opaqueArg = args[1] as! Bool - do { - try api.pigeonDelegate.setOpaque(pigeonApi: api, pigeonInstance: pigeonInstanceArg, opaque: opaqueArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let setOpaqueChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIView.setOpaque", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setOpaqueChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIView + let opaqueArg = args[1] as! Bool + do { + try api.pigeonDelegate.setOpaque( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, opaque: opaqueArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + setOpaqueChannel.setMessageHandler(nil) } - } else { - setOpaqueChannel.setMessageHandler(nil) - } #endif } #if !os(macOS) - ///Creates a Dart instance of UIView and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: UIView, 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.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(())) + ///Creates a Dart instance of UIView and attaches it to [pigeonInstance]. + func pigeonNewInstance( + pigeonInstance: UIView, 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.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(())) + } } } } - } #endif } protocol PigeonApiDelegateUIScrollView { #if !os(macOS) - /// The point at which the origin of the content view is offset from the - /// origin of the scroll view. - func getContentOffset(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView) throws -> [Double] + /// The point at which the origin of the content view is offset from the + /// origin of the scroll view. + func getContentOffset(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView) throws + -> [Double] #endif #if !os(macOS) - /// Move the scrolled position of your view. - /// - /// Convenience method to synchronize change to the x and y scroll position. - func scrollBy(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, x: Double, y: Double) throws + /// Move the scrolled position of your view. + /// + /// Convenience method to synchronize change to the x and y scroll position. + func scrollBy( + pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, x: Double, y: Double) throws #endif #if !os(macOS) - /// The point at which the origin of the content view is offset from the - /// origin of the scroll view. - func setContentOffset(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, x: Double, y: Double) throws + /// The point at which the origin of the content view is offset from the + /// origin of the scroll view. + func setContentOffset( + pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, x: Double, y: Double) throws #endif #if !os(macOS) - /// The delegate of the scroll view. - func setDelegate(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, delegate: UIScrollViewDelegate?) throws + /// The delegate of the scroll view. + func setDelegate( + pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, + delegate: UIScrollViewDelegate?) throws #endif #if !os(macOS) - /// Whether the scroll view bounces past the edge of content and back again. - func setBounces(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws + /// Whether the scroll view bounces past the edge of content and back again. + func setBounces(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) + throws #endif #if !os(macOS) - /// Whether the scroll view bounces when it reaches the ends of its horizontal - /// axis. - func setBouncesHorizontally(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws + /// Whether the scroll view bounces when it reaches the ends of its horizontal + /// axis. + func setBouncesHorizontally( + pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws #endif #if !os(macOS) - /// Whether the scroll view bounces when it reaches the ends of its vertical - /// axis. - func setBouncesVertically(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws + /// Whether the scroll view bounces when it reaches the ends of its vertical + /// axis. + func setBouncesVertically( + pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws #endif #if !os(macOS) - /// Whether bouncing always occurs when vertical scrolling reaches the end of - /// the content. - /// - /// If the value of this property is true and `bouncesVertically` is true, the - /// scroll view allows vertical dragging even if the content is smaller than - /// the bounds of the scroll view. - func setAlwaysBounceVertical(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws + /// Whether bouncing always occurs when vertical scrolling reaches the end of + /// the content. + /// + /// If the value of this property is true and `bouncesVertically` is true, the + /// scroll view allows vertical dragging even if the content is smaller than + /// the bounds of the scroll view. + func setAlwaysBounceVertical( + pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws #endif #if !os(macOS) - /// Whether bouncing always occurs when horizontal scrolling reaches the end - /// of the content view. - /// - /// If the value of this property is true and `bouncesHorizontally` is true, - /// the scroll view allows horizontal dragging even if the content is smaller - /// than the bounds of the scroll view. - func setAlwaysBounceHorizontal(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws + /// Whether bouncing always occurs when horizontal scrolling reaches the end + /// of the content view. + /// + /// If the value of this property is true and `bouncesHorizontally` is true, + /// the scroll view allows horizontal dragging even if the content is smaller + /// than the bounds of the scroll view. + func setAlwaysBounceHorizontal( + pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws #endif #if !os(macOS) - /// Whether the vertical scroll indicator is visible. - /// - /// The default value is true. - func setShowsVerticalScrollIndicator(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws + /// Whether the vertical scroll indicator is visible. + /// + /// The default value is true. + func setShowsVerticalScrollIndicator( + pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws #endif #if !os(macOS) - /// Whether the horizontal scroll indicator is visible. - /// - /// The default value is true. - func setShowsHorizontalScrollIndicator(pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws + /// Whether the horizontal scroll indicator is visible. + /// + /// The default value is true. + func setShowsHorizontalScrollIndicator( + pigeonApi: PigeonApiUIScrollView, pigeonInstance: UIScrollView, value: Bool) throws #endif } protocol PigeonApiProtocolUIScrollView { } -final class PigeonApiUIScrollView: PigeonApiProtocolUIScrollView { +final class PigeonApiUIScrollView: PigeonApiProtocolUIScrollView { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateUIScrollView ///An implementation of [UIView] used to access callback methods @@ -2702,287 +3051,353 @@ final class PigeonApiUIScrollView: PigeonApiProtocolUIScrollView { return pigeonRegistrar.apiDelegate.pigeonApiUIView(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateUIScrollView) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateUIScrollView + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiUIScrollView?) { + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiUIScrollView? + ) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() #if !os(macOS) - let getContentOffsetChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.getContentOffset", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - getContentOffsetChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! UIScrollView - do { - let result = try api.pigeonDelegate.getContentOffset(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) + let getContentOffsetChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.getContentOffset", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getContentOffsetChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + do { + let result = try api.pigeonDelegate.getContentOffset( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } } + } else { + getContentOffsetChannel.setMessageHandler(nil) } - } else { - getContentOffsetChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let scrollByChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.scrollBy", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - scrollByChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! UIScrollView - let xArg = args[1] as! Double - let yArg = args[2] as! Double - do { - try api.pigeonDelegate.scrollBy(pigeonApi: api, pigeonInstance: pigeonInstanceArg, x: xArg, y: yArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let scrollByChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.scrollBy", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + scrollByChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + let xArg = args[1] as! Double + let yArg = args[2] as! Double + do { + try api.pigeonDelegate.scrollBy( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, x: xArg, y: yArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + scrollByChannel.setMessageHandler(nil) } - } else { - scrollByChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let setContentOffsetChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setContentOffset", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setContentOffsetChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! UIScrollView - let xArg = args[1] as! Double - let yArg = args[2] as! Double - do { - try api.pigeonDelegate.setContentOffset(pigeonApi: api, pigeonInstance: pigeonInstanceArg, x: xArg, y: yArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let setContentOffsetChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setContentOffset", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setContentOffsetChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + let xArg = args[1] as! Double + let yArg = args[2] as! Double + do { + try api.pigeonDelegate.setContentOffset( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, x: xArg, y: yArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + setContentOffsetChannel.setMessageHandler(nil) } - } else { - setContentOffsetChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let setDelegateChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setDelegate", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setDelegateChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! UIScrollView - let delegateArg: UIScrollViewDelegate? = nilOrValue(args[1]) - do { - try api.pigeonDelegate.setDelegate(pigeonApi: api, pigeonInstance: pigeonInstanceArg, delegate: delegateArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let setDelegateChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setDelegate", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setDelegateChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + let delegateArg: UIScrollViewDelegate? = nilOrValue(args[1]) + do { + try api.pigeonDelegate.setDelegate( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, delegate: delegateArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + setDelegateChannel.setMessageHandler(nil) } - } else { - setDelegateChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let setBouncesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setBounces", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setBouncesChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! UIScrollView - let valueArg = args[1] as! Bool - do { - try api.pigeonDelegate.setBounces(pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let setBouncesChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setBounces", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setBouncesChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + let valueArg = args[1] as! Bool + do { + try api.pigeonDelegate.setBounces( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + setBouncesChannel.setMessageHandler(nil) } - } else { - setBouncesChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let setBouncesHorizontallyChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setBouncesHorizontally", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setBouncesHorizontallyChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! UIScrollView - let valueArg = args[1] as! Bool - do { - try api.pigeonDelegate.setBouncesHorizontally(pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let setBouncesHorizontallyChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setBouncesHorizontally", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setBouncesHorizontallyChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + let valueArg = args[1] as! Bool + do { + try api.pigeonDelegate.setBouncesHorizontally( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + setBouncesHorizontallyChannel.setMessageHandler(nil) } - } else { - setBouncesHorizontallyChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let setBouncesVerticallyChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setBouncesVertically", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setBouncesVerticallyChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! UIScrollView - let valueArg = args[1] as! Bool - do { - try api.pigeonDelegate.setBouncesVertically(pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let setBouncesVerticallyChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setBouncesVertically", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setBouncesVerticallyChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + let valueArg = args[1] as! Bool + do { + try api.pigeonDelegate.setBouncesVertically( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + setBouncesVerticallyChannel.setMessageHandler(nil) } - } else { - setBouncesVerticallyChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let setAlwaysBounceVerticalChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setAlwaysBounceVertical", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setAlwaysBounceVerticalChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! UIScrollView - let valueArg = args[1] as! Bool - do { - try api.pigeonDelegate.setAlwaysBounceVertical(pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let setAlwaysBounceVerticalChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setAlwaysBounceVertical", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setAlwaysBounceVerticalChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + let valueArg = args[1] as! Bool + do { + try api.pigeonDelegate.setAlwaysBounceVertical( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + setAlwaysBounceVerticalChannel.setMessageHandler(nil) } - } else { - setAlwaysBounceVerticalChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let setAlwaysBounceHorizontalChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setAlwaysBounceHorizontal", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setAlwaysBounceHorizontalChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! UIScrollView - let valueArg = args[1] as! Bool - do { - try api.pigeonDelegate.setAlwaysBounceHorizontal(pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let setAlwaysBounceHorizontalChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setAlwaysBounceHorizontal", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setAlwaysBounceHorizontalChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + let valueArg = args[1] as! Bool + do { + try api.pigeonDelegate.setAlwaysBounceHorizontal( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + setAlwaysBounceHorizontalChannel.setMessageHandler(nil) } - } else { - setAlwaysBounceHorizontalChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let setShowsVerticalScrollIndicatorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setShowsVerticalScrollIndicator", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setShowsVerticalScrollIndicatorChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! UIScrollView - let valueArg = args[1] as! Bool - do { - try api.pigeonDelegate.setShowsVerticalScrollIndicator(pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let setShowsVerticalScrollIndicatorChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setShowsVerticalScrollIndicator", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setShowsVerticalScrollIndicatorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + let valueArg = args[1] as! Bool + do { + try api.pigeonDelegate.setShowsVerticalScrollIndicator( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + setShowsVerticalScrollIndicatorChannel.setMessageHandler(nil) } - } else { - setShowsVerticalScrollIndicatorChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let setShowsHorizontalScrollIndicatorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setShowsHorizontalScrollIndicator", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setShowsHorizontalScrollIndicatorChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! UIScrollView - let valueArg = args[1] as! Bool - do { - try api.pigeonDelegate.setShowsHorizontalScrollIndicator(pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let setShowsHorizontalScrollIndicatorChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollView.setShowsHorizontalScrollIndicator", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setShowsHorizontalScrollIndicatorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! UIScrollView + let valueArg = args[1] as! Bool + do { + try api.pigeonDelegate.setShowsHorizontalScrollIndicator( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, value: valueArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + setShowsHorizontalScrollIndicatorChannel.setMessageHandler(nil) } - } else { - setShowsHorizontalScrollIndicatorChannel.setMessageHandler(nil) - } #endif } #if !os(macOS) - ///Creates a Dart instance of UIScrollView and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: UIScrollView, 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.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(())) + ///Creates a Dart instance of UIScrollView and attaches it to [pigeonInstance]. + func pigeonNewInstance( + pigeonInstance: UIScrollView, 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.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(())) + } } } } - } #endif } protocol PigeonApiDelegateWKWebViewConfiguration { - func pigeonDefaultConstructor(pigeonApi: PigeonApiWKWebViewConfiguration) throws -> WKWebViewConfiguration + func pigeonDefaultConstructor(pigeonApi: PigeonApiWKWebViewConfiguration) throws + -> WKWebViewConfiguration /// The object that coordinates interactions between your app’s native code /// and the webpage’s scripts and other content. - func setUserContentController(pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, controller: WKUserContentController) throws + func setUserContentController( + pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, + controller: WKUserContentController) throws /// The object that coordinates interactions between your app’s native code /// and the webpage’s scripts and other content. - func getUserContentController(pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration) throws -> WKUserContentController + func getUserContentController( + pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration + ) throws -> WKUserContentController /// The object you use to get and set the site’s cookies and to track the /// cached data objects. - func setWebsiteDataStore(pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, dataStore: WKWebsiteDataStore) throws + func setWebsiteDataStore( + pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, + dataStore: WKWebsiteDataStore) throws /// The object you use to get and set the site’s cookies and to track the /// cached data objects. - func getWebsiteDataStore(pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration) throws -> WKWebsiteDataStore + func getWebsiteDataStore( + pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration + ) throws -> WKWebsiteDataStore /// The object that manages the preference-related settings for the web view. - func setPreferences(pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, preferences: WKPreferences) throws + func setPreferences( + pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, + preferences: WKPreferences) throws /// The object that manages the preference-related settings for the web view. - func getPreferences(pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration) throws -> WKPreferences + func getPreferences( + pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration + ) throws -> WKPreferences /// A Boolean value that indicates whether HTML5 videos play inline or use the /// native full-screen controller. - func setAllowsInlineMediaPlayback(pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, allow: Bool) throws + func setAllowsInlineMediaPlayback( + pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, allow: Bool) + throws /// A Boolean value that indicates whether the web view limits navigation to /// pages within the app’s domain. - func setLimitsNavigationsToAppBoundDomains(pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, limit: Bool) throws + func setLimitsNavigationsToAppBoundDomains( + pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, limit: Bool) + throws /// The media types that require a user gesture to begin playing. - func setMediaTypesRequiringUserActionForPlayback(pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration, type: AudiovisualMediaType) throws + 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 + func getDefaultWebpagePreferences( + pigeonApi: PigeonApiWKWebViewConfiguration, pigeonInstance: WKWebViewConfiguration + ) throws -> WKWebpagePreferences } protocol PigeonApiProtocolWKWebViewConfiguration { } -final class PigeonApiWKWebViewConfiguration: PigeonApiProtocolWKWebViewConfiguration { +final class PigeonApiWKWebViewConfiguration: PigeonApiProtocolWKWebViewConfiguration { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKWebViewConfiguration ///An implementation of [NSObject] used to access callback methods @@ -2990,25 +3405,34 @@ final class PigeonApiWKWebViewConfiguration: PigeonApiProtocolWKWebViewConfigura return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKWebViewConfiguration) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateWKWebViewConfiguration + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKWebViewConfiguration?) { + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKWebViewConfiguration? + ) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.pigeon_defaultConstructor", binaryMessenger: binaryMessenger, codec: codec) + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.pigeon_defaultConstructor", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { pigeonDefaultConstructorChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonIdentifierArg = args[0] as! Int64 do { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( -try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), -withIdentifier: pigeonIdentifierArg) + try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), + withIdentifier: pigeonIdentifierArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3017,14 +3441,18 @@ withIdentifier: pigeonIdentifierArg) } else { pigeonDefaultConstructorChannel.setMessageHandler(nil) } - let setUserContentControllerChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setUserContentController", binaryMessenger: binaryMessenger, codec: codec) + let setUserContentControllerChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setUserContentController", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { setUserContentControllerChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKWebViewConfiguration let controllerArg = args[1] as! WKUserContentController do { - try api.pigeonDelegate.setUserContentController(pigeonApi: api, pigeonInstance: pigeonInstanceArg, controller: controllerArg) + try api.pigeonDelegate.setUserContentController( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, controller: controllerArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3033,13 +3461,17 @@ withIdentifier: pigeonIdentifierArg) } else { setUserContentControllerChannel.setMessageHandler(nil) } - let getUserContentControllerChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.getUserContentController", binaryMessenger: binaryMessenger, codec: codec) + let getUserContentControllerChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.getUserContentController", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { getUserContentControllerChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKWebViewConfiguration do { - let result = try api.pigeonDelegate.getUserContentController(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + let result = try api.pigeonDelegate.getUserContentController( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -3048,14 +3480,18 @@ withIdentifier: pigeonIdentifierArg) } else { getUserContentControllerChannel.setMessageHandler(nil) } - let setWebsiteDataStoreChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setWebsiteDataStore", binaryMessenger: binaryMessenger, codec: codec) + let setWebsiteDataStoreChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setWebsiteDataStore", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { setWebsiteDataStoreChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKWebViewConfiguration let dataStoreArg = args[1] as! WKWebsiteDataStore do { - try api.pigeonDelegate.setWebsiteDataStore(pigeonApi: api, pigeonInstance: pigeonInstanceArg, dataStore: dataStoreArg) + try api.pigeonDelegate.setWebsiteDataStore( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, dataStore: dataStoreArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3064,13 +3500,17 @@ withIdentifier: pigeonIdentifierArg) } else { setWebsiteDataStoreChannel.setMessageHandler(nil) } - let getWebsiteDataStoreChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.getWebsiteDataStore", binaryMessenger: binaryMessenger, codec: codec) + let getWebsiteDataStoreChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.getWebsiteDataStore", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { getWebsiteDataStoreChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKWebViewConfiguration do { - let result = try api.pigeonDelegate.getWebsiteDataStore(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + let result = try api.pigeonDelegate.getWebsiteDataStore( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -3079,14 +3519,17 @@ withIdentifier: pigeonIdentifierArg) } else { getWebsiteDataStoreChannel.setMessageHandler(nil) } - let setPreferencesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setPreferences", binaryMessenger: binaryMessenger, codec: codec) + let setPreferencesChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setPreferences", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { setPreferencesChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKWebViewConfiguration let preferencesArg = args[1] as! WKPreferences do { - try api.pigeonDelegate.setPreferences(pigeonApi: api, pigeonInstance: pigeonInstanceArg, preferences: preferencesArg) + try api.pigeonDelegate.setPreferences( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, preferences: preferencesArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3095,13 +3538,16 @@ withIdentifier: pigeonIdentifierArg) } else { setPreferencesChannel.setMessageHandler(nil) } - let getPreferencesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.getPreferences", binaryMessenger: binaryMessenger, codec: codec) + let getPreferencesChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.getPreferences", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { getPreferencesChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKWebViewConfiguration do { - let result = try api.pigeonDelegate.getPreferences(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + let result = try api.pigeonDelegate.getPreferences( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -3110,14 +3556,18 @@ withIdentifier: pigeonIdentifierArg) } else { getPreferencesChannel.setMessageHandler(nil) } - let setAllowsInlineMediaPlaybackChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setAllowsInlineMediaPlayback", binaryMessenger: binaryMessenger, codec: codec) + let setAllowsInlineMediaPlaybackChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setAllowsInlineMediaPlayback", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { setAllowsInlineMediaPlaybackChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKWebViewConfiguration let allowArg = args[1] as! Bool do { - try api.pigeonDelegate.setAllowsInlineMediaPlayback(pigeonApi: api, pigeonInstance: pigeonInstanceArg, allow: allowArg) + try api.pigeonDelegate.setAllowsInlineMediaPlayback( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, allow: allowArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3126,14 +3576,18 @@ withIdentifier: pigeonIdentifierArg) } else { setAllowsInlineMediaPlaybackChannel.setMessageHandler(nil) } - let setLimitsNavigationsToAppBoundDomainsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setLimitsNavigationsToAppBoundDomains", binaryMessenger: binaryMessenger, codec: codec) + let setLimitsNavigationsToAppBoundDomainsChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setLimitsNavigationsToAppBoundDomains", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { setLimitsNavigationsToAppBoundDomainsChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKWebViewConfiguration let limitArg = args[1] as! Bool do { - try api.pigeonDelegate.setLimitsNavigationsToAppBoundDomains(pigeonApi: api, pigeonInstance: pigeonInstanceArg, limit: limitArg) + try api.pigeonDelegate.setLimitsNavigationsToAppBoundDomains( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, limit: limitArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3142,14 +3596,18 @@ withIdentifier: pigeonIdentifierArg) } else { setLimitsNavigationsToAppBoundDomainsChannel.setMessageHandler(nil) } - let setMediaTypesRequiringUserActionForPlaybackChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setMediaTypesRequiringUserActionForPlayback", binaryMessenger: binaryMessenger, codec: codec) + let setMediaTypesRequiringUserActionForPlaybackChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.setMediaTypesRequiringUserActionForPlayback", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { setMediaTypesRequiringUserActionForPlaybackChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKWebViewConfiguration let typeArg = args[1] as! AudiovisualMediaType do { - try api.pigeonDelegate.setMediaTypesRequiringUserActionForPlayback(pigeonApi: api, pigeonInstance: pigeonInstanceArg, type: typeArg) + try api.pigeonDelegate.setMediaTypesRequiringUserActionForPlayback( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, type: typeArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3159,13 +3617,17 @@ withIdentifier: pigeonIdentifierArg) 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) + 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) + let result = try api.pigeonDelegate.getDefaultWebpagePreferences( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -3174,16 +3636,21 @@ withIdentifier: pigeonIdentifierArg) } else { getDefaultWebpagePreferencesChannel.setMessageHandler(nil) } - } else { + } else { let getDefaultWebpagePreferencesChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfiguration.getDefaultWebpagePreferences", + 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 - ))) + 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) @@ -3192,21 +3659,27 @@ withIdentifier: pigeonIdentifierArg) } ///Creates a Dart instance of WKWebViewConfiguration and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: WKWebViewConfiguration, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: WKWebViewConfiguration, + 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeonInstance as AnyObject) + } 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) + 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))) @@ -3226,23 +3699,31 @@ withIdentifier: pigeonIdentifierArg) } protocol PigeonApiDelegateWKUserContentController { /// Installs a message handler that you can call from your JavaScript code. - func addScriptMessageHandler(pigeonApi: PigeonApiWKUserContentController, pigeonInstance: WKUserContentController, handler: WKScriptMessageHandler, name: String) throws + func addScriptMessageHandler( + pigeonApi: PigeonApiWKUserContentController, pigeonInstance: WKUserContentController, + handler: WKScriptMessageHandler, name: String) throws /// Uninstalls the custom message handler with the specified name from your /// JavaScript code. - func removeScriptMessageHandler(pigeonApi: PigeonApiWKUserContentController, pigeonInstance: WKUserContentController, name: String) throws + func removeScriptMessageHandler( + pigeonApi: PigeonApiWKUserContentController, pigeonInstance: WKUserContentController, + name: String) throws /// Uninstalls all custom message handlers associated with the user content /// controller. - func removeAllScriptMessageHandlers(pigeonApi: PigeonApiWKUserContentController, pigeonInstance: WKUserContentController) throws + func removeAllScriptMessageHandlers( + pigeonApi: PigeonApiWKUserContentController, pigeonInstance: WKUserContentController) throws /// Injects the specified script into the webpage’s content. - func addUserScript(pigeonApi: PigeonApiWKUserContentController, pigeonInstance: WKUserContentController, userScript: WKUserScript) throws + func addUserScript( + pigeonApi: PigeonApiWKUserContentController, pigeonInstance: WKUserContentController, + userScript: WKUserScript) throws /// Removes all user scripts from the web view. - func removeAllUserScripts(pigeonApi: PigeonApiWKUserContentController, pigeonInstance: WKUserContentController) throws + func removeAllUserScripts( + pigeonApi: PigeonApiWKUserContentController, pigeonInstance: WKUserContentController) throws } protocol PigeonApiProtocolWKUserContentController { } -final class PigeonApiWKUserContentController: PigeonApiProtocolWKUserContentController { +final class PigeonApiWKUserContentController: PigeonApiProtocolWKUserContentController { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKUserContentController ///An implementation of [NSObject] used to access callback methods @@ -3250,17 +3731,26 @@ final class PigeonApiWKUserContentController: PigeonApiProtocolWKUserContentCont return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKUserContentController) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateWKUserContentController + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKUserContentController?) { + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKUserContentController? + ) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let addScriptMessageHandlerChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.addScriptMessageHandler", binaryMessenger: binaryMessenger, codec: codec) + let addScriptMessageHandlerChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.addScriptMessageHandler", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { addScriptMessageHandlerChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -3268,7 +3758,8 @@ final class PigeonApiWKUserContentController: PigeonApiProtocolWKUserContentCont let handlerArg = args[1] as! WKScriptMessageHandler let nameArg = args[2] as! String do { - try api.pigeonDelegate.addScriptMessageHandler(pigeonApi: api, pigeonInstance: pigeonInstanceArg, handler: handlerArg, name: nameArg) + try api.pigeonDelegate.addScriptMessageHandler( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, handler: handlerArg, name: nameArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3277,14 +3768,18 @@ final class PigeonApiWKUserContentController: PigeonApiProtocolWKUserContentCont } else { addScriptMessageHandlerChannel.setMessageHandler(nil) } - let removeScriptMessageHandlerChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.removeScriptMessageHandler", binaryMessenger: binaryMessenger, codec: codec) + let removeScriptMessageHandlerChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.removeScriptMessageHandler", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { removeScriptMessageHandlerChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKUserContentController let nameArg = args[1] as! String do { - try api.pigeonDelegate.removeScriptMessageHandler(pigeonApi: api, pigeonInstance: pigeonInstanceArg, name: nameArg) + try api.pigeonDelegate.removeScriptMessageHandler( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, name: nameArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3293,13 +3788,17 @@ final class PigeonApiWKUserContentController: PigeonApiProtocolWKUserContentCont } else { removeScriptMessageHandlerChannel.setMessageHandler(nil) } - let removeAllScriptMessageHandlersChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.removeAllScriptMessageHandlers", binaryMessenger: binaryMessenger, codec: codec) + let removeAllScriptMessageHandlersChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.removeAllScriptMessageHandlers", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { removeAllScriptMessageHandlersChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKUserContentController do { - try api.pigeonDelegate.removeAllScriptMessageHandlers(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + try api.pigeonDelegate.removeAllScriptMessageHandlers( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3308,14 +3807,17 @@ final class PigeonApiWKUserContentController: PigeonApiProtocolWKUserContentCont } else { removeAllScriptMessageHandlersChannel.setMessageHandler(nil) } - let addUserScriptChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.addUserScript", binaryMessenger: binaryMessenger, codec: codec) + let addUserScriptChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.addUserScript", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { addUserScriptChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKUserContentController let userScriptArg = args[1] as! WKUserScript do { - try api.pigeonDelegate.addUserScript(pigeonApi: api, pigeonInstance: pigeonInstanceArg, userScript: userScriptArg) + try api.pigeonDelegate.addUserScript( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, userScript: userScriptArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3324,13 +3826,17 @@ final class PigeonApiWKUserContentController: PigeonApiProtocolWKUserContentCont } else { addUserScriptChannel.setMessageHandler(nil) } - let removeAllUserScriptsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.removeAllUserScripts", binaryMessenger: binaryMessenger, codec: codec) + let removeAllUserScriptsChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.removeAllUserScripts", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { removeAllUserScriptsChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKUserContentController do { - try api.pigeonDelegate.removeAllUserScripts(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + try api.pigeonDelegate.removeAllUserScripts( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3342,21 +3848,27 @@ final class PigeonApiWKUserContentController: PigeonApiProtocolWKUserContentCont } ///Creates a Dart instance of WKUserContentController and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: WKUserContentController, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: WKUserContentController, + 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeonInstance as AnyObject) + } 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) + 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))) @@ -3376,13 +3888,14 @@ final class PigeonApiWKUserContentController: PigeonApiProtocolWKUserContentCont } protocol PigeonApiDelegateWKPreferences { /// A Boolean value that indicates whether JavaScript is enabled. - func setJavaScriptEnabled(pigeonApi: PigeonApiWKPreferences, pigeonInstance: WKPreferences, enabled: Bool) throws + func setJavaScriptEnabled( + pigeonApi: PigeonApiWKPreferences, pigeonInstance: WKPreferences, enabled: Bool) throws } protocol PigeonApiProtocolWKPreferences { } -final class PigeonApiWKPreferences: PigeonApiProtocolWKPreferences { +final class PigeonApiWKPreferences: PigeonApiProtocolWKPreferences { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKPreferences ///An implementation of [NSObject] used to access callback methods @@ -3390,24 +3903,32 @@ final class PigeonApiWKPreferences: PigeonApiProtocolWKPreferences { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKPreferences) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKPreferences + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKPreferences?) { + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKPreferences? + ) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let setJavaScriptEnabledChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKPreferences.setJavaScriptEnabled", binaryMessenger: binaryMessenger, codec: codec) + let setJavaScriptEnabledChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKPreferences.setJavaScriptEnabled", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { setJavaScriptEnabledChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKPreferences let enabledArg = args[1] as! Bool do { - try api.pigeonDelegate.setJavaScriptEnabled(pigeonApi: api, pigeonInstance: pigeonInstanceArg, enabled: enabledArg) + try api.pigeonDelegate.setJavaScriptEnabled( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, enabled: enabledArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3419,21 +3940,26 @@ final class PigeonApiWKPreferences: PigeonApiProtocolWKPreferences { } ///Creates a Dart instance of WKPreferences and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: WKPreferences, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: WKPreferences, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeonInstance as AnyObject) + } 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) + 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))) @@ -3452,15 +3978,19 @@ final class PigeonApiWKPreferences: PigeonApiProtocolWKPreferences { } } protocol PigeonApiDelegateWKScriptMessageHandler { - func pigeonDefaultConstructor(pigeonApi: PigeonApiWKScriptMessageHandler) throws -> WKScriptMessageHandler + func pigeonDefaultConstructor(pigeonApi: PigeonApiWKScriptMessageHandler) throws + -> WKScriptMessageHandler } protocol PigeonApiProtocolWKScriptMessageHandler { /// Tells the handler that a webpage sent a script message. - func didReceiveScriptMessage(pigeonInstance pigeonInstanceArg: WKScriptMessageHandler, controller controllerArg: WKUserContentController, message messageArg: WKScriptMessage, completion: @escaping (Result) -> Void) + func didReceiveScriptMessage( + pigeonInstance pigeonInstanceArg: WKScriptMessageHandler, + controller controllerArg: WKUserContentController, message messageArg: WKScriptMessage, + completion: @escaping (Result) -> Void) } -final class PigeonApiWKScriptMessageHandler: PigeonApiProtocolWKScriptMessageHandler { +final class PigeonApiWKScriptMessageHandler: PigeonApiProtocolWKScriptMessageHandler { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKScriptMessageHandler ///An implementation of [NSObject] used to access callback methods @@ -3468,25 +3998,34 @@ final class PigeonApiWKScriptMessageHandler: PigeonApiProtocolWKScriptMessageHan return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKScriptMessageHandler) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateWKScriptMessageHandler + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKScriptMessageHandler?) { + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKScriptMessageHandler? + ) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKScriptMessageHandler.pigeon_defaultConstructor", binaryMessenger: binaryMessenger, codec: codec) + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.WKScriptMessageHandler.pigeon_defaultConstructor", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { pigeonDefaultConstructorChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonIdentifierArg = args[0] as! Int64 do { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( -try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), -withIdentifier: pigeonIdentifierArg) + try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), + withIdentifier: pigeonIdentifierArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3498,25 +4037,34 @@ withIdentifier: pigeonIdentifierArg) } ///Creates a Dart instance of WKScriptMessageHandler and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: WKScriptMessageHandler, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: WKScriptMessageHandler, + 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { + } 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: ""))) + message: + "Error: Attempting to create a new Dart instance of WKScriptMessageHandler, but the class has a nonnull callback method.", + details: ""))) } } /// Tells the handler that a webpage sent a script message. - func didReceiveScriptMessage(pigeonInstance pigeonInstanceArg: WKScriptMessageHandler, controller controllerArg: WKUserContentController, message messageArg: WKScriptMessage, completion: @escaping (Result) -> Void) { + func didReceiveScriptMessage( + pigeonInstance pigeonInstanceArg: WKScriptMessageHandler, + controller controllerArg: WKUserContentController, message messageArg: WKScriptMessage, + completion: @escaping (Result) -> Void + ) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -3527,8 +4075,10 @@ withIdentifier: pigeonIdentifierArg) } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKScriptMessageHandler.didReceiveScriptMessage" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKScriptMessageHandler.didReceiveScriptMessage" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([pigeonInstanceArg, controllerArg, messageArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -3547,27 +4097,44 @@ withIdentifier: pigeonIdentifierArg) } protocol PigeonApiDelegateWKNavigationDelegate { - func pigeonDefaultConstructor(pigeonApi: PigeonApiWKNavigationDelegate) throws -> WKNavigationDelegate + func pigeonDefaultConstructor(pigeonApi: PigeonApiWKNavigationDelegate) throws + -> WKNavigationDelegate } protocol PigeonApiProtocolWKNavigationDelegate { /// Tells the delegate that navigation is complete. - func didFinishNavigation(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, url urlArg: String?, completion: @escaping (Result) -> Void) + func didFinishNavigation( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + url urlArg: String?, completion: @escaping (Result) -> Void) /// Tells the delegate that navigation from the main frame has started. - func didStartProvisionalNavigation(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, url urlArg: String?, completion: @escaping (Result) -> Void) + func didStartProvisionalNavigation( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + url urlArg: String?, completion: @escaping (Result) -> Void) /// Asks the delegate for permission to navigate to new content based on the /// specified action information. - func decidePolicyForNavigationAction(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, navigationAction navigationActionArg: WKNavigationAction, completion: @escaping (Result) -> Void) + func decidePolicyForNavigationAction( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + navigationAction navigationActionArg: WKNavigationAction, + completion: @escaping (Result) -> Void) /// Asks the delegate for permission to navigate to new content after the /// response to the navigation request is known. - func decidePolicyForNavigationResponse(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, navigationResponse navigationResponseArg: WKNavigationResponse, completion: @escaping (Result) -> Void) + func decidePolicyForNavigationResponse( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + navigationResponse navigationResponseArg: WKNavigationResponse, + completion: @escaping (Result) -> Void) /// Tells the delegate that an error occurred during navigation. - func didFailNavigation(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, error errorArg: NSError, completion: @escaping (Result) -> Void) + func didFailNavigation( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + error errorArg: NSError, completion: @escaping (Result) -> Void) /// Tells the delegate that an error occurred during the early navigation /// process. - func didFailProvisionalNavigation(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, error errorArg: NSError, completion: @escaping (Result) -> Void) + func didFailProvisionalNavigation( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + error errorArg: NSError, completion: @escaping (Result) -> Void) /// Tells the delegate that the web view’s content process was terminated. - func webViewWebContentProcessDidTerminate(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, completion: @escaping (Result) -> Void) + func webViewWebContentProcessDidTerminate( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + completion: @escaping (Result) -> Void) /// Asks the delegate to respond to an authentication challenge. /// /// This return value expects a List with: @@ -3579,10 +4146,13 @@ protocol PigeonApiProtocolWKNavigationDelegate { /// "password": "", /// "persistence": , /// ] - func didReceiveAuthenticationChallenge(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, challenge challengeArg: URLAuthenticationChallenge, completion: @escaping (Result<[Any?], PigeonError>) -> Void) + func didReceiveAuthenticationChallenge( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + challenge challengeArg: URLAuthenticationChallenge, + completion: @escaping (Result<[Any?], PigeonError>) -> Void) } -final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate { +final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKNavigationDelegate ///An implementation of [NSObject] used to access callback methods @@ -3590,25 +4160,34 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKNavigationDelegate) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateWKNavigationDelegate + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKNavigationDelegate?) { + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKNavigationDelegate? + ) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.pigeon_defaultConstructor", binaryMessenger: binaryMessenger, codec: codec) + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.pigeon_defaultConstructor", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { pigeonDefaultConstructorChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonIdentifierArg = args[0] as! Int64 do { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( -try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), -withIdentifier: pigeonIdentifierArg) + try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), + withIdentifier: pigeonIdentifierArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3620,25 +4199,32 @@ withIdentifier: pigeonIdentifierArg) } ///Creates a Dart instance of WKNavigationDelegate and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: WKNavigationDelegate, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: WKNavigationDelegate, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { + } 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: ""))) + message: + "Error: Attempting to create a new Dart instance of WKNavigationDelegate, but the class has a nonnull callback method.", + details: ""))) } } /// Tells the delegate that navigation is complete. - func didFinishNavigation(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, url urlArg: String?, completion: @escaping (Result) -> Void) { + func didFinishNavigation( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + url urlArg: String?, completion: @escaping (Result) -> Void + ) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -3649,8 +4235,10 @@ withIdentifier: pigeonIdentifierArg) } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didFinishNavigation" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didFinishNavigation" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([pigeonInstanceArg, webViewArg, urlArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -3668,7 +4256,10 @@ withIdentifier: pigeonIdentifierArg) } /// Tells the delegate that navigation from the main frame has started. - func didStartProvisionalNavigation(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, url urlArg: String?, completion: @escaping (Result) -> Void) { + func didStartProvisionalNavigation( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + url urlArg: String?, completion: @escaping (Result) -> Void + ) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -3679,8 +4270,10 @@ withIdentifier: pigeonIdentifierArg) } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didStartProvisionalNavigation" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didStartProvisionalNavigation" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([pigeonInstanceArg, webViewArg, urlArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -3699,7 +4292,11 @@ withIdentifier: pigeonIdentifierArg) /// Asks the delegate for permission to navigate to new content based on the /// specified action information. - func decidePolicyForNavigationAction(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, navigationAction navigationActionArg: WKNavigationAction, completion: @escaping (Result) -> Void) { + func decidePolicyForNavigationAction( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + navigationAction navigationActionArg: WKNavigationAction, + completion: @escaping (Result) -> Void + ) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -3710,9 +4307,12 @@ withIdentifier: pigeonIdentifierArg) } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.decidePolicyForNavigationAction" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, webViewArg, navigationActionArg] as [Any?]) { response in + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.decidePolicyForNavigationAction" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, webViewArg, navigationActionArg] as [Any?]) { + response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -3723,7 +4323,11 @@ withIdentifier: pigeonIdentifierArg) let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! NavigationActionPolicy completion(.success(result)) @@ -3733,7 +4337,11 @@ withIdentifier: pigeonIdentifierArg) /// Asks the delegate for permission to navigate to new content after the /// response to the navigation request is known. - func decidePolicyForNavigationResponse(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, navigationResponse navigationResponseArg: WKNavigationResponse, completion: @escaping (Result) -> Void) { + func decidePolicyForNavigationResponse( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + navigationResponse navigationResponseArg: WKNavigationResponse, + completion: @escaping (Result) -> Void + ) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -3744,9 +4352,12 @@ withIdentifier: pigeonIdentifierArg) } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.decidePolicyForNavigationResponse" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, webViewArg, navigationResponseArg] as [Any?]) { response in + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.decidePolicyForNavigationResponse" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, webViewArg, navigationResponseArg] as [Any?]) { + response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -3757,7 +4368,11 @@ withIdentifier: pigeonIdentifierArg) let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! NavigationResponsePolicy completion(.success(result)) @@ -3766,7 +4381,10 @@ withIdentifier: pigeonIdentifierArg) } /// Tells the delegate that an error occurred during navigation. - func didFailNavigation(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, error errorArg: NSError, completion: @escaping (Result) -> Void) { + func didFailNavigation( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + error errorArg: NSError, completion: @escaping (Result) -> Void + ) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -3777,8 +4395,10 @@ withIdentifier: pigeonIdentifierArg) } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didFailNavigation" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didFailNavigation" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([pigeonInstanceArg, webViewArg, errorArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -3797,7 +4417,10 @@ withIdentifier: pigeonIdentifierArg) /// Tells the delegate that an error occurred during the early navigation /// process. - func didFailProvisionalNavigation(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, error errorArg: NSError, completion: @escaping (Result) -> Void) { + func didFailProvisionalNavigation( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + error errorArg: NSError, completion: @escaping (Result) -> Void + ) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -3808,8 +4431,10 @@ withIdentifier: pigeonIdentifierArg) } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didFailProvisionalNavigation" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didFailProvisionalNavigation" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([pigeonInstanceArg, webViewArg, errorArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -3827,7 +4452,10 @@ withIdentifier: pigeonIdentifierArg) } /// Tells the delegate that the web view’s content process was terminated. - func webViewWebContentProcessDidTerminate(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, completion: @escaping (Result) -> Void) { + func webViewWebContentProcessDidTerminate( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + completion: @escaping (Result) -> Void + ) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -3838,8 +4466,10 @@ withIdentifier: pigeonIdentifierArg) } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.webViewWebContentProcessDidTerminate" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.webViewWebContentProcessDidTerminate" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([pigeonInstanceArg, webViewArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -3867,7 +4497,11 @@ withIdentifier: pigeonIdentifierArg) /// "password": "", /// "persistence": , /// ] - func didReceiveAuthenticationChallenge(pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, challenge challengeArg: URLAuthenticationChallenge, completion: @escaping (Result<[Any?], PigeonError>) -> Void) { + func didReceiveAuthenticationChallenge( + pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, + challenge challengeArg: URLAuthenticationChallenge, + completion: @escaping (Result<[Any?], PigeonError>) -> Void + ) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -3878,8 +4512,10 @@ withIdentifier: pigeonIdentifierArg) } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didReceiveAuthenticationChallenge" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didReceiveAuthenticationChallenge" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([pigeonInstanceArg, webViewArg, challengeArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -3891,7 +4527,11 @@ withIdentifier: pigeonIdentifierArg) let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! [Any?] completion(.success(result)) @@ -3904,41 +4544,52 @@ protocol PigeonApiDelegateNSObject { func pigeonDefaultConstructor(pigeonApi: PigeonApiNSObject) throws -> NSObject /// Registers the observer object to receive KVO notifications for the key /// path relative to the object receiving this message. - func addObserver(pigeonApi: PigeonApiNSObject, pigeonInstance: NSObject, observer: NSObject, keyPath: String, options: [KeyValueObservingOptions]) throws + func addObserver( + pigeonApi: PigeonApiNSObject, pigeonInstance: NSObject, observer: NSObject, keyPath: String, + options: [KeyValueObservingOptions]) throws /// Stops the observer object from receiving change notifications for the /// property specified by the key path relative to the object receiving this /// message. - func removeObserver(pigeonApi: PigeonApiNSObject, pigeonInstance: NSObject, observer: NSObject, keyPath: String) throws + func removeObserver( + pigeonApi: PigeonApiNSObject, pigeonInstance: NSObject, observer: NSObject, keyPath: String) + throws } protocol PigeonApiProtocolNSObject { /// Informs the observing object when the value at the specified key path /// relative to the observed object has changed. - func observeValue(pigeonInstance pigeonInstanceArg: NSObject, keyPath keyPathArg: String?, object objectArg: NSObject?, change changeArg: [KeyValueChangeKey: Any?]?, completion: @escaping (Result) -> Void) + func observeValue( + pigeonInstance pigeonInstanceArg: NSObject, keyPath keyPathArg: String?, + object objectArg: NSObject?, change changeArg: [KeyValueChangeKey: Any?]?, + completion: @escaping (Result) -> Void) } -final class PigeonApiNSObject: PigeonApiProtocolNSObject { +final class PigeonApiNSObject: PigeonApiProtocolNSObject { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateNSObject init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateNSObject) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiNSObject?) { + static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiNSObject?) + { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSObject.pigeon_defaultConstructor", binaryMessenger: binaryMessenger, codec: codec) + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSObject.pigeon_defaultConstructor", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { pigeonDefaultConstructorChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonIdentifierArg = args[0] as! Int64 do { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( -try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), -withIdentifier: pigeonIdentifierArg) + try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), + withIdentifier: pigeonIdentifierArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3947,7 +4598,9 @@ withIdentifier: pigeonIdentifierArg) } else { pigeonDefaultConstructorChannel.setMessageHandler(nil) } - let addObserverChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSObject.addObserver", binaryMessenger: binaryMessenger, codec: codec) + let addObserverChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSObject.addObserver", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { addObserverChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -3956,7 +4609,9 @@ withIdentifier: pigeonIdentifierArg) let keyPathArg = args[2] as! String let optionsArg = args[3] as! [KeyValueObservingOptions] do { - try api.pigeonDelegate.addObserver(pigeonApi: api, pigeonInstance: pigeonInstanceArg, observer: observerArg, keyPath: keyPathArg, options: optionsArg) + try api.pigeonDelegate.addObserver( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, observer: observerArg, + keyPath: keyPathArg, options: optionsArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3965,7 +4620,9 @@ withIdentifier: pigeonIdentifierArg) } else { addObserverChannel.setMessageHandler(nil) } - let removeObserverChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSObject.removeObserver", binaryMessenger: binaryMessenger, codec: codec) + let removeObserverChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSObject.removeObserver", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { removeObserverChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -3973,7 +4630,9 @@ withIdentifier: pigeonIdentifierArg) let observerArg = args[1] as! NSObject let keyPathArg = args[2] as! String do { - try api.pigeonDelegate.removeObserver(pigeonApi: api, pigeonInstance: pigeonInstanceArg, observer: observerArg, keyPath: keyPathArg) + try api.pigeonDelegate.removeObserver( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, observer: observerArg, + keyPath: keyPathArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -3985,21 +4644,26 @@ withIdentifier: pigeonIdentifierArg) } ///Creates a Dart instance of NSObject and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: NSObject, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: NSObject, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeonInstance as AnyObject) + } 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) + 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))) @@ -4018,7 +4682,11 @@ withIdentifier: pigeonIdentifierArg) } /// Informs the observing object when the value at the specified key path /// relative to the observed object has changed. - func observeValue(pigeonInstance pigeonInstanceArg: NSObject, keyPath keyPathArg: String?, object objectArg: NSObject?, change changeArg: [KeyValueChangeKey: Any?]?, completion: @escaping (Result) -> Void) { + func observeValue( + pigeonInstance pigeonInstanceArg: NSObject, keyPath keyPathArg: String?, + object objectArg: NSObject?, change changeArg: [KeyValueChangeKey: Any?]?, + completion: @escaping (Result) -> Void + ) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -4030,8 +4698,10 @@ withIdentifier: pigeonIdentifierArg) let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.NSObject.observeValue" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, keyPathArg, objectArg, changeArg] as [Any?]) { response in + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, keyPathArg, objectArg, changeArg] as [Any?]) { + response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -4050,111 +4720,133 @@ withIdentifier: pigeonIdentifierArg) } protocol PigeonApiDelegateUIViewWKWebView { #if !os(macOS) - func pigeonDefaultConstructor(pigeonApi: PigeonApiUIViewWKWebView, initialConfiguration: WKWebViewConfiguration) throws -> WKWebView + func pigeonDefaultConstructor( + pigeonApi: PigeonApiUIViewWKWebView, initialConfiguration: WKWebViewConfiguration + ) throws -> WKWebView #endif #if !os(macOS) - /// The object that contains the configuration details for the web view. - func configuration(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> WKWebViewConfiguration + /// The object that contains the configuration details for the web view. + func configuration(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws + -> WKWebViewConfiguration #endif #if !os(macOS) - /// The scroll view associated with the web view. - func scrollView(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> UIScrollView + /// The scroll view associated with the web view. + func scrollView(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws + -> UIScrollView #endif #if !os(macOS) - /// The object you use to integrate custom user interface elements, such as - /// contextual menus or panels, into web view interactions. - func setUIDelegate(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, delegate: WKUIDelegate) throws + /// The object you use to integrate custom user interface elements, such as + /// contextual menus or panels, into web view interactions. + func setUIDelegate( + pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, delegate: WKUIDelegate) throws #endif #if !os(macOS) - /// The object you use to manage navigation behavior for the web view. - func setNavigationDelegate(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, delegate: WKNavigationDelegate) throws + /// The object you use to manage navigation behavior for the web view. + func setNavigationDelegate( + pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, delegate: WKNavigationDelegate + ) throws #endif #if !os(macOS) - /// The URL for the current webpage. - func getUrl(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> String? + /// The URL for the current webpage. + func getUrl(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> String? #endif #if !os(macOS) - /// An estimate of what fraction of the current navigation has been loaded. - func getEstimatedProgress(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> Double + /// An estimate of what fraction of the current navigation has been loaded. + func getEstimatedProgress(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws + -> Double #endif #if !os(macOS) - /// Loads the web content that the specified URL request object references and - /// navigates to that content. - func load(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, request: URLRequestWrapper) throws + /// Loads the web content that the specified URL request object references and + /// navigates to that content. + func load( + pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, request: URLRequestWrapper) + throws #endif #if !os(macOS) - /// Loads the contents of the specified HTML string and navigates to it. - func loadHtmlString(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, string: String, baseUrl: String?) throws + /// Loads the contents of the specified HTML string and navigates to it. + func loadHtmlString( + pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, string: String, + baseUrl: String?) throws #endif #if !os(macOS) - /// Loads the web content from the specified file and navigates to it. - func loadFileUrl(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, url: String, readAccessUrl: String) throws + /// Loads the web content from the specified file and navigates to it. + func loadFileUrl( + pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, url: String, + readAccessUrl: String) throws #endif #if !os(macOS) - /// Convenience method to load a Flutter asset. - func loadFlutterAsset(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, key: String) throws + /// Convenience method to load a Flutter asset. + func loadFlutterAsset( + pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, key: String) throws #endif #if !os(macOS) - /// A Boolean value that indicates whether there is a valid back item in the - /// back-forward list. - func canGoBack(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> Bool + /// A Boolean value that indicates whether there is a valid back item in the + /// back-forward list. + func canGoBack(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> Bool #endif #if !os(macOS) - /// A Boolean value that indicates whether there is a valid forward item in - /// the back-forward list. - func canGoForward(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> Bool + /// A Boolean value that indicates whether there is a valid forward item in + /// the back-forward list. + func canGoForward(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> Bool #endif #if !os(macOS) - /// Navigates to the back item in the back-forward list. - func goBack(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws + /// Navigates to the back item in the back-forward list. + func goBack(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws #endif #if !os(macOS) - /// Navigates to the forward item in the back-forward list. - func goForward(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws + /// Navigates to the forward item in the back-forward list. + func goForward(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws #endif #if !os(macOS) - /// Reloads the current webpage. - func reload(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws + /// Reloads the current webpage. + func reload(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws #endif #if !os(macOS) - /// The page title. - func getTitle(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> String? + /// The page title. + func getTitle(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> String? #endif #if !os(macOS) - /// A Boolean value that indicates whether horizontal swipe gestures trigger - /// backward and forward page navigation. - func setAllowsBackForwardNavigationGestures(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, allow: Bool) throws + /// A Boolean value that indicates whether horizontal swipe gestures trigger + /// backward and forward page navigation. + func setAllowsBackForwardNavigationGestures( + pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, allow: Bool) throws #endif #if !os(macOS) - /// The custom user agent string. - func setCustomUserAgent(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, userAgent: String?) throws + /// The custom user agent string. + func setCustomUserAgent( + pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, userAgent: String?) throws #endif #if !os(macOS) - /// Evaluates the specified JavaScript string. - func evaluateJavaScript(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, javaScriptString: String, completion: @escaping (Result) -> Void) + /// Evaluates the specified JavaScript string. + func evaluateJavaScript( + pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, javaScriptString: String, + completion: @escaping (Result) -> Void) #endif #if !os(macOS) - /// A Boolean value that indicates whether you can inspect the view with - /// Safari Web Inspector. - func setInspectable(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, inspectable: Bool) throws + /// A Boolean value that indicates whether you can inspect the view with + /// Safari Web Inspector. + func setInspectable( + pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, inspectable: Bool) throws #endif #if !os(macOS) - /// The custom user agent string. - func getCustomUserAgent(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws -> String? + /// The custom user agent string. + func getCustomUserAgent(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView) throws + -> String? #endif #if !os(macOS) - /// Whether to allow previews for link destinations and detected data such as - /// addresses and phone numbers. - /// - /// Defaults to true. - func setAllowsLinkPreview(pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, allow: Bool) throws + /// Whether to allow previews for link destinations and detected data such as + /// addresses and phone numbers. + /// + /// Defaults to true. + func setAllowsLinkPreview( + pigeonApi: PigeonApiUIViewWKWebView, pigeonInstance: WKWebView, allow: Bool) throws #endif } protocol PigeonApiProtocolUIViewWKWebView { } -final class PigeonApiUIViewWKWebView: PigeonApiProtocolUIViewWKWebView { +final class PigeonApiUIViewWKWebView: PigeonApiProtocolUIViewWKWebView { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateUIViewWKWebView ///An implementation of [UIView] used to access callback methods @@ -4167,567 +4859,673 @@ final class PigeonApiUIViewWKWebView: PigeonApiProtocolUIViewWKWebView { return pigeonRegistrar.apiDelegate.pigeonApiWKWebView(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateUIViewWKWebView) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateUIViewWKWebView + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiUIViewWKWebView?) { + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiUIViewWKWebView? + ) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() #if !os(macOS) - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.pigeon_defaultConstructor", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - pigeonDefaultConstructorChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonIdentifierArg = args[0] as! Int64 - let initialConfigurationArg = args[1] as! WKWebViewConfiguration - do { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance( -try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api, initialConfiguration: initialConfigurationArg), -withIdentifier: pigeonIdentifierArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.pigeon_defaultConstructor", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + pigeonDefaultConstructorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonIdentifierArg = args[0] as! Int64 + let initialConfigurationArg = args[1] as! WKWebViewConfiguration + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + try api.pigeonDelegate.pigeonDefaultConstructor( + pigeonApi: api, initialConfiguration: initialConfigurationArg), + withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + pigeonDefaultConstructorChannel.setMessageHandler(nil) } - } else { - pigeonDefaultConstructorChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let configurationChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.configuration", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - configurationChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let pigeonIdentifierArg = args[1] as! Int64 - do { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance(try api.pigeonDelegate.configuration(pigeonApi: api, pigeonInstance: pigeonInstanceArg), withIdentifier: pigeonIdentifierArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let configurationChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.configuration", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + configurationChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let pigeonIdentifierArg = args[1] as! Int64 + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + try api.pigeonDelegate.configuration( + pigeonApi: api, pigeonInstance: pigeonInstanceArg), + withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + configurationChannel.setMessageHandler(nil) } - } else { - configurationChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let scrollViewChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.scrollView", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - scrollViewChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let pigeonIdentifierArg = args[1] as! Int64 - do { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance(try api.pigeonDelegate.scrollView(pigeonApi: api, pigeonInstance: pigeonInstanceArg), withIdentifier: pigeonIdentifierArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let scrollViewChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.scrollView", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + scrollViewChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let pigeonIdentifierArg = args[1] as! Int64 + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + try api.pigeonDelegate.scrollView(pigeonApi: api, pigeonInstance: pigeonInstanceArg), + withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + scrollViewChannel.setMessageHandler(nil) } - } else { - scrollViewChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let setUIDelegateChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setUIDelegate", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setUIDelegateChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let delegateArg = args[1] as! WKUIDelegate - do { - try api.pigeonDelegate.setUIDelegate(pigeonApi: api, pigeonInstance: pigeonInstanceArg, delegate: delegateArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let setUIDelegateChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setUIDelegate", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setUIDelegateChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let delegateArg = args[1] as! WKUIDelegate + do { + try api.pigeonDelegate.setUIDelegate( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, delegate: delegateArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + setUIDelegateChannel.setMessageHandler(nil) } - } else { - setUIDelegateChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let setNavigationDelegateChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setNavigationDelegate", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setNavigationDelegateChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let delegateArg = args[1] as! WKNavigationDelegate - do { - try api.pigeonDelegate.setNavigationDelegate(pigeonApi: api, pigeonInstance: pigeonInstanceArg, delegate: delegateArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let setNavigationDelegateChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setNavigationDelegate", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setNavigationDelegateChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let delegateArg = args[1] as! WKNavigationDelegate + do { + try api.pigeonDelegate.setNavigationDelegate( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, delegate: delegateArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + setNavigationDelegateChannel.setMessageHandler(nil) } - } else { - setNavigationDelegateChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let getUrlChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.getUrl", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - getUrlChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - let result = try api.pigeonDelegate.getUrl(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) + let getUrlChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.getUrl", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getUrlChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.getUrl( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } } + } else { + getUrlChannel.setMessageHandler(nil) } - } else { - getUrlChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let getEstimatedProgressChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.getEstimatedProgress", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - getEstimatedProgressChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - let result = try api.pigeonDelegate.getEstimatedProgress(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) + let getEstimatedProgressChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.getEstimatedProgress", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getEstimatedProgressChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.getEstimatedProgress( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } } + } else { + getEstimatedProgressChannel.setMessageHandler(nil) } - } else { - getEstimatedProgressChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let loadChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.load", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - loadChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let requestArg = args[1] as! URLRequestWrapper - do { - try api.pigeonDelegate.load(pigeonApi: api, pigeonInstance: pigeonInstanceArg, request: requestArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let loadChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.load", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + loadChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let requestArg = args[1] as! URLRequestWrapper + do { + try api.pigeonDelegate.load( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, request: requestArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + loadChannel.setMessageHandler(nil) } - } else { - loadChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let loadHtmlStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.loadHtmlString", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - loadHtmlStringChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let stringArg = args[1] as! String - let baseUrlArg: String? = nilOrValue(args[2]) - do { - try api.pigeonDelegate.loadHtmlString(pigeonApi: api, pigeonInstance: pigeonInstanceArg, string: stringArg, baseUrl: baseUrlArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let loadHtmlStringChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.loadHtmlString", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + loadHtmlStringChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let stringArg = args[1] as! String + let baseUrlArg: String? = nilOrValue(args[2]) + do { + try api.pigeonDelegate.loadHtmlString( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, string: stringArg, + baseUrl: baseUrlArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + loadHtmlStringChannel.setMessageHandler(nil) } - } else { - loadHtmlStringChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let loadFileUrlChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.loadFileUrl", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - loadFileUrlChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let urlArg = args[1] as! String - let readAccessUrlArg = args[2] as! String - do { - try api.pigeonDelegate.loadFileUrl(pigeonApi: api, pigeonInstance: pigeonInstanceArg, url: urlArg, readAccessUrl: readAccessUrlArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let loadFileUrlChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.loadFileUrl", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + loadFileUrlChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let urlArg = args[1] as! String + let readAccessUrlArg = args[2] as! String + do { + try api.pigeonDelegate.loadFileUrl( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, url: urlArg, + readAccessUrl: readAccessUrlArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + loadFileUrlChannel.setMessageHandler(nil) } - } else { - loadFileUrlChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let loadFlutterAssetChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.loadFlutterAsset", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - loadFlutterAssetChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let keyArg = args[1] as! String - do { - try api.pigeonDelegate.loadFlutterAsset(pigeonApi: api, pigeonInstance: pigeonInstanceArg, key: keyArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let loadFlutterAssetChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.loadFlutterAsset", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + loadFlutterAssetChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let keyArg = args[1] as! String + do { + try api.pigeonDelegate.loadFlutterAsset( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, key: keyArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + loadFlutterAssetChannel.setMessageHandler(nil) } - } else { - loadFlutterAssetChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let canGoBackChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.canGoBack", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - canGoBackChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - let result = try api.pigeonDelegate.canGoBack(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) + let canGoBackChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.canGoBack", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + canGoBackChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.canGoBack( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } } + } else { + canGoBackChannel.setMessageHandler(nil) } - } else { - canGoBackChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let canGoForwardChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.canGoForward", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - canGoForwardChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - let result = try api.pigeonDelegate.canGoForward(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) + let canGoForwardChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.canGoForward", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + canGoForwardChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.canGoForward( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } } + } else { + canGoForwardChannel.setMessageHandler(nil) } - } else { - canGoForwardChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let goBackChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.goBack", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - goBackChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - try api.pigeonDelegate.goBack(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let goBackChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.goBack", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + goBackChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + try api.pigeonDelegate.goBack(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + goBackChannel.setMessageHandler(nil) } - } else { - goBackChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let goForwardChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.goForward", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - goForwardChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - try api.pigeonDelegate.goForward(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let goForwardChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.goForward", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + goForwardChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + try api.pigeonDelegate.goForward(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + goForwardChannel.setMessageHandler(nil) } - } else { - goForwardChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let reloadChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.reload", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - reloadChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - try api.pigeonDelegate.reload(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let reloadChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.reload", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + reloadChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + try api.pigeonDelegate.reload(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + reloadChannel.setMessageHandler(nil) } - } else { - reloadChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let getTitleChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.getTitle", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - getTitleChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - let result = try api.pigeonDelegate.getTitle(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) + let getTitleChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.getTitle", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getTitleChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.getTitle( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } } + } else { + getTitleChannel.setMessageHandler(nil) } - } else { - getTitleChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let setAllowsBackForwardNavigationGesturesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setAllowsBackForwardNavigationGestures", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setAllowsBackForwardNavigationGesturesChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let allowArg = args[1] as! Bool - do { - try api.pigeonDelegate.setAllowsBackForwardNavigationGestures(pigeonApi: api, pigeonInstance: pigeonInstanceArg, allow: allowArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let setAllowsBackForwardNavigationGesturesChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setAllowsBackForwardNavigationGestures", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setAllowsBackForwardNavigationGesturesChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let allowArg = args[1] as! Bool + do { + try api.pigeonDelegate.setAllowsBackForwardNavigationGestures( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, allow: allowArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + setAllowsBackForwardNavigationGesturesChannel.setMessageHandler(nil) } - } else { - setAllowsBackForwardNavigationGesturesChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let setCustomUserAgentChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setCustomUserAgent", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setCustomUserAgentChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let userAgentArg: String? = nilOrValue(args[1]) - do { - try api.pigeonDelegate.setCustomUserAgent(pigeonApi: api, pigeonInstance: pigeonInstanceArg, userAgent: userAgentArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let setCustomUserAgentChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setCustomUserAgent", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setCustomUserAgentChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let userAgentArg: String? = nilOrValue(args[1]) + do { + try api.pigeonDelegate.setCustomUserAgent( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, userAgent: userAgentArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + setCustomUserAgentChannel.setMessageHandler(nil) } - } else { - setCustomUserAgentChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let evaluateJavaScriptChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.evaluateJavaScript", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - evaluateJavaScriptChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let javaScriptStringArg = args[1] as! String - api.pigeonDelegate.evaluateJavaScript(pigeonApi: api, pigeonInstance: pigeonInstanceArg, javaScriptString: javaScriptStringArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) + let evaluateJavaScriptChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.evaluateJavaScript", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + evaluateJavaScriptChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let javaScriptStringArg = args[1] as! String + api.pigeonDelegate.evaluateJavaScript( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, javaScriptString: javaScriptStringArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } } } + } else { + evaluateJavaScriptChannel.setMessageHandler(nil) } - } else { - evaluateJavaScriptChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let setInspectableChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setInspectable", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setInspectableChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let inspectableArg = args[1] as! Bool - do { - try api.pigeonDelegate.setInspectable(pigeonApi: api, pigeonInstance: pigeonInstanceArg, inspectable: inspectableArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let setInspectableChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setInspectable", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setInspectableChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let inspectableArg = args[1] as! Bool + do { + try api.pigeonDelegate.setInspectable( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, inspectable: inspectableArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + setInspectableChannel.setMessageHandler(nil) } - } else { - setInspectableChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let getCustomUserAgentChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.getCustomUserAgent", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - getCustomUserAgentChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - let result = try api.pigeonDelegate.getCustomUserAgent(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) + let getCustomUserAgentChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.getCustomUserAgent", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getCustomUserAgentChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.getCustomUserAgent( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } } + } else { + getCustomUserAgentChannel.setMessageHandler(nil) } - } else { - getCustomUserAgentChannel.setMessageHandler(nil) - } #endif #if !os(macOS) - let setAllowsLinkPreviewChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setAllowsLinkPreview", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setAllowsLinkPreviewChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let allowArg = args[1] as! Bool - do { - try api.pigeonDelegate.setAllowsLinkPreview(pigeonApi: api, pigeonInstance: pigeonInstanceArg, allow: allowArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let setAllowsLinkPreviewChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIViewWKWebView.setAllowsLinkPreview", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setAllowsLinkPreviewChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let allowArg = args[1] as! Bool + do { + try api.pigeonDelegate.setAllowsLinkPreview( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, allow: allowArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + setAllowsLinkPreviewChannel.setMessageHandler(nil) } - } else { - setAllowsLinkPreviewChannel.setMessageHandler(nil) - } #endif } #if !os(macOS) - ///Creates a Dart instance of UIViewWKWebView 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: ""))) - } 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(())) + ///Creates a Dart instance of UIViewWKWebView 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: ""))) + } 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(())) + } } } } - } #endif } protocol PigeonApiDelegateNSViewWKWebView { #if !os(iOS) - func pigeonDefaultConstructor(pigeonApi: PigeonApiNSViewWKWebView, initialConfiguration: WKWebViewConfiguration) throws -> WKWebView + func pigeonDefaultConstructor( + pigeonApi: PigeonApiNSViewWKWebView, initialConfiguration: WKWebViewConfiguration + ) throws -> WKWebView #endif #if !os(iOS) - /// The object that contains the configuration details for the web view. - func configuration(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> WKWebViewConfiguration + /// The object that contains the configuration details for the web view. + func configuration(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws + -> WKWebViewConfiguration #endif #if !os(iOS) - /// The object you use to integrate custom user interface elements, such as - /// contextual menus or panels, into web view interactions. - func setUIDelegate(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, delegate: WKUIDelegate) throws + /// The object you use to integrate custom user interface elements, such as + /// contextual menus or panels, into web view interactions. + func setUIDelegate( + pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, delegate: WKUIDelegate) throws #endif #if !os(iOS) - /// The object you use to manage navigation behavior for the web view. - func setNavigationDelegate(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, delegate: WKNavigationDelegate) throws + /// The object you use to manage navigation behavior for the web view. + func setNavigationDelegate( + pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, delegate: WKNavigationDelegate + ) throws #endif #if !os(iOS) - /// The URL for the current webpage. - func getUrl(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> String? + /// The URL for the current webpage. + func getUrl(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> String? #endif #if !os(iOS) - /// An estimate of what fraction of the current navigation has been loaded. - func getEstimatedProgress(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> Double + /// An estimate of what fraction of the current navigation has been loaded. + func getEstimatedProgress(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws + -> Double #endif #if !os(iOS) - /// Loads the web content that the specified URL request object references and - /// navigates to that content. - func load(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, request: URLRequestWrapper) throws + /// Loads the web content that the specified URL request object references and + /// navigates to that content. + func load( + pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, request: URLRequestWrapper) + throws #endif #if !os(iOS) - /// Loads the contents of the specified HTML string and navigates to it. - func loadHtmlString(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, string: String, baseUrl: String?) throws + /// Loads the contents of the specified HTML string and navigates to it. + func loadHtmlString( + pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, string: String, + baseUrl: String?) throws #endif #if !os(iOS) - /// Loads the web content from the specified file and navigates to it. - func loadFileUrl(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, url: String, readAccessUrl: String) throws + /// Loads the web content from the specified file and navigates to it. + func loadFileUrl( + pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, url: String, + readAccessUrl: String) throws #endif #if !os(iOS) - /// Convenience method to load a Flutter asset. - func loadFlutterAsset(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, key: String) throws + /// Convenience method to load a Flutter asset. + func loadFlutterAsset( + pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, key: String) throws #endif #if !os(iOS) - /// A Boolean value that indicates whether there is a valid back item in the - /// back-forward list. - func canGoBack(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> Bool + /// A Boolean value that indicates whether there is a valid back item in the + /// back-forward list. + func canGoBack(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> Bool #endif #if !os(iOS) - /// A Boolean value that indicates whether there is a valid forward item in - /// the back-forward list. - func canGoForward(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> Bool + /// A Boolean value that indicates whether there is a valid forward item in + /// the back-forward list. + func canGoForward(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> Bool #endif #if !os(iOS) - /// Navigates to the back item in the back-forward list. - func goBack(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws + /// Navigates to the back item in the back-forward list. + func goBack(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws #endif #if !os(iOS) - /// Navigates to the forward item in the back-forward list. - func goForward(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws + /// Navigates to the forward item in the back-forward list. + func goForward(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws #endif #if !os(iOS) - /// Reloads the current webpage. - func reload(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws + /// Reloads the current webpage. + func reload(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws #endif #if !os(iOS) - /// The page title. - func getTitle(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> String? + /// The page title. + func getTitle(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> String? #endif #if !os(iOS) - /// A Boolean value that indicates whether horizontal swipe gestures trigger - /// backward and forward page navigation. - func setAllowsBackForwardNavigationGestures(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, allow: Bool) throws + /// A Boolean value that indicates whether horizontal swipe gestures trigger + /// backward and forward page navigation. + func setAllowsBackForwardNavigationGestures( + pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, allow: Bool) throws #endif #if !os(iOS) - /// The custom user agent string. - func setCustomUserAgent(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, userAgent: String?) throws + /// The custom user agent string. + func setCustomUserAgent( + pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, userAgent: String?) throws #endif #if !os(iOS) - /// Evaluates the specified JavaScript string. - func evaluateJavaScript(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, javaScriptString: String, completion: @escaping (Result) -> Void) + /// Evaluates the specified JavaScript string. + func evaluateJavaScript( + pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, javaScriptString: String, + completion: @escaping (Result) -> Void) #endif #if !os(iOS) - /// A Boolean value that indicates whether you can inspect the view with - /// Safari Web Inspector. - func setInspectable(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, inspectable: Bool) throws + /// A Boolean value that indicates whether you can inspect the view with + /// Safari Web Inspector. + func setInspectable( + pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, inspectable: Bool) throws #endif #if !os(iOS) - /// The custom user agent string. - func getCustomUserAgent(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws -> String? + /// The custom user agent string. + func getCustomUserAgent(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView) throws + -> String? #endif #if !os(iOS) - /// Whether to allow previews for link destinations and detected data such as - /// addresses and phone numbers. - /// - /// Defaults to true. - func setAllowsLinkPreview(pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, allow: Bool) throws + /// Whether to allow previews for link destinations and detected data such as + /// addresses and phone numbers. + /// + /// Defaults to true. + func setAllowsLinkPreview( + pigeonApi: PigeonApiNSViewWKWebView, pigeonInstance: WKWebView, allow: Bool) throws #endif } protocol PigeonApiProtocolNSViewWKWebView { } -final class PigeonApiNSViewWKWebView: PigeonApiProtocolNSViewWKWebView { +final class PigeonApiNSViewWKWebView: PigeonApiProtocolNSViewWKWebView { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateNSViewWKWebView ///An implementation of [NSObject] used to access callback methods @@ -4740,444 +5538,525 @@ final class PigeonApiNSViewWKWebView: PigeonApiProtocolNSViewWKWebView { return pigeonRegistrar.apiDelegate.pigeonApiWKWebView(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateNSViewWKWebView) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateNSViewWKWebView + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiNSViewWKWebView?) { + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiNSViewWKWebView? + ) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() #if !os(iOS) - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.pigeon_defaultConstructor", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - pigeonDefaultConstructorChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonIdentifierArg = args[0] as! Int64 - let initialConfigurationArg = args[1] as! WKWebViewConfiguration - do { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance( -try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api, initialConfiguration: initialConfigurationArg), -withIdentifier: pigeonIdentifierArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.pigeon_defaultConstructor", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + pigeonDefaultConstructorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonIdentifierArg = args[0] as! Int64 + let initialConfigurationArg = args[1] as! WKWebViewConfiguration + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + try api.pigeonDelegate.pigeonDefaultConstructor( + pigeonApi: api, initialConfiguration: initialConfigurationArg), + withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + pigeonDefaultConstructorChannel.setMessageHandler(nil) } - } else { - pigeonDefaultConstructorChannel.setMessageHandler(nil) - } #endif #if !os(iOS) - let configurationChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.configuration", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - configurationChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let pigeonIdentifierArg = args[1] as! Int64 - do { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance(try api.pigeonDelegate.configuration(pigeonApi: api, pigeonInstance: pigeonInstanceArg), withIdentifier: pigeonIdentifierArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let configurationChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.configuration", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + configurationChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let pigeonIdentifierArg = args[1] as! Int64 + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + try api.pigeonDelegate.configuration( + pigeonApi: api, pigeonInstance: pigeonInstanceArg), + withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + configurationChannel.setMessageHandler(nil) } - } else { - configurationChannel.setMessageHandler(nil) - } #endif #if !os(iOS) - let setUIDelegateChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setUIDelegate", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setUIDelegateChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let delegateArg = args[1] as! WKUIDelegate - do { - try api.pigeonDelegate.setUIDelegate(pigeonApi: api, pigeonInstance: pigeonInstanceArg, delegate: delegateArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let setUIDelegateChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setUIDelegate", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setUIDelegateChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let delegateArg = args[1] as! WKUIDelegate + do { + try api.pigeonDelegate.setUIDelegate( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, delegate: delegateArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + setUIDelegateChannel.setMessageHandler(nil) } - } else { - setUIDelegateChannel.setMessageHandler(nil) - } #endif #if !os(iOS) - let setNavigationDelegateChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setNavigationDelegate", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setNavigationDelegateChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let delegateArg = args[1] as! WKNavigationDelegate - do { - try api.pigeonDelegate.setNavigationDelegate(pigeonApi: api, pigeonInstance: pigeonInstanceArg, delegate: delegateArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let setNavigationDelegateChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setNavigationDelegate", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setNavigationDelegateChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let delegateArg = args[1] as! WKNavigationDelegate + do { + try api.pigeonDelegate.setNavigationDelegate( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, delegate: delegateArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + setNavigationDelegateChannel.setMessageHandler(nil) } - } else { - setNavigationDelegateChannel.setMessageHandler(nil) - } #endif #if !os(iOS) - let getUrlChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.getUrl", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - getUrlChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - let result = try api.pigeonDelegate.getUrl(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) + let getUrlChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.getUrl", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getUrlChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.getUrl( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } } + } else { + getUrlChannel.setMessageHandler(nil) } - } else { - getUrlChannel.setMessageHandler(nil) - } #endif #if !os(iOS) - let getEstimatedProgressChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.getEstimatedProgress", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - getEstimatedProgressChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - let result = try api.pigeonDelegate.getEstimatedProgress(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) + let getEstimatedProgressChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.getEstimatedProgress", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getEstimatedProgressChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.getEstimatedProgress( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } } + } else { + getEstimatedProgressChannel.setMessageHandler(nil) } - } else { - getEstimatedProgressChannel.setMessageHandler(nil) - } #endif #if !os(iOS) - let loadChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.load", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - loadChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let requestArg = args[1] as! URLRequestWrapper - do { - try api.pigeonDelegate.load(pigeonApi: api, pigeonInstance: pigeonInstanceArg, request: requestArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let loadChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.load", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + loadChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let requestArg = args[1] as! URLRequestWrapper + do { + try api.pigeonDelegate.load( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, request: requestArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + loadChannel.setMessageHandler(nil) } - } else { - loadChannel.setMessageHandler(nil) - } #endif #if !os(iOS) - let loadHtmlStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.loadHtmlString", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - loadHtmlStringChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let stringArg = args[1] as! String - let baseUrlArg: String? = nilOrValue(args[2]) - do { - try api.pigeonDelegate.loadHtmlString(pigeonApi: api, pigeonInstance: pigeonInstanceArg, string: stringArg, baseUrl: baseUrlArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let loadHtmlStringChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.loadHtmlString", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + loadHtmlStringChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let stringArg = args[1] as! String + let baseUrlArg: String? = nilOrValue(args[2]) + do { + try api.pigeonDelegate.loadHtmlString( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, string: stringArg, + baseUrl: baseUrlArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + loadHtmlStringChannel.setMessageHandler(nil) } - } else { - loadHtmlStringChannel.setMessageHandler(nil) - } #endif #if !os(iOS) - let loadFileUrlChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.loadFileUrl", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - loadFileUrlChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let urlArg = args[1] as! String - let readAccessUrlArg = args[2] as! String - do { - try api.pigeonDelegate.loadFileUrl(pigeonApi: api, pigeonInstance: pigeonInstanceArg, url: urlArg, readAccessUrl: readAccessUrlArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let loadFileUrlChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.loadFileUrl", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + loadFileUrlChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let urlArg = args[1] as! String + let readAccessUrlArg = args[2] as! String + do { + try api.pigeonDelegate.loadFileUrl( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, url: urlArg, + readAccessUrl: readAccessUrlArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + loadFileUrlChannel.setMessageHandler(nil) } - } else { - loadFileUrlChannel.setMessageHandler(nil) - } #endif #if !os(iOS) - let loadFlutterAssetChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.loadFlutterAsset", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - loadFlutterAssetChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let keyArg = args[1] as! String - do { - try api.pigeonDelegate.loadFlutterAsset(pigeonApi: api, pigeonInstance: pigeonInstanceArg, key: keyArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let loadFlutterAssetChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.loadFlutterAsset", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + loadFlutterAssetChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let keyArg = args[1] as! String + do { + try api.pigeonDelegate.loadFlutterAsset( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, key: keyArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + loadFlutterAssetChannel.setMessageHandler(nil) } - } else { - loadFlutterAssetChannel.setMessageHandler(nil) - } #endif #if !os(iOS) - let canGoBackChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.canGoBack", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - canGoBackChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - let result = try api.pigeonDelegate.canGoBack(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) + let canGoBackChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.canGoBack", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + canGoBackChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.canGoBack( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } } + } else { + canGoBackChannel.setMessageHandler(nil) } - } else { - canGoBackChannel.setMessageHandler(nil) - } #endif #if !os(iOS) - let canGoForwardChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.canGoForward", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - canGoForwardChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - let result = try api.pigeonDelegate.canGoForward(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) + let canGoForwardChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.canGoForward", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + canGoForwardChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.canGoForward( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } } + } else { + canGoForwardChannel.setMessageHandler(nil) } - } else { - canGoForwardChannel.setMessageHandler(nil) - } #endif #if !os(iOS) - let goBackChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.goBack", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - goBackChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - try api.pigeonDelegate.goBack(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let goBackChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.goBack", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + goBackChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + try api.pigeonDelegate.goBack(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + goBackChannel.setMessageHandler(nil) } - } else { - goBackChannel.setMessageHandler(nil) - } #endif #if !os(iOS) - let goForwardChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.goForward", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - goForwardChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - try api.pigeonDelegate.goForward(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let goForwardChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.goForward", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + goForwardChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + try api.pigeonDelegate.goForward(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + goForwardChannel.setMessageHandler(nil) } - } else { - goForwardChannel.setMessageHandler(nil) - } #endif #if !os(iOS) - let reloadChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.reload", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - reloadChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - try api.pigeonDelegate.reload(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let reloadChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.reload", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + reloadChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + try api.pigeonDelegate.reload(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + reloadChannel.setMessageHandler(nil) } - } else { - reloadChannel.setMessageHandler(nil) - } #endif - #if !os(iOS) - let getTitleChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.getTitle", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - getTitleChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - let result = try api.pigeonDelegate.getTitle(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) + #if !os(iOS) + let getTitleChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.getTitle", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getTitleChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.getTitle( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } } + } else { + getTitleChannel.setMessageHandler(nil) } - } else { - getTitleChannel.setMessageHandler(nil) - } #endif #if !os(iOS) - let setAllowsBackForwardNavigationGesturesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setAllowsBackForwardNavigationGestures", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setAllowsBackForwardNavigationGesturesChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let allowArg = args[1] as! Bool - do { - try api.pigeonDelegate.setAllowsBackForwardNavigationGestures(pigeonApi: api, pigeonInstance: pigeonInstanceArg, allow: allowArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let setAllowsBackForwardNavigationGesturesChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setAllowsBackForwardNavigationGestures", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setAllowsBackForwardNavigationGesturesChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let allowArg = args[1] as! Bool + do { + try api.pigeonDelegate.setAllowsBackForwardNavigationGestures( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, allow: allowArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + setAllowsBackForwardNavigationGesturesChannel.setMessageHandler(nil) } - } else { - setAllowsBackForwardNavigationGesturesChannel.setMessageHandler(nil) - } #endif #if !os(iOS) - let setCustomUserAgentChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setCustomUserAgent", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setCustomUserAgentChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let userAgentArg: String? = nilOrValue(args[1]) - do { - try api.pigeonDelegate.setCustomUserAgent(pigeonApi: api, pigeonInstance: pigeonInstanceArg, userAgent: userAgentArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let setCustomUserAgentChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setCustomUserAgent", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setCustomUserAgentChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let userAgentArg: String? = nilOrValue(args[1]) + do { + try api.pigeonDelegate.setCustomUserAgent( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, userAgent: userAgentArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + setCustomUserAgentChannel.setMessageHandler(nil) } - } else { - setCustomUserAgentChannel.setMessageHandler(nil) - } #endif #if !os(iOS) - let evaluateJavaScriptChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.evaluateJavaScript", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - evaluateJavaScriptChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let javaScriptStringArg = args[1] as! String - api.pigeonDelegate.evaluateJavaScript(pigeonApi: api, pigeonInstance: pigeonInstanceArg, javaScriptString: javaScriptStringArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) + let evaluateJavaScriptChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.evaluateJavaScript", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + evaluateJavaScriptChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let javaScriptStringArg = args[1] as! String + api.pigeonDelegate.evaluateJavaScript( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, javaScriptString: javaScriptStringArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } } } + } else { + evaluateJavaScriptChannel.setMessageHandler(nil) } - } else { - evaluateJavaScriptChannel.setMessageHandler(nil) - } #endif #if !os(iOS) - let setInspectableChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setInspectable", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setInspectableChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let inspectableArg = args[1] as! Bool - do { - try api.pigeonDelegate.setInspectable(pigeonApi: api, pigeonInstance: pigeonInstanceArg, inspectable: inspectableArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let setInspectableChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setInspectable", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setInspectableChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let inspectableArg = args[1] as! Bool + do { + try api.pigeonDelegate.setInspectable( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, inspectable: inspectableArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + setInspectableChannel.setMessageHandler(nil) } - } else { - setInspectableChannel.setMessageHandler(nil) - } #endif #if !os(iOS) - let getCustomUserAgentChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.getCustomUserAgent", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - getCustomUserAgentChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - do { - let result = try api.pigeonDelegate.getCustomUserAgent(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) + let getCustomUserAgentChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.getCustomUserAgent", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getCustomUserAgentChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + do { + let result = try api.pigeonDelegate.getCustomUserAgent( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } } + } else { + getCustomUserAgentChannel.setMessageHandler(nil) } - } else { - getCustomUserAgentChannel.setMessageHandler(nil) - } #endif #if !os(iOS) - let setAllowsLinkPreviewChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setAllowsLinkPreview", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - setAllowsLinkPreviewChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! WKWebView - let allowArg = args[1] as! Bool - do { - try api.pigeonDelegate.setAllowsLinkPreview(pigeonApi: api, pigeonInstance: pigeonInstanceArg, allow: allowArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let setAllowsLinkPreviewChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.setAllowsLinkPreview", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setAllowsLinkPreviewChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! WKWebView + let allowArg = args[1] as! Bool + do { + try api.pigeonDelegate.setAllowsLinkPreview( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, allow: allowArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + setAllowsLinkPreviewChannel.setMessageHandler(nil) } - } else { - setAllowsLinkPreviewChannel.setMessageHandler(nil) - } #endif } #if !os(iOS) - ///Creates a Dart instance of NSViewWKWebView 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: ""))) - } 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(())) + ///Creates a Dart instance of NSViewWKWebView 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: ""))) + } 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(())) + } } } } - } #endif } open class PigeonApiDelegateWKWebView { @@ -5186,7 +6065,7 @@ open class PigeonApiDelegateWKWebView { protocol PigeonApiProtocolWKWebView { } -final class PigeonApiWKWebView: PigeonApiProtocolWKWebView { +final class PigeonApiWKWebView: PigeonApiProtocolWKWebView { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKWebView ///An implementation of [NSObject] used to access callback methods @@ -5194,26 +6073,32 @@ final class PigeonApiWKWebView: PigeonApiProtocolWKWebView { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKWebView) { + init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKWebView) + { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } ///Creates a Dart instance of WKWebView and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: WKWebView, completion: @escaping (Result) -> 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeonInstance as AnyObject) + } 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) + 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))) @@ -5237,19 +6122,35 @@ protocol PigeonApiDelegateWKUIDelegate { protocol PigeonApiProtocolWKUIDelegate { /// Creates a new web view. - func onCreateWebView(pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, configuration configurationArg: WKWebViewConfiguration, navigationAction navigationActionArg: WKNavigationAction, completion: @escaping (Result) -> Void) + func onCreateWebView( + pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, + configuration configurationArg: WKWebViewConfiguration, + navigationAction navigationActionArg: WKNavigationAction, + completion: @escaping (Result) -> Void) /// Determines whether a web resource, which the security origin object /// describes, can access to the device’s microphone audio and camera video. - func requestMediaCapturePermission(pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, origin originArg: WKSecurityOrigin, frame frameArg: WKFrameInfo, type typeArg: MediaCaptureType, completion: @escaping (Result) -> Void) + func requestMediaCapturePermission( + pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, + origin originArg: WKSecurityOrigin, frame frameArg: WKFrameInfo, type typeArg: MediaCaptureType, + completion: @escaping (Result) -> Void) /// Displays a JavaScript alert panel. - func runJavaScriptAlertPanel(pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, message messageArg: String, frame frameArg: WKFrameInfo, completion: @escaping (Result) -> Void) + func runJavaScriptAlertPanel( + pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, + message messageArg: String, frame frameArg: WKFrameInfo, + completion: @escaping (Result) -> Void) /// Displays a JavaScript confirm panel. - func runJavaScriptConfirmPanel(pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, message messageArg: String, frame frameArg: WKFrameInfo, completion: @escaping (Result) -> Void) + func runJavaScriptConfirmPanel( + pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, + message messageArg: String, frame frameArg: WKFrameInfo, + completion: @escaping (Result) -> Void) /// Displays a JavaScript text input panel. - func runJavaScriptTextInputPanel(pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, prompt promptArg: String, defaultText defaultTextArg: String?, frame frameArg: WKFrameInfo, completion: @escaping (Result) -> Void) + func runJavaScriptTextInputPanel( + pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, + prompt promptArg: String, defaultText defaultTextArg: String?, frame frameArg: WKFrameInfo, + completion: @escaping (Result) -> Void) } -final class PigeonApiWKUIDelegate: PigeonApiProtocolWKUIDelegate { +final class PigeonApiWKUIDelegate: PigeonApiProtocolWKUIDelegate { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKUIDelegate ///An implementation of [NSObject] used to access callback methods @@ -5257,25 +6158,32 @@ final class PigeonApiWKUIDelegate: PigeonApiProtocolWKUIDelegate { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKUIDelegate) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKUIDelegate + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKUIDelegate?) { + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKUIDelegate? + ) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.pigeon_defaultConstructor", binaryMessenger: binaryMessenger, codec: codec) + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.pigeon_defaultConstructor", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { pigeonDefaultConstructorChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonIdentifierArg = args[0] as! Int64 do { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( -try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), -withIdentifier: pigeonIdentifierArg) + try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), + withIdentifier: pigeonIdentifierArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -5287,25 +6195,34 @@ withIdentifier: pigeonIdentifierArg) } ///Creates a Dart instance of WKUIDelegate and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: WKUIDelegate, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: WKUIDelegate, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { + } 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: ""))) + message: + "Error: Attempting to create a new Dart instance of WKUIDelegate, but the class has a nonnull callback method.", + details: ""))) } } /// Creates a new web view. - func onCreateWebView(pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, configuration configurationArg: WKWebViewConfiguration, navigationAction navigationActionArg: WKNavigationAction, completion: @escaping (Result) -> Void) { + func onCreateWebView( + pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, + configuration configurationArg: WKWebViewConfiguration, + navigationAction navigationActionArg: WKNavigationAction, + completion: @escaping (Result) -> Void + ) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -5316,9 +6233,13 @@ withIdentifier: pigeonIdentifierArg) } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.onCreateWebView" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, webViewArg, configurationArg, navigationActionArg] as [Any?]) { response in + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.onCreateWebView" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage( + [pigeonInstanceArg, webViewArg, configurationArg, navigationActionArg] as [Any?] + ) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -5336,7 +6257,11 @@ withIdentifier: pigeonIdentifierArg) /// Determines whether a web resource, which the security origin object /// describes, can access to the device’s microphone audio and camera video. - func requestMediaCapturePermission(pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, origin originArg: WKSecurityOrigin, frame frameArg: WKFrameInfo, type typeArg: MediaCaptureType, completion: @escaping (Result) -> Void) { + func requestMediaCapturePermission( + pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, + origin originArg: WKSecurityOrigin, frame frameArg: WKFrameInfo, type typeArg: MediaCaptureType, + completion: @escaping (Result) -> Void + ) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -5347,9 +6272,12 @@ withIdentifier: pigeonIdentifierArg) } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.requestMediaCapturePermission" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, webViewArg, originArg, frameArg, typeArg] as [Any?]) { response in + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.requestMediaCapturePermission" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, webViewArg, originArg, frameArg, typeArg] as [Any?]) { + response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -5360,7 +6288,11 @@ withIdentifier: pigeonIdentifierArg) let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! PermissionDecision completion(.success(result)) @@ -5369,7 +6301,11 @@ withIdentifier: pigeonIdentifierArg) } /// Displays a JavaScript alert panel. - func runJavaScriptAlertPanel(pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, message messageArg: String, frame frameArg: WKFrameInfo, completion: @escaping (Result) -> Void) { + func runJavaScriptAlertPanel( + pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, + message messageArg: String, frame frameArg: WKFrameInfo, + completion: @escaping (Result) -> Void + ) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -5380,9 +6316,12 @@ withIdentifier: pigeonIdentifierArg) } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.runJavaScriptAlertPanel" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, webViewArg, messageArg, frameArg] as [Any?]) { response in + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.runJavaScriptAlertPanel" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, webViewArg, messageArg, frameArg] as [Any?]) { + response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -5399,7 +6338,11 @@ withIdentifier: pigeonIdentifierArg) } /// Displays a JavaScript confirm panel. - func runJavaScriptConfirmPanel(pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, message messageArg: String, frame frameArg: WKFrameInfo, completion: @escaping (Result) -> Void) { + func runJavaScriptConfirmPanel( + pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, + message messageArg: String, frame frameArg: WKFrameInfo, + completion: @escaping (Result) -> Void + ) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -5410,9 +6353,12 @@ withIdentifier: pigeonIdentifierArg) } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.runJavaScriptConfirmPanel" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, webViewArg, messageArg, frameArg] as [Any?]) { response in + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.runJavaScriptConfirmPanel" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, webViewArg, messageArg, frameArg] as [Any?]) { + response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -5423,7 +6369,11 @@ withIdentifier: pigeonIdentifierArg) let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! Bool completion(.success(result)) @@ -5432,7 +6382,11 @@ withIdentifier: pigeonIdentifierArg) } /// Displays a JavaScript text input panel. - func runJavaScriptTextInputPanel(pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, prompt promptArg: String, defaultText defaultTextArg: String?, frame frameArg: WKFrameInfo, completion: @escaping (Result) -> Void) { + func runJavaScriptTextInputPanel( + pigeonInstance pigeonInstanceArg: WKUIDelegate, webView webViewArg: WKWebView, + prompt promptArg: String, defaultText defaultTextArg: String?, frame frameArg: WKFrameInfo, + completion: @escaping (Result) -> Void + ) { if pigeonRegistrar.ignoreCallsToDart { completion( .failure( @@ -5443,9 +6397,13 @@ withIdentifier: pigeonIdentifierArg) } let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.runJavaScriptTextInputPanel" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, webViewArg, promptArg, defaultTextArg, frameArg] as [Any?]) { response in + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.runJavaScriptTextInputPanel" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage( + [pigeonInstanceArg, webViewArg, promptArg, defaultTextArg, frameArg] as [Any?] + ) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -5466,13 +6424,15 @@ withIdentifier: pigeonIdentifierArg) protocol PigeonApiDelegateWKHTTPCookieStore { /// Sets a cookie policy that indicates whether the cookie store allows cookie /// storage. - func setCookie(pigeonApi: PigeonApiWKHTTPCookieStore, pigeonInstance: WKHTTPCookieStore, cookie: HTTPCookie, completion: @escaping (Result) -> Void) + func setCookie( + pigeonApi: PigeonApiWKHTTPCookieStore, pigeonInstance: WKHTTPCookieStore, cookie: HTTPCookie, + completion: @escaping (Result) -> Void) } protocol PigeonApiProtocolWKHTTPCookieStore { } -final class PigeonApiWKHTTPCookieStore: PigeonApiProtocolWKHTTPCookieStore { +final class PigeonApiWKHTTPCookieStore: PigeonApiProtocolWKHTTPCookieStore { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKHTTPCookieStore ///An implementation of [NSObject] used to access callback methods @@ -5480,23 +6440,33 @@ final class PigeonApiWKHTTPCookieStore: PigeonApiProtocolWKHTTPCookieStore { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKHTTPCookieStore) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateWKHTTPCookieStore + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKHTTPCookieStore?) { + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKHTTPCookieStore? + ) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let setCookieChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKHTTPCookieStore.setCookie", binaryMessenger: binaryMessenger, codec: codec) + let setCookieChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKHTTPCookieStore.setCookie", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { setCookieChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! WKHTTPCookieStore let cookieArg = args[1] as! HTTPCookie - api.pigeonDelegate.setCookie(pigeonApi: api, pigeonInstance: pigeonInstanceArg, cookie: cookieArg) { result in + api.pigeonDelegate.setCookie( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, cookie: cookieArg + ) { result in switch result { case .success: reply(wrapResult(nil)) @@ -5511,21 +6481,26 @@ final class PigeonApiWKHTTPCookieStore: PigeonApiProtocolWKHTTPCookieStore { } ///Creates a Dart instance of WKHTTPCookieStore and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: WKHTTPCookieStore, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: WKHTTPCookieStore, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeonInstance as AnyObject) + } 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) + 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))) @@ -5545,22 +6520,27 @@ final class PigeonApiWKHTTPCookieStore: PigeonApiProtocolWKHTTPCookieStore { } protocol PigeonApiDelegateUIScrollViewDelegate { #if !os(macOS) - func pigeonDefaultConstructor(pigeonApi: PigeonApiUIScrollViewDelegate) throws -> UIScrollViewDelegate + func pigeonDefaultConstructor(pigeonApi: PigeonApiUIScrollViewDelegate) throws + -> UIScrollViewDelegate #endif } protocol PigeonApiProtocolUIScrollViewDelegate { #if !os(macOS) - /// Tells the delegate when the user scrolls the content view within the - /// scroll view. - /// - /// Note that this is a convenient method that includes the `contentOffset` of - /// the `scrollView`. - func scrollViewDidScroll(pigeonInstance pigeonInstanceArg: UIScrollViewDelegate, scrollView scrollViewArg: UIScrollView, x xArg: Double, y yArg: Double, completion: @escaping (Result) -> Void) #endif + /// Tells the delegate when the user scrolls the content view within the + /// scroll view. + /// + /// Note that this is a convenient method that includes the `contentOffset` of + /// the `scrollView`. + func scrollViewDidScroll( + pigeonInstance pigeonInstanceArg: UIScrollViewDelegate, + scrollView scrollViewArg: UIScrollView, x xArg: Double, y yArg: Double, + completion: @escaping (Result) -> Void) + #endif } -final class PigeonApiUIScrollViewDelegate: PigeonApiProtocolUIScrollViewDelegate { +final class PigeonApiUIScrollViewDelegate: PigeonApiProtocolUIScrollViewDelegate { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateUIScrollViewDelegate ///An implementation of [NSObject] used to access callback methods @@ -5568,55 +6548,112 @@ final class PigeonApiUIScrollViewDelegate: PigeonApiProtocolUIScrollViewDelegate return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateUIScrollViewDelegate) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateUIScrollViewDelegate + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiUIScrollViewDelegate?) { + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiUIScrollViewDelegate? + ) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() #if !os(macOS) - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewDelegate.pigeon_defaultConstructor", binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - pigeonDefaultConstructorChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonIdentifierArg = args[0] as! Int64 - do { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance( -try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), -withIdentifier: pigeonIdentifierArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewDelegate.pigeon_defaultConstructor", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + pigeonDefaultConstructorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonIdentifierArg = args[0] as! Int64 + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), + withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } } + } else { + pigeonDefaultConstructorChannel.setMessageHandler(nil) } - } else { - pigeonDefaultConstructorChannel.setMessageHandler(nil) - } #endif } #if !os(macOS) - ///Creates a Dart instance of UIScrollViewDelegate and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: UIScrollViewDelegate, 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) + ///Creates a Dart instance of UIScrollViewDelegate and attaches it to [pigeonInstance]. + func pigeonNewInstance( + pigeonInstance: UIScrollViewDelegate, + 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.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(())) + } + } + } + } + #endif + #if !os(macOS) + /// Tells the delegate when the user scrolls the content view within the + /// scroll view. + /// + /// Note that this is a convenient method that includes the `contentOffset` of + /// the `scrollView`. + func scrollViewDidScroll( + pigeonInstance pigeonInstanceArg: UIScrollViewDelegate, + scrollView scrollViewArg: UIScrollView, x xArg: Double, y yArg: Double, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + PigeonError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } 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 + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewDelegate.scrollViewDidScroll" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, scrollViewArg, xArg, yArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -5631,55 +6668,22 @@ withIdentifier: pigeonIdentifierArg) } } } - } - #endif - #if !os(macOS) - /// Tells the delegate when the user scrolls the content view within the - /// scroll view. - /// - /// Note that this is a convenient method that includes the `contentOffset` of - /// the `scrollView`. - func scrollViewDidScroll(pigeonInstance pigeonInstanceArg: UIScrollViewDelegate, scrollView scrollViewArg: UIScrollView, x xArg: Double, y yArg: Double, completion: @escaping (Result) -> Void) { - if pigeonRegistrar.ignoreCallsToDart { - completion( - .failure( - PigeonError( - code: "ignore-calls-error", - message: "Calls to Dart are being ignored.", details: ""))) - return - } - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewDelegate.scrollViewDidScroll" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, scrollViewArg, xArg, yArg] 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(())) - } - } - } #endif } protocol PigeonApiDelegateURLCredential { /// Creates a URL credential instance for internet password authentication /// with a given user name and password, using a given persistence setting. - func withUser(pigeonApi: PigeonApiURLCredential, user: String, password: String, persistence: UrlCredentialPersistence) throws -> URLCredential + func withUser( + pigeonApi: PigeonApiURLCredential, user: String, password: String, + persistence: UrlCredentialPersistence + ) throws -> URLCredential } protocol PigeonApiProtocolURLCredential { } -final class PigeonApiURLCredential: PigeonApiProtocolURLCredential { +final class PigeonApiURLCredential: PigeonApiProtocolURLCredential { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateURLCredential ///An implementation of [NSObject] used to access callback methods @@ -5687,17 +6691,24 @@ final class PigeonApiURLCredential: PigeonApiProtocolURLCredential { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateURLCredential) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateURLCredential + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiURLCredential?) { + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiURLCredential? + ) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let withUserChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLCredential.withUser", binaryMessenger: binaryMessenger, codec: codec) + let withUserChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLCredential.withUser", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { withUserChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -5707,8 +6718,9 @@ final class PigeonApiURLCredential: PigeonApiProtocolURLCredential { let persistenceArg = args[3] as! UrlCredentialPersistence do { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( -try api.pigeonDelegate.withUser(pigeonApi: api, user: userArg, password: passwordArg, persistence: persistenceArg), -withIdentifier: pigeonIdentifierArg) + try api.pigeonDelegate.withUser( + pigeonApi: api, user: userArg, password: passwordArg, persistence: persistenceArg), + withIdentifier: pigeonIdentifierArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -5720,21 +6732,26 @@ withIdentifier: pigeonIdentifierArg) } ///Creates a Dart instance of URLCredential and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: URLCredential, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: URLCredential, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeonInstance as AnyObject) + } 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) + 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))) @@ -5754,21 +6771,27 @@ withIdentifier: pigeonIdentifierArg) } protocol PigeonApiDelegateURLProtectionSpace { /// The receiver’s host. - func host(pigeonApi: PigeonApiURLProtectionSpace, pigeonInstance: URLProtectionSpace) throws -> String + func host(pigeonApi: PigeonApiURLProtectionSpace, pigeonInstance: URLProtectionSpace) throws + -> String /// The receiver’s port. - func port(pigeonApi: PigeonApiURLProtectionSpace, pigeonInstance: URLProtectionSpace) throws -> Int64 + func port(pigeonApi: PigeonApiURLProtectionSpace, pigeonInstance: URLProtectionSpace) throws + -> Int64 /// The receiver’s authentication realm. - func realm(pigeonApi: PigeonApiURLProtectionSpace, pigeonInstance: URLProtectionSpace) throws -> String? + func realm(pigeonApi: PigeonApiURLProtectionSpace, pigeonInstance: URLProtectionSpace) throws + -> String? /// The authentication method used by the receiver. - func authenticationMethod(pigeonApi: PigeonApiURLProtectionSpace, pigeonInstance: URLProtectionSpace) throws -> String? + func authenticationMethod( + pigeonApi: PigeonApiURLProtectionSpace, pigeonInstance: URLProtectionSpace + ) throws -> String? /// A representation of the server’s SSL transaction state. - func getServerTrust(pigeonApi: PigeonApiURLProtectionSpace, pigeonInstance: URLProtectionSpace) throws -> SecTrustWrapper? + func getServerTrust(pigeonApi: PigeonApiURLProtectionSpace, pigeonInstance: URLProtectionSpace) + throws -> SecTrustWrapper? } protocol PigeonApiProtocolURLProtectionSpace { } -final class PigeonApiURLProtectionSpace: PigeonApiProtocolURLProtectionSpace { +final class PigeonApiURLProtectionSpace: PigeonApiProtocolURLProtectionSpace { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateURLProtectionSpace ///An implementation of [NSObject] used to access callback methods @@ -5776,32 +6799,47 @@ final class PigeonApiURLProtectionSpace: PigeonApiProtocolURLProtectionSpace { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateURLProtectionSpace) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateURLProtectionSpace + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } ///Creates a Dart instance of URLProtectionSpace and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: URLProtectionSpace, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: URLProtectionSpace, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeonInstance as AnyObject) + } 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 getServerTrustArg = try! pigeonDelegate.getServerTrust(pigeonApi: self, pigeonInstance: pigeonInstance) + let authenticationMethodArg = try! pigeonDelegate.authenticationMethod( + pigeonApi: self, pigeonInstance: pigeonInstance) + let getServerTrustArg = try! pigeonDelegate.getServerTrust( + 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, getServerTrustArg] as [Any?]) { response in + 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, + getServerTrustArg, + ] as [Any?] + ) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -5820,13 +6858,15 @@ final class PigeonApiURLProtectionSpace: PigeonApiProtocolURLProtectionSpace { } protocol PigeonApiDelegateURLAuthenticationChallenge { /// The receiver’s protection space. - func getProtectionSpace(pigeonApi: PigeonApiURLAuthenticationChallenge, pigeonInstance: URLAuthenticationChallenge) throws -> URLProtectionSpace + func getProtectionSpace( + pigeonApi: PigeonApiURLAuthenticationChallenge, pigeonInstance: URLAuthenticationChallenge + ) throws -> URLProtectionSpace } protocol PigeonApiProtocolURLAuthenticationChallenge { } -final class PigeonApiURLAuthenticationChallenge: PigeonApiProtocolURLAuthenticationChallenge { +final class PigeonApiURLAuthenticationChallenge: PigeonApiProtocolURLAuthenticationChallenge { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateURLAuthenticationChallenge ///An implementation of [NSObject] used to access callback methods @@ -5834,23 +6874,33 @@ final class PigeonApiURLAuthenticationChallenge: PigeonApiProtocolURLAuthenticat return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateURLAuthenticationChallenge) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateURLAuthenticationChallenge + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiURLAuthenticationChallenge?) { + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiURLAuthenticationChallenge? + ) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let getProtectionSpaceChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLAuthenticationChallenge.getProtectionSpace", binaryMessenger: binaryMessenger, codec: codec) + let getProtectionSpaceChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.URLAuthenticationChallenge.getProtectionSpace", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { getProtectionSpaceChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! URLAuthenticationChallenge do { - let result = try api.pigeonDelegate.getProtectionSpace(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + let result = try api.pigeonDelegate.getProtectionSpace( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -5862,21 +6912,27 @@ final class PigeonApiURLAuthenticationChallenge: PigeonApiProtocolURLAuthenticat } ///Creates a Dart instance of URLAuthenticationChallenge and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: URLAuthenticationChallenge, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: URLAuthenticationChallenge, + 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeonInstance as AnyObject) + } 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) + 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))) @@ -5902,7 +6958,7 @@ protocol PigeonApiDelegateURL { protocol PigeonApiProtocolURL { } -final class PigeonApiURL: PigeonApiProtocolURL { +final class PigeonApiURL: PigeonApiProtocolURL { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateURL ///An implementation of [NSObject] used to access callback methods @@ -5918,15 +6974,19 @@ final class PigeonApiURL: PigeonApiProtocolURL { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let getAbsoluteStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.URL.getAbsoluteString", binaryMessenger: binaryMessenger, codec: codec) + let getAbsoluteStringChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.URL.getAbsoluteString", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { getAbsoluteStringChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! URL do { - let result = try api.pigeonDelegate.getAbsoluteString(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + let result = try api.pigeonDelegate.getAbsoluteString( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -5938,21 +6998,26 @@ final class PigeonApiURL: PigeonApiProtocolURL { } ///Creates a Dart instance of URL and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: URL, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: URL, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeonInstance as AnyObject) + } 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) + 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))) @@ -5974,13 +7039,15 @@ 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 + func setAllowsContentJavaScript( + pigeonApi: PigeonApiWKWebpagePreferences, pigeonInstance: WKWebpagePreferences, allow: Bool) + throws } protocol PigeonApiProtocolWKWebpagePreferences { } -final class PigeonApiWKWebpagePreferences: PigeonApiProtocolWKWebpagePreferences { +final class PigeonApiWKWebpagePreferences: PigeonApiProtocolWKWebpagePreferences { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateWKWebpagePreferences ///An implementation of [NSObject] used to access callback methods @@ -5988,25 +7055,35 @@ final class PigeonApiWKWebpagePreferences: PigeonApiProtocolWKWebpagePreferences return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateWKWebpagePreferences) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateWKWebpagePreferences + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKWebpagePreferences?) { + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiWKWebpagePreferences? + ) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) + 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) + 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) + try api.pigeonDelegate.setAllowsContentJavaScript( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, allow: allowArg) reply(wrapResult(nil)) } catch { reply(wrapError(error)) @@ -6015,16 +7092,21 @@ final class PigeonApiWKWebpagePreferences: PigeonApiProtocolWKWebpagePreferences } else { setAllowsContentJavaScriptChannel.setMessageHandler(nil) } - } else { + } else { let setAllowsContentJavaScriptChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.webview_flutter_wkwebview.WKWebpagePreferences.setAllowsContentJavaScript", + 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 - ))) + 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) @@ -6034,21 +7116,26 @@ final class PigeonApiWKWebpagePreferences: PigeonApiProtocolWKWebpagePreferences ///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) { + 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeonInstance as AnyObject) + } 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) + 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))) @@ -6068,17 +7155,20 @@ final class PigeonApiWKWebpagePreferences: PigeonApiProtocolWKWebpagePreferences } protocol PigeonApiDelegateGetTrustResultResponse { /// The result code from the most recent trust evaluation. - func result(pigeonApi: PigeonApiGetTrustResultResponse, pigeonInstance: GetTrustResultResponse) throws -> DartSecTrustResultType + func result(pigeonApi: PigeonApiGetTrustResultResponse, pigeonInstance: GetTrustResultResponse) + throws -> DartSecTrustResultType /// A result code. /// /// See https://developer.apple.com/documentation/security/security-framework-result-codes?language=objc. - func resultCode(pigeonApi: PigeonApiGetTrustResultResponse, pigeonInstance: GetTrustResultResponse) throws -> Int64 + func resultCode( + pigeonApi: PigeonApiGetTrustResultResponse, pigeonInstance: GetTrustResultResponse + ) throws -> Int64 } protocol PigeonApiProtocolGetTrustResultResponse { } -final class PigeonApiGetTrustResultResponse: PigeonApiProtocolGetTrustResultResponse { +final class PigeonApiGetTrustResultResponse: PigeonApiProtocolGetTrustResultResponse { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateGetTrustResultResponse ///An implementation of [NSObject] used to access callback methods @@ -6086,28 +7176,38 @@ final class PigeonApiGetTrustResultResponse: PigeonApiProtocolGetTrustResultResp return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateGetTrustResultResponse) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateGetTrustResultResponse + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } ///Creates a Dart instance of GetTrustResultResponse and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: GetTrustResultResponse, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: GetTrustResultResponse, + 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeonInstance as AnyObject) + } else { + let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( + pigeonInstance as AnyObject) let resultArg = try! pigeonDelegate.result(pigeonApi: self, pigeonInstance: pigeonInstance) - let resultCodeArg = try! pigeonDelegate.resultCode(pigeonApi: self, pigeonInstance: pigeonInstance) + let resultCodeArg = try! pigeonDelegate.resultCode( + pigeonApi: self, pigeonInstance: pigeonInstance) let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec - let channelName: String = "dev.flutter.pigeon.webview_flutter_wkwebview.GetTrustResultResponse.pigeon_newInstance" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.GetTrustResultResponse.pigeon_newInstance" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([pigeonIdentifierArg, resultArg, resultCodeArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -6127,23 +7227,30 @@ final class PigeonApiGetTrustResultResponse: PigeonApiProtocolGetTrustResultResp } protocol PigeonApiDelegateSecTrust { /// Evaluates trust for the specified certificate and policies. - func evaluateWithError(pigeonApi: PigeonApiSecTrust, trust: SecTrustWrapper, completion: @escaping (Result) -> Void) + func evaluateWithError( + pigeonApi: PigeonApiSecTrust, trust: SecTrustWrapper, + completion: @escaping (Result) -> Void) /// Returns an opaque cookie containing exceptions to trust policies that will /// allow future evaluations of the current certificate to succeed. - func copyExceptions(pigeonApi: PigeonApiSecTrust, trust: SecTrustWrapper) throws -> FlutterStandardTypedData? + func copyExceptions(pigeonApi: PigeonApiSecTrust, trust: SecTrustWrapper) throws + -> FlutterStandardTypedData? /// Sets a list of exceptions that should be ignored when the certificate is /// evaluated. - func setExceptions(pigeonApi: PigeonApiSecTrust, trust: SecTrustWrapper, exceptions: FlutterStandardTypedData?) throws -> Bool + func setExceptions( + pigeonApi: PigeonApiSecTrust, trust: SecTrustWrapper, exceptions: FlutterStandardTypedData? + ) throws -> Bool /// Returns the result code from the most recent trust evaluation. - func getTrustResult(pigeonApi: PigeonApiSecTrust, trust: SecTrustWrapper) throws -> GetTrustResultResponse + func getTrustResult(pigeonApi: PigeonApiSecTrust, trust: SecTrustWrapper) throws + -> GetTrustResultResponse /// Certificates used to evaluate trust. - func copyCertificateChain(pigeonApi: PigeonApiSecTrust, trust: SecTrustWrapper) throws -> [SecCertificateWrapper]? + func copyCertificateChain(pigeonApi: PigeonApiSecTrust, trust: SecTrustWrapper) throws + -> [SecCertificateWrapper]? } protocol PigeonApiProtocolSecTrust { } -final class PigeonApiSecTrust: PigeonApiProtocolSecTrust { +final class PigeonApiSecTrust: PigeonApiProtocolSecTrust { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateSecTrust ///An implementation of [NSObject] used to access callback methods @@ -6155,13 +7262,17 @@ final class PigeonApiSecTrust: PigeonApiProtocolSecTrust { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiSecTrust?) { + static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiSecTrust?) + { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let evaluateWithErrorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.SecTrust.evaluateWithError", binaryMessenger: binaryMessenger, codec: codec) + let evaluateWithErrorChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.SecTrust.evaluateWithError", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { evaluateWithErrorChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -6178,7 +7289,9 @@ final class PigeonApiSecTrust: PigeonApiProtocolSecTrust { } else { evaluateWithErrorChannel.setMessageHandler(nil) } - let copyExceptionsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.SecTrust.copyExceptions", binaryMessenger: binaryMessenger, codec: codec) + let copyExceptionsChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.SecTrust.copyExceptions", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { copyExceptionsChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -6193,14 +7306,17 @@ final class PigeonApiSecTrust: PigeonApiProtocolSecTrust { } else { copyExceptionsChannel.setMessageHandler(nil) } - let setExceptionsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.SecTrust.setExceptions", binaryMessenger: binaryMessenger, codec: codec) + let setExceptionsChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.SecTrust.setExceptions", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { setExceptionsChannel.setMessageHandler { message, reply in let args = message as! [Any?] let trustArg = args[0] as! SecTrustWrapper let exceptionsArg: FlutterStandardTypedData? = nilOrValue(args[1]) do { - let result = try api.pigeonDelegate.setExceptions(pigeonApi: api, trust: trustArg, exceptions: exceptionsArg) + let result = try api.pigeonDelegate.setExceptions( + pigeonApi: api, trust: trustArg, exceptions: exceptionsArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -6209,7 +7325,9 @@ final class PigeonApiSecTrust: PigeonApiProtocolSecTrust { } else { setExceptionsChannel.setMessageHandler(nil) } - let getTrustResultChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.SecTrust.getTrustResult", binaryMessenger: binaryMessenger, codec: codec) + let getTrustResultChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.SecTrust.getTrustResult", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { getTrustResultChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -6224,7 +7342,9 @@ final class PigeonApiSecTrust: PigeonApiProtocolSecTrust { } else { getTrustResultChannel.setMessageHandler(nil) } - let copyCertificateChainChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.SecTrust.copyCertificateChain", binaryMessenger: binaryMessenger, codec: codec) + let copyCertificateChainChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.SecTrust.copyCertificateChain", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { copyCertificateChainChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -6242,21 +7362,26 @@ final class PigeonApiSecTrust: PigeonApiProtocolSecTrust { } ///Creates a Dart instance of SecTrust and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: SecTrustWrapper, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: SecTrustWrapper, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeonInstance as AnyObject) + } 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.SecTrust.pigeon_newInstance" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.SecTrust.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))) @@ -6276,13 +7401,14 @@ final class PigeonApiSecTrust: PigeonApiProtocolSecTrust { } protocol PigeonApiDelegateSecCertificate { /// Returns a DER representation of a certificate given a certificate object. - func copyData(pigeonApi: PigeonApiSecCertificate, certificate: SecCertificateWrapper) throws -> FlutterStandardTypedData + func copyData(pigeonApi: PigeonApiSecCertificate, certificate: SecCertificateWrapper) throws + -> FlutterStandardTypedData } protocol PigeonApiProtocolSecCertificate { } -final class PigeonApiSecCertificate: PigeonApiProtocolSecCertificate { +final class PigeonApiSecCertificate: PigeonApiProtocolSecCertificate { unowned let pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar let pigeonDelegate: PigeonApiDelegateSecCertificate ///An implementation of [NSObject] used to access callback methods @@ -6290,17 +7416,24 @@ final class PigeonApiSecCertificate: PigeonApiProtocolSecCertificate { return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) } - init(pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateSecCertificate) { + init( + pigeonRegistrar: WebKitLibraryPigeonProxyApiRegistrar, delegate: PigeonApiDelegateSecCertificate + ) { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } - static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiSecCertificate?) { + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiSecCertificate? + ) { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: api!.pigeonRegistrar)) + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() - let copyDataChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.webview_flutter_wkwebview.SecCertificate.copyData", binaryMessenger: binaryMessenger, codec: codec) + let copyDataChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.SecCertificate.copyData", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { copyDataChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -6318,21 +7451,26 @@ final class PigeonApiSecCertificate: PigeonApiProtocolSecCertificate { } ///Creates a Dart instance of SecCertificate and attaches it to [pigeonInstance]. - func pigeonNewInstance(pigeonInstance: SecCertificateWrapper, completion: @escaping (Result) -> Void) { + func pigeonNewInstance( + pigeonInstance: SecCertificateWrapper, 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) { + } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeonInstance as AnyObject) + } 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.SecCertificate.pigeon_newInstance" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = + "dev.flutter.pigeon.webview_flutter_wkwebview.SecCertificate.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))) 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 4b079c9cc96..2df3a6c23cc 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 @@ -8,7 +8,8 @@ import 'dart:async'; import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; -import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer, immutable, protected; +import 'package:flutter/foundation.dart' + show ReadBuffer, WriteBuffer, immutable, protected; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart' show WidgetsFlutterBinding; @@ -19,7 +20,8 @@ PlatformException _createConnectionError(String channelName) { ); } -List wrapResponse({Object? result, PlatformException? error, bool empty = false}) { +List wrapResponse( + {Object? result, PlatformException? error, bool empty = false}) { if (empty) { return []; } @@ -28,6 +30,7 @@ List wrapResponse({Object? result, PlatformException? error, bool empty } return [error.code, error.message, error.details]; } + /// An immutable object that serves as the base class for all ProxyApis and /// can provide functional copies of itself. /// @@ -110,9 +113,10 @@ class PigeonInstanceManager { // by calling instanceManager.getIdentifier() inside of `==` while this was a // HashMap). final Expando _identifiers = Expando(); - final Map> _weakInstances = - >{}; - final Map _strongInstances = {}; + final Map> + _weakInstances = >{}; + final Map _strongInstances = + {}; late final Finalizer _finalizer; int _nextIdentifier = 0; @@ -122,7 +126,8 @@ class PigeonInstanceManager { static PigeonInstanceManager _initInstance() { WidgetsFlutterBinding.ensureInitialized(); - final _PigeonInternalInstanceManagerApi api = _PigeonInternalInstanceManagerApi(); + final _PigeonInternalInstanceManagerApi api = + _PigeonInternalInstanceManagerApi(); // Clears the native `PigeonInstanceManager` on the initial use of the Dart one. api.clear(); final PigeonInstanceManager instanceManager = PigeonInstanceManager( @@ -130,42 +135,76 @@ class PigeonInstanceManager { api.removeStrongReference(identifier); }, ); - _PigeonInternalInstanceManagerApi.setUpMessageHandlers(instanceManager: instanceManager); - URLRequest.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - HTTPURLResponse.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - URLResponse.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WKUserScript.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WKNavigationAction.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WKNavigationResponse.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WKFrameInfo.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - NSError.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WKScriptMessage.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WKSecurityOrigin.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - HTTPCookie.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - AuthenticationChallengeResponse.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WKWebsiteDataStore.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + _PigeonInternalInstanceManagerApi.setUpMessageHandlers( + instanceManager: instanceManager); + URLRequest.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + HTTPURLResponse.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + URLResponse.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WKUserScript.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WKNavigationAction.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WKNavigationResponse.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WKFrameInfo.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + NSError.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WKScriptMessage.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WKSecurityOrigin.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + HTTPCookie.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + AuthenticationChallengeResponse.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WKWebsiteDataStore.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); UIView.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - UIScrollView.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WKWebViewConfiguration.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WKUserContentController.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WKPreferences.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WKScriptMessageHandler.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WKNavigationDelegate.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - NSObject.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - UIViewWKWebView.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - NSViewWKWebView.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WKWebView.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WKUIDelegate.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WKHTTPCookieStore.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - UIScrollViewDelegate.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - URLCredential.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - URLProtectionSpace.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - URLAuthenticationChallenge.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + UIScrollView.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WKWebViewConfiguration.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WKUserContentController.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WKPreferences.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WKScriptMessageHandler.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WKNavigationDelegate.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + NSObject.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + UIViewWKWebView.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + NSViewWKWebView.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WKWebView.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WKUIDelegate.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WKHTTPCookieStore.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + UIScrollViewDelegate.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + URLCredential.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + URLProtectionSpace.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + URLAuthenticationChallenge.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); URL.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WKWebpagePreferences.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - GetTrustResultResponse.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - SecTrust.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - SecCertificate.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + WKWebpagePreferences.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + GetTrustResultResponse.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + SecTrust.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + SecCertificate.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); return instanceManager; } @@ -229,15 +268,20 @@ class PigeonInstanceManager { /// /// This method also expects the host `InstanceManager` to have a strong /// reference to the instance the identifier is associated with. - T? getInstanceWithWeakReference(int identifier) { - final PigeonInternalProxyApiBaseClass? weakInstance = _weakInstances[identifier]?.target; + T? getInstanceWithWeakReference( + int identifier) { + final PigeonInternalProxyApiBaseClass? weakInstance = + _weakInstances[identifier]?.target; if (weakInstance == null) { - final PigeonInternalProxyApiBaseClass? strongInstance = _strongInstances[identifier]; + final PigeonInternalProxyApiBaseClass? strongInstance = + _strongInstances[identifier]; if (strongInstance != null) { - final PigeonInternalProxyApiBaseClass copy = strongInstance.pigeon_copy(); + final PigeonInternalProxyApiBaseClass copy = + strongInstance.pigeon_copy(); _identifiers[copy] = identifier; - _weakInstances[identifier] = WeakReference(copy); + _weakInstances[identifier] = + WeakReference(copy); _finalizer.attach(copy, identifier, detach: copy); return copy as T; } @@ -261,17 +305,20 @@ class PigeonInstanceManager { /// added. /// /// Returns unique identifier of the [instance] added. - void addHostCreatedInstance(PigeonInternalProxyApiBaseClass instance, int identifier) { + void addHostCreatedInstance( + PigeonInternalProxyApiBaseClass instance, int identifier) { _addInstanceWithIdentifier(instance, identifier); } - void _addInstanceWithIdentifier(PigeonInternalProxyApiBaseClass instance, int identifier) { + void _addInstanceWithIdentifier( + PigeonInternalProxyApiBaseClass instance, int identifier) { assert(!containsIdentifier(identifier)); assert(getIdentifier(instance) == null); assert(identifier >= 0); _identifiers[instance] = identifier; - _weakInstances[identifier] = WeakReference(instance); + _weakInstances[identifier] = + WeakReference(instance); _finalizer.attach(instance, identifier, detach: instance); final PigeonInternalProxyApiBaseClass copy = instance.pigeon_copy(); @@ -398,29 +445,29 @@ class _PigeonInternalInstanceManagerApi { } class _PigeonInternalProxyApiBaseCodec extends _PigeonCodec { - const _PigeonInternalProxyApiBaseCodec(this.instanceManager); - final PigeonInstanceManager instanceManager; - @override - void writeValue(WriteBuffer buffer, Object? value) { - if (value is PigeonInternalProxyApiBaseClass) { - buffer.putUint8(128); - writeValue(buffer, instanceManager.getIdentifier(value)); - } else { - super.writeValue(buffer, value); - } - } - @override - Object? readValueOfType(int type, ReadBuffer buffer) { - switch (type) { - case 128: - return instanceManager - .getInstanceWithWeakReference(readValue(buffer)! as int); - default: - return super.readValueOfType(type, buffer); - } - } -} + const _PigeonInternalProxyApiBaseCodec(this.instanceManager); + final PigeonInstanceManager instanceManager; + @override + void writeValue(WriteBuffer buffer, Object? value) { + if (value is PigeonInternalProxyApiBaseClass) { + buffer.putUint8(128); + writeValue(buffer, instanceManager.getIdentifier(value)); + } else { + super.writeValue(buffer, value); + } + } + @override + Object? readValueOfType(int type, ReadBuffer buffer) { + switch (type) { + case 128: + return instanceManager + .getInstanceWithWeakReference(readValue(buffer)! as int); + default: + return super.readValueOfType(type, buffer); + } + } +} /// The values that can be returned in a change dictionary. /// @@ -429,12 +476,15 @@ enum KeyValueObservingOptions { /// Indicates that the change dictionary should provide the new attribute /// value, if applicable. newValue, + /// Indicates that the change dictionary should contain the old attribute /// value, if applicable. oldValue, + /// If specified, a notification should be sent to the observer immediately, /// before the observer registration method even returns. initialValue, + /// Whether separate notifications should be sent to the observer before and /// after each change, instead of a single notification after the change. priorNotification, @@ -446,15 +496,19 @@ enum KeyValueObservingOptions { enum KeyValueChange { /// Indicates that the value of the observed key path was set to a new value. setting, + /// Indicates that an object has been inserted into the to-many relationship /// that is being observed. insertion, + /// Indicates that an object has been removed from the to-many relationship /// that is being observed. removal, + /// Indicates that an object has been replaced in the to-many relationship /// that is being observed. replacement, + /// The value is not recognized by the wrapper. unknown, } @@ -468,23 +522,28 @@ enum KeyValueChangeKey { /// `KeyValueChange.replacement`, the value of this key is a Set object that /// contains the indexes of the inserted, removed, or replaced objects. indexes, + /// An object that contains a value corresponding to one of the /// `KeyValueChange` enum, indicating what sort of change has occurred. kind, + /// If the value of the `KeyValueChange.kind` entry is /// `KeyValueChange.setting, and `KeyValueObservingOptions.newValue` was /// specified when the observer was registered, the value of this key is the /// new value for the attribute. newValue, + /// If the `KeyValueObservingOptions.priorNotification` option was specified /// when the observer was registered this notification is sent prior to a /// change. notificationIsPrior, + /// If the value of the `KeyValueChange.kind` entry is /// `KeyValueChange.setting`, and `KeyValueObservingOptions.old` was specified /// when the observer was registered, the value of this key is the value /// before the attribute was changed. oldValue, + /// The value is not recognized by the wrapper. unknown, } @@ -496,9 +555,11 @@ enum UserScriptInjectionTime { /// A constant to inject the script after the creation of the webpage’s /// document element, but before loading any other content. atDocumentStart, + /// A constant to inject the script after the document finishes loading, but /// before loading any other subresources. atDocumentEnd, + /// The value is not recognized by the wrapper. unknown, } @@ -509,10 +570,13 @@ enum UserScriptInjectionTime { enum AudiovisualMediaType { /// No media types require a user gesture to begin playing. none, + /// Media types that contain audio require a user gesture to begin playing. audio, + /// Media types that contain video require a user gesture to begin playing. video, + /// All media types require a user gesture to begin playing. all, } @@ -524,18 +588,25 @@ enum AudiovisualMediaType { enum WebsiteDataType { /// Cookies. cookies, + /// In-memory caches. memoryCache, + /// On-disk caches. diskCache, + /// HTML offline web app caches. offlineWebApplicationCache, + /// HTML local storage. localStorage, + /// HTML session storage. sessionStorage, + /// WebSQL databases. webSQLDatabases, + /// IndexedDB databases. indexedDBDatabases, } @@ -547,8 +618,10 @@ enum WebsiteDataType { enum NavigationActionPolicy { /// Allow the navigation to continue. allow, + /// Cancel the navigation. cancel, + /// Allow the download to proceed. download, } @@ -560,8 +633,10 @@ enum NavigationActionPolicy { enum NavigationResponsePolicy { /// Allow the navigation to continue. allow, + /// Cancel the navigation. cancel, + /// Allow the download to proceed. download, } @@ -572,37 +647,51 @@ enum NavigationResponsePolicy { enum HttpCookiePropertyKey { /// A String object containing the comment for the cookie. comment, + /// An Uri object or String object containing the comment URL for the cookie. commentUrl, + /// Aa String object stating whether the cookie should be discarded at the end /// of the session. discard, + /// An String object containing the domain for the cookie. domain, + /// An Date object or String object specifying the expiration date for the /// cookie. expires, + /// An String object containing an integer value stating how long in seconds /// the cookie should be kept, at most. maximumAge, + /// An String object containing the name of the cookie (required). name, + /// A URL or String object containing the URL that set this cookie. originUrl, + /// A String object containing the path for the cookie. path, + /// An String object containing comma-separated integer values specifying the /// ports for the cookie. port, + /// A string indicating the same-site policy for the cookie. sameSitePolicy, + /// A String object indicating that the cookie should be transmitted only over /// secure channels. secure, + /// A String object containing the value of the cookie. value, + /// A String object that specifies the version of the cookie. version, + /// The value is not recognized by the wrapper. unknown, } @@ -613,16 +702,22 @@ enum HttpCookiePropertyKey { enum NavigationType { /// A link activation. linkActivated, + /// A request to submit a form. formSubmitted, + /// A request for the frame’s next or previous item. backForward, + /// A request to reload the webpage. reload, + /// A request to resubmit a form. formResubmitted, + /// A navigation request that originates for some other reason. other, + /// The value is not recognized by the wrapper. unknown, } @@ -633,8 +728,10 @@ enum NavigationType { enum PermissionDecision { /// Deny permission for the requested resource. deny, + /// Deny permission for the requested resource. grant, + /// Prompt the user for permission for the requested resource. prompt, } @@ -645,10 +742,13 @@ enum PermissionDecision { enum MediaCaptureType { /// A media device that can capture video. camera, + /// A media device or devices that can capture audio and video. cameraAndMicrophone, + /// A media device that can capture audio. microphone, + /// The value is not recognized by the wrapper. unknown, } @@ -659,14 +759,18 @@ enum MediaCaptureType { enum UrlSessionAuthChallengeDisposition { /// Use the specified credential, which may be nil. useCredential, + /// Use the default handling for the challenge as though this delegate method /// were not implemented. performDefaultHandling, + /// Cancel the entire request. cancelAuthenticationChallenge, + /// Reject this challenge, and call the authentication delegate method again /// with the next authentication protection space. rejectProtectionSpace, + /// The value is not recognized by the wrapper. unknown, } @@ -677,10 +781,13 @@ enum UrlSessionAuthChallengeDisposition { enum UrlCredentialPersistence { /// The credential should not be stored. none, + /// The credential should be stored only for this session. forSession, + /// The credential should be stored in the keychain. permanent, + /// The credential should be stored permanently in the keychain, and in /// addition should be distributed to other devices based on the owning Apple /// ID. @@ -693,26 +800,33 @@ enum UrlCredentialPersistence { enum DartSecTrustResultType { /// The user did not specify a trust setting. unspecified, + /// The user granted permission to trust the certificate for the purposes /// designated in the specified policies. proceed, + /// The user specified that the certificate should not be trusted. deny, + /// Trust is denied, but recovery may be possible. recoverableTrustFailure, + /// Trust is denied and no simple fix is available. fatalTrustFailure, + /// A value that indicates a failure other than trust evaluation. otherError, + /// An indication of an invalid setting or result. invalid, + /// User confirmation is required before proceeding. confirm, + /// The type is not recognized by this wrapper. unknown, } - class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override @@ -720,49 +834,49 @@ class _PigeonCodec extends StandardMessageCodec { if (value is int) { buffer.putUint8(4); buffer.putInt64(value); - } else if (value is KeyValueObservingOptions) { + } else if (value is KeyValueObservingOptions) { buffer.putUint8(129); writeValue(buffer, value.index); - } else if (value is KeyValueChange) { + } else if (value is KeyValueChange) { buffer.putUint8(130); writeValue(buffer, value.index); - } else if (value is KeyValueChangeKey) { + } else if (value is KeyValueChangeKey) { buffer.putUint8(131); writeValue(buffer, value.index); - } else if (value is UserScriptInjectionTime) { + } else if (value is UserScriptInjectionTime) { buffer.putUint8(132); writeValue(buffer, value.index); - } else if (value is AudiovisualMediaType) { + } else if (value is AudiovisualMediaType) { buffer.putUint8(133); writeValue(buffer, value.index); - } else if (value is WebsiteDataType) { + } else if (value is WebsiteDataType) { buffer.putUint8(134); writeValue(buffer, value.index); - } else if (value is NavigationActionPolicy) { + } else if (value is NavigationActionPolicy) { buffer.putUint8(135); writeValue(buffer, value.index); - } else if (value is NavigationResponsePolicy) { + } else if (value is NavigationResponsePolicy) { buffer.putUint8(136); writeValue(buffer, value.index); - } else if (value is HttpCookiePropertyKey) { + } else if (value is HttpCookiePropertyKey) { buffer.putUint8(137); writeValue(buffer, value.index); - } else if (value is NavigationType) { + } else if (value is NavigationType) { buffer.putUint8(138); writeValue(buffer, value.index); - } else if (value is PermissionDecision) { + } else if (value is PermissionDecision) { buffer.putUint8(139); writeValue(buffer, value.index); - } else if (value is MediaCaptureType) { + } else if (value is MediaCaptureType) { buffer.putUint8(140); writeValue(buffer, value.index); - } else if (value is UrlSessionAuthChallengeDisposition) { + } else if (value is UrlSessionAuthChallengeDisposition) { buffer.putUint8(141); writeValue(buffer, value.index); - } else if (value is UrlCredentialPersistence) { + } else if (value is UrlCredentialPersistence) { buffer.putUint8(142); writeValue(buffer, value.index); - } else if (value is DartSecTrustResultType) { + } else if (value is DartSecTrustResultType) { buffer.putUint8(143); writeValue(buffer, value.index); } else { @@ -773,49 +887,51 @@ class _PigeonCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 129: + case 129: final int? value = readValue(buffer) as int?; return value == null ? null : KeyValueObservingOptions.values[value]; - case 130: + case 130: final int? value = readValue(buffer) as int?; return value == null ? null : KeyValueChange.values[value]; - case 131: + case 131: final int? value = readValue(buffer) as int?; return value == null ? null : KeyValueChangeKey.values[value]; - case 132: + case 132: final int? value = readValue(buffer) as int?; return value == null ? null : UserScriptInjectionTime.values[value]; - case 133: + case 133: final int? value = readValue(buffer) as int?; return value == null ? null : AudiovisualMediaType.values[value]; - case 134: + case 134: final int? value = readValue(buffer) as int?; return value == null ? null : WebsiteDataType.values[value]; - case 135: + case 135: final int? value = readValue(buffer) as int?; return value == null ? null : NavigationActionPolicy.values[value]; - case 136: + case 136: final int? value = readValue(buffer) as int?; return value == null ? null : NavigationResponsePolicy.values[value]; - case 137: + case 137: final int? value = readValue(buffer) as int?; return value == null ? null : HttpCookiePropertyKey.values[value]; - case 138: + case 138: final int? value = readValue(buffer) as int?; return value == null ? null : NavigationType.values[value]; - case 139: + case 139: final int? value = readValue(buffer) as int?; return value == null ? null : PermissionDecision.values[value]; - case 140: + case 140: final int? value = readValue(buffer) as int?; return value == null ? null : MediaCaptureType.values[value]; - case 141: + case 141: final int? value = readValue(buffer) as int?; - return value == null ? null : UrlSessionAuthChallengeDisposition.values[value]; - case 142: + return value == null + ? null + : UrlSessionAuthChallengeDisposition.values[value]; + case 142: final int? value = readValue(buffer) as int?; return value == null ? null : UrlCredentialPersistence.values[value]; - case 143: + case 143: final int? value = readValue(buffer) as int?; return value == null ? null : DartSecTrustResultType.values[value]; default: @@ -823,6 +939,7 @@ class _PigeonCodec extends StandardMessageCodec { } } } + /// A URL load request that is independent of protocol or URL scheme. /// /// See https://developer.apple.com/documentation/foundation/urlrequest. @@ -8516,4 +8633,3 @@ class SecCertificate extends NSObject { ); } } - 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 51397409589..d6981859154 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,86 +36,86 @@ 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 _FakeWKNavigationDelegate_3 extends _i1.SmartFake implements _i2.WKNavigationDelegate { _FakeWKNavigationDelegate_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 _FakeWKScriptMessageHandler_5 extends _i1.SmartFake implements _i2.WKScriptMessageHandler { _FakeWKScriptMessageHandler_5(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWKWebView_6 extends _i1.SmartFake implements _i2.WKWebView { _FakeWKWebView_6(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWKWebViewConfiguration_7 extends _i1.SmartFake implements _i2.WKWebViewConfiguration { _FakeWKWebViewConfiguration_7(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeUIViewWKWebView_8 extends _i1.SmartFake implements _i2.UIViewWKWebView { _FakeUIViewWKWebView_8(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWKUserContentController_9 extends _i1.SmartFake implements _i2.WKUserContentController { _FakeWKUserContentController_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 _FakeWKHTTPCookieStore_12 extends _i1.SmartFake implements _i2.WKHTTPCookieStore { _FakeWKHTTPCookieStore_12(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakeWKUIDelegate_13 extends _i1.SmartFake implements _i2.WKUIDelegate { _FakeWKUIDelegate_13(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } class _FakePlatformWebView_14 extends _i1.SmartFake implements _i3.PlatformWebView { _FakePlatformWebView_14(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + : super(parent, parentInvocation); } /// A class which mocks [UIScrollView]. @@ -127,142 +127,117 @@ 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 _i4.Future setShowsVerticalScrollIndicator(bool? value) => (super.noSuchMethod( - Invocation.method(#setShowsVerticalScrollIndicator, [value]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#setShowsVerticalScrollIndicator, [value]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override _i4.Future setShowsHorizontalScrollIndicator(bool? value) => (super.noSuchMethod( - Invocation.method(#setShowsHorizontalScrollIndicator, [value]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + Invocation.method(#setShowsHorizontalScrollIndicator, [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( @@ -271,20 +246,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]. @@ -296,85 +269,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( @@ -383,20 +340,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]. @@ -413,92 +368,79 @@ 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> 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>.value([]), - ) - as _i4.Future> 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); + ) get didReceiveAuthenticationChallenge => (super.noSuchMethod( + Invocation.getter(#didReceiveAuthenticationChallenge), + returnValue: ( + _i2.WKNavigationDelegate pigeon_instance, + _i2.WKWebView webView, + _i2.URLAuthenticationChallenge challenge, + ) => + _i4.Future>.value([]), + ) as _i4.Future> 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); @override _i4.Future addObserver( @@ -507,20 +449,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]. @@ -532,35 +472,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_4( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WKPreferences); + _i2.WKPreferences pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKPreferences_4( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WKPreferences); @override _i4.Future addObserver( @@ -569,20 +503,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]. @@ -599,44 +531,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_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_5( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WKScriptMessageHandler); @override _i4.Future addObserver( @@ -645,20 +569,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]. @@ -670,26 +592,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_6( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WKWebView); + _i2.WKWebView pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKWebView_6( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WKWebView); @override _i4.Future addObserver( @@ -698,20 +616,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]. @@ -723,261 +639,211 @@ 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); + _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); + _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_7( - this, - Invocation.method(#pigeonVar_configuration, []), - ), - ) - as _i2.WKWebViewConfiguration); + _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.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 - _i4.Future setAllowsLinkPreview(bool? allow) => - (super.noSuchMethod( - Invocation.method(#setAllowsLinkPreview, [allow]), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) - as _i4.Future); + _i4.Future setAllowsLinkPreview(bool? allow) => (super.noSuchMethod( + Invocation.method(#setAllowsLinkPreview, [allow]), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _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); + _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); + _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( @@ -986,20 +852,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]. @@ -1012,138 +876,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_9( + this, Invocation.method(#getUserContentController, []), - returnValue: _i4.Future<_i2.WKUserContentController>.value( - _FakeWKUserContentController_9( - 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_10( + this, Invocation.method(#getWebsiteDataStore, []), - returnValue: _i4.Future<_i2.WKWebsiteDataStore>.value( - _FakeWKWebsiteDataStore_10( - 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_4( + this, Invocation.method(#getPreferences, []), - returnValue: _i4.Future<_i2.WKPreferences>.value( - _FakeWKPreferences_4( - 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_11( + this, Invocation.method(#getDefaultWebpagePreferences, []), - returnValue: _i4.Future<_i2.WKWebpagePreferences>.value( - _FakeWKWebpagePreferences_11( - 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_7( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WKWebViewConfiguration); + _i2.WKWebViewConfiguration pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKWebViewConfiguration_7( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WKWebViewConfiguration); @override _i4.Future addObserver( @@ -1152,20 +1001,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]. @@ -1178,37 +1025,31 @@ class MockWKWebsiteDataStore extends _i1.Mock } @override - _i2.WKHTTPCookieStore get httpCookieStore => - (super.noSuchMethod( - Invocation.getter(#httpCookieStore), - returnValue: _FakeWKHTTPCookieStore_12( - this, - Invocation.getter(#httpCookieStore), - ), - ) - as _i2.WKHTTPCookieStore); + _i2.WKHTTPCookieStore get httpCookieStore => (super.noSuchMethod( + Invocation.getter(#httpCookieStore), + returnValue: _FakeWKHTTPCookieStore_12( + 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_12( - this, - Invocation.method(#pigeonVar_httpCookieStore, []), - ), - ) - as _i2.WKHTTPCookieStore); + _i2.WKHTTPCookieStore pigeonVar_httpCookieStore() => (super.noSuchMethod( + Invocation.method(#pigeonVar_httpCookieStore, []), + returnValue: _FakeWKHTTPCookieStore_12( + this, + Invocation.method(#pigeonVar_httpCookieStore, []), + ), + ) as _i2.WKHTTPCookieStore); @override _i4.Future removeDataOfTypes( @@ -1216,24 +1057,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_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, []), + ), + ) as _i2.WKWebsiteDataStore); @override _i4.Future addObserver( @@ -1242,20 +1080,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]. @@ -1273,28 +1109,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( @@ -1302,46 +1135,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_13( - 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_13( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WKUIDelegate); @override _i4.Future addObserver( @@ -1350,20 +1176,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]. @@ -1376,15 +1200,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( @@ -1392,58 +1214,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_9( - this, - Invocation.method(#pigeon_copy, []), - ), - ) - as _i2.WKUserContentController); + _i2.WKUserContentController pigeon_copy() => (super.noSuchMethod( + Invocation.method(#pigeon_copy, []), + returnValue: _FakeWKUserContentController_9( + this, + Invocation.method(#pigeon_copy, []), + ), + ) as _i2.WKUserContentController); @override _i4.Future addObserver( @@ -1452,20 +1265,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]. @@ -1478,12 +1289,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) => @@ -1515,37 +1324,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]. @@ -1561,35 +1369,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_14( - 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_14( + 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({ @@ -1597,21 +1402,19 @@ class MockWebViewWidgetProxy extends _i1.Mock _i2.WKScriptMessageHandler, _i2.WKUserContentController, _i2.WKScriptMessage, - )? - didReceiveScriptMessage, + )? didReceiveScriptMessage, }) => (super.noSuchMethod( - Invocation.method(#createScriptMessageHandler, [], { - #didReceiveScriptMessage: didReceiveScriptMessage, - }), - returnValue: _FakeWKScriptMessageHandler_5( - this, - Invocation.method(#createScriptMessageHandler, [], { - #didReceiveScriptMessage: didReceiveScriptMessage, - }), - ), - ) - as _i2.WKScriptMessageHandler); + Invocation.method(#createScriptMessageHandler, [], { + #didReceiveScriptMessage: didReceiveScriptMessage, + }), + returnValue: _FakeWKScriptMessageHandler_5( + this, + Invocation.method(#createScriptMessageHandler, [], { + #didReceiveScriptMessage: didReceiveScriptMessage, + }), + ), + ) as _i2.WKScriptMessageHandler); @override _i2.WKUIDelegate createUIDelgate({ @@ -1620,86 +1423,77 @@ class MockWebViewWidgetProxy extends _i1.Mock _i2.WKWebView, _i2.WKWebViewConfiguration, _i2.WKNavigationAction, - )? - onCreateWebView, + )? onCreateWebView, }) => (super.noSuchMethod( - Invocation.method(#createUIDelgate, [], { - #onCreateWebView: onCreateWebView, - }), - returnValue: _FakeWKUIDelegate_13( - this, - Invocation.method(#createUIDelgate, [], { - #onCreateWebView: onCreateWebView, - }), - ), - ) - as _i2.WKUIDelegate); + Invocation.method(#createUIDelgate, [], { + #onCreateWebView: onCreateWebView, + }), + returnValue: _FakeWKUIDelegate_13( + 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> 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, [], { - #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_3( + 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]. @@ -1712,35 +1506,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_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, []), + ), + ) as _i2.WKWebpagePreferences); @override _i4.Future addObserver( @@ -1749,18 +1538,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 caf2e7bd565..f5f1ce191c0 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,153 +113,128 @@ 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 _i3.Future setShowsVerticalScrollIndicator(bool? value) => (super.noSuchMethod( - Invocation.method(#setShowsVerticalScrollIndicator, [value]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#setShowsVerticalScrollIndicator, [value]), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future setShowsHorizontalScrollIndicator(bool? value) => (super.noSuchMethod( - Invocation.method(#setShowsHorizontalScrollIndicator, [value]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + Invocation.method(#setShowsHorizontalScrollIndicator, [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( @@ -268,20 +243,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]. @@ -290,34 +263,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( @@ -326,20 +295,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]. @@ -347,50 +314,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( @@ -399,20 +360,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]. @@ -420,97 +379,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( @@ -519,20 +462,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]. @@ -540,43 +481,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( @@ -585,20 +520,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]. @@ -611,58 +544,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( @@ -671,20 +595,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]. @@ -693,19 +615,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( @@ -713,62 +633,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( @@ -777,20 +688,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]. @@ -798,68 +707,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( @@ -868,20 +766,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]. @@ -889,34 +785,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( @@ -925,20 +817,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]. @@ -947,172 +837,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, []), + ), + ), + returnValueForMissingStub: + _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>); + ), + ), + ) 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, []), - 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>); + ), + ), + 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); + 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, []), + ), + ), + returnValueForMissingStub: _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>); + ), + ), + ) 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( @@ -1121,20 +995,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]. @@ -1143,43 +1015,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( @@ -1188,20 +1055,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]. @@ -1209,292 +1074,242 @@ 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 - _i3.Future setAllowsLinkPreview(bool? allow) => - (super.noSuchMethod( - Invocation.method(#setAllowsLinkPreview, [allow]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); + _i3.Future setAllowsLinkPreview(bool? allow) => (super.noSuchMethod( + Invocation.method(#setAllowsLinkPreview, [allow]), + 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( @@ -1503,20 +1318,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]. @@ -1525,49 +1338,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( @@ -1575,29 +1382,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( @@ -1606,18 +1410,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 b35c5fb246758251c2302978a693e4a62f27b0ee Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Mon, 21 Apr 2025 17:16:20 -0400 Subject: [PATCH 19/29] format and add support query --- .../lib/src/webview_controller.dart | 8 ++++++++ .../test/webview_controller_test.dart | 14 ++++++++++++++ .../test/webview_controller_test.mocks.dart | 6 ++++++ .../test/webview_widget_test.mocks.dart | 6 ++++++ .../lib/src/android_webview_controller.dart | 3 +++ .../lib/src/platform_webview_controller.dart | 8 ++++++++ .../lib/src/webkit_webview_controller.dart | 3 +++ 7 files changed, 48 insertions(+) diff --git a/packages/webview_flutter/webview_flutter/lib/src/webview_controller.dart b/packages/webview_flutter/webview_flutter/lib/src/webview_controller.dart index cfa0bf48dab..6a2771aead1 100644 --- a/packages/webview_flutter/webview_flutter/lib/src/webview_controller.dart +++ b/packages/webview_flutter/webview_flutter/lib/src/webview_controller.dart @@ -416,6 +416,14 @@ class WebViewController { return platform.setHorizontalScrollBarEnabled(enabled); } + /// Returns true if the current platform supports setting whether scrollbars + /// should be drawn or not. + /// + /// See [setVerticalScrollBarEnabled] and [setHorizontalScrollBarEnabled]. + bool supportsSetScrollBarsEnabled() { + return platform.supportsSetScrollBarsEnabled(); + } + /// Sets the over-scroll mode for the WebView. /// /// Default behavior is platform dependent. diff --git a/packages/webview_flutter/webview_flutter/test/webview_controller_test.dart b/packages/webview_flutter/webview_flutter/test/webview_controller_test.dart index 4dcd8a55d26..ed6e9efcbef 100644 --- a/packages/webview_flutter/webview_flutter/test/webview_controller_test.dart +++ b/packages/webview_flutter/webview_flutter/test/webview_controller_test.dart @@ -305,6 +305,20 @@ void main() { verify(mockPlatformWebViewController.setHorizontalScrollBarEnabled(false)); }); + test('supportsSetScrollBarsEnabled', () async { + final MockPlatformWebViewController mockPlatformWebViewController = + MockPlatformWebViewController(); + when(mockPlatformWebViewController.supportsSetScrollBarsEnabled()) + .thenReturn(true); + + final WebViewController webViewController = WebViewController.fromPlatform( + mockPlatformWebViewController, + ); + + expect(webViewController.supportsSetScrollBarsEnabled(), true); + verify(mockPlatformWebViewController.supportsSetScrollBarsEnabled()); + }); + test('getScrollPosition', () async { final MockPlatformWebViewController mockPlatformWebViewController = MockPlatformWebViewController(); diff --git a/packages/webview_flutter/webview_flutter/test/webview_controller_test.mocks.dart b/packages/webview_flutter/webview_flutter/test/webview_controller_test.mocks.dart index 816424a5e22..9c1b7e24961 100644 --- a/packages/webview_flutter/webview_flutter/test/webview_controller_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter/test/webview_controller_test.mocks.dart @@ -239,6 +239,12 @@ class MockPlatformWebViewController extends _i1.Mock returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); + @override + bool supportsSetScrollBarsEnabled() => (super.noSuchMethod( + Invocation.method(#supportsSetScrollBarsEnabled, []), + returnValue: false, + ) as bool); + @override _i5.Future<_i3.Offset> getScrollPosition() => (super.noSuchMethod( Invocation.method(#getScrollPosition, []), diff --git a/packages/webview_flutter/webview_flutter/test/webview_widget_test.mocks.dart b/packages/webview_flutter/webview_flutter/test/webview_widget_test.mocks.dart index 74b949a8590..691f0fdbc31 100644 --- a/packages/webview_flutter/webview_flutter/test/webview_widget_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter/test/webview_widget_test.mocks.dart @@ -252,6 +252,12 @@ class MockPlatformWebViewController extends _i1.Mock returnValueForMissingStub: _i7.Future.value(), ) as _i7.Future); + @override + bool supportsSetScrollBarsEnabled() => (super.noSuchMethod( + Invocation.method(#supportsSetScrollBarsEnabled, []), + returnValue: false, + ) as bool); + @override _i7.Future<_i3.Offset> getScrollPosition() => (super.noSuchMethod( Invocation.method(#getScrollPosition, []), diff --git a/packages/webview_flutter/webview_flutter_android/lib/src/android_webview_controller.dart b/packages/webview_flutter/webview_flutter_android/lib/src/android_webview_controller.dart index d1c04152887..92937665912 100644 --- a/packages/webview_flutter/webview_flutter_android/lib/src/android_webview_controller.dart +++ b/packages/webview_flutter/webview_flutter_android/lib/src/android_webview_controller.dart @@ -740,6 +740,9 @@ class AndroidWebViewController extends PlatformWebViewController { Future setHorizontalScrollBarEnabled(bool enabled) => _webView.setHorizontalScrollBarEnabled(enabled); + @override + bool supportsSetScrollBarsEnabled() => true; + @override Future setOverScrollMode(WebViewOverScrollMode mode) { return switch (mode) { diff --git a/packages/webview_flutter/webview_flutter_platform_interface/lib/src/platform_webview_controller.dart b/packages/webview_flutter/webview_flutter_platform_interface/lib/src/platform_webview_controller.dart index 106487691af..97645c93cd3 100644 --- a/packages/webview_flutter/webview_flutter_platform_interface/lib/src/platform_webview_controller.dart +++ b/packages/webview_flutter/webview_flutter_platform_interface/lib/src/platform_webview_controller.dart @@ -241,6 +241,14 @@ abstract class PlatformWebViewController extends PlatformInterface { 'setHorizontalScrollBarEnabled is not implemented on the current platform'); } + /// Returns true if the current platform supports setting whether scrollbars + /// should be drawn or not. + /// + /// See [setVerticalScrollBarEnabled] and [setHorizontalScrollBarEnabled]. + bool supportsSetScrollBarsEnabled() { + return false; + } + /// Return the current scroll position of this view. /// /// Scroll position is measured from the top left. 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 015a86f26e4..eb999f98bb4 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 @@ -590,6 +590,9 @@ class WebKitWebViewController extends PlatformWebViewController { return _webView.scrollView.setShowsHorizontalScrollIndicator(enabled); } + @override + bool supportsSetScrollBarsEnabled() => true; + @override Future setBackgroundColor(Color color) { return Future.wait(>[ From d9de6736fd5fc9e3e0d93b6aa1f6b350e6091a8f Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Mon, 21 Apr 2025 17:19:25 -0400 Subject: [PATCH 20/29] query test platform interface --- .../test/platform_webview_controller_test.dart | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/webview_flutter/webview_flutter_platform_interface/test/platform_webview_controller_test.dart b/packages/webview_flutter/webview_flutter_platform_interface/test/platform_webview_controller_test.dart index 502589ed3a8..4af409cd8c7 100644 --- a/packages/webview_flutter/webview_flutter_platform_interface/test/platform_webview_controller_test.dart +++ b/packages/webview_flutter/webview_flutter_platform_interface/test/platform_webview_controller_test.dart @@ -337,6 +337,15 @@ void main() { ); }); + test('Default implementation of supportsSetScrollBarsEnabled returns false', + () {f + final PlatformWebViewController controller = + ExtendsPlatformWebViewController( + const PlatformWebViewControllerCreationParams()); + + expect(controller.supportsSetScrollBarsEnabled(), isFalse); + }); + test( 'Default implementation of getScrollPosition should throw unimplemented error', () { From cd1b2d7ddeb74a62c5c09ce5561e4090ad91987b Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Mon, 21 Apr 2025 17:24:44 -0400 Subject: [PATCH 21/29] reeturn value based on platform for wkwebview --- .../lib/src/webkit_webview_controller.dart | 13 ++++++++- .../test/webkit_webview_controller_test.dart | 28 +++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) 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 eb999f98bb4..2da49f04fae 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 @@ -591,7 +591,18 @@ class WebKitWebViewController extends PlatformWebViewController { } @override - bool supportsSetScrollBarsEnabled() => true; + bool supportsSetScrollBarsEnabled() { + switch (defaultTargetPlatform) { + case TargetPlatform.iOS: + return true; + case TargetPlatform.macOS: + return false; + case _: + throw UnsupportedError( + 'This plugin does not support this platform: $defaultTargetPlatform', + ); + } + } @override Future setBackgroundColor(Color color) { 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 fc91a8a9e5a..767f35fdc03 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 @@ -709,6 +709,34 @@ void main() { debugDefaultTargetPlatformOverride = null; }); + test('supportsSetScrollBarsEnabled returns true for iOS', () { + final MockUIScrollView mockScrollView = MockUIScrollView(); + + final WebKitWebViewController controller = createControllerWithMocks( + mockScrollView: mockScrollView, + ); + + debugDefaultTargetPlatformOverride = TargetPlatform.iOS; + + expect(controller.supportsSetScrollBarsEnabled(), true); + + debugDefaultTargetPlatformOverride = null; + }); + + test('supportsSetScrollBarsEnabled returns false for macOS', () { + final MockUIScrollView mockScrollView = MockUIScrollView(); + + final WebKitWebViewController controller = createControllerWithMocks( + mockScrollView: mockScrollView, + ); + + debugDefaultTargetPlatformOverride = TargetPlatform.macOS; + + expect(controller.supportsSetScrollBarsEnabled(), false); + + debugDefaultTargetPlatformOverride = null; + }); + test('disable zoom', () async { final MockWKUserContentController mockUserContentController = MockWKUserContentController(); From 1d52c56ffd289c64c6d8a43519f626c8f7233181 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Mon, 21 Apr 2025 17:34:00 -0400 Subject: [PATCH 22/29] accidental character --- .../test/platform_webview_controller_test.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/webview_flutter/webview_flutter_platform_interface/test/platform_webview_controller_test.dart b/packages/webview_flutter/webview_flutter_platform_interface/test/platform_webview_controller_test.dart index 4af409cd8c7..a0ac5002619 100644 --- a/packages/webview_flutter/webview_flutter_platform_interface/test/platform_webview_controller_test.dart +++ b/packages/webview_flutter/webview_flutter_platform_interface/test/platform_webview_controller_test.dart @@ -338,7 +338,7 @@ void main() { }); test('Default implementation of supportsSetScrollBarsEnabled returns false', - () {f + () { final PlatformWebViewController controller = ExtendsPlatformWebViewController( const PlatformWebViewControllerCreationParams()); From 61ab32a1a76e79c1791ca6ccf4d26dff0dade2b6 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Mon, 21 Apr 2025 19:44:49 -0400 Subject: [PATCH 23/29] docs that i prefer --- .../lib/src/platform_webview_controller.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/webview_flutter/webview_flutter_platform_interface/lib/src/platform_webview_controller.dart b/packages/webview_flutter/webview_flutter_platform_interface/lib/src/platform_webview_controller.dart index 97645c93cd3..9e294f01a1a 100644 --- a/packages/webview_flutter/webview_flutter_platform_interface/lib/src/platform_webview_controller.dart +++ b/packages/webview_flutter/webview_flutter_platform_interface/lib/src/platform_webview_controller.dart @@ -241,8 +241,8 @@ abstract class PlatformWebViewController extends PlatformInterface { 'setHorizontalScrollBarEnabled is not implemented on the current platform'); } - /// Returns true if the current platform supports setting whether scrollbars - /// should be drawn or not. + /// Whether the current platform supports enabling/disabling the scrollbars to + /// be drawn. /// /// See [setVerticalScrollBarEnabled] and [setHorizontalScrollBarEnabled]. bool supportsSetScrollBarsEnabled() { From a523caede1e92fdc9095420138ae585501d42499 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Tue, 13 May 2025 18:38:10 -0400 Subject: [PATCH 24/29] formatting --- .../webviewflutter/AndroidWebkitLibrary.g.kt | 3994 ++++++++++------- .../lib/src/android_webkit.g.dart | 208 +- 2 files changed, 2623 insertions(+), 1579 deletions(-) diff --git a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/AndroidWebkitLibrary.g.kt b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/AndroidWebkitLibrary.g.kt index 227a64ef44b..bb77054da22 100644 --- a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/AndroidWebkitLibrary.g.kt +++ b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/AndroidWebkitLibrary.g.kt @@ -10,16 +10,17 @@ package io.flutter.plugins.webviewflutter import android.util.Log import io.flutter.plugin.common.BasicMessageChannel import io.flutter.plugin.common.BinaryMessenger -import io.flutter.plugin.common.EventChannel import io.flutter.plugin.common.MessageCodec -import io.flutter.plugin.common.StandardMethodCodec import io.flutter.plugin.common.StandardMessageCodec import java.io.ByteArrayOutputStream import java.nio.ByteBuffer + private object AndroidWebkitLibraryPigeonUtils { fun createConnectionError(channelName: String): AndroidWebKitError { - return AndroidWebKitError("channel-error", "Unable to establish connection on channel: '$channelName'.", "") } + return AndroidWebKitError( + "channel-error", "Unable to establish connection on channel: '$channelName'.", "") + } fun wrapResult(result: Any?): List { return listOf(result) @@ -27,50 +28,48 @@ private object AndroidWebkitLibraryPigeonUtils { fun wrapError(exception: Throwable): List { return if (exception is AndroidWebKitError) { - listOf( - exception.code, - exception.message, - exception.details - ) + listOf(exception.code, exception.message, exception.details) } else { listOf( - exception.javaClass.simpleName, - exception.toString(), - "Cause: " + exception.cause + ", Stacktrace: " + Log.getStackTraceString(exception) - ) + exception.javaClass.simpleName, + exception.toString(), + "Cause: " + exception.cause + ", Stacktrace: " + Log.getStackTraceString(exception)) } } } /** * Error class for passing custom error details to Flutter via a thrown PlatformException. + * * @property code The error code. * @property message The error message. * @property details The error details. Must be a datatype supported by the api codec. */ -class AndroidWebKitError ( - val code: String, - override val message: String? = null, - val details: Any? = null +class AndroidWebKitError( + val code: String, + override val message: String? = null, + val details: Any? = null ) : Throwable() /** * Maintains instances used to communicate with the corresponding objects in Dart. * - * Objects stored in this container are represented by an object in Dart that is also stored in - * an InstanceManager with the same identifier. + * Objects stored in this container are represented by an object in Dart that is also stored in an + * InstanceManager with the same identifier. * * When an instance is added with an identifier, either can be used to retrieve the other. * - * Added instances are added as a weak reference and a strong reference. When the strong - * reference is removed with [remove] and the weak reference is deallocated, the - * `finalizationListener.onFinalize` is called with the instance's identifier. However, if the strong - * reference is removed and then the identifier is retrieved with the intention to pass the identifier - * to Dart (e.g. calling [getIdentifierForStrongReference]), the strong reference to the instance - * is recreated. The strong reference will then need to be removed manually again. + * Added instances are added as a weak reference and a strong reference. When the strong reference + * is removed with [remove] and the weak reference is deallocated, the + * `finalizationListener.onFinalize` is called with the instance's identifier. However, if the + * strong reference is removed and then the identifier is retrieved with the intention to pass the + * identifier to Dart (e.g. calling [getIdentifierForStrongReference]), the strong reference to the + * instance is recreated. The strong reference will then need to be removed manually again. */ @Suppress("UNCHECKED_CAST", "MemberVisibilityCanBePrivate") -class AndroidWebkitLibraryPigeonInstanceManager(private val finalizationListener: PigeonFinalizationListener) { - /** Interface for listening when a weak reference of an instance is removed from the manager. */ +class AndroidWebkitLibraryPigeonInstanceManager( + private val finalizationListener: PigeonFinalizationListener +) { + /** Interface for listening when a weak reference of an instance is removed from the manager. */ interface PigeonFinalizationListener { fun onFinalize(identifier: Long) } @@ -111,19 +110,20 @@ class AndroidWebkitLibraryPigeonInstanceManager(private val finalizationListener private const val tag = "PigeonInstanceManager" /** - * Instantiate a new manager with a listener for garbage collected weak - * references. + * Instantiate a new manager with a listener for garbage collected weak references. * * When the manager is no longer needed, [stopFinalizationListener] must be called. */ - fun create(finalizationListener: PigeonFinalizationListener): AndroidWebkitLibraryPigeonInstanceManager { + fun create( + finalizationListener: PigeonFinalizationListener + ): AndroidWebkitLibraryPigeonInstanceManager { return AndroidWebkitLibraryPigeonInstanceManager(finalizationListener) } } /** - * Removes `identifier` and return its associated strongly referenced instance, if present, - * from the manager. + * Removes `identifier` and return its associated strongly referenced instance, if present, from + * the manager. */ fun remove(identifier: Long): T? { logWarningIfFinalizationListenerHasStopped() @@ -133,15 +133,13 @@ class AndroidWebkitLibraryPigeonInstanceManager(private val finalizationListener /** * Retrieves the identifier paired with an instance, if present, otherwise `null`. * - * * If the manager contains a strong reference to `instance`, it will return the identifier * associated with `instance`. If the manager contains only a weak reference to `instance`, a new * strong reference to `instance` will be added and will need to be removed again with [remove]. * - * * If this method returns a nonnull identifier, this method also expects the Dart - * `AndroidWebkitLibraryPigeonInstanceManager` to have, or recreate, a weak reference to the Dart instance the - * identifier is associated with. + * `AndroidWebkitLibraryPigeonInstanceManager` to have, or recreate, a weak reference to the Dart + * instance the identifier is associated with. */ fun getIdentifierForStrongReference(instance: Any?): Long? { logWarningIfFinalizationListenerHasStopped() @@ -155,9 +153,9 @@ class AndroidWebkitLibraryPigeonInstanceManager(private val finalizationListener /** * Adds a new instance that was instantiated from Dart. * - * The same instance can be added multiple times, but each identifier must be unique. This - * allows two objects that are equivalent (e.g. the `equals` method returns true and their - * hashcodes are equal) to both be added. + * The same instance can be added multiple times, but each identifier must be unique. This allows + * two objects that are equivalent (e.g. the `equals` method returns true and their hashcodes are + * equal) to both be added. * * [identifier] must be >= 0 and unique. */ @@ -169,13 +167,15 @@ class AndroidWebkitLibraryPigeonInstanceManager(private val finalizationListener /** * Adds a new unique instance that was instantiated from the host platform. * - * If the manager contains [instance], this returns the corresponding identifier. If the - * manager does not contain [instance], this adds the instance and returns a unique - * identifier for that [instance]. + * If the manager contains [instance], this returns the corresponding identifier. If the manager + * does not contain [instance], this adds the instance and returns a unique identifier for that + * [instance]. */ fun addHostCreatedInstance(instance: Any): Long { logWarningIfFinalizationListenerHasStopped() - require(!containsInstance(instance)) { "Instance of ${instance.javaClass} has already been added." } + require(!containsInstance(instance)) { + "Instance of ${instance.javaClass} has already been added." + } val identifier = nextIdentifier++ addInstance(instance, identifier) return identifier @@ -233,7 +233,8 @@ class AndroidWebkitLibraryPigeonInstanceManager(private val finalizationListener return } var reference: java.lang.ref.WeakReference? - while ((referenceQueue.poll() as java.lang.ref.WeakReference?).also { reference = it } != null) { + while ((referenceQueue.poll() as java.lang.ref.WeakReference?).also { reference = it } != + null) { val identifier = weakReferencesToIdentifiers.remove(reference) if (identifier != null) { weakInstances.remove(identifier) @@ -259,39 +260,43 @@ class AndroidWebkitLibraryPigeonInstanceManager(private val finalizationListener private fun logWarningIfFinalizationListenerHasStopped() { if (hasFinalizationListenerStopped()) { Log.w( - tag, - "The manager was used after calls to the PigeonFinalizationListener has been stopped." - ) + tag, + "The manager was used after calls to the PigeonFinalizationListener has been stopped.") } } } - /** Generated API for managing the Dart and native `InstanceManager`s. */ private class AndroidWebkitLibraryPigeonInstanceManagerApi(val binaryMessenger: BinaryMessenger) { companion object { /** The codec used by AndroidWebkitLibraryPigeonInstanceManagerApi. */ - val codec: MessageCodec by lazy { - AndroidWebkitLibraryPigeonCodec() - } + val codec: MessageCodec by lazy { AndroidWebkitLibraryPigeonCodec() } /** - * Sets up an instance of `AndroidWebkitLibraryPigeonInstanceManagerApi` to handle messages from the - * `binaryMessenger`. + * Sets up an instance of `AndroidWebkitLibraryPigeonInstanceManagerApi` to handle messages from + * the `binaryMessenger`. */ - fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, instanceManager: AndroidWebkitLibraryPigeonInstanceManager?) { + fun setUpMessageHandlers( + binaryMessenger: BinaryMessenger, + instanceManager: AndroidWebkitLibraryPigeonInstanceManager? + ) { run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.PigeonInternalInstanceManager.removeStrongReference", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.PigeonInternalInstanceManager.removeStrongReference", + codec) if (instanceManager != null) { channel.setMessageHandler { message, reply -> val args = message as List val identifierArg = args[0] as Long - val wrapped: List = try { - instanceManager.remove(identifierArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + instanceManager.remove(identifierArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -299,15 +304,20 @@ private class AndroidWebkitLibraryPigeonInstanceManagerApi(val binaryMessenger: } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.PigeonInternalInstanceManager.clear", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.PigeonInternalInstanceManager.clear", + codec) if (instanceManager != null) { channel.setMessageHandler { _, reply -> - val wrapped: List = try { - instanceManager.clear() - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + instanceManager.clear() + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -317,26 +327,28 @@ private class AndroidWebkitLibraryPigeonInstanceManagerApi(val binaryMessenger: } } - fun removeStrongReference(identifierArg: Long, callback: (Result) -> Unit) -{ - val channelName = "dev.flutter.pigeon.webview_flutter_android.PigeonInternalInstanceManager.removeStrongReference" + fun removeStrongReference(identifierArg: Long, callback: (Result) -> Unit) { + val channelName = + "dev.flutter.pigeon.webview_flutter_android.PigeonInternalInstanceManager.removeStrongReference" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } } /** - * Provides implementations for each ProxyApi implementation and provides access to resources - * needed by any implementation. + * Provides implementations for each ProxyApi implementation and provides access to resources needed + * by any implementation. */ abstract class AndroidWebkitLibraryPigeonProxyApiRegistrar(val binaryMessenger: BinaryMessenger) { /** Whether APIs should ignore calling to Dart. */ @@ -353,20 +365,19 @@ abstract class AndroidWebkitLibraryPigeonProxyApiRegistrar(val binaryMessenger: init { val api = AndroidWebkitLibraryPigeonInstanceManagerApi(binaryMessenger) - instanceManager = AndroidWebkitLibraryPigeonInstanceManager.create( - object : AndroidWebkitLibraryPigeonInstanceManager.PigeonFinalizationListener { - override fun onFinalize(identifier: Long) { - api.removeStrongReference(identifier) { - if (it.isFailure) { - Log.e( - "PigeonProxyApiRegistrar", - "Failed to remove Dart strong reference with identifier: $identifier" - ) - } - } - } - } - ) + instanceManager = + AndroidWebkitLibraryPigeonInstanceManager.create( + object : AndroidWebkitLibraryPigeonInstanceManager.PigeonFinalizationListener { + override fun onFinalize(identifier: Long) { + api.removeStrongReference(identifier) { + if (it.isFailure) { + Log.e( + "PigeonProxyApiRegistrar", + "Failed to remove Dart strong reference with identifier: $identifier") + } + } + } + }) } /** * An implementation of [PigeonApiWebResourceRequest] used to add a new Dart instance of @@ -393,8 +404,8 @@ abstract class AndroidWebkitLibraryPigeonProxyApiRegistrar(val binaryMessenger: abstract fun getPigeonApiWebResourceErrorCompat(): PigeonApiWebResourceErrorCompat /** - * An implementation of [PigeonApiWebViewPoint] used to add a new Dart instance of - * `WebViewPoint` to the Dart `InstanceManager`. + * An implementation of [PigeonApiWebViewPoint] used to add a new Dart instance of `WebViewPoint` + * to the Dart `InstanceManager`. */ abstract fun getPigeonApiWebViewPoint(): PigeonApiWebViewPoint @@ -411,14 +422,14 @@ abstract class AndroidWebkitLibraryPigeonProxyApiRegistrar(val binaryMessenger: abstract fun getPigeonApiCookieManager(): PigeonApiCookieManager /** - * An implementation of [PigeonApiWebView] used to add a new Dart instance of - * `WebView` to the Dart `InstanceManager`. + * An implementation of [PigeonApiWebView] used to add a new Dart instance of `WebView` to the + * Dart `InstanceManager`. */ abstract fun getPigeonApiWebView(): PigeonApiWebView /** - * An implementation of [PigeonApiWebSettings] used to add a new Dart instance of - * `WebSettings` to the Dart `InstanceManager`. + * An implementation of [PigeonApiWebSettings] used to add a new Dart instance of `WebSettings` to + * the Dart `InstanceManager`. */ abstract fun getPigeonApiWebSettings(): PigeonApiWebSettings @@ -453,8 +464,8 @@ abstract class AndroidWebkitLibraryPigeonProxyApiRegistrar(val binaryMessenger: abstract fun getPigeonApiFlutterAssetManager(): PigeonApiFlutterAssetManager /** - * An implementation of [PigeonApiWebStorage] used to add a new Dart instance of - * `WebStorage` to the Dart `InstanceManager`. + * An implementation of [PigeonApiWebStorage] used to add a new Dart instance of `WebStorage` to + * the Dart `InstanceManager`. */ abstract fun getPigeonApiWebStorage(): PigeonApiWebStorage @@ -477,14 +488,14 @@ abstract class AndroidWebkitLibraryPigeonProxyApiRegistrar(val binaryMessenger: abstract fun getPigeonApiCustomViewCallback(): PigeonApiCustomViewCallback /** - * An implementation of [PigeonApiView] used to add a new Dart instance of - * `View` to the Dart `InstanceManager`. + * An implementation of [PigeonApiView] used to add a new Dart instance of `View` to the Dart + * `InstanceManager`. */ abstract fun getPigeonApiView(): PigeonApiView /** - * An implementation of [PigeonApiGeolocationPermissionsCallback] used to add a new Dart instance of - * `GeolocationPermissionsCallback` to the Dart `InstanceManager`. + * An implementation of [PigeonApiGeolocationPermissionsCallback] used to add a new Dart instance + * of `GeolocationPermissionsCallback` to the Dart `InstanceManager`. */ abstract fun getPigeonApiGeolocationPermissionsCallback(): PigeonApiGeolocationPermissionsCallback @@ -507,11 +518,10 @@ abstract class AndroidWebkitLibraryPigeonProxyApiRegistrar(val binaryMessenger: abstract fun getPigeonApiClientCertRequest(): PigeonApiClientCertRequest /** - * An implementation of [PigeonApiPrivateKey] used to add a new Dart instance of - * `PrivateKey` to the Dart `InstanceManager`. + * An implementation of [PigeonApiPrivateKey] used to add a new Dart instance of `PrivateKey` to + * the Dart `InstanceManager`. */ - open fun getPigeonApiPrivateKey(): PigeonApiPrivateKey - { + open fun getPigeonApiPrivateKey(): PigeonApiPrivateKey { return PigeonApiPrivateKey(this) } @@ -519,8 +529,7 @@ abstract class AndroidWebkitLibraryPigeonProxyApiRegistrar(val binaryMessenger: * An implementation of [PigeonApiX509Certificate] used to add a new Dart instance of * `X509Certificate` to the Dart `InstanceManager`. */ - open fun getPigeonApiX509Certificate(): PigeonApiX509Certificate - { + open fun getPigeonApiX509Certificate(): PigeonApiX509Certificate { return PigeonApiX509Certificate(this) } @@ -531,8 +540,8 @@ abstract class AndroidWebkitLibraryPigeonProxyApiRegistrar(val binaryMessenger: abstract fun getPigeonApiSslErrorHandler(): PigeonApiSslErrorHandler /** - * An implementation of [PigeonApiSslError] used to add a new Dart instance of - * `SslError` to the Dart `InstanceManager`. + * An implementation of [PigeonApiSslError] used to add a new Dart instance of `SslError` to the + * Dart `InstanceManager`. */ abstract fun getPigeonApiSslError(): PigeonApiSslError @@ -549,28 +558,37 @@ abstract class AndroidWebkitLibraryPigeonProxyApiRegistrar(val binaryMessenger: abstract fun getPigeonApiSslCertificate(): PigeonApiSslCertificate fun setUp() { - AndroidWebkitLibraryPigeonInstanceManagerApi.setUpMessageHandlers(binaryMessenger, instanceManager) + AndroidWebkitLibraryPigeonInstanceManagerApi.setUpMessageHandlers( + binaryMessenger, instanceManager) PigeonApiCookieManager.setUpMessageHandlers(binaryMessenger, getPigeonApiCookieManager()) PigeonApiWebView.setUpMessageHandlers(binaryMessenger, getPigeonApiWebView()) PigeonApiWebSettings.setUpMessageHandlers(binaryMessenger, getPigeonApiWebSettings()) - PigeonApiJavaScriptChannel.setUpMessageHandlers(binaryMessenger, getPigeonApiJavaScriptChannel()) + PigeonApiJavaScriptChannel.setUpMessageHandlers( + binaryMessenger, getPigeonApiJavaScriptChannel()) PigeonApiWebViewClient.setUpMessageHandlers(binaryMessenger, getPigeonApiWebViewClient()) PigeonApiDownloadListener.setUpMessageHandlers(binaryMessenger, getPigeonApiDownloadListener()) PigeonApiWebChromeClient.setUpMessageHandlers(binaryMessenger, getPigeonApiWebChromeClient()) - PigeonApiFlutterAssetManager.setUpMessageHandlers(binaryMessenger, getPigeonApiFlutterAssetManager()) + PigeonApiFlutterAssetManager.setUpMessageHandlers( + binaryMessenger, getPigeonApiFlutterAssetManager()) PigeonApiWebStorage.setUpMessageHandlers(binaryMessenger, getPigeonApiWebStorage()) - PigeonApiPermissionRequest.setUpMessageHandlers(binaryMessenger, getPigeonApiPermissionRequest()) - PigeonApiCustomViewCallback.setUpMessageHandlers(binaryMessenger, getPigeonApiCustomViewCallback()) + PigeonApiPermissionRequest.setUpMessageHandlers( + binaryMessenger, getPigeonApiPermissionRequest()) + PigeonApiCustomViewCallback.setUpMessageHandlers( + binaryMessenger, getPigeonApiCustomViewCallback()) PigeonApiView.setUpMessageHandlers(binaryMessenger, getPigeonApiView()) - PigeonApiGeolocationPermissionsCallback.setUpMessageHandlers(binaryMessenger, getPigeonApiGeolocationPermissionsCallback()) + PigeonApiGeolocationPermissionsCallback.setUpMessageHandlers( + binaryMessenger, getPigeonApiGeolocationPermissionsCallback()) PigeonApiHttpAuthHandler.setUpMessageHandlers(binaryMessenger, getPigeonApiHttpAuthHandler()) PigeonApiAndroidMessage.setUpMessageHandlers(binaryMessenger, getPigeonApiAndroidMessage()) - PigeonApiClientCertRequest.setUpMessageHandlers(binaryMessenger, getPigeonApiClientCertRequest()) + PigeonApiClientCertRequest.setUpMessageHandlers( + binaryMessenger, getPigeonApiClientCertRequest()) PigeonApiSslErrorHandler.setUpMessageHandlers(binaryMessenger, getPigeonApiSslErrorHandler()) PigeonApiSslError.setUpMessageHandlers(binaryMessenger, getPigeonApiSslError()) - PigeonApiSslCertificateDName.setUpMessageHandlers(binaryMessenger, getPigeonApiSslCertificateDName()) + PigeonApiSslCertificateDName.setUpMessageHandlers( + binaryMessenger, getPigeonApiSslCertificateDName()) PigeonApiSslCertificate.setUpMessageHandlers(binaryMessenger, getPigeonApiSslCertificate()) } + fun tearDown() { AndroidWebkitLibraryPigeonInstanceManagerApi.setUpMessageHandlers(binaryMessenger, null) PigeonApiCookieManager.setUpMessageHandlers(binaryMessenger, null) @@ -595,17 +613,17 @@ abstract class AndroidWebkitLibraryPigeonProxyApiRegistrar(val binaryMessenger: PigeonApiSslCertificate.setUpMessageHandlers(binaryMessenger, null) } } -private class AndroidWebkitLibraryPigeonProxyApiBaseCodec(val registrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) : AndroidWebkitLibraryPigeonCodec() { + +private class AndroidWebkitLibraryPigeonProxyApiBaseCodec( + val registrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) : AndroidWebkitLibraryPigeonCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { 128.toByte() -> { val identifier: Long = readValue(buffer) as Long val instance: Any? = registrar.instanceManager.getInstance(identifier) if (instance == null) { - Log.e( - "PigeonProxyApiBaseCodec", - "Failed to find instance with identifier: $identifier" - ) + Log.e("PigeonProxyApiBaseCodec", "Failed to find instance with identifier: $identifier") } return instance } @@ -614,97 +632,86 @@ private class AndroidWebkitLibraryPigeonProxyApiBaseCodec(val registrar: Android } override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { - if (value is Boolean || value is ByteArray || value is Double || value is DoubleArray || value is FloatArray || value is Int || value is IntArray || value is List<*> || value is Long || value is LongArray || value is Map<*, *> || value is String || value is FileChooserMode || value is ConsoleMessageLevel || value is OverScrollMode || value is SslErrorType || value == null) { + if (value is Boolean || + value is ByteArray || + value is Double || + value is DoubleArray || + value is FloatArray || + value is Int || + value is IntArray || + value is List<*> || + value is Long || + value is LongArray || + value is Map<*, *> || + value is String || + value is FileChooserMode || + value is ConsoleMessageLevel || + value is OverScrollMode || + value is SslErrorType || + value == null) { super.writeValue(stream, value) return } if (value is android.webkit.WebResourceRequest) { - registrar.getPigeonApiWebResourceRequest().pigeon_newInstance(value) { } - } - else if (value is android.webkit.WebResourceResponse) { - registrar.getPigeonApiWebResourceResponse().pigeon_newInstance(value) { } - } - else if (android.os.Build.VERSION.SDK_INT >= 23 && value is android.webkit.WebResourceError) { - registrar.getPigeonApiWebResourceError().pigeon_newInstance(value) { } - } - else if (value is androidx.webkit.WebResourceErrorCompat) { - registrar.getPigeonApiWebResourceErrorCompat().pigeon_newInstance(value) { } - } - else if (value is WebViewPoint) { - registrar.getPigeonApiWebViewPoint().pigeon_newInstance(value) { } - } - else if (value is android.webkit.ConsoleMessage) { - registrar.getPigeonApiConsoleMessage().pigeon_newInstance(value) { } - } - else if (value is android.webkit.CookieManager) { - registrar.getPigeonApiCookieManager().pigeon_newInstance(value) { } - } - else if (value is android.webkit.WebView) { - registrar.getPigeonApiWebView().pigeon_newInstance(value) { } - } - else if (value is android.webkit.WebSettings) { - registrar.getPigeonApiWebSettings().pigeon_newInstance(value) { } - } - else if (value is JavaScriptChannel) { - registrar.getPigeonApiJavaScriptChannel().pigeon_newInstance(value) { } - } - else if (value is android.webkit.WebViewClient) { - registrar.getPigeonApiWebViewClient().pigeon_newInstance(value) { } - } - else if (value is android.webkit.DownloadListener) { - registrar.getPigeonApiDownloadListener().pigeon_newInstance(value) { } - } - else if (value is io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl) { - registrar.getPigeonApiWebChromeClient().pigeon_newInstance(value) { } - } - else if (value is io.flutter.plugins.webviewflutter.FlutterAssetManager) { - registrar.getPigeonApiFlutterAssetManager().pigeon_newInstance(value) { } - } - else if (value is android.webkit.WebStorage) { - registrar.getPigeonApiWebStorage().pigeon_newInstance(value) { } - } - else if (value is android.webkit.WebChromeClient.FileChooserParams) { - registrar.getPigeonApiFileChooserParams().pigeon_newInstance(value) { } - } - else if (value is android.webkit.PermissionRequest) { - registrar.getPigeonApiPermissionRequest().pigeon_newInstance(value) { } - } - else if (value is android.webkit.WebChromeClient.CustomViewCallback) { - registrar.getPigeonApiCustomViewCallback().pigeon_newInstance(value) { } - } - else if (value is android.view.View) { - registrar.getPigeonApiView().pigeon_newInstance(value) { } - } - else if (value is android.webkit.GeolocationPermissions.Callback) { - registrar.getPigeonApiGeolocationPermissionsCallback().pigeon_newInstance(value) { } - } - else if (value is android.webkit.HttpAuthHandler) { - registrar.getPigeonApiHttpAuthHandler().pigeon_newInstance(value) { } - } - else if (value is android.os.Message) { - registrar.getPigeonApiAndroidMessage().pigeon_newInstance(value) { } - } - else if (value is android.webkit.ClientCertRequest) { - registrar.getPigeonApiClientCertRequest().pigeon_newInstance(value) { } - } - else if (value is java.security.PrivateKey) { - registrar.getPigeonApiPrivateKey().pigeon_newInstance(value) { } - } - else if (value is java.security.cert.X509Certificate) { - registrar.getPigeonApiX509Certificate().pigeon_newInstance(value) { } - } - else if (value is android.webkit.SslErrorHandler) { - registrar.getPigeonApiSslErrorHandler().pigeon_newInstance(value) { } - } - else if (value is android.net.http.SslError) { - registrar.getPigeonApiSslError().pigeon_newInstance(value) { } - } - else if (value is android.net.http.SslCertificate.DName) { - registrar.getPigeonApiSslCertificateDName().pigeon_newInstance(value) { } - } - else if (value is android.net.http.SslCertificate) { - registrar.getPigeonApiSslCertificate().pigeon_newInstance(value) { } + registrar.getPigeonApiWebResourceRequest().pigeon_newInstance(value) {} + } else if (value is android.webkit.WebResourceResponse) { + registrar.getPigeonApiWebResourceResponse().pigeon_newInstance(value) {} + } else if (android.os.Build.VERSION.SDK_INT >= 23 && value is android.webkit.WebResourceError) { + registrar.getPigeonApiWebResourceError().pigeon_newInstance(value) {} + } else if (value is androidx.webkit.WebResourceErrorCompat) { + registrar.getPigeonApiWebResourceErrorCompat().pigeon_newInstance(value) {} + } else if (value is WebViewPoint) { + registrar.getPigeonApiWebViewPoint().pigeon_newInstance(value) {} + } else if (value is android.webkit.ConsoleMessage) { + registrar.getPigeonApiConsoleMessage().pigeon_newInstance(value) {} + } else if (value is android.webkit.CookieManager) { + registrar.getPigeonApiCookieManager().pigeon_newInstance(value) {} + } else if (value is android.webkit.WebView) { + registrar.getPigeonApiWebView().pigeon_newInstance(value) {} + } else if (value is android.webkit.WebSettings) { + registrar.getPigeonApiWebSettings().pigeon_newInstance(value) {} + } else if (value is JavaScriptChannel) { + registrar.getPigeonApiJavaScriptChannel().pigeon_newInstance(value) {} + } else if (value is android.webkit.WebViewClient) { + registrar.getPigeonApiWebViewClient().pigeon_newInstance(value) {} + } else if (value is android.webkit.DownloadListener) { + registrar.getPigeonApiDownloadListener().pigeon_newInstance(value) {} + } else if (value + is io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl) { + registrar.getPigeonApiWebChromeClient().pigeon_newInstance(value) {} + } else if (value is io.flutter.plugins.webviewflutter.FlutterAssetManager) { + registrar.getPigeonApiFlutterAssetManager().pigeon_newInstance(value) {} + } else if (value is android.webkit.WebStorage) { + registrar.getPigeonApiWebStorage().pigeon_newInstance(value) {} + } else if (value is android.webkit.WebChromeClient.FileChooserParams) { + registrar.getPigeonApiFileChooserParams().pigeon_newInstance(value) {} + } else if (value is android.webkit.PermissionRequest) { + registrar.getPigeonApiPermissionRequest().pigeon_newInstance(value) {} + } else if (value is android.webkit.WebChromeClient.CustomViewCallback) { + registrar.getPigeonApiCustomViewCallback().pigeon_newInstance(value) {} + } else if (value is android.view.View) { + registrar.getPigeonApiView().pigeon_newInstance(value) {} + } else if (value is android.webkit.GeolocationPermissions.Callback) { + registrar.getPigeonApiGeolocationPermissionsCallback().pigeon_newInstance(value) {} + } else if (value is android.webkit.HttpAuthHandler) { + registrar.getPigeonApiHttpAuthHandler().pigeon_newInstance(value) {} + } else if (value is android.os.Message) { + registrar.getPigeonApiAndroidMessage().pigeon_newInstance(value) {} + } else if (value is android.webkit.ClientCertRequest) { + registrar.getPigeonApiClientCertRequest().pigeon_newInstance(value) {} + } else if (value is java.security.PrivateKey) { + registrar.getPigeonApiPrivateKey().pigeon_newInstance(value) {} + } else if (value is java.security.cert.X509Certificate) { + registrar.getPigeonApiX509Certificate().pigeon_newInstance(value) {} + } else if (value is android.webkit.SslErrorHandler) { + registrar.getPigeonApiSslErrorHandler().pigeon_newInstance(value) {} + } else if (value is android.net.http.SslError) { + registrar.getPigeonApiSslError().pigeon_newInstance(value) {} + } else if (value is android.net.http.SslCertificate.DName) { + registrar.getPigeonApiSslCertificateDName().pigeon_newInstance(value) {} + } else if (value is android.net.http.SslCertificate) { + registrar.getPigeonApiSslCertificate().pigeon_newInstance(value) {} } when { @@ -712,7 +719,9 @@ private class AndroidWebkitLibraryPigeonProxyApiBaseCodec(val registrar: Android stream.write(128) writeValue(stream, registrar.instanceManager.getIdentifierForStrongReference(value)) } - else -> throw IllegalArgumentException("Unsupported value: '$value' of type '${value.javaClass.name}'") + else -> + throw IllegalArgumentException( + "Unsupported value: '$value' of type '${value.javaClass.name}'") } } } @@ -724,29 +733,31 @@ private class AndroidWebkitLibraryPigeonProxyApiBaseCodec(val registrar: Android */ enum class FileChooserMode(val raw: Int) { /** - * Open single file and requires that the file exists before allowing the - * user to pick it. + * Open single file and requires that the file exists before allowing the user to pick it. * - * See https://developer.android.com/reference/android/webkit/WebChromeClient.FileChooserParams#MODE_OPEN. + * See + * https://developer.android.com/reference/android/webkit/WebChromeClient.FileChooserParams#MODE_OPEN. */ OPEN(0), /** * Similar to [open] but allows multiple files to be selected. * - * See https://developer.android.com/reference/android/webkit/WebChromeClient.FileChooserParams#MODE_OPEN_MULTIPLE. + * See + * https://developer.android.com/reference/android/webkit/WebChromeClient.FileChooserParams#MODE_OPEN_MULTIPLE. */ OPEN_MULTIPLE(1), /** * Allows picking a nonexistent file and saving it. * - * See https://developer.android.com/reference/android/webkit/WebChromeClient.FileChooserParams#MODE_SAVE. + * See + * https://developer.android.com/reference/android/webkit/WebChromeClient.FileChooserParams#MODE_SAVE. */ SAVE(2), /** * Indicates a `FileChooserMode` with an unknown mode. * - * This does not represent an actual value provided by the platform and only - * indicates a value was provided that isn't currently supported. + * This does not represent an actual value provided by the platform and only indicates a value was + * provided that isn't currently supported. */ UNKNOWN(3); @@ -796,8 +807,8 @@ enum class ConsoleMessageLevel(val raw: Int) { /** * Indicates a message with an unknown level. * - * This does not represent an actual value provided by the platform and only - * indicates a value was provided that isn't currently supported. + * This does not represent an actual value provided by the platform and only indicates a value was + * provided that isn't currently supported. */ UNKNOWN(5); @@ -814,14 +825,11 @@ enum class ConsoleMessageLevel(val raw: Int) { * See https://developer.android.com/reference/android/view/View#OVER_SCROLL_ALWAYS. */ enum class OverScrollMode(val raw: Int) { - /** - * Always allow a user to over-scroll this view, provided it is a view that - * can scroll. - */ + /** Always allow a user to over-scroll this view, provided it is a view that can scroll. */ ALWAYS(0), /** - * Allow a user to over-scroll this view only if the content is large enough - * to meaningfully scroll, provided it is a view that can scroll. + * Allow a user to over-scroll this view only if the content is large enough to meaningfully + * scroll, provided it is a view that can scroll. */ IF_CONTENT_SCROLLS(1), /** Never allow a user to over-scroll this view. */ @@ -863,33 +871,27 @@ enum class SslErrorType(val raw: Int) { } } } + private open class AndroidWebkitLibraryPigeonCodec : StandardMessageCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { 129.toByte() -> { - return (readValue(buffer) as Long?)?.let { - FileChooserMode.ofRaw(it.toInt()) - } + return (readValue(buffer) as Long?)?.let { FileChooserMode.ofRaw(it.toInt()) } } 130.toByte() -> { - return (readValue(buffer) as Long?)?.let { - ConsoleMessageLevel.ofRaw(it.toInt()) - } + return (readValue(buffer) as Long?)?.let { ConsoleMessageLevel.ofRaw(it.toInt()) } } 131.toByte() -> { - return (readValue(buffer) as Long?)?.let { - OverScrollMode.ofRaw(it.toInt()) - } + return (readValue(buffer) as Long?)?.let { OverScrollMode.ofRaw(it.toInt()) } } 132.toByte() -> { - return (readValue(buffer) as Long?)?.let { - SslErrorType.ofRaw(it.toInt()) - } + return (readValue(buffer) as Long?)?.let { SslErrorType.ofRaw(it.toInt()) } } else -> super.readValueOfType(type, buffer) } } - override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { + + override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { when (value) { is FileChooserMode -> { stream.write(129) @@ -918,7 +920,9 @@ private open class AndroidWebkitLibraryPigeonCodec : StandardMessageCodec() { * See https://developer.android.com/reference/android/webkit/WebResourceRequest. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiWebResourceRequest(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiWebResourceRequest( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { /** The URL for which the resource request was made. */ abstract fun url(pigeon_instance: android.webkit.WebResourceRequest): String @@ -935,20 +939,25 @@ abstract class PigeonApiWebResourceRequest(open val pigeonRegistrar: AndroidWebk abstract fun method(pigeon_instance: android.webkit.WebResourceRequest): String /** The headers associated with the request. */ - abstract fun requestHeaders(pigeon_instance: android.webkit.WebResourceRequest): Map? + abstract fun requestHeaders( + pigeon_instance: android.webkit.WebResourceRequest + ): Map? @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of WebResourceRequest and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.webkit.WebResourceRequest, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.webkit.WebResourceRequest, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val urlArg = url(pigeon_instanceArg) val isForMainFrameArg = isForMainFrame(pigeon_instanceArg) val isRedirectArg = isRedirect(pigeon_instanceArg) @@ -957,22 +966,34 @@ abstract class PigeonApiWebResourceRequest(open val pigeonRegistrar: AndroidWebk val requestHeadersArg = requestHeaders(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.WebResourceRequest.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.WebResourceRequest.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_identifierArg, urlArg, isForMainFrameArg, isRedirectArg, hasGestureArg, methodArg, requestHeadersArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) - } else { - callback(Result.success(Unit)) + channel.send( + listOf( + pigeon_identifierArg, + urlArg, + isForMainFrameArg, + isRedirectArg, + hasGestureArg, + methodArg, + requestHeadersArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback( + Result.failure( + AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } - } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } - } } } - } /** * Encapsulates a resource response. @@ -980,50 +1001,59 @@ abstract class PigeonApiWebResourceRequest(open val pigeonRegistrar: AndroidWebk * See https://developer.android.com/reference/android/webkit/WebResourceResponse. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiWebResourceResponse(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiWebResourceResponse( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { /** The resource response's status code. */ abstract fun statusCode(pigeon_instance: android.webkit.WebResourceResponse): Long @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of WebResourceResponse and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.webkit.WebResourceResponse, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.webkit.WebResourceResponse, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val statusCodeArg = statusCode(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.WebResourceResponse.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.WebResourceResponse.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg, statusCodeArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } } } - } /** - * Encapsulates information about errors that occurred during loading of web - * resources. + * Encapsulates information about errors that occurred during loading of web resources. * * See https://developer.android.com/reference/android/webkit/WebResourceError. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiWebResourceError(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiWebResourceError( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { /** The error code of the error. */ @androidx.annotation.RequiresApi(api = 23) abstract fun errorCode(pigeon_instance: android.webkit.WebResourceError): Long @@ -1035,45 +1065,52 @@ abstract class PigeonApiWebResourceError(open val pigeonRegistrar: AndroidWebkit @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of WebResourceError and attaches it to [pigeon_instanceArg]. */ @androidx.annotation.RequiresApi(api = 23) - fun pigeon_newInstance(pigeon_instanceArg: android.webkit.WebResourceError, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.webkit.WebResourceError, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val errorCodeArg = errorCode(pigeon_instanceArg) val descriptionArg = description(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.WebResourceError.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.WebResourceError.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg, errorCodeArg, descriptionArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } } } - } /** - * Encapsulates information about errors that occurred during loading of web - * resources. + * Encapsulates information about errors that occurred during loading of web resources. * * See https://developer.android.com/reference/androidx/webkit/WebResourceErrorCompat. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiWebResourceErrorCompat(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiWebResourceErrorCompat( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { /** The error code of the error. */ abstract fun errorCode(pigeon_instance: androidx.webkit.WebResourceErrorCompat): Long @@ -1082,36 +1119,42 @@ abstract class PigeonApiWebResourceErrorCompat(open val pigeonRegistrar: Android @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of WebResourceErrorCompat and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: androidx.webkit.WebResourceErrorCompat, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: androidx.webkit.WebResourceErrorCompat, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val errorCodeArg = errorCode(pigeon_instanceArg) val descriptionArg = description(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.WebResourceErrorCompat.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.WebResourceErrorCompat.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg, errorCodeArg, descriptionArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } } } - } /** * Represents a position on a web page. @@ -1119,23 +1162,25 @@ abstract class PigeonApiWebResourceErrorCompat(open val pigeonRegistrar: Android * This is a custom class created for convenience of the wrapper. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiWebViewPoint(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiWebViewPoint( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { abstract fun x(pigeon_instance: WebViewPoint): Long abstract fun y(pigeon_instance: WebViewPoint): Long @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of WebViewPoint and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: WebViewPoint, callback: (Result) -> Unit) -{ + fun pigeon_newInstance(pigeon_instanceArg: WebViewPoint, callback: (Result) -> Unit) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val xArg = x(pigeon_instanceArg) val yArg = y(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger @@ -1145,17 +1190,19 @@ abstract class PigeonApiWebViewPoint(open val pigeonRegistrar: AndroidWebkitLibr channel.send(listOf(pigeon_identifierArg, xArg, yArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } } } - } /** * Represents a JavaScript console message from WebCore. @@ -1163,7 +1210,9 @@ abstract class PigeonApiWebViewPoint(open val pigeonRegistrar: AndroidWebkitLibr * See https://developer.android.com/reference/android/webkit/ConsoleMessage */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiConsoleMessage(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiConsoleMessage( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { abstract fun lineNumber(pigeon_instance: android.webkit.ConsoleMessage): Long abstract fun message(pigeon_instance: android.webkit.ConsoleMessage): String @@ -1174,38 +1223,44 @@ abstract class PigeonApiConsoleMessage(open val pigeonRegistrar: AndroidWebkitLi @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of ConsoleMessage and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.webkit.ConsoleMessage, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.webkit.ConsoleMessage, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val lineNumberArg = lineNumber(pigeon_instanceArg) val messageArg = message(pigeon_instanceArg) val levelArg = level(pigeon_instanceArg) val sourceIdArg = sourceId(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.ConsoleMessage.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.ConsoleMessage.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg, lineNumberArg, messageArg, levelArg, sourceIdArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } } } - } /** * Manages the cookies used by an application's `WebView` instances. @@ -1213,34 +1268,49 @@ abstract class PigeonApiConsoleMessage(open val pigeonRegistrar: AndroidWebkitLi * See https://developer.android.com/reference/android/webkit/CookieManager. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiCookieManager(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiCookieManager( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { abstract fun instance(): android.webkit.CookieManager /** Sets a single cookie (key-value pair) for the given URL. */ abstract fun setCookie(pigeon_instance: android.webkit.CookieManager, url: String, value: String) /** Removes all cookies. */ - abstract fun removeAllCookies(pigeon_instance: android.webkit.CookieManager, callback: (Result) -> Unit) + abstract fun removeAllCookies( + pigeon_instance: android.webkit.CookieManager, + callback: (Result) -> Unit + ) /** Sets whether the `WebView` should allow third party cookies to be set. */ - abstract fun setAcceptThirdPartyCookies(pigeon_instance: android.webkit.CookieManager, webView: android.webkit.WebView, accept: Boolean) + abstract fun setAcceptThirdPartyCookies( + pigeon_instance: android.webkit.CookieManager, + webView: android.webkit.WebView, + accept: Boolean + ) companion object { @Suppress("LocalVariableName") fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiCookieManager?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.CookieManager.instance", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.CookieManager.instance", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_identifierArg = args[0] as Long - val wrapped: List = try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.instance(), pigeon_identifierArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + api.instance(), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1248,19 +1318,24 @@ abstract class PigeonApiCookieManager(open val pigeonRegistrar: AndroidWebkitLib } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.CookieManager.setCookie", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.CookieManager.setCookie", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.CookieManager val urlArg = args[1] as String val valueArg = args[2] as String - val wrapped: List = try { - api.setCookie(pigeon_instanceArg, urlArg, valueArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setCookie(pigeon_instanceArg, urlArg, valueArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1268,7 +1343,11 @@ abstract class PigeonApiCookieManager(open val pigeonRegistrar: AndroidWebkitLib } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.CookieManager.removeAllCookies", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.CookieManager.removeAllCookies", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1288,19 +1367,24 @@ abstract class PigeonApiCookieManager(open val pigeonRegistrar: AndroidWebkitLib } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.CookieManager.setAcceptThirdPartyCookies", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.CookieManager.setAcceptThirdPartyCookies", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.CookieManager val webViewArg = args[1] as android.webkit.WebView val acceptArg = args[2] as Boolean - val wrapped: List = try { - api.setAcceptThirdPartyCookies(pigeon_instanceArg, webViewArg, acceptArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setAcceptThirdPartyCookies(pigeon_instanceArg, webViewArg, acceptArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1312,34 +1396,40 @@ abstract class PigeonApiCookieManager(open val pigeonRegistrar: AndroidWebkitLib @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of CookieManager and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.webkit.CookieManager, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.webkit.CookieManager, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.CookieManager.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.CookieManager.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } } } - } /** * A View that displays web pages. @@ -1347,23 +1437,38 @@ abstract class PigeonApiCookieManager(open val pigeonRegistrar: AndroidWebkitLib * See https://developer.android.com/reference/android/webkit/WebView. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiWebView( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { abstract fun pigeon_defaultConstructor(): android.webkit.WebView /** The WebSettings object used to control the settings for this WebView. */ abstract fun settings(pigeon_instance: android.webkit.WebView): android.webkit.WebSettings /** Loads the given data into this WebView using a 'data' scheme URL. */ - abstract fun loadData(pigeon_instance: android.webkit.WebView, data: String, mimeType: String?, encoding: String?) - - /** - * Loads the given data into this WebView, using baseUrl as the base URL for - * the content. - */ - abstract fun loadDataWithBaseUrl(pigeon_instance: android.webkit.WebView, baseUrl: String?, data: String, mimeType: String?, encoding: String?, historyUrl: String?) + abstract fun loadData( + pigeon_instance: android.webkit.WebView, + data: String, + mimeType: String?, + encoding: String? + ) + + /** Loads the given data into this WebView, using baseUrl as the base URL for the content. */ + abstract fun loadDataWithBaseUrl( + pigeon_instance: android.webkit.WebView, + baseUrl: String?, + data: String, + mimeType: String?, + encoding: String?, + historyUrl: String? + ) /** Loads the given URL. */ - abstract fun loadUrl(pigeon_instance: android.webkit.WebView, url: String, headers: Map) + abstract fun loadUrl( + pigeon_instance: android.webkit.WebView, + url: String, + headers: Map + ) /** Loads the URL with postData using "POST" method into this WebView. */ abstract fun postUrl(pigeon_instance: android.webkit.WebView, url: String, data: ByteArray) @@ -1389,41 +1494,51 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi /** Clears the resource cache. */ abstract fun clearCache(pigeon_instance: android.webkit.WebView, includeDiskFiles: Boolean) - /** - * Asynchronously evaluates JavaScript in the context of the currently - * displayed page. - */ - abstract fun evaluateJavascript(pigeon_instance: android.webkit.WebView, javascriptString: String, callback: (Result) -> Unit) + /** Asynchronously evaluates JavaScript in the context of the currently displayed page. */ + abstract fun evaluateJavascript( + pigeon_instance: android.webkit.WebView, + javascriptString: String, + callback: (Result) -> Unit + ) /** Gets the title for the current page. */ abstract fun getTitle(pigeon_instance: android.webkit.WebView): String? /** - * Enables debugging of web contents (HTML / CSS / JavaScript) loaded into - * any WebViews of this application. + * Enables debugging of web contents (HTML / CSS / JavaScript) loaded into any WebViews of this + * application. */ abstract fun setWebContentsDebuggingEnabled(enabled: Boolean) - /** - * Sets the WebViewClient that will receive various notifications and - * requests. - */ - abstract fun setWebViewClient(pigeon_instance: android.webkit.WebView, client: android.webkit.WebViewClient?) + /** Sets the WebViewClient that will receive various notifications and requests. */ + abstract fun setWebViewClient( + pigeon_instance: android.webkit.WebView, + client: android.webkit.WebViewClient? + ) /** Injects the supplied Java object into this WebView. */ - abstract fun addJavaScriptChannel(pigeon_instance: android.webkit.WebView, channel: JavaScriptChannel) + abstract fun addJavaScriptChannel( + pigeon_instance: android.webkit.WebView, + channel: JavaScriptChannel + ) /** Removes a previously injected Java object from this WebView. */ abstract fun removeJavaScriptChannel(pigeon_instance: android.webkit.WebView, name: String) /** - * Registers the interface to be used when content can not be handled by the - * rendering engine, and should be downloaded instead. + * Registers the interface to be used when content can not be handled by the rendering engine, and + * should be downloaded instead. */ - abstract fun setDownloadListener(pigeon_instance: android.webkit.WebView, listener: android.webkit.DownloadListener?) + abstract fun setDownloadListener( + pigeon_instance: android.webkit.WebView, + listener: android.webkit.DownloadListener? + ) /** Sets the chrome handler. */ - abstract fun setWebChromeClient(pigeon_instance: android.webkit.WebView, client: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl?) + abstract fun setWebChromeClient( + pigeon_instance: android.webkit.WebView, + client: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl? + ) /** Sets the background color for this view. */ abstract fun setBackgroundColor(pigeon_instance: android.webkit.WebView, color: Long) @@ -1436,17 +1551,23 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiWebView?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.pigeon_defaultConstructor", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.pigeon_defaultConstructor", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_identifierArg = args[0] as Long - val wrapped: List = try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.pigeon_defaultConstructor(), pigeon_identifierArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + api.pigeon_defaultConstructor(), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1454,18 +1575,24 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.settings", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.settings", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView val pigeon_identifierArg = args[1] as Long - val wrapped: List = try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.settings(pigeon_instanceArg), pigeon_identifierArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + api.settings(pigeon_instanceArg), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1473,7 +1600,11 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.loadData", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.loadData", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1481,12 +1612,13 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi val dataArg = args[1] as String val mimeTypeArg = args[2] as String? val encodingArg = args[3] as String? - val wrapped: List = try { - api.loadData(pigeon_instanceArg, dataArg, mimeTypeArg, encodingArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.loadData(pigeon_instanceArg, dataArg, mimeTypeArg, encodingArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1494,7 +1626,11 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.loadDataWithBaseUrl", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.loadDataWithBaseUrl", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1504,12 +1640,19 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi val mimeTypeArg = args[3] as String? val encodingArg = args[4] as String? val historyUrlArg = args[5] as String? - val wrapped: List = try { - api.loadDataWithBaseUrl(pigeon_instanceArg, baseUrlArg, dataArg, mimeTypeArg, encodingArg, historyUrlArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.loadDataWithBaseUrl( + pigeon_instanceArg, + baseUrlArg, + dataArg, + mimeTypeArg, + encodingArg, + historyUrlArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1517,19 +1660,24 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.loadUrl", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.loadUrl", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView val urlArg = args[1] as String val headersArg = args[2] as Map - val wrapped: List = try { - api.loadUrl(pigeon_instanceArg, urlArg, headersArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.loadUrl(pigeon_instanceArg, urlArg, headersArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1537,19 +1685,24 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.postUrl", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.postUrl", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView val urlArg = args[1] as String val dataArg = args[2] as ByteArray - val wrapped: List = try { - api.postUrl(pigeon_instanceArg, urlArg, dataArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.postUrl(pigeon_instanceArg, urlArg, dataArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1557,16 +1710,19 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.getUrl", codec) + val channel = + BasicMessageChannel( + binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.getUrl", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView - val wrapped: List = try { - listOf(api.getUrl(pigeon_instanceArg)) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + listOf(api.getUrl(pigeon_instanceArg)) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1574,16 +1730,21 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.canGoBack", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.canGoBack", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView - val wrapped: List = try { - listOf(api.canGoBack(pigeon_instanceArg)) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + listOf(api.canGoBack(pigeon_instanceArg)) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1591,16 +1752,21 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.canGoForward", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.canGoForward", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView - val wrapped: List = try { - listOf(api.canGoForward(pigeon_instanceArg)) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + listOf(api.canGoForward(pigeon_instanceArg)) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1608,17 +1774,20 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.goBack", codec) + val channel = + BasicMessageChannel( + binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.goBack", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView - val wrapped: List = try { - api.goBack(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.goBack(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1626,17 +1795,22 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.goForward", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.goForward", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView - val wrapped: List = try { - api.goForward(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.goForward(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1644,17 +1818,20 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.reload", codec) + val channel = + BasicMessageChannel( + binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.reload", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView - val wrapped: List = try { - api.reload(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.reload(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1662,18 +1839,23 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.clearCache", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.clearCache", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView val includeDiskFilesArg = args[1] as Boolean - val wrapped: List = try { - api.clearCache(pigeon_instanceArg, includeDiskFilesArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.clearCache(pigeon_instanceArg, includeDiskFilesArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1681,13 +1863,18 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.evaluateJavascript", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.evaluateJavascript", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView val javascriptStringArg = args[1] as String - api.evaluateJavascript(pigeon_instanceArg, javascriptStringArg) { result: Result -> + api.evaluateJavascript(pigeon_instanceArg, javascriptStringArg) { + result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(AndroidWebkitLibraryPigeonUtils.wrapError(error)) @@ -1702,16 +1889,21 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.getTitle", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.getTitle", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView - val wrapped: List = try { - listOf(api.getTitle(pigeon_instanceArg)) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + listOf(api.getTitle(pigeon_instanceArg)) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1719,17 +1911,22 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.setWebContentsDebuggingEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.setWebContentsDebuggingEnabled", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val enabledArg = args[0] as Boolean - val wrapped: List = try { - api.setWebContentsDebuggingEnabled(enabledArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setWebContentsDebuggingEnabled(enabledArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1737,18 +1934,23 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.setWebViewClient", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.setWebViewClient", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView val clientArg = args[1] as android.webkit.WebViewClient? - val wrapped: List = try { - api.setWebViewClient(pigeon_instanceArg, clientArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setWebViewClient(pigeon_instanceArg, clientArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1756,18 +1958,23 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.addJavaScriptChannel", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.addJavaScriptChannel", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView val channelArg = args[1] as JavaScriptChannel - val wrapped: List = try { - api.addJavaScriptChannel(pigeon_instanceArg, channelArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.addJavaScriptChannel(pigeon_instanceArg, channelArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1775,18 +1982,23 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.removeJavaScriptChannel", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.removeJavaScriptChannel", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView val nameArg = args[1] as String - val wrapped: List = try { - api.removeJavaScriptChannel(pigeon_instanceArg, nameArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.removeJavaScriptChannel(pigeon_instanceArg, nameArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1794,18 +2006,23 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.setDownloadListener", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.setDownloadListener", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView val listenerArg = args[1] as android.webkit.DownloadListener? - val wrapped: List = try { - api.setDownloadListener(pigeon_instanceArg, listenerArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setDownloadListener(pigeon_instanceArg, listenerArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1813,18 +2030,26 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.setWebChromeClient", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.setWebChromeClient", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView - val clientArg = args[1] as io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl? - val wrapped: List = try { - api.setWebChromeClient(pigeon_instanceArg, clientArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val clientArg = + args[1] + as + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl? + val wrapped: List = + try { + api.setWebChromeClient(pigeon_instanceArg, clientArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1832,18 +2057,23 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.setBackgroundColor", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.setBackgroundColor", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView val colorArg = args[1] as Long - val wrapped: List = try { - api.setBackgroundColor(pigeon_instanceArg, colorArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setBackgroundColor(pigeon_instanceArg, colorArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1851,17 +2081,22 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebView.destroy", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebView.destroy", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebView - val wrapped: List = try { - api.destroy(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.destroy(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1873,16 +2108,19 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of WebView and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.webkit.WebView, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.webkit.WebView, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.webview_flutter_android.WebView.pigeon_newInstance" @@ -1890,23 +2128,32 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } } } /** - * This is called in response to an internal scroll in this view (i.e., the - * view scrolled its own contents). + * This is called in response to an internal scroll in this view (i.e., the view scrolled its own + * contents). */ - fun onScrollChanged(pigeon_instanceArg: android.webkit.WebView, leftArg: Long, topArg: Long, oldLeftArg: Long, oldTopArg: Long, callback: (Result) -> Unit) -{ + fun onScrollChanged( + pigeon_instanceArg: android.webkit.WebView, + leftArg: Long, + topArg: Long, + oldLeftArg: Long, + oldTopArg: Long, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -1920,23 +2167,23 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi channel.send(listOf(pigeon_instanceArg, leftArg, topArg, oldLeftArg, oldTopArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } @Suppress("FunctionName") /** An implementation of [PigeonApiView] used to access callback methods */ - fun pigeon_getPigeonApiView(): PigeonApiView - { + fun pigeon_getPigeonApiView(): PigeonApiView { return pigeonRegistrar.getPigeonApiView() } - } /** * Manages settings state for a `WebView`. @@ -1944,52 +2191,68 @@ abstract class PigeonApiWebView(open val pigeonRegistrar: AndroidWebkitLibraryPi * See https://developer.android.com/reference/android/webkit/WebSettings. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiWebSettings( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { /** Sets whether the DOM storage API is enabled. */ abstract fun setDomStorageEnabled(pigeon_instance: android.webkit.WebSettings, flag: Boolean) /** Tells JavaScript to open windows automatically. */ - abstract fun setJavaScriptCanOpenWindowsAutomatically(pigeon_instance: android.webkit.WebSettings, flag: Boolean) + abstract fun setJavaScriptCanOpenWindowsAutomatically( + pigeon_instance: android.webkit.WebSettings, + flag: Boolean + ) /** Sets whether the WebView whether supports multiple windows. */ - abstract fun setSupportMultipleWindows(pigeon_instance: android.webkit.WebSettings, support: Boolean) + abstract fun setSupportMultipleWindows( + pigeon_instance: android.webkit.WebSettings, + support: Boolean + ) /** Tells the WebView to enable JavaScript execution. */ abstract fun setJavaScriptEnabled(pigeon_instance: android.webkit.WebSettings, flag: Boolean) /** Sets the WebView's user-agent string. */ - abstract fun setUserAgentString(pigeon_instance: android.webkit.WebSettings, userAgentString: String?) + abstract fun setUserAgentString( + pigeon_instance: android.webkit.WebSettings, + userAgentString: String? + ) /** Sets whether the WebView requires a user gesture to play media. */ - abstract fun setMediaPlaybackRequiresUserGesture(pigeon_instance: android.webkit.WebSettings, require: Boolean) + abstract fun setMediaPlaybackRequiresUserGesture( + pigeon_instance: android.webkit.WebSettings, + require: Boolean + ) /** - * Sets whether the WebView should support zooming using its on-screen zoom - * controls and gestures. + * Sets whether the WebView should support zooming using its on-screen zoom controls and gestures. */ abstract fun setSupportZoom(pigeon_instance: android.webkit.WebSettings, support: Boolean) /** - * Sets whether the WebView loads pages in overview mode, that is, zooms out - * the content to fit on screen by width. + * Sets whether the WebView loads pages in overview mode, that is, zooms out the content to fit on + * screen by width. */ - abstract fun setLoadWithOverviewMode(pigeon_instance: android.webkit.WebSettings, overview: Boolean) + abstract fun setLoadWithOverviewMode( + pigeon_instance: android.webkit.WebSettings, + overview: Boolean + ) /** - * Sets whether the WebView should enable support for the "viewport" HTML - * meta tag or should use a wide viewport. + * Sets whether the WebView should enable support for the "viewport" HTML meta tag or should use a + * wide viewport. */ abstract fun setUseWideViewPort(pigeon_instance: android.webkit.WebSettings, use: Boolean) /** - * Sets whether the WebView should display on-screen zoom controls when using - * the built-in zoom mechanisms. + * Sets whether the WebView should display on-screen zoom controls when using the built-in zoom + * mechanisms. */ abstract fun setDisplayZoomControls(pigeon_instance: android.webkit.WebSettings, enabled: Boolean) /** - * Sets whether the WebView should display on-screen zoom controls when using - * the built-in zoom mechanisms. + * Sets whether the WebView should display on-screen zoom controls when using the built-in zoom + * mechanisms. */ abstract fun setBuiltInZoomControls(pigeon_instance: android.webkit.WebSettings, enabled: Boolean) @@ -2013,18 +2276,23 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiWebSettings?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setDomStorageEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebSettings.setDomStorageEnabled", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val flagArg = args[1] as Boolean - val wrapped: List = try { - api.setDomStorageEnabled(pigeon_instanceArg, flagArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setDomStorageEnabled(pigeon_instanceArg, flagArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2032,18 +2300,23 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setJavaScriptCanOpenWindowsAutomatically", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebSettings.setJavaScriptCanOpenWindowsAutomatically", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val flagArg = args[1] as Boolean - val wrapped: List = try { - api.setJavaScriptCanOpenWindowsAutomatically(pigeon_instanceArg, flagArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setJavaScriptCanOpenWindowsAutomatically(pigeon_instanceArg, flagArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2051,18 +2324,23 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setSupportMultipleWindows", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebSettings.setSupportMultipleWindows", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val supportArg = args[1] as Boolean - val wrapped: List = try { - api.setSupportMultipleWindows(pigeon_instanceArg, supportArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setSupportMultipleWindows(pigeon_instanceArg, supportArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2070,18 +2348,23 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setJavaScriptEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebSettings.setJavaScriptEnabled", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val flagArg = args[1] as Boolean - val wrapped: List = try { - api.setJavaScriptEnabled(pigeon_instanceArg, flagArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setJavaScriptEnabled(pigeon_instanceArg, flagArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2089,18 +2372,23 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setUserAgentString", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebSettings.setUserAgentString", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val userAgentStringArg = args[1] as String? - val wrapped: List = try { - api.setUserAgentString(pigeon_instanceArg, userAgentStringArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setUserAgentString(pigeon_instanceArg, userAgentStringArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2108,18 +2396,23 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setMediaPlaybackRequiresUserGesture", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebSettings.setMediaPlaybackRequiresUserGesture", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val requireArg = args[1] as Boolean - val wrapped: List = try { - api.setMediaPlaybackRequiresUserGesture(pigeon_instanceArg, requireArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setMediaPlaybackRequiresUserGesture(pigeon_instanceArg, requireArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2127,18 +2420,23 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setSupportZoom", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebSettings.setSupportZoom", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val supportArg = args[1] as Boolean - val wrapped: List = try { - api.setSupportZoom(pigeon_instanceArg, supportArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setSupportZoom(pigeon_instanceArg, supportArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2146,18 +2444,23 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setLoadWithOverviewMode", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebSettings.setLoadWithOverviewMode", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val overviewArg = args[1] as Boolean - val wrapped: List = try { - api.setLoadWithOverviewMode(pigeon_instanceArg, overviewArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setLoadWithOverviewMode(pigeon_instanceArg, overviewArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2165,18 +2468,23 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setUseWideViewPort", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebSettings.setUseWideViewPort", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val useArg = args[1] as Boolean - val wrapped: List = try { - api.setUseWideViewPort(pigeon_instanceArg, useArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setUseWideViewPort(pigeon_instanceArg, useArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2184,18 +2492,23 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setDisplayZoomControls", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebSettings.setDisplayZoomControls", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val enabledArg = args[1] as Boolean - val wrapped: List = try { - api.setDisplayZoomControls(pigeon_instanceArg, enabledArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setDisplayZoomControls(pigeon_instanceArg, enabledArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2203,18 +2516,23 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setBuiltInZoomControls", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebSettings.setBuiltInZoomControls", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val enabledArg = args[1] as Boolean - val wrapped: List = try { - api.setBuiltInZoomControls(pigeon_instanceArg, enabledArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setBuiltInZoomControls(pigeon_instanceArg, enabledArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2222,18 +2540,23 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setAllowFileAccess", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebSettings.setAllowFileAccess", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val enabledArg = args[1] as Boolean - val wrapped: List = try { - api.setAllowFileAccess(pigeon_instanceArg, enabledArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setAllowFileAccess(pigeon_instanceArg, enabledArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2241,18 +2564,23 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setAllowContentAccess", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebSettings.setAllowContentAccess", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val enabledArg = args[1] as Boolean - val wrapped: List = try { - api.setAllowContentAccess(pigeon_instanceArg, enabledArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setAllowContentAccess(pigeon_instanceArg, enabledArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2260,18 +2588,23 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setGeolocationEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebSettings.setGeolocationEnabled", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val enabledArg = args[1] as Boolean - val wrapped: List = try { - api.setGeolocationEnabled(pigeon_instanceArg, enabledArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setGeolocationEnabled(pigeon_instanceArg, enabledArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2279,18 +2612,23 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.setTextZoom", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebSettings.setTextZoom", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings val textZoomArg = args[1] as Long - val wrapped: List = try { - api.setTextZoom(pigeon_instanceArg, textZoomArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setTextZoom(pigeon_instanceArg, textZoomArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2298,16 +2636,21 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebSettings.getUserAgentString", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebSettings.getUserAgentString", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebSettings - val wrapped: List = try { - listOf(api.getUserAgentString(pigeon_instanceArg)) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + listOf(api.getUserAgentString(pigeon_instanceArg)) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2319,16 +2662,19 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of WebSettings and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.webkit.WebSettings, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.webkit.WebSettings, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.webview_flutter_android.WebSettings.pigeon_newInstance" @@ -2336,17 +2682,19 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } } } - } /** * A JavaScript interface for exposing Javascript callbacks to Dart. @@ -2355,7 +2703,9 @@ abstract class PigeonApiWebSettings(open val pigeonRegistrar: AndroidWebkitLibra * [JavascriptInterface](https://developer.android.com/reference/android/webkit/JavascriptInterface). */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiJavaScriptChannel(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiJavaScriptChannel( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { abstract fun pigeon_defaultConstructor(channelName: String): JavaScriptChannel companion object { @@ -2363,18 +2713,24 @@ abstract class PigeonApiJavaScriptChannel(open val pigeonRegistrar: AndroidWebki fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiJavaScriptChannel?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.JavaScriptChannel.pigeon_defaultConstructor", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.JavaScriptChannel.pigeon_defaultConstructor", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_identifierArg = args[0] as Long val channelNameArg = args[1] as String - val wrapped: List = try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.pigeon_defaultConstructor(channelNameArg), pigeon_identifierArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + api.pigeon_defaultConstructor(channelNameArg), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2386,24 +2742,29 @@ abstract class PigeonApiJavaScriptChannel(open val pigeonRegistrar: AndroidWebki @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of JavaScriptChannel and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: JavaScriptChannel, callback: (Result) -> Unit) -{ + fun pigeon_newInstance(pigeon_instanceArg: JavaScriptChannel, callback: (Result) -> Unit) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { + } else { callback( Result.failure( - AndroidWebKitError("new-instance-error", "Attempting to create a new Dart instance of JavaScriptChannel, but the class has a nonnull callback method.", ""))) + AndroidWebKitError( + "new-instance-error", + "Attempting to create a new Dart instance of JavaScriptChannel, but the class has a nonnull callback method.", + ""))) } } /** Handles callbacks messages from JavaScript. */ - fun postMessage(pigeon_instanceArg: JavaScriptChannel, messageArg: String, callback: (Result) -> Unit) -{ + fun postMessage( + pigeon_instanceArg: JavaScriptChannel, + messageArg: String, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2417,16 +2778,17 @@ abstract class PigeonApiJavaScriptChannel(open val pigeonRegistrar: AndroidWebki channel.send(listOf(pigeon_instanceArg, messageArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } - } /** * Receives various notifications and requests from a `WebView`. @@ -2434,41 +2796,51 @@ abstract class PigeonApiJavaScriptChannel(open val pigeonRegistrar: AndroidWebki * See https://developer.android.com/reference/android/webkit/WebViewClient. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiWebViewClient( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { abstract fun pigeon_defaultConstructor(): android.webkit.WebViewClient /** * Sets the required synchronous return value for the Java method, * `WebViewClient.shouldOverrideUrlLoading(...)`. * - * The Java method, `WebViewClient.shouldOverrideUrlLoading(...)`, requires - * a boolean to be returned and this method sets the returned value for all - * calls to the Java method. + * The Java method, `WebViewClient.shouldOverrideUrlLoading(...)`, requires a boolean to be + * returned and this method sets the returned value for all calls to the Java method. * - * Setting this to true causes the current [WebView] to abort loading any URL - * received by [requestLoading] or [urlLoading], while setting this to false - * causes the [WebView] to continue loading a URL as usual. + * Setting this to true causes the current [WebView] to abort loading any URL received by + * [requestLoading] or [urlLoading], while setting this to false causes the [WebView] to continue + * loading a URL as usual. * * Defaults to false. */ - abstract fun setSynchronousReturnValueForShouldOverrideUrlLoading(pigeon_instance: android.webkit.WebViewClient, value: Boolean) + abstract fun setSynchronousReturnValueForShouldOverrideUrlLoading( + pigeon_instance: android.webkit.WebViewClient, + value: Boolean + ) companion object { @Suppress("LocalVariableName") fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiWebViewClient?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebViewClient.pigeon_defaultConstructor", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebViewClient.pigeon_defaultConstructor", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_identifierArg = args[0] as Long - val wrapped: List = try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.pigeon_defaultConstructor(), pigeon_identifierArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + api.pigeon_defaultConstructor(), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2476,18 +2848,24 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebViewClient.setSynchronousReturnValueForShouldOverrideUrlLoading", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebViewClient.setSynchronousReturnValueForShouldOverrideUrlLoading", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebViewClient val valueArg = args[1] as Boolean - val wrapped: List = try { - api.setSynchronousReturnValueForShouldOverrideUrlLoading(pigeon_instanceArg, valueArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setSynchronousReturnValueForShouldOverrideUrlLoading( + pigeon_instanceArg, valueArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2499,37 +2877,48 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of WebViewClient and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.webkit.WebViewClient, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.webkit.WebViewClient, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.WebViewClient.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.WebViewClient.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } } } /** Notify the host application that a page has started loading. */ - fun onPageStarted(pigeon_instanceArg: android.webkit.WebViewClient, webViewArg: android.webkit.WebView, urlArg: String, callback: (Result) -> Unit) -{ + fun onPageStarted( + pigeon_instanceArg: android.webkit.WebViewClient, + webViewArg: android.webkit.WebView, + urlArg: String, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2543,19 +2932,25 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib channel.send(listOf(pigeon_instanceArg, webViewArg, urlArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } /** Notify the host application that a page has finished loading. */ - fun onPageFinished(pigeon_instanceArg: android.webkit.WebViewClient, webViewArg: android.webkit.WebView, urlArg: String, callback: (Result) -> Unit) -{ + fun onPageFinished( + pigeon_instanceArg: android.webkit.WebViewClient, + webViewArg: android.webkit.WebView, + urlArg: String, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2569,22 +2964,29 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib channel.send(listOf(pigeon_instanceArg, webViewArg, urlArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } /** - * Notify the host application that an HTTP error has been received from the - * server while loading a resource. + * Notify the host application that an HTTP error has been received from the server while loading + * a resource. */ - fun onReceivedHttpError(pigeon_instanceArg: android.webkit.WebViewClient, webViewArg: android.webkit.WebView, requestArg: android.webkit.WebResourceRequest, responseArg: android.webkit.WebResourceResponse, callback: (Result) -> Unit) -{ + fun onReceivedHttpError( + pigeon_instanceArg: android.webkit.WebViewClient, + webViewArg: android.webkit.WebView, + requestArg: android.webkit.WebResourceRequest, + responseArg: android.webkit.WebResourceResponse, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2598,20 +3000,27 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib channel.send(listOf(pigeon_instanceArg, webViewArg, requestArg, responseArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } /** Report web resource loading error to the host application. */ @androidx.annotation.RequiresApi(api = 23) - fun onReceivedRequestError(pigeon_instanceArg: android.webkit.WebViewClient, webViewArg: android.webkit.WebView, requestArg: android.webkit.WebResourceRequest, errorArg: android.webkit.WebResourceError, callback: (Result) -> Unit) -{ + fun onReceivedRequestError( + pigeon_instanceArg: android.webkit.WebViewClient, + webViewArg: android.webkit.WebView, + requestArg: android.webkit.WebResourceRequest, + errorArg: android.webkit.WebResourceError, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2620,24 +3029,32 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedRequestError" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedRequestError" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, webViewArg, requestArg, errorArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } /** Report web resource loading error to the host application. */ - fun onReceivedRequestErrorCompat(pigeon_instanceArg: android.webkit.WebViewClient, webViewArg: android.webkit.WebView, requestArg: android.webkit.WebResourceRequest, errorArg: androidx.webkit.WebResourceErrorCompat, callback: (Result) -> Unit) -{ + fun onReceivedRequestErrorCompat( + pigeon_instanceArg: android.webkit.WebViewClient, + webViewArg: android.webkit.WebView, + requestArg: android.webkit.WebResourceRequest, + errorArg: androidx.webkit.WebResourceErrorCompat, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2646,24 +3063,33 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedRequestErrorCompat" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedRequestErrorCompat" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, webViewArg, requestArg, errorArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } /** Report an error to the host application. */ - fun onReceivedError(pigeon_instanceArg: android.webkit.WebViewClient, webViewArg: android.webkit.WebView, errorCodeArg: Long, descriptionArg: String, failingUrlArg: String, callback: (Result) -> Unit) -{ + fun onReceivedError( + pigeon_instanceArg: android.webkit.WebViewClient, + webViewArg: android.webkit.WebView, + errorCodeArg: Long, + descriptionArg: String, + failingUrlArg: String, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2674,25 +3100,33 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedError" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_instanceArg, webViewArg, errorCodeArg, descriptionArg, failingUrlArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) - } else { - callback(Result.success(Unit)) + channel.send( + listOf(pigeon_instanceArg, webViewArg, errorCodeArg, descriptionArg, failingUrlArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } - } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } - } } /** - * Give the host application a chance to take control when a URL is about to - * be loaded in the current WebView. + * Give the host application a chance to take control when a URL is about to be loaded in the + * current WebView. */ - fun requestLoading(pigeon_instanceArg: android.webkit.WebViewClient, webViewArg: android.webkit.WebView, requestArg: android.webkit.WebResourceRequest, callback: (Result) -> Unit) -{ + fun requestLoading( + pigeon_instanceArg: android.webkit.WebViewClient, + webViewArg: android.webkit.WebView, + requestArg: android.webkit.WebResourceRequest, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2706,22 +3140,28 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib channel.send(listOf(pigeon_instanceArg, webViewArg, requestArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } /** - * Give the host application a chance to take control when a URL is about to - * be loaded in the current WebView. + * Give the host application a chance to take control when a URL is about to be loaded in the + * current WebView. */ - fun urlLoading(pigeon_instanceArg: android.webkit.WebViewClient, webViewArg: android.webkit.WebView, urlArg: String, callback: (Result) -> Unit) -{ + fun urlLoading( + pigeon_instanceArg: android.webkit.WebViewClient, + webViewArg: android.webkit.WebView, + urlArg: String, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2735,19 +3175,26 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib channel.send(listOf(pigeon_instanceArg, webViewArg, urlArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } /** Notify the host application to update its visited links database. */ - fun doUpdateVisitedHistory(pigeon_instanceArg: android.webkit.WebViewClient, webViewArg: android.webkit.WebView, urlArg: String, isReloadArg: Boolean, callback: (Result) -> Unit) -{ + fun doUpdateVisitedHistory( + pigeon_instanceArg: android.webkit.WebViewClient, + webViewArg: android.webkit.WebView, + urlArg: String, + isReloadArg: Boolean, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2756,27 +3203,33 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.WebViewClient.doUpdateVisitedHistory" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.WebViewClient.doUpdateVisitedHistory" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, webViewArg, urlArg, isReloadArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } - /** - * Notifies the host application that the WebView received an HTTP - * authentication request. - */ - fun onReceivedHttpAuthRequest(pigeon_instanceArg: android.webkit.WebViewClient, webViewArg: android.webkit.WebView, handlerArg: android.webkit.HttpAuthHandler, hostArg: String, realmArg: String, callback: (Result) -> Unit) -{ + /** Notifies the host application that the WebView received an HTTP authentication request. */ + fun onReceivedHttpAuthRequest( + pigeon_instanceArg: android.webkit.WebViewClient, + webViewArg: android.webkit.WebView, + handlerArg: android.webkit.HttpAuthHandler, + hostArg: String, + realmArg: String, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2785,27 +3238,35 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedHttpAuthRequest" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedHttpAuthRequest" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, webViewArg, handlerArg, hostArg, realmArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } /** - * Ask the host application if the browser should resend data as the - * requested page was a result of a POST. + * Ask the host application if the browser should resend data as the requested page was a result + * of a POST. */ - fun onFormResubmission(pigeon_instanceArg: android.webkit.WebViewClient, viewArg: android.webkit.WebView, dontResendArg: android.os.Message, resendArg: android.os.Message, callback: (Result) -> Unit) -{ + fun onFormResubmission( + pigeon_instanceArg: android.webkit.WebViewClient, + viewArg: android.webkit.WebView, + dontResendArg: android.os.Message, + resendArg: android.os.Message, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2819,22 +3280,27 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib channel.send(listOf(pigeon_instanceArg, viewArg, dontResendArg, resendArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } /** - * Notify the host application that the WebView will load the resource - * specified by the given url. + * Notify the host application that the WebView will load the resource specified by the given url. */ - fun onLoadResource(pigeon_instanceArg: android.webkit.WebViewClient, viewArg: android.webkit.WebView, urlArg: String, callback: (Result) -> Unit) -{ + fun onLoadResource( + pigeon_instanceArg: android.webkit.WebViewClient, + viewArg: android.webkit.WebView, + urlArg: String, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2848,22 +3314,28 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib channel.send(listOf(pigeon_instanceArg, viewArg, urlArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } /** - * Notify the host application that WebView content left over from previous - * page navigations will no longer be drawn. + * Notify the host application that WebView content left over from previous page navigations will + * no longer be drawn. */ - fun onPageCommitVisible(pigeon_instanceArg: android.webkit.WebViewClient, viewArg: android.webkit.WebView, urlArg: String, callback: (Result) -> Unit) -{ + fun onPageCommitVisible( + pigeon_instanceArg: android.webkit.WebViewClient, + viewArg: android.webkit.WebView, + urlArg: String, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2877,19 +3349,25 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib channel.send(listOf(pigeon_instanceArg, viewArg, urlArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } /** Notify the host application to handle a SSL client certificate request. */ - fun onReceivedClientCertRequest(pigeon_instanceArg: android.webkit.WebViewClient, viewArg: android.webkit.WebView, requestArg: android.webkit.ClientCertRequest, callback: (Result) -> Unit) -{ + fun onReceivedClientCertRequest( + pigeon_instanceArg: android.webkit.WebViewClient, + viewArg: android.webkit.WebView, + requestArg: android.webkit.ClientCertRequest, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2898,27 +3376,35 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedClientCertRequest" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedClientCertRequest" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, viewArg, requestArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } /** - * Notify the host application that a request to automatically log in the - * user has been processed. + * Notify the host application that a request to automatically log in the user has been processed. */ - fun onReceivedLoginRequest(pigeon_instanceArg: android.webkit.WebViewClient, viewArg: android.webkit.WebView, realmArg: String, accountArg: String?, argsArg: String, callback: (Result) -> Unit) -{ + fun onReceivedLoginRequest( + pigeon_instanceArg: android.webkit.WebViewClient, + viewArg: android.webkit.WebView, + realmArg: String, + accountArg: String?, + argsArg: String, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2927,27 +3413,32 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedLoginRequest" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedLoginRequest" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, viewArg, realmArg, accountArg, argsArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } - /** - * Notifies the host application that an SSL error occurred while loading a - * resource. - */ - fun onReceivedSslError(pigeon_instanceArg: android.webkit.WebViewClient, viewArg: android.webkit.WebView, handlerArg: android.webkit.SslErrorHandler, errorArg: android.net.http.SslError, callback: (Result) -> Unit) -{ + /** Notifies the host application that an SSL error occurred while loading a resource. */ + fun onReceivedSslError( + pigeon_instanceArg: android.webkit.WebViewClient, + viewArg: android.webkit.WebView, + handlerArg: android.webkit.SslErrorHandler, + errorArg: android.net.http.SslError, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2961,22 +3452,26 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib channel.send(listOf(pigeon_instanceArg, viewArg, handlerArg, errorArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } - /** - * Notify the host application that the scale applied to the WebView has - * changed. - */ - fun onScaleChanged(pigeon_instanceArg: android.webkit.WebViewClient, viewArg: android.webkit.WebView, oldScaleArg: Double, newScaleArg: Double, callback: (Result) -> Unit) -{ + /** Notify the host application that the scale applied to the WebView has changed. */ + fun onScaleChanged( + pigeon_instanceArg: android.webkit.WebViewClient, + viewArg: android.webkit.WebView, + oldScaleArg: Double, + newScaleArg: Double, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -2990,16 +3485,17 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib channel.send(listOf(pigeon_instanceArg, viewArg, oldScaleArg, newScaleArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } - } /** * Handles notifications that a file should be downloaded. @@ -3007,7 +3503,9 @@ abstract class PigeonApiWebViewClient(open val pigeonRegistrar: AndroidWebkitLib * See https://developer.android.com/reference/android/webkit/DownloadListener. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiDownloadListener(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiDownloadListener( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { abstract fun pigeon_defaultConstructor(): android.webkit.DownloadListener companion object { @@ -3015,17 +3513,23 @@ abstract class PigeonApiDownloadListener(open val pigeonRegistrar: AndroidWebkit fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiDownloadListener?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.DownloadListener.pigeon_defaultConstructor", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.DownloadListener.pigeon_defaultConstructor", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_identifierArg = args[0] as Long - val wrapped: List = try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.pigeon_defaultConstructor(), pigeon_identifierArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + api.pigeon_defaultConstructor(), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3037,24 +3541,36 @@ abstract class PigeonApiDownloadListener(open val pigeonRegistrar: AndroidWebkit @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of DownloadListener and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.webkit.DownloadListener, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.webkit.DownloadListener, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { + } else { callback( Result.failure( - AndroidWebKitError("new-instance-error", "Attempting to create a new Dart instance of DownloadListener, but the class has a nonnull callback method.", ""))) + AndroidWebKitError( + "new-instance-error", + "Attempting to create a new Dart instance of DownloadListener, but the class has a nonnull callback method.", + ""))) } } /** Notify the host application that a file should be downloaded. */ - fun onDownloadStart(pigeon_instanceArg: android.webkit.DownloadListener, urlArg: String, userAgentArg: String, contentDispositionArg: String, mimetypeArg: String, contentLengthArg: Long, callback: (Result) -> Unit) -{ + fun onDownloadStart( + pigeon_instanceArg: android.webkit.DownloadListener, + urlArg: String, + userAgentArg: String, + contentDispositionArg: String, + mimetypeArg: String, + contentLengthArg: Long, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3065,133 +3581,161 @@ abstract class PigeonApiDownloadListener(open val pigeonRegistrar: AndroidWebkit val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.webview_flutter_android.DownloadListener.onDownloadStart" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_instanceArg, urlArg, userAgentArg, contentDispositionArg, mimetypeArg, contentLengthArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) - } else { - callback(Result.success(Unit)) + channel.send( + listOf( + pigeon_instanceArg, + urlArg, + userAgentArg, + contentDispositionArg, + mimetypeArg, + contentLengthArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } - } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } - } } - } /** - * Handles notification of JavaScript dialogs, favicons, titles, and the - * progress. + * Handles notification of JavaScript dialogs, favicons, titles, and the progress. * * See https://developer.android.com/reference/android/webkit/WebChromeClient. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { - abstract fun pigeon_defaultConstructor(): io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl +abstract class PigeonApiWebChromeClient( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { + abstract fun pigeon_defaultConstructor(): + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl /** * Sets the required synchronous return value for the Java method, * `WebChromeClient.onShowFileChooser(...)`. * - * The Java method, `WebChromeClient.onShowFileChooser(...)`, requires - * a boolean to be returned and this method sets the returned value for all - * calls to the Java method. + * The Java method, `WebChromeClient.onShowFileChooser(...)`, requires a boolean to be returned + * and this method sets the returned value for all calls to the Java method. * - * Setting this to true indicates that all file chooser requests should be - * handled by `onShowFileChooser` and the returned list of Strings will be - * returned to the WebView. Otherwise, the client will use the default - * handling and the returned value in `onShowFileChooser` will be ignored. + * Setting this to true indicates that all file chooser requests should be handled by + * `onShowFileChooser` and the returned list of Strings will be returned to the WebView. + * Otherwise, the client will use the default handling and the returned value in + * `onShowFileChooser` will be ignored. * * Requires `onShowFileChooser` to be nonnull. * * Defaults to false. */ - abstract fun setSynchronousReturnValueForOnShowFileChooser(pigeon_instance: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, value: Boolean) + abstract fun setSynchronousReturnValueForOnShowFileChooser( + pigeon_instance: + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, + value: Boolean + ) /** * Sets the required synchronous return value for the Java method, * `WebChromeClient.onConsoleMessage(...)`. * - * The Java method, `WebChromeClient.onConsoleMessage(...)`, requires - * a boolean to be returned and this method sets the returned value for all - * calls to the Java method. + * The Java method, `WebChromeClient.onConsoleMessage(...)`, requires a boolean to be returned and + * this method sets the returned value for all calls to the Java method. * - * Setting this to true indicates that the client is handling all console - * messages. + * Setting this to true indicates that the client is handling all console messages. * * Requires `onConsoleMessage` to be nonnull. * * Defaults to false. */ - abstract fun setSynchronousReturnValueForOnConsoleMessage(pigeon_instance: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, value: Boolean) + abstract fun setSynchronousReturnValueForOnConsoleMessage( + pigeon_instance: + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, + value: Boolean + ) /** * Sets the required synchronous return value for the Java method, * `WebChromeClient.onJsAlert(...)`. * - * The Java method, `WebChromeClient.onJsAlert(...)`, requires a boolean to - * be returned and this method sets the returned value for all calls to the - * Java method. + * The Java method, `WebChromeClient.onJsAlert(...)`, requires a boolean to be returned and this + * method sets the returned value for all calls to the Java method. * - * Setting this to true indicates that the client is handling all console - * messages. + * Setting this to true indicates that the client is handling all console messages. * * Requires `onJsAlert` to be nonnull. * * Defaults to false. */ - abstract fun setSynchronousReturnValueForOnJsAlert(pigeon_instance: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, value: Boolean) + abstract fun setSynchronousReturnValueForOnJsAlert( + pigeon_instance: + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, + value: Boolean + ) /** * Sets the required synchronous return value for the Java method, * `WebChromeClient.onJsConfirm(...)`. * - * The Java method, `WebChromeClient.onJsConfirm(...)`, requires a boolean to - * be returned and this method sets the returned value for all calls to the - * Java method. + * The Java method, `WebChromeClient.onJsConfirm(...)`, requires a boolean to be returned and this + * method sets the returned value for all calls to the Java method. * - * Setting this to true indicates that the client is handling all console - * messages. + * Setting this to true indicates that the client is handling all console messages. * * Requires `onJsConfirm` to be nonnull. * * Defaults to false. */ - abstract fun setSynchronousReturnValueForOnJsConfirm(pigeon_instance: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, value: Boolean) + abstract fun setSynchronousReturnValueForOnJsConfirm( + pigeon_instance: + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, + value: Boolean + ) /** * Sets the required synchronous return value for the Java method, * `WebChromeClient.onJsPrompt(...)`. * - * The Java method, `WebChromeClient.onJsPrompt(...)`, requires a boolean to - * be returned and this method sets the returned value for all calls to the - * Java method. + * The Java method, `WebChromeClient.onJsPrompt(...)`, requires a boolean to be returned and this + * method sets the returned value for all calls to the Java method. * - * Setting this to true indicates that the client is handling all console - * messages. + * Setting this to true indicates that the client is handling all console messages. * * Requires `onJsPrompt` to be nonnull. * * Defaults to false. */ - abstract fun setSynchronousReturnValueForOnJsPrompt(pigeon_instance: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, value: Boolean) + abstract fun setSynchronousReturnValueForOnJsPrompt( + pigeon_instance: + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, + value: Boolean + ) companion object { @Suppress("LocalVariableName") fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiWebChromeClient?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.pigeon_defaultConstructor", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.pigeon_defaultConstructor", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_identifierArg = args[0] as Long - val wrapped: List = try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.pigeon_defaultConstructor(), pigeon_identifierArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + api.pigeon_defaultConstructor(), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3199,18 +3743,25 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.setSynchronousReturnValueForOnShowFileChooser", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.setSynchronousReturnValueForOnShowFileChooser", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_instanceArg = args[0] as io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl + val pigeon_instanceArg = + args[0] + as io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl val valueArg = args[1] as Boolean - val wrapped: List = try { - api.setSynchronousReturnValueForOnShowFileChooser(pigeon_instanceArg, valueArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setSynchronousReturnValueForOnShowFileChooser(pigeon_instanceArg, valueArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3218,18 +3769,25 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.setSynchronousReturnValueForOnConsoleMessage", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.setSynchronousReturnValueForOnConsoleMessage", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_instanceArg = args[0] as io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl + val pigeon_instanceArg = + args[0] + as io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl val valueArg = args[1] as Boolean - val wrapped: List = try { - api.setSynchronousReturnValueForOnConsoleMessage(pigeon_instanceArg, valueArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setSynchronousReturnValueForOnConsoleMessage(pigeon_instanceArg, valueArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3237,18 +3795,25 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.setSynchronousReturnValueForOnJsAlert", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.setSynchronousReturnValueForOnJsAlert", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_instanceArg = args[0] as io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl + val pigeon_instanceArg = + args[0] + as io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl val valueArg = args[1] as Boolean - val wrapped: List = try { - api.setSynchronousReturnValueForOnJsAlert(pigeon_instanceArg, valueArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setSynchronousReturnValueForOnJsAlert(pigeon_instanceArg, valueArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3256,18 +3821,25 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.setSynchronousReturnValueForOnJsConfirm", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.setSynchronousReturnValueForOnJsConfirm", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_instanceArg = args[0] as io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl + val pigeon_instanceArg = + args[0] + as io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl val valueArg = args[1] as Boolean - val wrapped: List = try { - api.setSynchronousReturnValueForOnJsConfirm(pigeon_instanceArg, valueArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setSynchronousReturnValueForOnJsConfirm(pigeon_instanceArg, valueArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3275,18 +3847,25 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.setSynchronousReturnValueForOnJsPrompt", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.setSynchronousReturnValueForOnJsPrompt", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_instanceArg = args[0] as io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl + val pigeon_instanceArg = + args[0] + as io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl val valueArg = args[1] as Boolean - val wrapped: List = try { - api.setSynchronousReturnValueForOnJsPrompt(pigeon_instanceArg, valueArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setSynchronousReturnValueForOnJsPrompt(pigeon_instanceArg, valueArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3298,24 +3877,35 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of WebChromeClient and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { + } else { callback( Result.failure( - AndroidWebKitError("new-instance-error", "Attempting to create a new Dart instance of WebChromeClient, but the class has a nonnull callback method.", ""))) + AndroidWebKitError( + "new-instance-error", + "Attempting to create a new Dart instance of WebChromeClient, but the class has a nonnull callback method.", + ""))) } } /** Tell the host application the current progress of loading a page. */ - fun onProgressChanged(pigeon_instanceArg: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, webViewArg: android.webkit.WebView, progressArg: Long, callback: (Result) -> Unit) -{ + fun onProgressChanged( + pigeon_instanceArg: + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, + webViewArg: android.webkit.WebView, + progressArg: Long, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3329,19 +3919,26 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL channel.send(listOf(pigeon_instanceArg, webViewArg, progressArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } /** Tell the client to show a file chooser. */ - fun onShowFileChooser(pigeon_instanceArg: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, webViewArg: android.webkit.WebView, paramsArg: android.webkit.WebChromeClient.FileChooserParams, callback: (Result>) -> Unit) -{ + fun onShowFileChooser( + pigeon_instanceArg: + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, + webViewArg: android.webkit.WebView, + paramsArg: android.webkit.WebChromeClient.FileChooserParams, + callback: (Result>) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3355,26 +3952,36 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL channel.send(listOf(pigeon_instanceArg, webViewArg, paramsArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback(Result.failure(AndroidWebKitError("null-error", "Flutter api returned null value for non-null return value.", ""))) + callback( + Result.failure( + AndroidWebKitError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) } else { val output = it[0] as List callback(Result.success(output)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } /** - * Notify the host application that web content is requesting permission to - * access the specified resources and the permission currently isn't granted - * or denied. + * Notify the host application that web content is requesting permission to access the specified + * resources and the permission currently isn't granted or denied. */ - fun onPermissionRequest(pigeon_instanceArg: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, requestArg: android.webkit.PermissionRequest, callback: (Result) -> Unit) -{ + fun onPermissionRequest( + pigeon_instanceArg: + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, + requestArg: android.webkit.PermissionRequest, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3383,24 +3990,32 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.onPermissionRequest" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.onPermissionRequest" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, requestArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } /** Callback to Dart function `WebChromeClient.onShowCustomView`. */ - fun onShowCustomView(pigeon_instanceArg: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, viewArg: android.view.View, callbackArg: android.webkit.WebChromeClient.CustomViewCallback, callback: (Result) -> Unit) -{ + fun onShowCustomView( + pigeon_instanceArg: + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, + viewArg: android.view.View, + callbackArg: android.webkit.WebChromeClient.CustomViewCallback, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3414,22 +4029,24 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL channel.send(listOf(pigeon_instanceArg, viewArg, callbackArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } - /** - * Notify the host application that the current page has entered full screen - * mode. - */ - fun onHideCustomView(pigeon_instanceArg: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, callback: (Result) -> Unit) -{ + /** Notify the host application that the current page has entered full screen mode. */ + fun onHideCustomView( + pigeon_instanceArg: + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3443,23 +4060,29 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL channel.send(listOf(pigeon_instanceArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } /** - * Notify the host application that web content from the specified origin is - * attempting to use the Geolocation API, but no permission state is - * currently set for that origin. + * Notify the host application that web content from the specified origin is attempting to use the + * Geolocation API, but no permission state is currently set for that origin. */ - fun onGeolocationPermissionsShowPrompt(pigeon_instanceArg: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, originArg: String, callbackArg: android.webkit.GeolocationPermissions.Callback, callback: (Result) -> Unit) -{ + fun onGeolocationPermissionsShowPrompt( + pigeon_instanceArg: + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, + originArg: String, + callbackArg: android.webkit.GeolocationPermissions.Callback, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3468,28 +4091,33 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.onGeolocationPermissionsShowPrompt" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.onGeolocationPermissionsShowPrompt" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, originArg, callbackArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } /** - * Notify the host application that a request for Geolocation permissions, - * made with a previous call to `onGeolocationPermissionsShowPrompt` has been - * canceled. + * Notify the host application that a request for Geolocation permissions, made with a previous + * call to `onGeolocationPermissionsShowPrompt` has been canceled. */ - fun onGeolocationPermissionsHidePrompt(pigeon_instanceArg: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, callback: (Result) -> Unit) -{ + fun onGeolocationPermissionsHidePrompt( + pigeon_instanceArg: + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3498,24 +4126,31 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.onGeolocationPermissionsHidePrompt" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.onGeolocationPermissionsHidePrompt" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } /** Report a JavaScript console message to the host application. */ - fun onConsoleMessage(pigeon_instanceArg: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, messageArg: android.webkit.ConsoleMessage, callback: (Result) -> Unit) -{ + fun onConsoleMessage( + pigeon_instanceArg: + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, + messageArg: android.webkit.ConsoleMessage, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3529,22 +4164,29 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL channel.send(listOf(pigeon_instanceArg, messageArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } /** - * Notify the host application that the web page wants to display a - * JavaScript `alert()` dialog. + * Notify the host application that the web page wants to display a JavaScript `alert()` dialog. */ - fun onJsAlert(pigeon_instanceArg: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, webViewArg: android.webkit.WebView, urlArg: String, messageArg: String, callback: (Result) -> Unit) -{ + fun onJsAlert( + pigeon_instanceArg: + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, + webViewArg: android.webkit.WebView, + urlArg: String, + messageArg: String, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3558,22 +4200,29 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL channel.send(listOf(pigeon_instanceArg, webViewArg, urlArg, messageArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } /** - * Notify the host application that the web page wants to display a - * JavaScript `confirm()` dialog. + * Notify the host application that the web page wants to display a JavaScript `confirm()` dialog. */ - fun onJsConfirm(pigeon_instanceArg: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, webViewArg: android.webkit.WebView, urlArg: String, messageArg: String, callback: (Result) -> Unit) -{ + fun onJsConfirm( + pigeon_instanceArg: + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, + webViewArg: android.webkit.WebView, + urlArg: String, + messageArg: String, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3587,25 +4236,38 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL channel.send(listOf(pigeon_instanceArg, webViewArg, urlArg, messageArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback(Result.failure(AndroidWebKitError("null-error", "Flutter api returned null value for non-null return value.", ""))) + callback( + Result.failure( + AndroidWebKitError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) } else { val output = it[0] as Boolean callback(Result.success(output)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } /** - * Notify the host application that the web page wants to display a - * JavaScript `prompt()` dialog. + * Notify the host application that the web page wants to display a JavaScript `prompt()` dialog. */ - fun onJsPrompt(pigeon_instanceArg: io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, webViewArg: android.webkit.WebView, urlArg: String, messageArg: String, defaultValueArg: String, callback: (Result) -> Unit) -{ + fun onJsPrompt( + pigeon_instanceArg: + io.flutter.plugins.webviewflutter.WebChromeClientProxyApi.WebChromeClientImpl, + webViewArg: android.webkit.WebView, + urlArg: String, + messageArg: String, + defaultValueArg: String, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( @@ -3619,17 +4281,18 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL channel.send(listOf(pigeon_instanceArg, webViewArg, urlArg, messageArg, defaultValueArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { val output = it[0] as String? callback(Result.success(output)) } } else { callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + } } } - } /** * Provides access to the assets registered as part of the App bundle. @@ -3637,7 +4300,9 @@ abstract class PigeonApiWebChromeClient(open val pigeonRegistrar: AndroidWebkitL * Convenience class for accessing Flutter asset resources. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiFlutterAssetManager(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiFlutterAssetManager( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { /** The global instance of the `FlutterAssetManager`. */ abstract fun instance(): io.flutter.plugins.webviewflutter.FlutterAssetManager @@ -3646,35 +4311,46 @@ abstract class PigeonApiFlutterAssetManager(open val pigeonRegistrar: AndroidWeb * * Throws an IOException in case I/O operations were interrupted. */ - abstract fun list(pigeon_instance: io.flutter.plugins.webviewflutter.FlutterAssetManager, path: String): List + abstract fun list( + pigeon_instance: io.flutter.plugins.webviewflutter.FlutterAssetManager, + path: String + ): List /** * Gets the relative file path to the Flutter asset with the given name, including the file's * extension, e.g., "myImage.jpg". * - * The returned file path is relative to the Android app's standard asset's - * directory. Therefore, the returned path is appropriate to pass to - * Android's AssetManager, but the path is not appropriate to load as an - * absolute path. + * The returned file path is relative to the Android app's standard asset's directory. Therefore, + * the returned path is appropriate to pass to Android's AssetManager, but the path is not + * appropriate to load as an absolute path. */ - abstract fun getAssetFilePathByName(pigeon_instance: io.flutter.plugins.webviewflutter.FlutterAssetManager, name: String): String + abstract fun getAssetFilePathByName( + pigeon_instance: io.flutter.plugins.webviewflutter.FlutterAssetManager, + name: String + ): String companion object { @Suppress("LocalVariableName") fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiFlutterAssetManager?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.FlutterAssetManager.instance", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.FlutterAssetManager.instance", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_identifierArg = args[0] as Long - val wrapped: List = try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.instance(), pigeon_identifierArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + api.instance(), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3682,17 +4358,23 @@ abstract class PigeonApiFlutterAssetManager(open val pigeonRegistrar: AndroidWeb } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.FlutterAssetManager.list", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.FlutterAssetManager.list", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_instanceArg = args[0] as io.flutter.plugins.webviewflutter.FlutterAssetManager + val pigeon_instanceArg = + args[0] as io.flutter.plugins.webviewflutter.FlutterAssetManager val pathArg = args[1] as String - val wrapped: List = try { - listOf(api.list(pigeon_instanceArg, pathArg)) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + listOf(api.list(pigeon_instanceArg, pathArg)) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3700,17 +4382,23 @@ abstract class PigeonApiFlutterAssetManager(open val pigeonRegistrar: AndroidWeb } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.FlutterAssetManager.getAssetFilePathByName", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.FlutterAssetManager.getAssetFilePathByName", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_instanceArg = args[0] as io.flutter.plugins.webviewflutter.FlutterAssetManager + val pigeon_instanceArg = + args[0] as io.flutter.plugins.webviewflutter.FlutterAssetManager val nameArg = args[1] as String - val wrapped: List = try { - listOf(api.getAssetFilePathByName(pigeon_instanceArg, nameArg)) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + listOf(api.getAssetFilePathByName(pigeon_instanceArg, nameArg)) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3722,43 +4410,50 @@ abstract class PigeonApiFlutterAssetManager(open val pigeonRegistrar: AndroidWeb @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of FlutterAssetManager and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: io.flutter.plugins.webviewflutter.FlutterAssetManager, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: io.flutter.plugins.webviewflutter.FlutterAssetManager, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.FlutterAssetManager.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.FlutterAssetManager.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } } } - } /** - * This class is used to manage the JavaScript storage APIs provided by the - * WebView. + * This class is used to manage the JavaScript storage APIs provided by the WebView. * * See https://developer.android.com/reference/android/webkit/WebStorage. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiWebStorage(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiWebStorage( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { abstract fun instance(): android.webkit.WebStorage /** Clears all storage currently being used by the JavaScript storage APIs. */ @@ -3769,17 +4464,23 @@ abstract class PigeonApiWebStorage(open val pigeonRegistrar: AndroidWebkitLibrar fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiWebStorage?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebStorage.instance", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebStorage.instance", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_identifierArg = args[0] as Long - val wrapped: List = try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.instance(), pigeon_identifierArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + api.instance(), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3787,17 +4488,22 @@ abstract class PigeonApiWebStorage(open val pigeonRegistrar: AndroidWebkitLibrar } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.WebStorage.deleteAllData", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.WebStorage.deleteAllData", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebStorage - val wrapped: List = try { - api.deleteAllData(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.deleteAllData(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3809,16 +4515,19 @@ abstract class PigeonApiWebStorage(open val pigeonRegistrar: AndroidWebkitLibrar @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of WebStorage and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.webkit.WebStorage, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.webkit.WebStorage, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.webview_flutter_android.WebStorage.pigeon_newInstance" @@ -3826,17 +4535,19 @@ abstract class PigeonApiWebStorage(open val pigeonRegistrar: AndroidWebkitLibrar channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } } } - } /** * Parameters used in the `WebChromeClient.onShowFileChooser` method. @@ -3844,68 +4555,90 @@ abstract class PigeonApiWebStorage(open val pigeonRegistrar: AndroidWebkitLibrar * See https://developer.android.com/reference/android/webkit/WebChromeClient.FileChooserParams. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiFileChooserParams(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiFileChooserParams( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { /** Preference for a live media captured value (e.g. Camera, Microphone). */ - abstract fun isCaptureEnabled(pigeon_instance: android.webkit.WebChromeClient.FileChooserParams): Boolean + abstract fun isCaptureEnabled( + pigeon_instance: android.webkit.WebChromeClient.FileChooserParams + ): Boolean /** An array of acceptable MIME types. */ - abstract fun acceptTypes(pigeon_instance: android.webkit.WebChromeClient.FileChooserParams): List + abstract fun acceptTypes( + pigeon_instance: android.webkit.WebChromeClient.FileChooserParams + ): List /** File chooser mode. */ - abstract fun mode(pigeon_instance: android.webkit.WebChromeClient.FileChooserParams): FileChooserMode + abstract fun mode( + pigeon_instance: android.webkit.WebChromeClient.FileChooserParams + ): FileChooserMode /** File name of a default selection if specified, or null. */ - abstract fun filenameHint(pigeon_instance: android.webkit.WebChromeClient.FileChooserParams): String? + abstract fun filenameHint( + pigeon_instance: android.webkit.WebChromeClient.FileChooserParams + ): String? @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of FileChooserParams and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.webkit.WebChromeClient.FileChooserParams, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.webkit.WebChromeClient.FileChooserParams, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val isCaptureEnabledArg = isCaptureEnabled(pigeon_instanceArg) val acceptTypesArg = acceptTypes(pigeon_instanceArg) val modeArg = mode(pigeon_instanceArg) val filenameHintArg = filenameHint(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.FileChooserParams.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.FileChooserParams.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_identifierArg, isCaptureEnabledArg, acceptTypesArg, modeArg, filenameHintArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) - } else { - callback(Result.success(Unit)) + channel.send( + listOf( + pigeon_identifierArg, + isCaptureEnabledArg, + acceptTypesArg, + modeArg, + filenameHintArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback( + Result.failure( + AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } - } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } - } } } - } /** - * This class defines a permission request and is used when web content - * requests access to protected resources. + * This class defines a permission request and is used when web content requests access to protected + * resources. * * See https://developer.android.com/reference/android/webkit/PermissionRequest. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiPermissionRequest(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiPermissionRequest( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { abstract fun resources(pigeon_instance: android.webkit.PermissionRequest): List - /** - * Call this method to grant origin the permission to access the given - * resources. - */ + /** Call this method to grant origin the permission to access the given resources. */ abstract fun grant(pigeon_instance: android.webkit.PermissionRequest, resources: List) /** Call this method to deny the request. */ @@ -3916,18 +4649,23 @@ abstract class PigeonApiPermissionRequest(open val pigeonRegistrar: AndroidWebki fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiPermissionRequest?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.PermissionRequest.grant", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.PermissionRequest.grant", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.PermissionRequest val resourcesArg = args[1] as List - val wrapped: List = try { - api.grant(pigeon_instanceArg, resourcesArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.grant(pigeon_instanceArg, resourcesArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3935,17 +4673,22 @@ abstract class PigeonApiPermissionRequest(open val pigeonRegistrar: AndroidWebki } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.PermissionRequest.deny", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.PermissionRequest.deny", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.PermissionRequest - val wrapped: List = try { - api.deny(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.deny(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3957,63 +4700,78 @@ abstract class PigeonApiPermissionRequest(open val pigeonRegistrar: AndroidWebki @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of PermissionRequest and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.webkit.PermissionRequest, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.webkit.PermissionRequest, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val resourcesArg = resources(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.PermissionRequest.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.PermissionRequest.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg, resourcesArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } } } - } /** - * A callback interface used by the host application to notify the current page - * that its custom view has been dismissed. + * A callback interface used by the host application to notify the current page that its custom view + * has been dismissed. * * See https://developer.android.com/reference/android/webkit/WebChromeClient.CustomViewCallback. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiCustomViewCallback(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiCustomViewCallback( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { /** Invoked when the host application dismisses the custom view. */ - abstract fun onCustomViewHidden(pigeon_instance: android.webkit.WebChromeClient.CustomViewCallback) + abstract fun onCustomViewHidden( + pigeon_instance: android.webkit.WebChromeClient.CustomViewCallback + ) companion object { @Suppress("LocalVariableName") fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiCustomViewCallback?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.CustomViewCallback.onCustomViewHidden", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.CustomViewCallback.onCustomViewHidden", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.WebChromeClient.CustomViewCallback - val wrapped: List = try { - api.onCustomViewHidden(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.onCustomViewHidden(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4025,43 +4783,50 @@ abstract class PigeonApiCustomViewCallback(open val pigeonRegistrar: AndroidWebk @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of CustomViewCallback and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.webkit.WebChromeClient.CustomViewCallback, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.webkit.WebChromeClient.CustomViewCallback, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.CustomViewCallback.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.CustomViewCallback.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } } } - } /** - * This class represents the basic building block for user interface - * components. + * This class represents the basic building block for user interface components. * * See https://developer.android.com/reference/android/view/View. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiView(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiView( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { /** Set the scrolled position of your view. */ abstract fun scrollTo(pigeon_instance: android.view.View, x: Long, y: Long) @@ -4093,19 +4858,22 @@ abstract class PigeonApiView(open val pigeonRegistrar: AndroidWebkitLibraryPigeo fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiView?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.View.scrollTo", codec) + val channel = + BasicMessageChannel( + binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.View.scrollTo", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.view.View val xArg = args[1] as Long val yArg = args[2] as Long - val wrapped: List = try { - api.scrollTo(pigeon_instanceArg, xArg, yArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.scrollTo(pigeon_instanceArg, xArg, yArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4113,19 +4881,22 @@ abstract class PigeonApiView(open val pigeonRegistrar: AndroidWebkitLibraryPigeo } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.View.scrollBy", codec) + val channel = + BasicMessageChannel( + binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.View.scrollBy", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.view.View val xArg = args[1] as Long val yArg = args[2] as Long - val wrapped: List = try { - api.scrollBy(pigeon_instanceArg, xArg, yArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.scrollBy(pigeon_instanceArg, xArg, yArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4133,16 +4904,21 @@ abstract class PigeonApiView(open val pigeonRegistrar: AndroidWebkitLibraryPigeo } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.View.getScrollPosition", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.View.getScrollPosition", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.view.View - val wrapped: List = try { - listOf(api.getScrollPosition(pigeon_instanceArg)) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + listOf(api.getScrollPosition(pigeon_instanceArg)) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4150,18 +4926,23 @@ abstract class PigeonApiView(open val pigeonRegistrar: AndroidWebkitLibraryPigeo } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.View.setVerticalScrollBarEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.View.setVerticalScrollBarEnabled", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.view.View val enabledArg = args[1] as Boolean - val wrapped: List = try { - api.setVerticalScrollBarEnabled(pigeon_instanceArg, enabledArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setVerticalScrollBarEnabled(pigeon_instanceArg, enabledArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4169,18 +4950,23 @@ abstract class PigeonApiView(open val pigeonRegistrar: AndroidWebkitLibraryPigeo } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.View.setHorizontalScrollBarEnabled", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.View.setHorizontalScrollBarEnabled", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.view.View val enabledArg = args[1] as Boolean - val wrapped: List = try { - api.setHorizontalScrollBarEnabled(pigeon_instanceArg, enabledArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setHorizontalScrollBarEnabled(pigeon_instanceArg, enabledArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4188,18 +4974,23 @@ abstract class PigeonApiView(open val pigeonRegistrar: AndroidWebkitLibraryPigeo } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.View.setOverScrollMode", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.View.setOverScrollMode", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.view.View val modeArg = args[1] as OverScrollMode - val wrapped: List = try { - api.setOverScrollMode(pigeon_instanceArg, modeArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.setOverScrollMode(pigeon_instanceArg, modeArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4211,16 +5002,16 @@ abstract class PigeonApiView(open val pigeonRegistrar: AndroidWebkitLibraryPigeo @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of View and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.view.View, callback: (Result) -> Unit) -{ + fun pigeon_newInstance(pigeon_instanceArg: android.view.View, callback: (Result) -> Unit) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.webview_flutter_android.View.pigeon_newInstance" @@ -4228,35 +5019,51 @@ abstract class PigeonApiView(open val pigeonRegistrar: AndroidWebkitLibraryPigeo channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } } } - } /** - * A callback interface used by the host application to set the Geolocation - * permission state for an origin. + * A callback interface used by the host application to set the Geolocation permission state for an + * origin. * * See https://developer.android.com/reference/android/webkit/GeolocationPermissions.Callback. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiGeolocationPermissionsCallback(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiGeolocationPermissionsCallback( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { /** Sets the Geolocation permission state for the supplied origin. */ - abstract fun invoke(pigeon_instance: android.webkit.GeolocationPermissions.Callback, origin: String, allow: Boolean, retain: Boolean) + abstract fun invoke( + pigeon_instance: android.webkit.GeolocationPermissions.Callback, + origin: String, + allow: Boolean, + retain: Boolean + ) companion object { @Suppress("LocalVariableName") - fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiGeolocationPermissionsCallback?) { + fun setUpMessageHandlers( + binaryMessenger: BinaryMessenger, + api: PigeonApiGeolocationPermissionsCallback? + ) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.GeolocationPermissionsCallback.invoke", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.GeolocationPermissionsCallback.invoke", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -4264,12 +5071,13 @@ abstract class PigeonApiGeolocationPermissionsCallback(open val pigeonRegistrar: val originArg = args[1] as String val allowArg = args[2] as Boolean val retainArg = args[3] as Boolean - val wrapped: List = try { - api.invoke(pigeon_instanceArg, originArg, allowArg, retainArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.invoke(pigeon_instanceArg, originArg, allowArg, retainArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4280,35 +5088,44 @@ abstract class PigeonApiGeolocationPermissionsCallback(open val pigeonRegistrar: } @Suppress("LocalVariableName", "FunctionName") - /** Creates a Dart instance of GeolocationPermissionsCallback and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.webkit.GeolocationPermissions.Callback, callback: (Result) -> Unit) -{ + /** + * Creates a Dart instance of GeolocationPermissionsCallback and attaches it to + * [pigeon_instanceArg]. + */ + fun pigeon_newInstance( + pigeon_instanceArg: android.webkit.GeolocationPermissions.Callback, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.GeolocationPermissionsCallback.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.GeolocationPermissionsCallback.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } } } - } /** * Represents a request for HTTP authentication. @@ -4316,38 +5133,45 @@ abstract class PigeonApiGeolocationPermissionsCallback(open val pigeonRegistrar: * See https://developer.android.com/reference/android/webkit/HttpAuthHandler. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiHttpAuthHandler(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiHttpAuthHandler( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { /** - * Gets whether the credentials stored for the current host (i.e. the host - * for which `WebViewClient.onReceivedHttpAuthRequest` was called) are - * suitable for use. + * Gets whether the credentials stored for the current host (i.e. the host for which + * `WebViewClient.onReceivedHttpAuthRequest` was called) are suitable for use. */ abstract fun useHttpAuthUsernamePassword(pigeon_instance: android.webkit.HttpAuthHandler): Boolean /** Instructs the WebView to cancel the authentication request.. */ abstract fun cancel(pigeon_instance: android.webkit.HttpAuthHandler) - /** - * Instructs the WebView to proceed with the authentication with the given - * credentials. - */ - abstract fun proceed(pigeon_instance: android.webkit.HttpAuthHandler, username: String, password: String) + /** Instructs the WebView to proceed with the authentication with the given credentials. */ + abstract fun proceed( + pigeon_instance: android.webkit.HttpAuthHandler, + username: String, + password: String + ) companion object { @Suppress("LocalVariableName") fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiHttpAuthHandler?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.HttpAuthHandler.useHttpAuthUsernamePassword", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.HttpAuthHandler.useHttpAuthUsernamePassword", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.HttpAuthHandler - val wrapped: List = try { - listOf(api.useHttpAuthUsernamePassword(pigeon_instanceArg)) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + listOf(api.useHttpAuthUsernamePassword(pigeon_instanceArg)) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4355,17 +5179,22 @@ abstract class PigeonApiHttpAuthHandler(open val pigeonRegistrar: AndroidWebkitL } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.HttpAuthHandler.cancel", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.HttpAuthHandler.cancel", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.HttpAuthHandler - val wrapped: List = try { - api.cancel(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.cancel(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4373,19 +5202,24 @@ abstract class PigeonApiHttpAuthHandler(open val pigeonRegistrar: AndroidWebkitL } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.HttpAuthHandler.proceed", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.HttpAuthHandler.proceed", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.HttpAuthHandler val usernameArg = args[1] as String val passwordArg = args[2] as String - val wrapped: List = try { - api.proceed(pigeon_instanceArg, usernameArg, passwordArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.proceed(pigeon_instanceArg, usernameArg, passwordArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4397,46 +5231,53 @@ abstract class PigeonApiHttpAuthHandler(open val pigeonRegistrar: AndroidWebkitL @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of HttpAuthHandler and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.webkit.HttpAuthHandler, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.webkit.HttpAuthHandler, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.HttpAuthHandler.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.HttpAuthHandler.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } } } - } /** - * Defines a message containing a description and arbitrary data object that - * can be sent to a `Handler`. + * Defines a message containing a description and arbitrary data object that can be sent to a + * `Handler`. * * See https://developer.android.com/reference/android/os/Message. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiAndroidMessage(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiAndroidMessage( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { /** - * Sends this message to the Android native `Handler` specified by - * getTarget(). + * Sends this message to the Android native `Handler` specified by getTarget(). * * Throws a null pointer exception if this field has not been set. */ @@ -4447,17 +5288,22 @@ abstract class PigeonApiAndroidMessage(open val pigeonRegistrar: AndroidWebkitLi fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiAndroidMessage?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.AndroidMessage.sendToTarget", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.AndroidMessage.sendToTarget", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.os.Message - val wrapped: List = try { - api.sendToTarget(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.sendToTarget(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4469,43 +5315,48 @@ abstract class PigeonApiAndroidMessage(open val pigeonRegistrar: AndroidWebkitLi @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of AndroidMessage and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.os.Message, callback: (Result) -> Unit) -{ + fun pigeon_newInstance(pigeon_instanceArg: android.os.Message, callback: (Result) -> Unit) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.AndroidMessage.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.AndroidMessage.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } } } - } /** - * Defines a message containing a description and arbitrary data object that - * can be sent to a `Handler`. + * Defines a message containing a description and arbitrary data object that can be sent to a + * `Handler`. * * See https://developer.android.com/reference/android/webkit/ClientCertRequest. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiClientCertRequest(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiClientCertRequest( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { /** Cancel this request. */ abstract fun cancel(pigeon_instance: android.webkit.ClientCertRequest) @@ -4513,24 +5364,33 @@ abstract class PigeonApiClientCertRequest(open val pigeonRegistrar: AndroidWebki abstract fun ignore(pigeon_instance: android.webkit.ClientCertRequest) /** Proceed with the specified private key and client certificate chain. */ - abstract fun proceed(pigeon_instance: android.webkit.ClientCertRequest, privateKey: java.security.PrivateKey, chain: List) + abstract fun proceed( + pigeon_instance: android.webkit.ClientCertRequest, + privateKey: java.security.PrivateKey, + chain: List + ) companion object { @Suppress("LocalVariableName") fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiClientCertRequest?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.ClientCertRequest.cancel", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.ClientCertRequest.cancel", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.ClientCertRequest - val wrapped: List = try { - api.cancel(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.cancel(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4538,17 +5398,22 @@ abstract class PigeonApiClientCertRequest(open val pigeonRegistrar: AndroidWebki } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.ClientCertRequest.ignore", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.ClientCertRequest.ignore", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.ClientCertRequest - val wrapped: List = try { - api.ignore(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.ignore(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4556,19 +5421,24 @@ abstract class PigeonApiClientCertRequest(open val pigeonRegistrar: AndroidWebki } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.ClientCertRequest.proceed", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.ClientCertRequest.proceed", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.ClientCertRequest val privateKeyArg = args[1] as java.security.PrivateKey val chainArg = args[2] as List - val wrapped: List = try { - api.proceed(pigeon_instanceArg, privateKeyArg, chainArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.proceed(pigeon_instanceArg, privateKeyArg, chainArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4580,57 +5450,68 @@ abstract class PigeonApiClientCertRequest(open val pigeonRegistrar: AndroidWebki @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of ClientCertRequest and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.webkit.ClientCertRequest, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.webkit.ClientCertRequest, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.ClientCertRequest.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.ClientCertRequest.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } } } - } /** * A private key. * - * The purpose of this interface is to group (and provide type safety for) all - * private key interfaces. + * The purpose of this interface is to group (and provide type safety for) all private key + * interfaces. * * See https://developer.android.com/reference/java/security/PrivateKey. */ @Suppress("UNCHECKED_CAST") -open class PigeonApiPrivateKey(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +open class PigeonApiPrivateKey( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of PrivateKey and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: java.security.PrivateKey, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: java.security.PrivateKey, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.webview_flutter_android.PrivateKey.pigeon_newInstance" @@ -4638,58 +5519,67 @@ open class PigeonApiPrivateKey(open val pigeonRegistrar: AndroidWebkitLibraryPig channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } } } - } /** * Abstract class for X.509 certificates. * - * This provides a standard way to access all the attributes of an X.509 - * certificate. + * This provides a standard way to access all the attributes of an X.509 certificate. * * See https://developer.android.com/reference/java/security/cert/X509Certificate. */ @Suppress("UNCHECKED_CAST") -open class PigeonApiX509Certificate(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +open class PigeonApiX509Certificate( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of X509Certificate and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: java.security.cert.X509Certificate, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: java.security.cert.X509Certificate, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.X509Certificate.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.X509Certificate.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } } } - } /** * Represents a request for handling an SSL error. @@ -4697,16 +5587,18 @@ open class PigeonApiX509Certificate(open val pigeonRegistrar: AndroidWebkitLibra * See https://developer.android.com/reference/android/webkit/SslErrorHandler. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiSslErrorHandler(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiSslErrorHandler( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { /** - * Instructs the WebView that encountered the SSL certificate error to - * terminate communication with the server. + * Instructs the WebView that encountered the SSL certificate error to terminate communication + * with the server. */ abstract fun cancel(pigeon_instance: android.webkit.SslErrorHandler) /** - * Instructs the WebView that encountered the SSL certificate error to ignore - * the error and continue communicating with the server. + * Instructs the WebView that encountered the SSL certificate error to ignore the error and + * continue communicating with the server. */ abstract fun proceed(pigeon_instance: android.webkit.SslErrorHandler) @@ -4715,17 +5607,22 @@ abstract class PigeonApiSslErrorHandler(open val pigeonRegistrar: AndroidWebkitL fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiSslErrorHandler?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.SslErrorHandler.cancel", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.SslErrorHandler.cancel", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.SslErrorHandler - val wrapped: List = try { - api.cancel(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.cancel(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4733,17 +5630,22 @@ abstract class PigeonApiSslErrorHandler(open val pigeonRegistrar: AndroidWebkitL } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.SslErrorHandler.proceed", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.SslErrorHandler.proceed", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.webkit.SslErrorHandler - val wrapped: List = try { - api.proceed(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + api.proceed(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4755,45 +5657,54 @@ abstract class PigeonApiSslErrorHandler(open val pigeonRegistrar: AndroidWebkitL @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of SslErrorHandler and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.webkit.SslErrorHandler, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.webkit.SslErrorHandler, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.SslErrorHandler.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.SslErrorHandler.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } } } - } /** - * This class represents a set of one or more SSL errors and the associated SSL - * certificate. + * This class represents a set of one or more SSL errors and the associated SSL certificate. * * See https://developer.android.com/reference/android/net/http/SslError. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiSslError(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiSslError( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { /** Gets the SSL certificate associated with this object. */ - abstract fun certificate(pigeon_instance: android.net.http.SslError): android.net.http.SslCertificate + abstract fun certificate( + pigeon_instance: android.net.http.SslError + ): android.net.http.SslCertificate /** Gets the URL associated with this object. */ abstract fun url(pigeon_instance: android.net.http.SslError): String @@ -4809,16 +5720,21 @@ abstract class PigeonApiSslError(open val pigeonRegistrar: AndroidWebkitLibraryP fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiSslError?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.SslError.getPrimaryError", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.SslError.getPrimaryError", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.net.http.SslError - val wrapped: List = try { - listOf(api.getPrimaryError(pigeon_instanceArg)) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + listOf(api.getPrimaryError(pigeon_instanceArg)) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4826,17 +5742,22 @@ abstract class PigeonApiSslError(open val pigeonRegistrar: AndroidWebkitLibraryP } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.SslError.hasError", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.SslError.hasError", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.net.http.SslError val errorArg = args[1] as SslErrorType - val wrapped: List = try { - listOf(api.hasError(pigeon_instanceArg, errorArg)) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + listOf(api.hasError(pigeon_instanceArg, errorArg)) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4848,16 +5769,19 @@ abstract class PigeonApiSslError(open val pigeonRegistrar: AndroidWebkitLibraryP @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of SslError and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.net.http.SslError, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.net.http.SslError, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val certificateArg = certificate(pigeon_instanceArg) val urlArg = url(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger @@ -4867,28 +5791,30 @@ abstract class PigeonApiSslError(open val pigeonRegistrar: AndroidWebkitLibraryP channel.send(listOf(pigeon_identifierArg, certificateArg, urlArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } } } - } /** * A distinguished name helper class. * - * A 3-tuple of: - * the most specific common name (CN) - * the most specific organization (O) - * the most specific organizational unit (OU) + * A 3-tuple of: the most specific common name (CN) the most specific organization (O) the most + * specific organizational unit (OU) */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiSslCertificateDName(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiSslCertificateDName( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { /** The most specific Common-name (CN) component of this name. */ abstract fun getCName(pigeon_instance: android.net.http.SslCertificate.DName): String @@ -4906,16 +5832,21 @@ abstract class PigeonApiSslCertificateDName(open val pigeonRegistrar: AndroidWeb fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiSslCertificateDName?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.SslCertificateDName.getCName", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.SslCertificateDName.getCName", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.net.http.SslCertificate.DName - val wrapped: List = try { - listOf(api.getCName(pigeon_instanceArg)) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + listOf(api.getCName(pigeon_instanceArg)) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4923,16 +5854,21 @@ abstract class PigeonApiSslCertificateDName(open val pigeonRegistrar: AndroidWeb } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.SslCertificateDName.getDName", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.SslCertificateDName.getDName", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.net.http.SslCertificate.DName - val wrapped: List = try { - listOf(api.getDName(pigeon_instanceArg)) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + listOf(api.getDName(pigeon_instanceArg)) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4940,16 +5876,21 @@ abstract class PigeonApiSslCertificateDName(open val pigeonRegistrar: AndroidWeb } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.SslCertificateDName.getOName", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.SslCertificateDName.getOName", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.net.http.SslCertificate.DName - val wrapped: List = try { - listOf(api.getOName(pigeon_instanceArg)) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + listOf(api.getOName(pigeon_instanceArg)) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4957,16 +5898,21 @@ abstract class PigeonApiSslCertificateDName(open val pigeonRegistrar: AndroidWeb } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.SslCertificateDName.getUName", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.SslCertificateDName.getUName", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.net.http.SslCertificate.DName - val wrapped: List = try { - listOf(api.getUName(pigeon_instanceArg)) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + listOf(api.getUName(pigeon_instanceArg)) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -4978,34 +5924,40 @@ abstract class PigeonApiSslCertificateDName(open val pigeonRegistrar: AndroidWeb @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of SslCertificateDName and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.net.http.SslCertificate.DName, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.net.http.SslCertificate.DName, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.SslCertificateDName.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.SslCertificateDName.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } } } - } /** * SSL certificate info (certificate details) class. @@ -5013,48 +5965,56 @@ abstract class PigeonApiSslCertificateDName(open val pigeonRegistrar: AndroidWeb * See https://developer.android.com/reference/android/net/http/SslCertificate. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiSslCertificate(open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar) { +abstract class PigeonApiSslCertificate( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { /** Issued-by distinguished name or null if none has been set. */ - abstract fun getIssuedBy(pigeon_instance: android.net.http.SslCertificate): android.net.http.SslCertificate.DName? + abstract fun getIssuedBy( + pigeon_instance: android.net.http.SslCertificate + ): android.net.http.SslCertificate.DName? /** Issued-to distinguished name or null if none has been set. */ - abstract fun getIssuedTo(pigeon_instance: android.net.http.SslCertificate): android.net.http.SslCertificate.DName? + abstract fun getIssuedTo( + pigeon_instance: android.net.http.SslCertificate + ): android.net.http.SslCertificate.DName? - /** - * Not-after date from the certificate validity period or null if none has been - * set. - */ + /** Not-after date from the certificate validity period or null if none has been set. */ abstract fun getValidNotAfterMsSinceEpoch(pigeon_instance: android.net.http.SslCertificate): Long? - /** - * Not-before date from the certificate validity period or null if none has - * been set. - */ - abstract fun getValidNotBeforeMsSinceEpoch(pigeon_instance: android.net.http.SslCertificate): Long? + /** Not-before date from the certificate validity period or null if none has been set. */ + abstract fun getValidNotBeforeMsSinceEpoch( + pigeon_instance: android.net.http.SslCertificate + ): Long? /** - * The X509Certificate used to create this SslCertificate or null if no - * certificate was provided. + * The X509Certificate used to create this SslCertificate or null if no certificate was provided. * * Always returns null on Android versions below Q. */ - abstract fun getX509Certificate(pigeon_instance: android.net.http.SslCertificate): java.security.cert.X509Certificate? + abstract fun getX509Certificate( + pigeon_instance: android.net.http.SslCertificate + ): java.security.cert.X509Certificate? companion object { @Suppress("LocalVariableName") fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiSslCertificate?) { val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.SslCertificate.getIssuedBy", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.SslCertificate.getIssuedBy", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.net.http.SslCertificate - val wrapped: List = try { - listOf(api.getIssuedBy(pigeon_instanceArg)) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + listOf(api.getIssuedBy(pigeon_instanceArg)) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -5062,16 +6022,21 @@ abstract class PigeonApiSslCertificate(open val pigeonRegistrar: AndroidWebkitLi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.SslCertificate.getIssuedTo", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.SslCertificate.getIssuedTo", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.net.http.SslCertificate - val wrapped: List = try { - listOf(api.getIssuedTo(pigeon_instanceArg)) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + listOf(api.getIssuedTo(pigeon_instanceArg)) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -5079,16 +6044,21 @@ abstract class PigeonApiSslCertificate(open val pigeonRegistrar: AndroidWebkitLi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.SslCertificate.getValidNotAfterMsSinceEpoch", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.SslCertificate.getValidNotAfterMsSinceEpoch", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.net.http.SslCertificate - val wrapped: List = try { - listOf(api.getValidNotAfterMsSinceEpoch(pigeon_instanceArg)) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + listOf(api.getValidNotAfterMsSinceEpoch(pigeon_instanceArg)) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -5096,16 +6066,21 @@ abstract class PigeonApiSslCertificate(open val pigeonRegistrar: AndroidWebkitLi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.SslCertificate.getValidNotBeforeMsSinceEpoch", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.SslCertificate.getValidNotBeforeMsSinceEpoch", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.net.http.SslCertificate - val wrapped: List = try { - listOf(api.getValidNotBeforeMsSinceEpoch(pigeon_instanceArg)) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + listOf(api.getValidNotBeforeMsSinceEpoch(pigeon_instanceArg)) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -5113,16 +6088,21 @@ abstract class PigeonApiSslCertificate(open val pigeonRegistrar: AndroidWebkitLi } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.webview_flutter_android.SslCertificate.getX509Certificate", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.SslCertificate.getX509Certificate", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.net.http.SslCertificate - val wrapped: List = try { - listOf(api.getX509Certificate(pigeon_instanceArg)) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } + val wrapped: List = + try { + listOf(api.getX509Certificate(pigeon_instanceArg)) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -5134,32 +6114,38 @@ abstract class PigeonApiSslCertificate(open val pigeonRegistrar: AndroidWebkitLi @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of SslCertificate and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: android.net.http.SslCertificate, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: android.net.http.SslCertificate, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.ignoreCallsToDart) { callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { callback(Result.success(Unit)) - } else { - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.SslCertificate.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.webview_flutter_android.SslCertificate.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { - callback(Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) - } + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } } } } - } diff --git a/packages/webview_flutter/webview_flutter_android/lib/src/android_webkit.g.dart b/packages/webview_flutter/webview_flutter_android/lib/src/android_webkit.g.dart index 3c9e692929a..93a23f43161 100644 --- a/packages/webview_flutter/webview_flutter_android/lib/src/android_webkit.g.dart +++ b/packages/webview_flutter/webview_flutter_android/lib/src/android_webkit.g.dart @@ -8,7 +8,8 @@ import 'dart:async'; import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; -import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer, immutable, protected; +import 'package:flutter/foundation.dart' + show ReadBuffer, WriteBuffer, immutable, protected; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart' show WidgetsFlutterBinding; @@ -19,7 +20,8 @@ PlatformException _createConnectionError(String channelName) { ); } -List wrapResponse({Object? result, PlatformException? error, bool empty = false}) { +List wrapResponse( + {Object? result, PlatformException? error, bool empty = false}) { if (empty) { return []; } @@ -28,6 +30,7 @@ List wrapResponse({Object? result, PlatformException? error, bool empty } return [error.code, error.message, error.details]; } + /// An immutable object that serves as the base class for all ProxyApis and /// can provide functional copies of itself. /// @@ -110,9 +113,10 @@ class PigeonInstanceManager { // by calling instanceManager.getIdentifier() inside of `==` while this was a // HashMap). final Expando _identifiers = Expando(); - final Map> _weakInstances = - >{}; - final Map _strongInstances = {}; + final Map> + _weakInstances = >{}; + final Map _strongInstances = + {}; late final Finalizer _finalizer; int _nextIdentifier = 0; @@ -122,7 +126,8 @@ class PigeonInstanceManager { static PigeonInstanceManager _initInstance() { WidgetsFlutterBinding.ensureInitialized(); - final _PigeonInternalInstanceManagerApi api = _PigeonInternalInstanceManagerApi(); + final _PigeonInternalInstanceManagerApi api = + _PigeonInternalInstanceManagerApi(); // Clears the native `PigeonInstanceManager` on the initial use of the Dart one. api.clear(); final PigeonInstanceManager instanceManager = PigeonInstanceManager( @@ -130,36 +135,65 @@ class PigeonInstanceManager { api.removeStrongReference(identifier); }, ); - _PigeonInternalInstanceManagerApi.setUpMessageHandlers(instanceManager: instanceManager); - WebResourceRequest.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WebResourceResponse.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WebResourceError.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WebResourceErrorCompat.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WebViewPoint.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - ConsoleMessage.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - CookieManager.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WebView.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WebSettings.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - JavaScriptChannel.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WebViewClient.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - DownloadListener.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WebChromeClient.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - FlutterAssetManager.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - WebStorage.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - FileChooserParams.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - PermissionRequest.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - CustomViewCallback.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + _PigeonInternalInstanceManagerApi.setUpMessageHandlers( + instanceManager: instanceManager); + WebResourceRequest.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WebResourceResponse.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WebResourceError.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WebResourceErrorCompat.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WebViewPoint.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + ConsoleMessage.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + CookieManager.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WebView.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WebSettings.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + JavaScriptChannel.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WebViewClient.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + DownloadListener.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WebChromeClient.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + FlutterAssetManager.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + WebStorage.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + FileChooserParams.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + PermissionRequest.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + CustomViewCallback.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); View.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - GeolocationPermissionsCallback.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - HttpAuthHandler.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - AndroidMessage.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - ClientCertRequest.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - PrivateKey.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - X509Certificate.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - SslErrorHandler.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - SslError.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - SslCertificateDName.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - SslCertificate.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + GeolocationPermissionsCallback.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + HttpAuthHandler.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + AndroidMessage.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + ClientCertRequest.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + PrivateKey.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + X509Certificate.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + SslErrorHandler.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + SslError.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + SslCertificateDName.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + SslCertificate.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); return instanceManager; } @@ -223,15 +257,20 @@ class PigeonInstanceManager { /// /// This method also expects the host `InstanceManager` to have a strong /// reference to the instance the identifier is associated with. - T? getInstanceWithWeakReference(int identifier) { - final PigeonInternalProxyApiBaseClass? weakInstance = _weakInstances[identifier]?.target; + T? getInstanceWithWeakReference( + int identifier) { + final PigeonInternalProxyApiBaseClass? weakInstance = + _weakInstances[identifier]?.target; if (weakInstance == null) { - final PigeonInternalProxyApiBaseClass? strongInstance = _strongInstances[identifier]; + final PigeonInternalProxyApiBaseClass? strongInstance = + _strongInstances[identifier]; if (strongInstance != null) { - final PigeonInternalProxyApiBaseClass copy = strongInstance.pigeon_copy(); + final PigeonInternalProxyApiBaseClass copy = + strongInstance.pigeon_copy(); _identifiers[copy] = identifier; - _weakInstances[identifier] = WeakReference(copy); + _weakInstances[identifier] = + WeakReference(copy); _finalizer.attach(copy, identifier, detach: copy); return copy as T; } @@ -255,17 +294,20 @@ class PigeonInstanceManager { /// added. /// /// Returns unique identifier of the [instance] added. - void addHostCreatedInstance(PigeonInternalProxyApiBaseClass instance, int identifier) { + void addHostCreatedInstance( + PigeonInternalProxyApiBaseClass instance, int identifier) { _addInstanceWithIdentifier(instance, identifier); } - void _addInstanceWithIdentifier(PigeonInternalProxyApiBaseClass instance, int identifier) { + void _addInstanceWithIdentifier( + PigeonInternalProxyApiBaseClass instance, int identifier) { assert(!containsIdentifier(identifier)); assert(getIdentifier(instance) == null); assert(identifier >= 0); _identifiers[instance] = identifier; - _weakInstances[identifier] = WeakReference(instance); + _weakInstances[identifier] = + WeakReference(instance); _finalizer.attach(instance, identifier, detach: instance); final PigeonInternalProxyApiBaseClass copy = instance.pigeon_copy(); @@ -392,29 +434,29 @@ class _PigeonInternalInstanceManagerApi { } class _PigeonInternalProxyApiBaseCodec extends _PigeonCodec { - const _PigeonInternalProxyApiBaseCodec(this.instanceManager); - final PigeonInstanceManager instanceManager; - @override - void writeValue(WriteBuffer buffer, Object? value) { - if (value is PigeonInternalProxyApiBaseClass) { - buffer.putUint8(128); - writeValue(buffer, instanceManager.getIdentifier(value)); - } else { - super.writeValue(buffer, value); - } - } - @override - Object? readValueOfType(int type, ReadBuffer buffer) { - switch (type) { - case 128: - return instanceManager - .getInstanceWithWeakReference(readValue(buffer)! as int); - default: - return super.readValueOfType(type, buffer); - } - } -} + const _PigeonInternalProxyApiBaseCodec(this.instanceManager); + final PigeonInstanceManager instanceManager; + @override + void writeValue(WriteBuffer buffer, Object? value) { + if (value is PigeonInternalProxyApiBaseClass) { + buffer.putUint8(128); + writeValue(buffer, instanceManager.getIdentifier(value)); + } else { + super.writeValue(buffer, value); + } + } + @override + Object? readValueOfType(int type, ReadBuffer buffer) { + switch (type) { + case 128: + return instanceManager + .getInstanceWithWeakReference(readValue(buffer)! as int); + default: + return super.readValueOfType(type, buffer); + } + } +} /// Mode of how to select files for a file chooser. /// @@ -425,14 +467,17 @@ enum FileChooserMode { /// /// See https://developer.android.com/reference/android/webkit/WebChromeClient.FileChooserParams#MODE_OPEN. open, + /// Similar to [open] but allows multiple files to be selected. /// /// See https://developer.android.com/reference/android/webkit/WebChromeClient.FileChooserParams#MODE_OPEN_MULTIPLE. openMultiple, + /// Allows picking a nonexistent file and saving it. /// /// See https://developer.android.com/reference/android/webkit/WebChromeClient.FileChooserParams#MODE_SAVE. save, + /// Indicates a `FileChooserMode` with an unknown mode. /// /// This does not represent an actual value provided by the platform and only @@ -448,22 +493,27 @@ enum ConsoleMessageLevel { /// /// See https://developer.android.com/reference/android/webkit/ConsoleMessage.MessageLevel#DEBUG. debug, + /// Indicates a message is provided as an error. /// /// See https://developer.android.com/reference/android/webkit/ConsoleMessage.MessageLevel#ERROR. error, + /// Indicates a message is provided as a basic log message. /// /// See https://developer.android.com/reference/android/webkit/ConsoleMessage.MessageLevel#LOG. log, + /// Indicates a message is provided as a tip. /// /// See https://developer.android.com/reference/android/webkit/ConsoleMessage.MessageLevel#TIP. tip, + /// Indicates a message is provided as a warning. /// /// See https://developer.android.com/reference/android/webkit/ConsoleMessage.MessageLevel#WARNING. warning, + /// Indicates a message with an unknown level. /// /// This does not represent an actual value provided by the platform and only @@ -478,11 +528,14 @@ enum OverScrollMode { /// Always allow a user to over-scroll this view, provided it is a view that /// can scroll. always, + /// Allow a user to over-scroll this view only if the content is large enough /// to meaningfully scroll, provided it is a view that can scroll. ifContentScrolls, + /// Never allow a user to over-scroll this view. never, + /// The type is not recognized by this wrapper. unknown, } @@ -493,21 +546,26 @@ enum OverScrollMode { enum SslErrorType { /// The date of the certificate is invalid. dateInvalid, + /// The certificate has expired. expired, + /// Hostname mismatch. idMismatch, + /// A generic error occurred. invalid, + /// The certificate is not yet valid. notYetValid, + /// The certificate authority is not trusted. untrusted, + /// The type is not recognized by this wrapper. unknown, } - class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override @@ -515,16 +573,16 @@ class _PigeonCodec extends StandardMessageCodec { if (value is int) { buffer.putUint8(4); buffer.putInt64(value); - } else if (value is FileChooserMode) { + } else if (value is FileChooserMode) { buffer.putUint8(129); writeValue(buffer, value.index); - } else if (value is ConsoleMessageLevel) { + } else if (value is ConsoleMessageLevel) { buffer.putUint8(130); writeValue(buffer, value.index); - } else if (value is OverScrollMode) { + } else if (value is OverScrollMode) { buffer.putUint8(131); writeValue(buffer, value.index); - } else if (value is SslErrorType) { + } else if (value is SslErrorType) { buffer.putUint8(132); writeValue(buffer, value.index); } else { @@ -535,16 +593,16 @@ class _PigeonCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 129: + case 129: final int? value = readValue(buffer) as int?; return value == null ? null : FileChooserMode.values[value]; - case 130: + case 130: final int? value = readValue(buffer) as int?; return value == null ? null : ConsoleMessageLevel.values[value]; - case 131: + case 131: final int? value = readValue(buffer) as int?; return value == null ? null : OverScrollMode.values[value]; - case 132: + case 132: final int? value = readValue(buffer) as int?; return value == null ? null : SslErrorType.values[value]; default: @@ -552,6 +610,7 @@ class _PigeonCodec extends StandardMessageCodec { } } } + /// Encompasses parameters to the `WebViewClient.shouldInterceptRequest` method. /// /// See https://developer.android.com/reference/android/webkit/WebResourceRequest. @@ -8123,4 +8182,3 @@ class SslCertificate extends PigeonInternalProxyApiBaseClass { ); } } - From b667829f87fbcd6d4fb6a66999dac9aee7629b7f Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Wed, 14 May 2025 12:44:00 -0400 Subject: [PATCH 25/29] fix pubspecs and changelog --- .../webview_flutter/webview_flutter/CHANGELOG.md | 8 ++++++-- .../webview_flutter/example/pubspec.yaml | 12 +++--------- .../webview_flutter/webview_flutter/pubspec.yaml | 14 ++++---------- 3 files changed, 13 insertions(+), 21 deletions(-) diff --git a/packages/webview_flutter/webview_flutter/CHANGELOG.md b/packages/webview_flutter/webview_flutter/CHANGELOG.md index 333296aa501..0c2d9201dfc 100644 --- a/packages/webview_flutter/webview_flutter/CHANGELOG.md +++ b/packages/webview_flutter/webview_flutter/CHANGELOG.md @@ -1,6 +1,10 @@ -## NEXT +## 4.12.0 -* Updates README to indicate that Andoid SDK <21 is no longer supported. +* Adds support to set whether to draw the scrollbar. See + `WebViewController.setVerticalScrollBarEnabled`, + `WebViewController.setHorizontalScrollBarEnabled`, + `WebViewController.supportsSetScrollBarsEnabled`. +* Updates README to indicate that Android SDK <21 is no longer supported. ## 4.11.0 diff --git a/packages/webview_flutter/webview_flutter/example/pubspec.yaml b/packages/webview_flutter/webview_flutter/example/pubspec.yaml index 8e37ba23613..6b157228134 100644 --- a/packages/webview_flutter/webview_flutter/example/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter/example/pubspec.yaml @@ -17,8 +17,8 @@ dependencies: # The example app is bundled with the plugin so we use a path dependency on # the parent directory to use the current plugin's version. path: ../ - webview_flutter_android: ^4.4.0 - webview_flutter_wkwebview: ^3.19.0 + webview_flutter_android: ^4.5.0 + webview_flutter_wkwebview: ^3.21.0 dev_dependencies: build_runner: ^2.1.5 @@ -27,7 +27,7 @@ dev_dependencies: sdk: flutter integration_test: sdk: flutter - webview_flutter_platform_interface: ^2.11.0 + webview_flutter_platform_interface: ^2.12.0 flutter: uses-material-design: true @@ -36,9 +36,3 @@ flutter: - assets/sample_video.mp4 - assets/www/index.html - assets/www/styles/style.css -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-federated-plugins -dependency_overrides: - webview_flutter_android: {path: ../../../../packages/webview_flutter/webview_flutter_android} - webview_flutter_platform_interface: {path: ../../../../packages/webview_flutter/webview_flutter_platform_interface} - webview_flutter_wkwebview: {path: ../../../../packages/webview_flutter/webview_flutter_wkwebview} diff --git a/packages/webview_flutter/webview_flutter/pubspec.yaml b/packages/webview_flutter/webview_flutter/pubspec.yaml index 6592e978394..33484f3cead 100644 --- a/packages/webview_flutter/webview_flutter/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter/pubspec.yaml @@ -2,7 +2,7 @@ name: webview_flutter description: A Flutter plugin that provides a WebView widget backed by the system webview. repository: https://github.com/flutter/packages/tree/main/packages/webview_flutter/webview_flutter issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+webview%22 -version: 4.11.0 +version: 4.12.0 environment: sdk: ^3.6.0 @@ -21,9 +21,9 @@ flutter: dependencies: flutter: sdk: flutter - webview_flutter_android: ^4.4.0 - webview_flutter_platform_interface: ^2.11.0 - webview_flutter_wkwebview: ^3.19.0 + webview_flutter_android: ^4.5.0 + webview_flutter_platform_interface: ^2.12.0 + webview_flutter_wkwebview: ^3.21.0 dev_dependencies: build_runner: ^2.1.5 @@ -36,9 +36,3 @@ topics: - html - webview - webview-flutter -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-federated-plugins -dependency_overrides: - webview_flutter_android: {path: ../../../packages/webview_flutter/webview_flutter_android} - webview_flutter_platform_interface: {path: ../../../packages/webview_flutter/webview_flutter_platform_interface} - webview_flutter_wkwebview: {path: ../../../packages/webview_flutter/webview_flutter_wkwebview} From 518111c80bc89676f0c26f36b5a477d7eb0b462b Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Wed, 14 May 2025 12:47:30 -0400 Subject: [PATCH 26/29] fix pubspecs --- .../webviewflutter/AndroidWebkitLibrary.g.kt | 66 ++----------------- .../example/pubspec.yaml | 6 +- .../webview_flutter_android/pubspec.yaml | 8 +-- .../example/pubspec.yaml | 6 +- .../webview_flutter_wkwebview/pubspec.yaml | 8 +-- 5 files changed, 10 insertions(+), 84 deletions(-) diff --git a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/AndroidWebkitLibrary.g.kt b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/AndroidWebkitLibrary.g.kt index bb77054da22..f48cf24608a 100644 --- a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/AndroidWebkitLibrary.g.kt +++ b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/AndroidWebkitLibrary.g.kt @@ -127,6 +127,10 @@ class AndroidWebkitLibraryPigeonInstanceManager( */ fun remove(identifier: Long): T? { logWarningIfFinalizationListenerHasStopped() + val instance: Any? = getInstance(identifier) + if (instance is WebViewProxyApi.WebViewPlatformView) { + instance.destroy() + } return strongInstances.remove(identifier) as T? } @@ -4836,20 +4840,6 @@ abstract class PigeonApiView( /** Return the scrolled position of this view. */ abstract fun getScrollPosition(pigeon_instance: android.view.View): WebViewPoint - /** - * Define whether the vertical scrollbar should be drawn or not. - * - * The scrollbar is not drawn by default. - */ - abstract fun setVerticalScrollBarEnabled(pigeon_instance: android.view.View, enabled: Boolean) - - /** - * Define whether the horizontal scrollbar should be drawn or not. - * - * The scrollbar is not drawn by default. - */ - abstract fun setHorizontalScrollBarEnabled(pigeon_instance: android.view.View, enabled: Boolean) - /** Set the over-scroll mode for this view. */ abstract fun setOverScrollMode(pigeon_instance: android.view.View, mode: OverScrollMode) @@ -4925,54 +4915,6 @@ abstract class PigeonApiView( channel.setMessageHandler(null) } } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.View.setVerticalScrollBarEnabled", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as android.view.View - val enabledArg = args[1] as Boolean - val wrapped: List = - try { - api.setVerticalScrollBarEnabled(pigeon_instanceArg, enabledArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } - reply.reply(wrapped) - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.View.setHorizontalScrollBarEnabled", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as android.view.View - val enabledArg = args[1] as Boolean - val wrapped: List = - try { - api.setHorizontalScrollBarEnabled(pigeon_instanceArg, enabledArg) - listOf(null) - } catch (exception: Throwable) { - AndroidWebkitLibraryPigeonUtils.wrapError(exception) - } - reply.reply(wrapped) - } - } else { - channel.setMessageHandler(null) - } - } run { val channel = BasicMessageChannel( diff --git a/packages/webview_flutter/webview_flutter_android/example/pubspec.yaml b/packages/webview_flutter/webview_flutter_android/example/pubspec.yaml index 8e162716348..de6c69e7806 100644 --- a/packages/webview_flutter/webview_flutter_android/example/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter_android/example/pubspec.yaml @@ -17,7 +17,7 @@ dependencies: # The example app is bundled with the plugin so we use a path dependency on # the parent directory to use the current plugin's version. path: ../ - webview_flutter_platform_interface: ^2.12.0 + webview_flutter_platform_interface: ^2.11.0 dev_dependencies: espresso: ^0.4.0 @@ -33,7 +33,3 @@ flutter: - assets/sample_video.mp4 - assets/www/index.html - assets/www/styles/style.css -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-federated-plugins -dependency_overrides: - webview_flutter_platform_interface: {path: ../../../../packages/webview_flutter/webview_flutter_platform_interface} diff --git a/packages/webview_flutter/webview_flutter_android/pubspec.yaml b/packages/webview_flutter/webview_flutter_android/pubspec.yaml index cad200303c5..5f6cb957df8 100644 --- a/packages/webview_flutter/webview_flutter_android/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter_android/pubspec.yaml @@ -2,7 +2,7 @@ name: webview_flutter_android description: A Flutter plugin that provides a WebView widget on Android. repository: https://github.com/flutter/packages/tree/main/packages/webview_flutter/webview_flutter_android issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+webview%22 -version: 4.5.0 +version: 4.4.2 environment: sdk: ^3.6.0 @@ -20,7 +20,7 @@ flutter: dependencies: flutter: sdk: flutter - webview_flutter_platform_interface: ^2.12.0 + webview_flutter_platform_interface: ^2.11.0 dev_dependencies: build_runner: ^2.1.4 @@ -33,7 +33,3 @@ topics: - html - webview - webview-flutter -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-federated-plugins -dependency_overrides: - webview_flutter_platform_interface: {path: ../../../packages/webview_flutter/webview_flutter_platform_interface} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/pubspec.yaml b/packages/webview_flutter/webview_flutter_wkwebview/example/pubspec.yaml index 3f0e2f2c9e5..fa7f2114200 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/example/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter_wkwebview/example/pubspec.yaml @@ -10,7 +10,7 @@ dependencies: flutter: sdk: flutter path_provider: ^2.0.6 - webview_flutter_platform_interface: ^2.12.0 + webview_flutter_platform_interface: ^2.11.0 webview_flutter_wkwebview: # When depending on this package from a real application you should use: # webview_flutter: ^x.y.z @@ -34,7 +34,3 @@ flutter: - assets/www/styles/style.css # Test certificate used to create a test native `SecTrust`. - assets/test_cert.der -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-federated-plugins -dependency_overrides: - webview_flutter_platform_interface: {path: ../../../../packages/webview_flutter/webview_flutter_platform_interface} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml b/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml index 54b313a556b..64bf86387d4 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.21.0 +version: 3.20.0 environment: sdk: ^3.5.0 @@ -25,7 +25,7 @@ dependencies: flutter: sdk: flutter path: ^1.8.0 - webview_flutter_platform_interface: ^2.12.0 + webview_flutter_platform_interface: ^2.11.0 dev_dependencies: build_runner: ^2.1.5 @@ -38,7 +38,3 @@ topics: - html - webview - webview-flutter -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-federated-plugins -dependency_overrides: - webview_flutter_platform_interface: {path: ../../../packages/webview_flutter/webview_flutter_platform_interface} From c88c097d98cad5e0ba301bc1ed66876ba2116e17 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Wed, 14 May 2025 12:48:29 -0400 Subject: [PATCH 27/29] actual fix --- .../webview_flutter_android/example/pubspec.yaml | 2 +- packages/webview_flutter/webview_flutter_android/pubspec.yaml | 4 ++-- .../webview_flutter_wkwebview/example/pubspec.yaml | 2 +- .../webview_flutter/webview_flutter_wkwebview/pubspec.yaml | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/webview_flutter/webview_flutter_android/example/pubspec.yaml b/packages/webview_flutter/webview_flutter_android/example/pubspec.yaml index de6c69e7806..d5cd0d9827c 100644 --- a/packages/webview_flutter/webview_flutter_android/example/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter_android/example/pubspec.yaml @@ -17,7 +17,7 @@ dependencies: # The example app is bundled with the plugin so we use a path dependency on # the parent directory to use the current plugin's version. path: ../ - webview_flutter_platform_interface: ^2.11.0 + webview_flutter_platform_interface: ^2.12.0 dev_dependencies: espresso: ^0.4.0 diff --git a/packages/webview_flutter/webview_flutter_android/pubspec.yaml b/packages/webview_flutter/webview_flutter_android/pubspec.yaml index 5f6cb957df8..59cbf9fa2ee 100644 --- a/packages/webview_flutter/webview_flutter_android/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter_android/pubspec.yaml @@ -2,7 +2,7 @@ name: webview_flutter_android description: A Flutter plugin that provides a WebView widget on Android. repository: https://github.com/flutter/packages/tree/main/packages/webview_flutter/webview_flutter_android issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+webview%22 -version: 4.4.2 +version: 4.5.0 environment: sdk: ^3.6.0 @@ -20,7 +20,7 @@ flutter: dependencies: flutter: sdk: flutter - webview_flutter_platform_interface: ^2.11.0 + webview_flutter_platform_interface: ^2.12.0 dev_dependencies: build_runner: ^2.1.4 diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/pubspec.yaml b/packages/webview_flutter/webview_flutter_wkwebview/example/pubspec.yaml index fa7f2114200..e9898b31e7d 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/example/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter_wkwebview/example/pubspec.yaml @@ -10,7 +10,7 @@ dependencies: flutter: sdk: flutter path_provider: ^2.0.6 - webview_flutter_platform_interface: ^2.11.0 + webview_flutter_platform_interface: ^2.12.0 webview_flutter_wkwebview: # When depending on this package from a real application you should use: # webview_flutter: ^x.y.z diff --git a/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml b/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml index 64bf86387d4..396beb70a5a 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.20.0 +version: 3.21.0 environment: sdk: ^3.5.0 @@ -25,7 +25,7 @@ dependencies: flutter: sdk: flutter path: ^1.8.0 - webview_flutter_platform_interface: ^2.11.0 + webview_flutter_platform_interface: ^2.12.0 dev_dependencies: build_runner: ^2.1.5 From 0ecd78f9699632b9eb514d66bc2adaa10c1f70d9 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Wed, 14 May 2025 12:49:00 -0400 Subject: [PATCH 28/29] and one more file --- .../webviewflutter/AndroidWebkitLibrary.g.kt | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/AndroidWebkitLibrary.g.kt b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/AndroidWebkitLibrary.g.kt index f48cf24608a..bd1c4de2327 100644 --- a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/AndroidWebkitLibrary.g.kt +++ b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/AndroidWebkitLibrary.g.kt @@ -4840,6 +4840,20 @@ abstract class PigeonApiView( /** Return the scrolled position of this view. */ abstract fun getScrollPosition(pigeon_instance: android.view.View): WebViewPoint + /** + * Define whether the vertical scrollbar should be drawn or not. + * + * The scrollbar is not drawn by default. + */ + abstract fun setVerticalScrollBarEnabled(pigeon_instance: android.view.View, enabled: Boolean) + + /** + * Define whether the horizontal scrollbar should be drawn or not. + * + * The scrollbar is not drawn by default. + */ + abstract fun setHorizontalScrollBarEnabled(pigeon_instance: android.view.View, enabled: Boolean) + /** Set the over-scroll mode for this view. */ abstract fun setOverScrollMode(pigeon_instance: android.view.View, mode: OverScrollMode) @@ -4915,6 +4929,54 @@ abstract class PigeonApiView( channel.setMessageHandler(null) } } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.View.setVerticalScrollBarEnabled", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as android.view.View + val enabledArg = args[1] as Boolean + val wrapped: List = + try { + api.setVerticalScrollBarEnabled(pigeon_instanceArg, enabledArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.View.setHorizontalScrollBarEnabled", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as android.view.View + val enabledArg = args[1] as Boolean + val wrapped: List = + try { + api.setHorizontalScrollBarEnabled(pigeon_instanceArg, enabledArg) + listOf(null) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } run { val channel = BasicMessageChannel( From 181138bc92396583b05aba788321eefe8fac2887 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Thu, 15 May 2025 12:41:11 -0400 Subject: [PATCH 29/29] change to future bool --- .../webview_flutter/lib/src/webview_controller.dart | 2 +- .../webview_flutter/test/webview_controller_test.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/webview_flutter/webview_flutter/lib/src/webview_controller.dart b/packages/webview_flutter/webview_flutter/lib/src/webview_controller.dart index 6a2771aead1..e5c1361bfd9 100644 --- a/packages/webview_flutter/webview_flutter/lib/src/webview_controller.dart +++ b/packages/webview_flutter/webview_flutter/lib/src/webview_controller.dart @@ -420,7 +420,7 @@ class WebViewController { /// should be drawn or not. /// /// See [setVerticalScrollBarEnabled] and [setHorizontalScrollBarEnabled]. - bool supportsSetScrollBarsEnabled() { + Future supportsSetScrollBarsEnabled() async { return platform.supportsSetScrollBarsEnabled(); } diff --git a/packages/webview_flutter/webview_flutter/test/webview_controller_test.dart b/packages/webview_flutter/webview_flutter/test/webview_controller_test.dart index ed6e9efcbef..02acaa14b5e 100644 --- a/packages/webview_flutter/webview_flutter/test/webview_controller_test.dart +++ b/packages/webview_flutter/webview_flutter/test/webview_controller_test.dart @@ -315,7 +315,7 @@ void main() { mockPlatformWebViewController, ); - expect(webViewController.supportsSetScrollBarsEnabled(), true); + expect(await webViewController.supportsSetScrollBarsEnabled(), true); verify(mockPlatformWebViewController.supportsSetScrollBarsEnabled()); });