diff --git a/packages/camera/camera_android_camerax/CHANGELOG.md b/packages/camera/camera_android_camerax/CHANGELOG.md index c8428d21d4fe..58e471e3388f 100644 --- a/packages/camera/camera_android_camerax/CHANGELOG.md +++ b/packages/camera/camera_android_camerax/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.7.4+7 + +* Updates pigeon to `27.3.2`. + ## 0.7.4+6 * Adds explicit `androidx.concurrent:concurrent-futures:1.2.0` dependency to fix diff --git a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CameraXLibrary.g.kt b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CameraXLibrary.g.kt index 517187341260..1948a84a3fc2 100644 --- a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CameraXLibrary.g.kt +++ b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CameraXLibrary.g.kt @@ -1,7 +1,7 @@ // Copyright 2013 The Flutter Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Autogenerated from Pigeon (v26.3.4), do not edit directly. +// Autogenerated from Pigeon (v27.3.2), do not edit directly. // See also: https://pub.dev/packages/pigeon @file:Suppress("UNCHECKED_CAST", "ArrayInDataClass") diff --git a/packages/camera/camera_android_camerax/lib/src/camerax_library.g.dart b/packages/camera/camera_android_camerax/lib/src/camerax_library.g.dart index 13eef8a4e3ee..24fed5ace6f7 100644 --- a/packages/camera/camera_android_camerax/lib/src/camerax_library.g.dart +++ b/packages/camera/camera_android_camerax/lib/src/camerax_library.g.dart @@ -1,7 +1,7 @@ // Copyright 2013 The Flutter Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Autogenerated from Pigeon (v26.3.4), do not edit directly. +// Autogenerated from Pigeon (v27.3.2), do not edit directly. // See also: https://pub.dev/packages/pigeon // ignore_for_file: unused_import, unused_shown_name // ignore_for_file: type=lint @@ -5804,9 +5804,6 @@ class ImageProxyUtils extends PigeonInternalProxyApiBaseClass { @protected ImageProxyUtils.pigeon_detached({super.pigeon_binaryMessenger, super.pigeon_instanceManager}); - late final _PigeonInternalProxyApiBaseCodec _pigeonVar_codecImageProxyUtils = - _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); - static void pigeon_setUpMessageHandlers({ bool pigeon_clearHandlers = false, BinaryMessenger? pigeon_binaryMessenger, diff --git a/packages/camera/camera_android_camerax/pubspec.yaml b/packages/camera/camera_android_camerax/pubspec.yaml index 52667ef300f5..841a9cba3092 100644 --- a/packages/camera/camera_android_camerax/pubspec.yaml +++ b/packages/camera/camera_android_camerax/pubspec.yaml @@ -2,7 +2,7 @@ name: camera_android_camerax description: Android implementation of the camera plugin using the CameraX library. repository: https://github.com/flutter/packages/tree/main/packages/camera/camera_android_camerax issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22 -version: 0.7.4+6 +version: 0.7.4+7 environment: sdk: ^3.12.0 @@ -39,7 +39,7 @@ dev_dependencies: logging: ^1.2.0 mockito: ^5.4.4 path: ^1.8.0 - pigeon: ^26.1.4 + pigeon: ^27.3.2 topics: - camera diff --git a/packages/webview_flutter/webview_flutter_android/CHANGELOG.md b/packages/webview_flutter/webview_flutter_android/CHANGELOG.md index b464989abeea..f900d2b258fa 100644 --- a/packages/webview_flutter/webview_flutter_android/CHANGELOG.md +++ b/packages/webview_flutter/webview_flutter_android/CHANGELOG.md @@ -1,4 +1,9 @@ +## 4.14.1 + +* Updates pigeon to `27.3.2`. + ## 4.14.0 + * Adds support for configuring Web Authentication in `AndroidWebViewController` with `setWebAuthenticationSupport` to enable Passkey and other related Authentication. ## 4.13.0 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 651b288a49db..5110f2f1d3e9 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,7 +1,7 @@ // Copyright 2013 The Flutter Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Autogenerated from Pigeon (v26.3.4), do not edit directly. +// Autogenerated from Pigeon (v27.3.2), do not edit directly. // See also: https://pub.dev/packages/pigeon @file:Suppress("UNCHECKED_CAST", "ArrayInDataClass") 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 ec5388fd6a23..1db3655f7f96 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,7 +1,7 @@ // Copyright 2013 The Flutter Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Autogenerated from Pigeon (v26.3.4), do not edit directly. +// Autogenerated from Pigeon (v27.3.2), do not edit directly. // See also: https://pub.dev/packages/pigeon // ignore_for_file: unused_import, unused_shown_name // ignore_for_file: type=lint @@ -7116,9 +7116,6 @@ class WebSettingsCompat extends PigeonInternalProxyApiBaseClass { @protected WebSettingsCompat.pigeon_detached({super.pigeon_binaryMessenger, super.pigeon_instanceManager}); - late final _PigeonInternalProxyApiBaseCodec _pigeonVar_codecWebSettingsCompat = - _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); - static void pigeon_setUpMessageHandlers({ bool pigeon_clearHandlers = false, BinaryMessenger? pigeon_binaryMessenger, @@ -7241,9 +7238,6 @@ class WebViewFeature extends PigeonInternalProxyApiBaseClass { @protected WebViewFeature.pigeon_detached({super.pigeon_binaryMessenger, super.pigeon_instanceManager}); - late final _PigeonInternalProxyApiBaseCodec _pigeonVar_codecWebViewFeature = - _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); - static void pigeon_setUpMessageHandlers({ bool pigeon_clearHandlers = false, BinaryMessenger? pigeon_binaryMessenger, diff --git a/packages/webview_flutter/webview_flutter_android/pubspec.yaml b/packages/webview_flutter/webview_flutter_android/pubspec.yaml index 7b5d83779c7a..7b61e5c7bb9c 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.14.0 +version: 4.14.1 environment: sdk: ^3.12.0 @@ -28,7 +28,7 @@ dev_dependencies: flutter_test: sdk: flutter mockito: ^5.4.4 - pigeon: ^26.1.10 + pigeon: ^27.3.2 topics: - html diff --git a/packages/webview_flutter/webview_flutter_wkwebview/CHANGELOG.md b/packages/webview_flutter/webview_flutter_wkwebview/CHANGELOG.md index f5a9fd6ef336..a9c28fcccda7 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/CHANGELOG.md +++ b/packages/webview_flutter/webview_flutter_wkwebview/CHANGELOG.md @@ -1,3 +1,7 @@ +## 3.26.1 + +* Updates pigeon to `27.3.2`. + ## 3.26.0 * Adds new method for accessing a native `WKWebView` from a `FlutterPluginRegistrar`. 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 8848ee4485a5..e9421e88722d 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebKitLibrary.g.swift +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebKitLibrary.g.swift @@ -1,7 +1,7 @@ // Copyright 2013 The Flutter Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Autogenerated from Pigeon (v26.1.5), do not edit directly. +// Autogenerated from Pigeon (v27.3.2), do not edit directly. // See also: https://pub.dev/packages/pigeon import Foundation @@ -58,7 +58,7 @@ private func wrapError(_ error: Any) -> [Any?] { } return [ "\(error)", - "\(type(of: error))", + "\(Swift.type(of: error))", "Stacktrace: \(Thread.callStackSymbols)", ] } @@ -69,8 +69,18 @@ private func createConnectionError(withChannelName channelName: String) -> Pigeo details: "") } -private func isNullish(_ value: Any?) -> Bool { - return value is NSNull || value == nil +enum WebKitLibraryPigeonInternal { + static func isNullish(_ value: Any?) -> Bool { + guard let innerValue = value else { + return true + } + + if case Optional.some(Optional.none) = value { + return true + } + + return innerValue is NSNull + } } private func nilOrValue(_ value: Any?) -> T? { @@ -1157,7 +1167,7 @@ private class WebKitLibraryPigeonInternalProxyApiCodecReaderWriter: FlutterStand /// The values that can be returned in a change dictionary. /// /// See https://developer.apple.com/documentation/foundation/nskeyvalueobservingoptions. -enum KeyValueObservingOptions: Int { +enum KeyValueObservingOptions: Int, CaseIterable { /// Indicates that the change dictionary should provide the new attribute /// value, if applicable. case newValue = 0 @@ -1175,7 +1185,7 @@ enum KeyValueObservingOptions: Int { /// The kinds of changes that can be observed. /// /// See https://developer.apple.com/documentation/foundation/nskeyvaluechange. -enum KeyValueChange: Int { +enum KeyValueChange: Int, CaseIterable { /// 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 @@ -1194,7 +1204,7 @@ enum KeyValueChange: Int { /// The keys that can appear in the change dictionary. /// /// See https://developer.apple.com/documentation/foundation/nskeyvaluechangekey. -enum KeyValueChangeKey: Int { +enum KeyValueChangeKey: Int, CaseIterable { /// 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 @@ -1224,7 +1234,7 @@ enum KeyValueChangeKey: Int { /// Constants for the times at which to inject script content into a webpage. /// /// See https://developer.apple.com/documentation/webkit/wkuserscriptinjectiontime. -enum UserScriptInjectionTime: Int { +enum UserScriptInjectionTime: Int, CaseIterable { /// A constant to inject the script after the creation of the webpage’s /// document element, but before loading any other content. case atDocumentStart = 0 @@ -1238,7 +1248,7 @@ enum UserScriptInjectionTime: Int { /// The media types that require a user gesture to begin playing. /// /// See https://developer.apple.com/documentation/webkit/wkaudiovisualmediatypes. -enum AudiovisualMediaType: Int { +enum AudiovisualMediaType: Int, CaseIterable { /// 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. @@ -1253,7 +1263,7 @@ enum AudiovisualMediaType: Int { /// property. /// /// See https://developer.apple.com/documentation/webkit/wkwebsitedatarecord/data_store_record_types. -enum WebsiteDataType: Int { +enum WebsiteDataType: Int, CaseIterable { /// Cookies. case cookies = 0 /// In-memory caches. @@ -1276,7 +1286,7 @@ enum WebsiteDataType: Int { /// from an action. /// /// See https://developer.apple.com/documentation/webkit/wknavigationactionpolicy. -enum NavigationActionPolicy: Int { +enum NavigationActionPolicy: Int, CaseIterable { /// Allow the navigation to continue. case allow = 0 /// Cancel the navigation. @@ -1289,7 +1299,7 @@ enum NavigationActionPolicy: Int { /// from a response. /// /// See https://developer.apple.com/documentation/webkit/wknavigationresponsepolicy. -enum NavigationResponsePolicy: Int { +enum NavigationResponsePolicy: Int, CaseIterable { /// Allow the navigation to continue. case allow = 0 /// Cancel the navigation. @@ -1301,7 +1311,7 @@ enum NavigationResponsePolicy: Int { /// Constants that define the supported keys in a cookie attributes dictionary. /// /// See https://developer.apple.com/documentation/foundation/httpcookiepropertykey. -enum HttpCookiePropertyKey: Int { +enum HttpCookiePropertyKey: Int, CaseIterable { /// 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. @@ -1342,7 +1352,7 @@ enum HttpCookiePropertyKey: Int { /// The type of action that triggered the navigation. /// /// See https://developer.apple.com/documentation/webkit/wknavigationtype. -enum NavigationType: Int { +enum NavigationType: Int, CaseIterable { /// A link activation. case linkActivated = 0 /// A request to submit a form. @@ -1362,7 +1372,7 @@ enum NavigationType: Int { /// Possible permission decisions for device resource access. /// /// See https://developer.apple.com/documentation/webkit/wkpermissiondecision. -enum PermissionDecision: Int { +enum PermissionDecision: Int, CaseIterable { /// Deny permission for the requested resource. case deny = 0 /// Deny permission for the requested resource. @@ -1374,7 +1384,7 @@ enum PermissionDecision: Int { /// 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 { +enum MediaCaptureType: Int, CaseIterable { /// A media device that can capture video. case camera = 0 /// A media device or devices that can capture audio and video. @@ -1388,7 +1398,7 @@ enum MediaCaptureType: Int { /// Responses to an authentication challenge. /// /// See https://developer.apple.com/documentation/foundation/urlsession/authchallengedisposition. -enum UrlSessionAuthChallengeDisposition: Int { +enum UrlSessionAuthChallengeDisposition: Int, CaseIterable { /// Use the specified credential, which may be nil. case useCredential = 0 /// Use the default handling for the challenge as though this delegate method @@ -1406,7 +1416,7 @@ enum UrlSessionAuthChallengeDisposition: Int { /// Specifies how long a credential will be kept. /// /// See https://developer.apple.com/documentation/foundation/nsurlcredentialpersistence. -enum UrlCredentialPersistence: Int { +enum UrlCredentialPersistence: Int, CaseIterable { /// The credential should not be stored. case none = 0 /// The credential should be stored only for this session. @@ -1422,7 +1432,7 @@ enum UrlCredentialPersistence: Int { /// Trust evaluation result codes. /// /// See https://developer.apple.com/documentation/security/sectrustresulttype?language=objc. -enum DartSecTrustResultType: Int { +enum DartSecTrustResultType: Int, CaseIterable { /// The user did not specify a trust setting. case unspecified = 0 /// The user granted permission to trust the certificate for the purposes 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 423e4b1154c9..9b74bd7484de 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,24 +1,42 @@ // Copyright 2013 The Flutter Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Autogenerated from Pigeon (v26.1.5), do not edit directly. +// Autogenerated from Pigeon (v27.3.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, omit_obvious_local_variable_types, unused_shown_name, unnecessary_import, no_leading_underscores_for_local_identifiers +// ignore_for_file: unused_import, unused_shown_name +// ignore_for_file: type=lint import 'dart:async'; import 'dart:io' show Platform; -import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; +import 'dart:typed_data' show Float64List, Int32List, Int64List; -import 'package:flutter/foundation.dart' - show ReadBuffer, WriteBuffer, immutable, protected, visibleForTesting; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart' show WidgetsFlutterBinding; - -PlatformException _createConnectionError(String channelName) { - return PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel: "$channelName".', - ); +import 'package:meta/meta.dart' show immutable, protected, visibleForTesting; + +Object? _extractReplyValueOrThrow( + List? replyList, + String channelName, { + required bool isNullValid, +}) { + if (replyList == null) { + throw PlatformException( + code: 'channel-error', + message: 'Unable to establish connection on channel: "$channelName".', + ); + } else if (replyList.length > 1) { + throw PlatformException( + code: replyList[0]! as String, + message: replyList[1] as String?, + details: replyList[2], + ); + } else if (!isNullValid && (replyList.isNotEmpty && replyList[0] == null)) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } + return replyList.firstOrNull; } List wrapResponse({Object? result, PlatformException? error, bool empty = false}) { @@ -659,18 +677,10 @@ class _PigeonInternalInstanceManagerApi { 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.', - ); + final List args = message! as List; + final int arg_identifier = args[0]! as int; try { - (instanceManager ?? PigeonInstanceManager.instance).remove(arg_identifier!); + (instanceManager ?? PigeonInstanceManager.instance).remove(arg_identifier); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -694,17 +704,8 @@ class _PigeonInternalInstanceManagerApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([identifier]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } /// Clear the native `PigeonInstanceManager`. @@ -720,17 +721,8 @@ class _PigeonInternalInstanceManagerApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } } @@ -1277,17 +1269,8 @@ class URLRequest extends NSObject { ]); () async { final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); }(); } @@ -1325,16 +1308,8 @@ class URLRequest extends NSObject { 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.', - ); + final List args = message! as List; + final int arg_pigeon_instanceIdentifier = args[0]! as int; try { (pigeon_instanceManager ?? PigeonInstanceManager.instance).addHostCreatedInstance( pigeon_newInstance?.call() ?? @@ -1342,7 +1317,7 @@ class URLRequest extends NSObject { pigeon_binaryMessenger: pigeon_binaryMessenger, pigeon_instanceManager: pigeon_instanceManager, ), - arg_pigeon_instanceIdentifier!, + arg_pigeon_instanceIdentifier, ); return wrapResponse(empty: true); } on PlatformException catch (e) { @@ -1369,17 +1344,13 @@ class URLRequest extends NSObject { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this]); final 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?); - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); + return pigeonVar_replyValue as String?; } /// The HTTP request method. @@ -1395,17 +1366,8 @@ class URLRequest extends NSObject { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this, method]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } /// The HTTP request method. @@ -1421,17 +1383,13 @@ class URLRequest extends NSObject { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this]); final 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?); - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); + return pigeonVar_replyValue as String?; } /// The request body. @@ -1447,17 +1405,8 @@ class URLRequest extends NSObject { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this, body]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } /// The request body. @@ -1473,17 +1422,13 @@ class URLRequest extends NSObject { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this]); final 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?); - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); + return pigeonVar_replyValue as Uint8List?; } /// A dictionary containing all of the HTTP header fields for a request. @@ -1499,17 +1444,8 @@ class URLRequest extends NSObject { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this, fields]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } /// A dictionary containing all of the HTTP header fields for a request. @@ -1525,17 +1461,13 @@ class URLRequest extends NSObject { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this]); final 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(); - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); + return (pigeonVar_replyValue as Map?)?.cast(); } @override @@ -1588,30 +1520,18 @@ class HTTPURLResponse extends URLResponse { 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.', - ); + final List args = message! as List; + final int arg_pigeon_instanceIdentifier = args[0]! as int; + final int arg_statusCode = args[1]! as int; try { (pigeon_instanceManager ?? PigeonInstanceManager.instance).addHostCreatedInstance( - pigeon_newInstance?.call(arg_statusCode!) ?? + pigeon_newInstance?.call(arg_statusCode) ?? HTTPURLResponse.pigeon_detached( pigeon_binaryMessenger: pigeon_binaryMessenger, pigeon_instanceManager: pigeon_instanceManager, - statusCode: arg_statusCode!, + statusCode: arg_statusCode, ), - arg_pigeon_instanceIdentifier!, + arg_pigeon_instanceIdentifier, ); return wrapResponse(empty: true); } on PlatformException catch (e) { @@ -1673,16 +1593,8 @@ class URLResponse extends NSObject { 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.', - ); + final List args = message! as List; + final int arg_pigeon_instanceIdentifier = args[0]! as int; try { (pigeon_instanceManager ?? PigeonInstanceManager.instance).addHostCreatedInstance( pigeon_newInstance?.call() ?? @@ -1690,7 +1602,7 @@ class URLResponse extends NSObject { pigeon_binaryMessenger: pigeon_binaryMessenger, pigeon_instanceManager: pigeon_instanceManager, ), - arg_pigeon_instanceIdentifier!, + arg_pigeon_instanceIdentifier, ); return wrapResponse(empty: true); } on PlatformException catch (e) { @@ -1782,17 +1694,8 @@ class WKUserScript extends NSObject { ]); () async { final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); }(); } @@ -1848,42 +1751,22 @@ class WKUserScript extends NSObject { 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.', - ); + final List args = message! as List; + final int arg_pigeon_instanceIdentifier = args[0]! as int; + final String arg_source = args[1]! as String; + final UserScriptInjectionTime arg_injectionTime = args[2]! as UserScriptInjectionTime; + final bool arg_isForMainFrameOnly = args[3]! as bool; try { (pigeon_instanceManager ?? PigeonInstanceManager.instance).addHostCreatedInstance( - pigeon_newInstance?.call(arg_source!, arg_injectionTime!, arg_isForMainFrameOnly!) ?? + 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!, + source: arg_source, + injectionTime: arg_injectionTime, + isForMainFrameOnly: arg_isForMainFrameOnly, ), - arg_pigeon_instanceIdentifier!, + arg_pigeon_instanceIdentifier, ); return wrapResponse(empty: true); } on PlatformException catch (e) { @@ -1966,38 +1849,22 @@ class WKNavigationAction extends NSObject { 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.', - ); + final List args = message! as List; + final int arg_pigeon_instanceIdentifier = args[0]! as int; + final URLRequest arg_request = args[1]! as URLRequest; + final WKFrameInfo? arg_targetFrame = args[2] as WKFrameInfo?; + final NavigationType arg_navigationType = args[3]! as NavigationType; try { (pigeon_instanceManager ?? PigeonInstanceManager.instance).addHostCreatedInstance( - pigeon_newInstance?.call(arg_request!, arg_targetFrame, arg_navigationType!) ?? + pigeon_newInstance?.call(arg_request, arg_targetFrame, arg_navigationType) ?? WKNavigationAction.pigeon_detached( pigeon_binaryMessenger: pigeon_binaryMessenger, pigeon_instanceManager: pigeon_instanceManager, - request: arg_request!, + request: arg_request, targetFrame: arg_targetFrame, - navigationType: arg_navigationType!, + navigationType: arg_navigationType, ), - arg_pigeon_instanceIdentifier!, + arg_pigeon_instanceIdentifier, ); return wrapResponse(empty: true); } on PlatformException catch (e) { @@ -2070,36 +1937,20 @@ class WKNavigationResponse extends NSObject { 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.', - ); + final List args = message! as List; + final int arg_pigeon_instanceIdentifier = args[0]! as int; + final URLResponse arg_response = args[1]! as URLResponse; + final bool arg_isForMainFrame = args[2]! as bool; try { (pigeon_instanceManager ?? PigeonInstanceManager.instance).addHostCreatedInstance( - pigeon_newInstance?.call(arg_response!, arg_isForMainFrame!) ?? + pigeon_newInstance?.call(arg_response, arg_isForMainFrame) ?? WKNavigationResponse.pigeon_detached( pigeon_binaryMessenger: pigeon_binaryMessenger, pigeon_instanceManager: pigeon_instanceManager, - response: arg_response!, - isForMainFrame: arg_isForMainFrame!, + response: arg_response, + isForMainFrame: arg_isForMainFrame, ), - arg_pigeon_instanceIdentifier!, + arg_pigeon_instanceIdentifier, ); return wrapResponse(empty: true); } on PlatformException catch (e) { @@ -2170,32 +2021,20 @@ class WKFrameInfo extends NSObject { 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?); + final List args = message! as List; + final int arg_pigeon_instanceIdentifier = args[0]! as int; + final bool arg_isMainFrame = args[1]! as bool; + final URLRequest? arg_request = args[2] as URLRequest?; try { (pigeon_instanceManager ?? PigeonInstanceManager.instance).addHostCreatedInstance( - pigeon_newInstance?.call(arg_isMainFrame!, arg_request) ?? + pigeon_newInstance?.call(arg_isMainFrame, arg_request) ?? WKFrameInfo.pigeon_detached( pigeon_binaryMessenger: pigeon_binaryMessenger, pigeon_instanceManager: pigeon_instanceManager, - isMainFrame: arg_isMainFrame!, + isMainFrame: arg_isMainFrame, request: arg_request, ), - arg_pigeon_instanceIdentifier!, + arg_pigeon_instanceIdentifier, ); return wrapResponse(empty: true); } on PlatformException catch (e) { @@ -2270,43 +2109,23 @@ class NSError extends NSObject { 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.', - ); + final List args = message! as List; + final int arg_pigeon_instanceIdentifier = args[0]! as int; + final int arg_code = args[1]! as int; + final String arg_domain = args[2]! as String; + final Map arg_userInfo = (args[3]! as Map) + .cast(); try { (pigeon_instanceManager ?? PigeonInstanceManager.instance).addHostCreatedInstance( - pigeon_newInstance?.call(arg_code!, arg_domain!, arg_userInfo!) ?? + 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!, + code: arg_code, + domain: arg_domain, + userInfo: arg_userInfo, ), - arg_pigeon_instanceIdentifier!, + arg_pigeon_instanceIdentifier, ); return wrapResponse(empty: true); } on PlatformException catch (e) { @@ -2378,32 +2197,20 @@ class WKScriptMessage extends NSObject { 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?); + final List args = message! as List; + final int arg_pigeon_instanceIdentifier = args[0]! as int; + final String arg_name = args[1]! as String; + final Object? arg_body = args[2]; try { (pigeon_instanceManager ?? PigeonInstanceManager.instance).addHostCreatedInstance( - pigeon_newInstance?.call(arg_name!, arg_body) ?? + pigeon_newInstance?.call(arg_name, arg_body) ?? WKScriptMessage.pigeon_detached( pigeon_binaryMessenger: pigeon_binaryMessenger, pigeon_instanceManager: pigeon_instanceManager, - name: arg_name!, + name: arg_name, body: arg_body, ), - arg_pigeon_instanceIdentifier!, + arg_pigeon_instanceIdentifier, ); return wrapResponse(empty: true); } on PlatformException catch (e) { @@ -2477,42 +2284,22 @@ class WKSecurityOrigin extends NSObject { 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.', - ); + final List args = message! as List; + final int arg_pigeon_instanceIdentifier = args[0]! as int; + final String arg_host = args[1]! as String; + final int arg_port = args[2]! as int; + final String arg_securityProtocol = args[3]! as String; try { (pigeon_instanceManager ?? PigeonInstanceManager.instance).addHostCreatedInstance( - pigeon_newInstance?.call(arg_host!, arg_port!, arg_securityProtocol!) ?? + 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!, + host: arg_host, + port: arg_port, + securityProtocol: arg_securityProtocol, ), - arg_pigeon_instanceIdentifier!, + arg_pigeon_instanceIdentifier, ); return wrapResponse(empty: true); } on PlatformException catch (e) { @@ -2590,17 +2377,8 @@ class HTTPCookie extends NSObject { ]); () async { final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); }(); } @@ -2638,16 +2416,8 @@ class HTTPCookie extends NSObject { 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.', - ); + final List args = message! as List; + final int arg_pigeon_instanceIdentifier = args[0]! as int; try { (pigeon_instanceManager ?? PigeonInstanceManager.instance).addHostCreatedInstance( pigeon_newInstance?.call() ?? @@ -2655,7 +2425,7 @@ class HTTPCookie extends NSObject { pigeon_binaryMessenger: pigeon_binaryMessenger, pigeon_instanceManager: pigeon_instanceManager, ), - arg_pigeon_instanceIdentifier!, + arg_pigeon_instanceIdentifier, ); return wrapResponse(empty: true); } on PlatformException catch (e) { @@ -2683,18 +2453,13 @@ class HTTPCookie extends NSObject { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this]); final 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(); - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); + return (pigeonVar_replyValue as Map?)?.cast(); } @override @@ -2767,17 +2532,8 @@ class AuthenticationChallengeResponse extends PigeonInternalProxyApiBaseClass { ]); () async { final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); }(); } @@ -2827,33 +2583,21 @@ class AuthenticationChallengeResponse extends PigeonInternalProxyApiBaseClass { 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?); + final List args = message! as List; + final int arg_pigeon_instanceIdentifier = args[0]! as int; + final UrlSessionAuthChallengeDisposition arg_disposition = + args[1]! as UrlSessionAuthChallengeDisposition; + final URLCredential? arg_credential = args[2] as URLCredential?; try { (pigeon_instanceManager ?? PigeonInstanceManager.instance).addHostCreatedInstance( - pigeon_newInstance?.call(arg_disposition!, arg_credential) ?? + pigeon_newInstance?.call(arg_disposition, arg_credential) ?? AuthenticationChallengeResponse.pigeon_detached( pigeon_binaryMessenger: pigeon_binaryMessenger, pigeon_instanceManager: pigeon_instanceManager, - disposition: arg_disposition!, + disposition: arg_disposition, credential: arg_credential, ), - arg_pigeon_instanceIdentifier!, + arg_pigeon_instanceIdentifier, ); return wrapResponse(empty: true); } on PlatformException catch (e) { @@ -2898,22 +2642,13 @@ class AuthenticationChallengeResponse extends PigeonInternalProxyApiBaseClass { credential, ]); final 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 AuthenticationChallengeResponse?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as AuthenticationChallengeResponse; } @override @@ -2976,16 +2711,8 @@ class WKWebsiteDataStore extends NSObject { 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.', - ); + final List args = message! as List; + final int arg_pigeon_instanceIdentifier = args[0]! as int; try { (pigeon_instanceManager ?? PigeonInstanceManager.instance).addHostCreatedInstance( pigeon_newInstance?.call() ?? @@ -2993,7 +2720,7 @@ class WKWebsiteDataStore extends NSObject { pigeon_binaryMessenger: pigeon_binaryMessenger, pigeon_instanceManager: pigeon_instanceManager, ), - arg_pigeon_instanceIdentifier!, + arg_pigeon_instanceIdentifier, ); return wrapResponse(empty: true); } on PlatformException catch (e) { @@ -3030,17 +2757,8 @@ class WKWebsiteDataStore extends NSObject { pigeonVar_instanceIdentifier, ]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); }(); return pigeonVar_instance; } @@ -3068,17 +2786,8 @@ class WKWebsiteDataStore extends NSObject { pigeonVar_instanceIdentifier, ]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); }(); return pigeonVar_instance; } @@ -3103,22 +2812,13 @@ class WKWebsiteDataStore extends NSObject { modificationTimeInSecondsSinceEpoch, ]); final 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?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as bool; } @override @@ -3169,16 +2869,8 @@ class UIView extends NSObject { 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.', - ); + final List args = message! as List; + final int arg_pigeon_instanceIdentifier = args[0]! as int; try { (pigeon_instanceManager ?? PigeonInstanceManager.instance).addHostCreatedInstance( pigeon_newInstance?.call() ?? @@ -3186,7 +2878,7 @@ class UIView extends NSObject { pigeon_binaryMessenger: pigeon_binaryMessenger, pigeon_instanceManager: pigeon_instanceManager, ), - arg_pigeon_instanceIdentifier!, + arg_pigeon_instanceIdentifier, ); return wrapResponse(empty: true); } on PlatformException catch (e) { @@ -3214,17 +2906,8 @@ class UIView extends NSObject { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this, value]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } /// A Boolean value that determines whether the view is opaque. @@ -3239,17 +2922,8 @@ class UIView extends NSObject { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this, opaque]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } @override @@ -3300,16 +2974,8 @@ class UIScrollView extends UIView { 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.', - ); + final List args = message! as List; + final int arg_pigeon_instanceIdentifier = args[0]! as int; try { (pigeon_instanceManager ?? PigeonInstanceManager.instance).addHostCreatedInstance( pigeon_newInstance?.call() ?? @@ -3317,7 +2983,7 @@ class UIScrollView extends UIView { pigeon_binaryMessenger: pigeon_binaryMessenger, pigeon_instanceManager: pigeon_instanceManager, ), - arg_pigeon_instanceIdentifier!, + arg_pigeon_instanceIdentifier, ); return wrapResponse(empty: true); } on PlatformException catch (e) { @@ -3346,22 +3012,13 @@ class UIScrollView extends UIView { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this]); final 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(); - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return (pigeonVar_replyValue! as List).cast(); } /// Move the scrolled position of your view. @@ -3379,17 +3036,8 @@ class UIScrollView extends UIView { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this, x, y]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } /// The point at which the origin of the content view is offset from the @@ -3406,17 +3054,8 @@ class UIScrollView extends UIView { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this, x, y]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } /// The delegate of the scroll view. @@ -3432,17 +3071,8 @@ class UIScrollView extends UIView { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this, delegate]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } /// Whether the scroll view bounces past the edge of content and back again. @@ -3458,17 +3088,8 @@ class UIScrollView extends UIView { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this, value]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } /// Whether the scroll view bounces when it reaches the ends of its horizontal @@ -3485,17 +3106,8 @@ class UIScrollView extends UIView { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this, value]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } /// Whether the scroll view bounces when it reaches the ends of its vertical @@ -3512,17 +3124,8 @@ class UIScrollView extends UIView { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this, value]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } /// Whether bouncing always occurs when vertical scrolling reaches the end of @@ -3543,17 +3146,8 @@ class UIScrollView extends UIView { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this, value]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } /// Whether bouncing always occurs when horizontal scrolling reaches the end @@ -3574,17 +3168,8 @@ class UIScrollView extends UIView { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this, value]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } /// Whether the vertical scroll indicator is visible. @@ -3602,17 +3187,8 @@ class UIScrollView extends UIView { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this, value]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } /// Whether the horizontal scroll indicator is visible. @@ -3630,17 +3206,8 @@ class UIScrollView extends UIView { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this, value]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } @override @@ -3700,17 +3267,8 @@ class WKWebViewConfiguration extends NSObject { ]); () async { final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); }(); } @@ -3748,16 +3306,8 @@ class WKWebViewConfiguration extends NSObject { 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.', - ); + final List args = message! as List; + final int arg_pigeon_instanceIdentifier = args[0]! as int; try { (pigeon_instanceManager ?? PigeonInstanceManager.instance).addHostCreatedInstance( pigeon_newInstance?.call() ?? @@ -3765,7 +3315,7 @@ class WKWebViewConfiguration extends NSObject { pigeon_binaryMessenger: pigeon_binaryMessenger, pigeon_instanceManager: pigeon_instanceManager, ), - arg_pigeon_instanceIdentifier!, + arg_pigeon_instanceIdentifier, ); return wrapResponse(empty: true); } on PlatformException catch (e) { @@ -3798,17 +3348,8 @@ class WKWebViewConfiguration extends NSObject { controller, ]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } /// The object that coordinates interactions between your app’s native code @@ -3826,22 +3367,13 @@ class WKWebViewConfiguration extends NSObject { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this]); final 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 WKUserContentController?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as WKUserContentController; } /// The object you use to get and set the site’s cookies and to track the @@ -3859,17 +3391,8 @@ class WKWebViewConfiguration extends NSObject { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this, dataStore]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } /// The object you use to get and set the site’s cookies and to track the @@ -3887,22 +3410,13 @@ class WKWebViewConfiguration extends NSObject { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this]); final 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 WKWebsiteDataStore?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as WKWebsiteDataStore; } /// The object that manages the preference-related settings for the web view. @@ -3922,17 +3436,8 @@ class WKWebViewConfiguration extends NSObject { preferences, ]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } /// The object that manages the preference-related settings for the web view. @@ -3949,22 +3454,13 @@ class WKWebViewConfiguration extends NSObject { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this]); final 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 WKPreferences?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as WKPreferences; } /// A Boolean value that indicates whether HTML5 videos play inline or use the @@ -3982,17 +3478,8 @@ class WKWebViewConfiguration extends NSObject { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this, allow]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } /// A Boolean value that indicates whether the web view limits navigation to @@ -4010,17 +3497,8 @@ class WKWebViewConfiguration extends NSObject { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this, limit]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } /// The media types that require a user gesture to begin playing. @@ -4037,17 +3515,8 @@ class WKWebViewConfiguration extends NSObject { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this, type]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } /// The default preferences to use when loading and rendering content. @@ -4064,22 +3533,13 @@ class WKWebViewConfiguration extends NSObject { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this]); final 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 WKWebpagePreferences?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as WKWebpagePreferences; } @override @@ -4131,16 +3591,8 @@ class WKUserContentController extends NSObject { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert( - message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentController.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.WKUserContentController.pigeon_newInstance was null, expected non-null int.', - ); + final List args = message! as List; + final int arg_pigeon_instanceIdentifier = args[0]! as int; try { (pigeon_instanceManager ?? PigeonInstanceManager.instance).addHostCreatedInstance( pigeon_newInstance?.call() ?? @@ -4148,7 +3600,7 @@ class WKUserContentController extends NSObject { pigeon_binaryMessenger: pigeon_binaryMessenger, pigeon_instanceManager: pigeon_instanceManager, ), - arg_pigeon_instanceIdentifier!, + arg_pigeon_instanceIdentifier, ); return wrapResponse(empty: true); } on PlatformException catch (e) { @@ -4181,17 +3633,8 @@ class WKUserContentController extends NSObject { name, ]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } /// Uninstalls the custom message handler with the specified name from your @@ -4209,17 +3652,8 @@ class WKUserContentController extends NSObject { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this, name]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } /// Uninstalls all custom message handlers associated with the user content @@ -4237,17 +3671,8 @@ class WKUserContentController extends NSObject { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } /// Injects the specified script into the webpage’s content. @@ -4267,17 +3692,8 @@ class WKUserContentController extends NSObject { userScript, ]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } /// Removes all user scripts from the web view. @@ -4294,17 +3710,8 @@ class WKUserContentController extends NSObject { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } @override @@ -4355,16 +3762,8 @@ class WKPreferences extends NSObject { 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.', - ); + final List args = message! as List; + final int arg_pigeon_instanceIdentifier = args[0]! as int; try { (pigeon_instanceManager ?? PigeonInstanceManager.instance).addHostCreatedInstance( pigeon_newInstance?.call() ?? @@ -4372,7 +3771,7 @@ class WKPreferences extends NSObject { pigeon_binaryMessenger: pigeon_binaryMessenger, pigeon_instanceManager: pigeon_instanceManager, ), - arg_pigeon_instanceIdentifier!, + arg_pigeon_instanceIdentifier, ); return wrapResponse(empty: true); } on PlatformException catch (e) { @@ -4400,17 +3799,8 @@ class WKPreferences extends NSObject { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this, enabled]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } /// Set a Boolean value that indicates whether JavaScript can open windows @@ -4429,17 +3819,8 @@ class WKPreferences extends NSObject { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this, enabled]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } @override @@ -4510,17 +3891,8 @@ class WKScriptMessageHandler extends NSObject { ]); () async { final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); }(); } @@ -4590,31 +3962,15 @@ class WKScriptMessageHandler extends NSObject { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert( - message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKScriptMessageHandler.didReceiveScriptMessage was null.', - ); - final List args = (message as List?)!; - 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.WKScriptMessageHandler.didReceiveScriptMessage was null, expected non-null WKScriptMessage.', - ); + final List args = message! as List; + final WKScriptMessageHandler arg_pigeon_instance = args[0]! as WKScriptMessageHandler; + final WKUserContentController arg_controller = args[1]! as WKUserContentController; + final WKScriptMessage arg_message = args[2]! as WKScriptMessage; try { - (didReceiveScriptMessage ?? arg_pigeon_instance!.didReceiveScriptMessage).call( - arg_pigeon_instance!, - arg_controller!, - arg_message!, + (didReceiveScriptMessage ?? arg_pigeon_instance.didReceiveScriptMessage).call( + arg_pigeon_instance, + arg_controller, + arg_message, ); return wrapResponse(empty: true); } on PlatformException catch (e) { @@ -4742,17 +4098,8 @@ class WKNavigationDelegate extends NSObject { ]); () async { final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); }(); } @@ -5016,26 +4363,14 @@ class WKNavigationDelegate extends NSObject { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert( - message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didFinishNavigation was null.', - ); - final List args = (message as List?)!; - 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?); + final List args = message! as List; + final WKNavigationDelegate arg_pigeon_instance = args[0]! as WKNavigationDelegate; + final WKWebView arg_webView = args[1]! as WKWebView; + final String? arg_url = args[2] as String?; try { - (didFinishNavigation ?? arg_pigeon_instance!.didFinishNavigation)?.call( - arg_pigeon_instance!, - arg_webView!, + (didFinishNavigation ?? arg_pigeon_instance.didFinishNavigation)?.call( + arg_pigeon_instance, + arg_webView, arg_url, ); return wrapResponse(empty: true); @@ -5060,25 +4395,13 @@ class WKNavigationDelegate extends NSObject { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert( - message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didStartProvisionalNavigation was null.', - ); - final List args = (message as List?)!; - 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?); + final List args = message! as List; + final WKNavigationDelegate arg_pigeon_instance = args[0]! as WKNavigationDelegate; + final WKWebView arg_webView = args[1]! as WKWebView; + final String? arg_url = args[2] as String?; try { - (didStartProvisionalNavigation ?? arg_pigeon_instance!.didStartProvisionalNavigation) - ?.call(arg_pigeon_instance!, arg_webView!, 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); @@ -5101,31 +4424,15 @@ class WKNavigationDelegate extends NSObject { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert( - message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.decidePolicyForNavigationAction was null.', - ); - final List args = (message as List?)!; - 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.WKNavigationDelegate.decidePolicyForNavigationAction was null, expected non-null WKNavigationAction.', - ); + final List args = message! as List; + final WKNavigationDelegate arg_pigeon_instance = args[0]! as WKNavigationDelegate; + final WKWebView arg_webView = args[1]! as WKWebView; + final WKNavigationAction arg_navigationAction = args[2]! as WKNavigationAction; try { final NavigationActionPolicy output = await (decidePolicyForNavigationAction ?? - arg_pigeon_instance!.decidePolicyForNavigationAction) - .call(arg_pigeon_instance!, arg_webView!, arg_navigationAction!); + arg_pigeon_instance.decidePolicyForNavigationAction) + .call(arg_pigeon_instance, arg_webView, arg_navigationAction); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -5148,31 +4455,15 @@ class WKNavigationDelegate extends NSObject { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert( - message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.decidePolicyForNavigationResponse was null.', - ); - final List args = (message as List?)!; - 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.WKNavigationDelegate.decidePolicyForNavigationResponse was null, expected non-null WKNavigationResponse.', - ); + final List args = message! as List; + final WKNavigationDelegate arg_pigeon_instance = args[0]! as WKNavigationDelegate; + final WKWebView arg_webView = args[1]! as WKWebView; + final WKNavigationResponse arg_navigationResponse = args[2]! as WKNavigationResponse; try { final NavigationResponsePolicy output = await (decidePolicyForNavigationResponse ?? - arg_pigeon_instance!.decidePolicyForNavigationResponse) - .call(arg_pigeon_instance!, arg_webView!, arg_navigationResponse!); + arg_pigeon_instance.decidePolicyForNavigationResponse) + .call(arg_pigeon_instance, arg_webView, arg_navigationResponse); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -5195,31 +4486,15 @@ class WKNavigationDelegate extends NSObject { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert( - message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didFailNavigation was null.', - ); - final List args = (message as List?)!; - 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.WKNavigationDelegate.didFailNavigation was null, expected non-null NSError.', - ); + final List args = message! as List; + final WKNavigationDelegate arg_pigeon_instance = args[0]! as WKNavigationDelegate; + final WKWebView arg_webView = args[1]! as WKWebView; + final NSError arg_error = args[2]! as NSError; try { - (didFailNavigation ?? arg_pigeon_instance!.didFailNavigation)?.call( - arg_pigeon_instance!, - arg_webView!, - arg_error!, + (didFailNavigation ?? arg_pigeon_instance.didFailNavigation)?.call( + arg_pigeon_instance, + arg_webView, + arg_error, ); return wrapResponse(empty: true); } on PlatformException catch (e) { @@ -5243,29 +4518,13 @@ class WKNavigationDelegate extends NSObject { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert( - message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didFailProvisionalNavigation was null.', - ); - final List args = (message as List?)!; - 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.WKNavigationDelegate.didFailProvisionalNavigation was null, expected non-null NSError.', - ); + final List args = message! as List; + final WKNavigationDelegate arg_pigeon_instance = args[0]! as WKNavigationDelegate; + final WKWebView arg_webView = args[1]! as WKWebView; + final NSError arg_error = args[2]! as NSError; try { - (didFailProvisionalNavigation ?? arg_pigeon_instance!.didFailProvisionalNavigation) - ?.call(arg_pigeon_instance!, arg_webView!, 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); @@ -5288,25 +4547,13 @@ class WKNavigationDelegate extends NSObject { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert( - message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.webViewWebContentProcessDidTerminate was null.', - ); - final List args = (message as List?)!; - 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.', - ); + final List args = message! as List; + final WKNavigationDelegate arg_pigeon_instance = args[0]! as WKNavigationDelegate; + final WKWebView arg_webView = args[1]! as WKWebView; try { (webViewWebContentProcessDidTerminate ?? - arg_pigeon_instance!.webViewWebContentProcessDidTerminate) - ?.call(arg_pigeon_instance!, arg_webView!); + arg_pigeon_instance.webViewWebContentProcessDidTerminate) + ?.call(arg_pigeon_instance, arg_webView); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -5329,32 +4576,15 @@ class WKNavigationDelegate extends NSObject { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert( - message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didReceiveAuthenticationChallenge was null.', - ); - final List args = (message as List?)!; - 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.', - ); + final List args = message! as List; + final WKNavigationDelegate arg_pigeon_instance = args[0]! as WKNavigationDelegate; + final WKWebView arg_webView = args[1]! as WKWebView; + final URLAuthenticationChallenge arg_challenge = args[2]! as URLAuthenticationChallenge; try { final AuthenticationChallengeResponse output = await (didReceiveAuthenticationChallenge ?? - arg_pigeon_instance!.didReceiveAuthenticationChallenge) - .call(arg_pigeon_instance!, arg_webView!, arg_challenge!); + arg_pigeon_instance.didReceiveAuthenticationChallenge) + .call(arg_pigeon_instance, arg_webView, arg_challenge); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -5434,17 +4664,8 @@ class NSObject extends PigeonInternalProxyApiBaseClass { ]); () async { final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); }(); } @@ -5517,16 +4738,8 @@ class NSObject extends PigeonInternalProxyApiBaseClass { 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.', - ); + final List args = message! as List; + final int arg_pigeon_instanceIdentifier = args[0]! as int; try { (pigeon_instanceManager ?? PigeonInstanceManager.instance).addHostCreatedInstance( pigeon_newInstance?.call() ?? @@ -5534,7 +4747,7 @@ class NSObject extends PigeonInternalProxyApiBaseClass { pigeon_binaryMessenger: pigeon_binaryMessenger, pigeon_instanceManager: pigeon_instanceManager, ), - arg_pigeon_instanceIdentifier!, + arg_pigeon_instanceIdentifier, ); return wrapResponse(empty: true); } on PlatformException catch (e) { @@ -5558,23 +4771,15 @@ class NSObject extends PigeonInternalProxyApiBaseClass { 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 List args = message! as List; + final NSObject arg_pigeon_instance = args[0]! as 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!, + (observeValue ?? arg_pigeon_instance.observeValue)?.call( + arg_pigeon_instance, arg_keyPath, arg_object, arg_change, @@ -5615,17 +4820,8 @@ class NSObject extends PigeonInternalProxyApiBaseClass { options, ]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } /// Stops the observer object from receiving change notifications for the @@ -5647,17 +4843,8 @@ class NSObject extends PigeonInternalProxyApiBaseClass { keyPath, ]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } @override @@ -5724,17 +4911,8 @@ class UIViewWKWebView extends UIView implements WKWebView { ]); () async { final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); }(); } @@ -5778,16 +4956,8 @@ class UIViewWKWebView extends UIView implements WKWebView { 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.', - ); + final List args = message! as List; + final int arg_pigeon_instanceIdentifier = args[0]! as int; try { (pigeon_instanceManager ?? PigeonInstanceManager.instance).addHostCreatedInstance( pigeon_newInstance?.call() ?? @@ -5795,7 +4965,7 @@ class UIViewWKWebView extends UIView implements WKWebView { pigeon_binaryMessenger: pigeon_binaryMessenger, pigeon_instanceManager: pigeon_instanceManager, ), - arg_pigeon_instanceIdentifier!, + arg_pigeon_instanceIdentifier, ); return wrapResponse(empty: true); } on PlatformException catch (e) { @@ -5833,17 +5003,8 @@ class UIViewWKWebView extends UIView implements WKWebView { pigeonVar_instanceIdentifier, ]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); }(); return pigeonVar_instance; } @@ -5871,17 +5032,8 @@ class UIViewWKWebView extends UIView implements WKWebView { pigeonVar_instanceIdentifier, ]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); }(); return pigeonVar_instance; } @@ -5900,17 +5052,8 @@ class UIViewWKWebView extends UIView implements WKWebView { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this, delegate]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } /// The object you use to manage navigation behavior for the web view. @@ -5926,17 +5069,8 @@ class UIViewWKWebView extends UIView implements WKWebView { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this, delegate]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } /// The URL for the current webpage. @@ -5952,17 +5086,13 @@ class UIViewWKWebView extends UIView implements WKWebView { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this]); final 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?); - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); + return pigeonVar_replyValue as String?; } /// An estimate of what fraction of the current navigation has been loaded. @@ -5978,22 +5108,13 @@ class UIViewWKWebView extends UIView implements WKWebView { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this]); final 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?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as double; } /// Loads the web content that the specified URL request object references and @@ -6010,17 +5131,8 @@ class UIViewWKWebView extends UIView implements WKWebView { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this, request]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } /// Loads the contents of the specified HTML string and navigates to it. @@ -6040,17 +5152,8 @@ class UIViewWKWebView extends UIView implements WKWebView { baseUrl, ]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } /// Loads the web content from the specified file and navigates to it. @@ -6070,17 +5173,8 @@ class UIViewWKWebView extends UIView implements WKWebView { readAccessUrl, ]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } /// Convenience method to load a Flutter asset. @@ -6096,17 +5190,8 @@ class UIViewWKWebView extends UIView implements WKWebView { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this, key]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } /// A Boolean value that indicates whether there is a valid back item in the @@ -6123,22 +5208,13 @@ class UIViewWKWebView extends UIView implements WKWebView { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this]); final 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?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as bool; } /// A Boolean value that indicates whether there is a valid forward item in @@ -6155,22 +5231,13 @@ class UIViewWKWebView extends UIView implements WKWebView { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this]); final 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?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as bool; } /// Navigates to the back item in the back-forward list. @@ -6186,17 +5253,8 @@ class UIViewWKWebView extends UIView implements WKWebView { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } /// Navigates to the forward item in the back-forward list. @@ -6212,17 +5270,8 @@ class UIViewWKWebView extends UIView implements WKWebView { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } /// Reloads the current webpage. @@ -6238,17 +5287,8 @@ class UIViewWKWebView extends UIView implements WKWebView { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } /// The page title. @@ -6264,17 +5304,13 @@ class UIViewWKWebView extends UIView implements WKWebView { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this]); final 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?); - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); + return pigeonVar_replyValue as String?; } /// A Boolean value that indicates whether horizontal swipe gestures trigger @@ -6291,17 +5327,8 @@ class UIViewWKWebView extends UIView implements WKWebView { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this, allow]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } /// The custom user agent string. @@ -6317,17 +5344,8 @@ class UIViewWKWebView extends UIView implements WKWebView { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this, userAgent]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } /// Evaluates the specified JavaScript string. @@ -6346,17 +5364,13 @@ class UIViewWKWebView extends UIView implements WKWebView { javaScriptString, ]); final 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]; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); + return pigeonVar_replyValue; } /// A Boolean value that indicates whether you can inspect the view with @@ -6376,17 +5390,8 @@ class UIViewWKWebView extends UIView implements WKWebView { inspectable, ]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } /// The custom user agent string. @@ -6402,17 +5407,13 @@ class UIViewWKWebView extends UIView implements WKWebView { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this]); final 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?); - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); + return pigeonVar_replyValue as String?; } /// Whether to allow previews for link destinations and detected data such as @@ -6431,17 +5432,8 @@ class UIViewWKWebView extends UIView implements WKWebView { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this, allow]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } @override @@ -6508,17 +5500,8 @@ class NSViewWKWebView extends NSObject implements WKWebView { ]); () async { final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); }(); } @@ -6559,16 +5542,8 @@ class NSViewWKWebView extends NSObject implements WKWebView { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert( - message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.NSViewWKWebView.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.NSViewWKWebView.pigeon_newInstance was null, expected non-null int.', - ); + final List args = message! as List; + final int arg_pigeon_instanceIdentifier = args[0]! as int; try { (pigeon_instanceManager ?? PigeonInstanceManager.instance).addHostCreatedInstance( pigeon_newInstance?.call() ?? @@ -6576,7 +5551,7 @@ class NSViewWKWebView extends NSObject implements WKWebView { pigeon_binaryMessenger: pigeon_binaryMessenger, pigeon_instanceManager: pigeon_instanceManager, ), - arg_pigeon_instanceIdentifier!, + arg_pigeon_instanceIdentifier, ); return wrapResponse(empty: true); } on PlatformException catch (e) { @@ -6614,17 +5589,8 @@ class NSViewWKWebView extends NSObject implements WKWebView { pigeonVar_instanceIdentifier, ]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); }(); return pigeonVar_instance; } @@ -6643,17 +5609,8 @@ class NSViewWKWebView extends NSObject implements WKWebView { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this, delegate]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } /// The object you use to manage navigation behavior for the web view. @@ -6669,17 +5626,8 @@ class NSViewWKWebView extends NSObject implements WKWebView { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this, delegate]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } /// The URL for the current webpage. @@ -6695,17 +5643,13 @@ class NSViewWKWebView extends NSObject implements WKWebView { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this]); final 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?); - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); + return pigeonVar_replyValue as String?; } /// An estimate of what fraction of the current navigation has been loaded. @@ -6721,22 +5665,13 @@ class NSViewWKWebView extends NSObject implements WKWebView { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this]); final 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?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as double; } /// Loads the web content that the specified URL request object references and @@ -6753,17 +5688,8 @@ class NSViewWKWebView extends NSObject implements WKWebView { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this, request]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } /// Loads the contents of the specified HTML string and navigates to it. @@ -6783,17 +5709,8 @@ class NSViewWKWebView extends NSObject implements WKWebView { baseUrl, ]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } /// Loads the web content from the specified file and navigates to it. @@ -6813,17 +5730,8 @@ class NSViewWKWebView extends NSObject implements WKWebView { readAccessUrl, ]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } /// Convenience method to load a Flutter asset. @@ -6839,17 +5747,8 @@ class NSViewWKWebView extends NSObject implements WKWebView { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this, key]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } /// A Boolean value that indicates whether there is a valid back item in the @@ -6866,22 +5765,13 @@ class NSViewWKWebView extends NSObject implements WKWebView { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this]); final 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?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as bool; } /// A Boolean value that indicates whether there is a valid forward item in @@ -6898,22 +5788,13 @@ class NSViewWKWebView extends NSObject implements WKWebView { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this]); final 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?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as bool; } /// Navigates to the back item in the back-forward list. @@ -6929,17 +5810,8 @@ class NSViewWKWebView extends NSObject implements WKWebView { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } /// Navigates to the forward item in the back-forward list. @@ -6955,17 +5827,8 @@ class NSViewWKWebView extends NSObject implements WKWebView { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } /// Reloads the current webpage. @@ -6981,17 +5844,8 @@ class NSViewWKWebView extends NSObject implements WKWebView { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } /// The page title. @@ -7007,17 +5861,13 @@ class NSViewWKWebView extends NSObject implements WKWebView { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this]); final 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?); - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); + return pigeonVar_replyValue as String?; } /// A Boolean value that indicates whether horizontal swipe gestures trigger @@ -7034,17 +5884,8 @@ class NSViewWKWebView extends NSObject implements WKWebView { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this, allow]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } /// The custom user agent string. @@ -7060,17 +5901,8 @@ class NSViewWKWebView extends NSObject implements WKWebView { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this, userAgent]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } /// Evaluates the specified JavaScript string. @@ -7089,17 +5921,13 @@ class NSViewWKWebView extends NSObject implements WKWebView { javaScriptString, ]); final 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]; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); + return pigeonVar_replyValue; } /// A Boolean value that indicates whether you can inspect the view with @@ -7119,17 +5947,8 @@ class NSViewWKWebView extends NSObject implements WKWebView { inspectable, ]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } /// The custom user agent string. @@ -7145,17 +5964,13 @@ class NSViewWKWebView extends NSObject implements WKWebView { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this]); final 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?); - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); + return pigeonVar_replyValue as String?; } /// Whether to allow previews for link destinations and detected data such as @@ -7174,17 +5989,8 @@ class NSViewWKWebView extends NSObject implements WKWebView { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this, allow]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } @override @@ -7233,16 +6039,8 @@ class WKWebView extends NSObject { 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.', - ); + final List args = message! as List; + final int arg_pigeon_instanceIdentifier = args[0]! as int; try { (pigeon_instanceManager ?? PigeonInstanceManager.instance).addHostCreatedInstance( pigeon_newInstance?.call() ?? @@ -7250,7 +6048,7 @@ class WKWebView extends NSObject { pigeon_binaryMessenger: pigeon_binaryMessenger, pigeon_instanceManager: pigeon_instanceManager, ), - arg_pigeon_instanceIdentifier!, + arg_pigeon_instanceIdentifier, ); return wrapResponse(empty: true); } on PlatformException catch (e) { @@ -7376,17 +6174,8 @@ class WKUIDelegate extends NSObject { ]); () async { final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); }(); } @@ -7603,37 +6392,17 @@ class WKUIDelegate extends NSObject { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert( - message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.onCreateWebView was null.', - ); - final List args = (message as List?)!; - 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.WKUIDelegate.onCreateWebView was null, expected non-null WKNavigationAction.', - ); + final List args = message! as List; + final WKUIDelegate arg_pigeon_instance = args[0]! as WKUIDelegate; + final WKWebView arg_webView = args[1]! as WKWebView; + final WKWebViewConfiguration arg_configuration = args[2]! as WKWebViewConfiguration; + final WKNavigationAction arg_navigationAction = args[3]! as WKNavigationAction; try { - (onCreateWebView ?? arg_pigeon_instance!.onCreateWebView)?.call( - arg_pigeon_instance!, - arg_webView!, - arg_configuration!, - 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) { @@ -7657,41 +6426,17 @@ class WKUIDelegate extends NSObject { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert( - message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.requestMediaCapturePermission was null.', - ); - final List args = (message as List?)!; - 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.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.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.WKUIDelegate.requestMediaCapturePermission was null, expected non-null MediaCaptureType.', - ); + final List args = message! as List; + final WKUIDelegate arg_pigeon_instance = args[0]! as WKUIDelegate; + final WKWebView arg_webView = args[1]! as WKWebView; + final WKSecurityOrigin arg_origin = args[2]! as WKSecurityOrigin; + final WKFrameInfo arg_frame = args[3]! as WKFrameInfo; + final MediaCaptureType arg_type = args[4]! as MediaCaptureType; try { final PermissionDecision output = await (requestMediaCapturePermission ?? - arg_pigeon_instance!.requestMediaCapturePermission) - .call(arg_pigeon_instance!, arg_webView!, arg_origin!, arg_frame!, arg_type!); + 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); @@ -7714,37 +6459,17 @@ class WKUIDelegate extends NSObject { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert( - message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.runJavaScriptAlertPanel was null.', - ); - final List args = (message as List?)!; - 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.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.WKUIDelegate.runJavaScriptAlertPanel was null, expected non-null WKFrameInfo.', - ); + final List args = message! as List; + final WKUIDelegate arg_pigeon_instance = args[0]! as WKUIDelegate; + final WKWebView arg_webView = args[1]! as WKWebView; + final String arg_message = args[2]! as String; + final WKFrameInfo arg_frame = args[3]! as WKFrameInfo; try { - await (runJavaScriptAlertPanel ?? arg_pigeon_instance!.runJavaScriptAlertPanel)?.call( - arg_pigeon_instance!, - arg_webView!, - 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) { @@ -7768,35 +6493,15 @@ class WKUIDelegate extends NSObject { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert( - message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.runJavaScriptConfirmPanel was null.', - ); - final List args = (message as List?)!; - 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.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.WKUIDelegate.runJavaScriptConfirmPanel was null, expected non-null WKFrameInfo.', - ); + final List args = message! as List; + final WKUIDelegate arg_pigeon_instance = args[0]! as WKUIDelegate; + final WKWebView arg_webView = args[1]! as WKWebView; + final String arg_message = args[2]! as String; + final WKFrameInfo arg_frame = args[3]! as WKFrameInfo; try { final bool output = - await (runJavaScriptConfirmPanel ?? arg_pigeon_instance!.runJavaScriptConfirmPanel) - .call(arg_pigeon_instance!, arg_webView!, arg_message!, arg_frame!); + 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); @@ -7819,42 +6524,22 @@ class WKUIDelegate extends NSObject { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert( - message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.runJavaScriptTextInputPanel was null.', - ); - final List args = (message as List?)!; - 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.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.WKUIDelegate.runJavaScriptTextInputPanel was null, expected non-null WKFrameInfo.', - ); + final List args = message! as List; + final WKUIDelegate arg_pigeon_instance = args[0]! as WKUIDelegate; + final WKWebView arg_webView = args[1]! as WKWebView; + final String arg_prompt = args[2]! as String; + final String? arg_defaultText = args[3] as String?; + final WKFrameInfo arg_frame = args[4]! as WKFrameInfo; try { final String? output = await (runJavaScriptTextInputPanel ?? - arg_pigeon_instance!.runJavaScriptTextInputPanel) + arg_pigeon_instance.runJavaScriptTextInputPanel) ?.call( - arg_pigeon_instance!, - arg_webView!, - arg_prompt!, + arg_pigeon_instance, + arg_webView, + arg_prompt, arg_defaultText, - arg_frame!, + arg_frame, ); return wrapResponse(result: output); } on PlatformException catch (e) { @@ -7923,16 +6608,8 @@ class WKHTTPCookieStore extends NSObject { 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.', - ); + final List args = message! as List; + final int arg_pigeon_instanceIdentifier = args[0]! as int; try { (pigeon_instanceManager ?? PigeonInstanceManager.instance).addHostCreatedInstance( pigeon_newInstance?.call() ?? @@ -7940,7 +6617,7 @@ class WKHTTPCookieStore extends NSObject { pigeon_binaryMessenger: pigeon_binaryMessenger, pigeon_instanceManager: pigeon_instanceManager, ), - arg_pigeon_instanceIdentifier!, + arg_pigeon_instanceIdentifier, ); return wrapResponse(empty: true); } on PlatformException catch (e) { @@ -7969,17 +6646,8 @@ class WKHTTPCookieStore extends NSObject { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this, cookie]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } /// Fetches all stored cookies. @@ -7995,22 +6663,13 @@ class WKHTTPCookieStore extends NSObject { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this]); final 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(); - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return (pigeonVar_replyValue! as List).cast(); } @override @@ -8082,17 +6741,8 @@ class UIScrollViewDelegate extends NSObject { ]); () async { final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); }(); } @@ -8169,16 +6819,8 @@ class UIScrollViewDelegate extends NSObject { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert( - message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewDelegate.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.UIScrollViewDelegate.pigeon_newInstance was null, expected non-null int.', - ); + final List args = message! as List; + final int arg_pigeon_instanceIdentifier = args[0]! as int; try { (pigeon_instanceManager ?? PigeonInstanceManager.instance).addHostCreatedInstance( pigeon_newInstance?.call() ?? @@ -8186,7 +6828,7 @@ class UIScrollViewDelegate extends NSObject { pigeon_binaryMessenger: pigeon_binaryMessenger, pigeon_instanceManager: pigeon_instanceManager, ), - arg_pigeon_instanceIdentifier!, + arg_pigeon_instanceIdentifier, ); return wrapResponse(empty: true); } on PlatformException catch (e) { @@ -8210,37 +6852,17 @@ class UIScrollViewDelegate extends NSObject { 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.', - ); + final List args = message! as List; + final UIScrollViewDelegate arg_pigeon_instance = args[0]! as UIScrollViewDelegate; + final UIScrollView arg_scrollView = args[1]! as UIScrollView; + final double arg_x = args[2]! as double; + final double arg_y = args[3]! as double; try { - (scrollViewDidScroll ?? arg_pigeon_instance!.scrollViewDidScroll)?.call( - arg_pigeon_instance!, - arg_scrollView!, - arg_x!, - arg_y!, + (scrollViewDidScroll ?? arg_pigeon_instance.scrollViewDidScroll)?.call( + arg_pigeon_instance, + arg_scrollView, + arg_x, + arg_y, ); return wrapResponse(empty: true); } on PlatformException catch (e) { @@ -8334,17 +6956,8 @@ class URLCredential extends NSObject { ]); () async { final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); }(); } @@ -8382,16 +6995,8 @@ class URLCredential extends NSObject { 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.', - ); + final List args = message! as List; + final int arg_pigeon_instanceIdentifier = args[0]! as int; try { (pigeon_instanceManager ?? PigeonInstanceManager.instance).addHostCreatedInstance( pigeon_newInstance?.call() ?? @@ -8399,7 +7004,7 @@ class URLCredential extends NSObject { pigeon_binaryMessenger: pigeon_binaryMessenger, pigeon_instanceManager: pigeon_instanceManager, ), - arg_pigeon_instanceIdentifier!, + arg_pigeon_instanceIdentifier, ); return wrapResponse(empty: true); } on PlatformException catch (e) { @@ -8447,22 +7052,13 @@ class URLCredential extends NSObject { persistence, ]); final 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 URLCredential?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as URLCredential; } /// Creates a URL credential instance for server trust authentication, @@ -8492,22 +7088,13 @@ class URLCredential extends NSObject { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([trust]); final 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 URLCredential?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as URLCredential; } @override @@ -8576,40 +7163,24 @@ class URLProtectionSpace extends NSObject { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert( - message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.URLProtectionSpace.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.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?); + final List args = message! as List; + final int arg_pigeon_instanceIdentifier = args[0]! as int; + final String arg_host = args[1]! as String; + final int arg_port = args[2]! as int; + final String? arg_realm = args[3] as String?; + final String? arg_authenticationMethod = args[4] as String?; try { (pigeon_instanceManager ?? PigeonInstanceManager.instance).addHostCreatedInstance( - pigeon_newInstance?.call(arg_host!, arg_port!, arg_realm, arg_authenticationMethod) ?? + 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!, + host: arg_host, + port: arg_port, realm: arg_realm, authenticationMethod: arg_authenticationMethod, ), - arg_pigeon_instanceIdentifier!, + arg_pigeon_instanceIdentifier, ); return wrapResponse(empty: true); } on PlatformException catch (e) { @@ -8637,17 +7208,13 @@ class URLProtectionSpace extends NSObject { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this]); final 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 SecTrust?); - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); + return pigeonVar_replyValue as SecTrust?; } @override @@ -8702,16 +7269,8 @@ class URLAuthenticationChallenge extends NSObject { 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.', - ); + final List args = message! as List; + final int arg_pigeon_instanceIdentifier = args[0]! as int; try { (pigeon_instanceManager ?? PigeonInstanceManager.instance).addHostCreatedInstance( pigeon_newInstance?.call() ?? @@ -8719,7 +7278,7 @@ class URLAuthenticationChallenge extends NSObject { pigeon_binaryMessenger: pigeon_binaryMessenger, pigeon_instanceManager: pigeon_instanceManager, ), - arg_pigeon_instanceIdentifier!, + arg_pigeon_instanceIdentifier, ); return wrapResponse(empty: true); } on PlatformException catch (e) { @@ -8748,22 +7307,13 @@ class URLAuthenticationChallenge extends NSObject { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this]); final 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 URLProtectionSpace?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as URLProtectionSpace; } @override @@ -8815,16 +7365,8 @@ class URL extends NSObject { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert( - message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.URL.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.URL.pigeon_newInstance was null, expected non-null int.', - ); + final List args = message! as List; + final int arg_pigeon_instanceIdentifier = args[0]! as int; try { (pigeon_instanceManager ?? PigeonInstanceManager.instance).addHostCreatedInstance( pigeon_newInstance?.call() ?? @@ -8832,7 +7374,7 @@ class URL extends NSObject { pigeon_binaryMessenger: pigeon_binaryMessenger, pigeon_instanceManager: pigeon_instanceManager, ), - arg_pigeon_instanceIdentifier!, + arg_pigeon_instanceIdentifier, ); return wrapResponse(empty: true); } on PlatformException catch (e) { @@ -8860,22 +7402,13 @@ class URL extends NSObject { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this]); final 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?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as String; } @override @@ -8927,16 +7460,8 @@ class WKWebpagePreferences extends NSObject { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert( - message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebpagePreferences.pigeon_newInstance was null.', - ); - final List args = (message as List?)!; - final int? arg_pigeon_instanceIdentifier = (args[0] as int?); - assert( - arg_pigeon_instanceIdentifier != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebpagePreferences.pigeon_newInstance was null, expected non-null int.', - ); + final List args = message! as List; + final int arg_pigeon_instanceIdentifier = args[0]! as int; try { (pigeon_instanceManager ?? PigeonInstanceManager.instance).addHostCreatedInstance( pigeon_newInstance?.call() ?? @@ -8944,7 +7469,7 @@ class WKWebpagePreferences extends NSObject { pigeon_binaryMessenger: pigeon_binaryMessenger, pigeon_instanceManager: pigeon_instanceManager, ), - arg_pigeon_instanceIdentifier!, + arg_pigeon_instanceIdentifier, ); return wrapResponse(empty: true); } on PlatformException catch (e) { @@ -8974,17 +7499,8 @@ class WKWebpagePreferences extends NSObject { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([this, allow]); final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } @override @@ -9044,36 +7560,20 @@ class GetTrustResultResponse extends NSObject { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert( - message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.GetTrustResultResponse.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.GetTrustResultResponse.pigeon_newInstance was null, expected non-null int.', - ); - final DartSecTrustResultType? arg_result = (args[1] as DartSecTrustResultType?); - assert( - arg_result != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.GetTrustResultResponse.pigeon_newInstance was null, expected non-null DartSecTrustResultType.', - ); - final int? arg_resultCode = (args[2] as int?); - assert( - arg_resultCode != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.GetTrustResultResponse.pigeon_newInstance was null, expected non-null int.', - ); + final List args = message! as List; + final int arg_pigeon_instanceIdentifier = args[0]! as int; + final DartSecTrustResultType arg_result = args[1]! as DartSecTrustResultType; + final int arg_resultCode = args[2]! as int; try { (pigeon_instanceManager ?? PigeonInstanceManager.instance).addHostCreatedInstance( - pigeon_newInstance?.call(arg_result!, arg_resultCode!) ?? + pigeon_newInstance?.call(arg_result, arg_resultCode) ?? GetTrustResultResponse.pigeon_detached( pigeon_binaryMessenger: pigeon_binaryMessenger, pigeon_instanceManager: pigeon_instanceManager, - result: arg_result!, - resultCode: arg_resultCode!, + result: arg_result, + resultCode: arg_resultCode, ), - arg_pigeon_instanceIdentifier!, + arg_pigeon_instanceIdentifier, ); return wrapResponse(empty: true); } on PlatformException catch (e) { @@ -9115,9 +7615,6 @@ class SecTrust extends NSObject { super.observeValue, }) : super.pigeon_detached(); - late final _PigeonInternalProxyApiBaseCodec _pigeonVar_codecSecTrust = - _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); - static void pigeon_setUpMessageHandlers({ bool pigeon_clearHandlers = false, BinaryMessenger? pigeon_binaryMessenger, @@ -9138,16 +7635,8 @@ class SecTrust extends NSObject { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert( - message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.SecTrust.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.SecTrust.pigeon_newInstance was null, expected non-null int.', - ); + final List args = message! as List; + final int arg_pigeon_instanceIdentifier = args[0]! as int; try { (pigeon_instanceManager ?? PigeonInstanceManager.instance).addHostCreatedInstance( pigeon_newInstance?.call() ?? @@ -9155,7 +7644,7 @@ class SecTrust extends NSObject { pigeon_binaryMessenger: pigeon_binaryMessenger, pigeon_instanceManager: pigeon_instanceManager, ), - arg_pigeon_instanceIdentifier!, + arg_pigeon_instanceIdentifier, ); return wrapResponse(empty: true); } on PlatformException catch (e) { @@ -9192,22 +7681,13 @@ class SecTrust extends NSObject { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([trust]); final 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?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as bool; } /// Returns an opaque cookie containing exceptions to trust policies that will @@ -9233,17 +7713,13 @@ class SecTrust extends NSObject { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([trust]); final 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?); - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); + return pigeonVar_replyValue as Uint8List?; } /// Sets a list of exceptions that should be ignored when the certificate is @@ -9273,22 +7749,13 @@ class SecTrust extends NSObject { exceptions, ]); final 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?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as bool; } /// Returns the result code from the most recent trust evaluation. @@ -9313,22 +7780,13 @@ class SecTrust extends NSObject { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([trust]); final 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 GetTrustResultResponse?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as GetTrustResultResponse; } /// Certificates used to evaluate trust. @@ -9353,17 +7811,13 @@ class SecTrust extends NSObject { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([trust]); final 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 List?)?.cast(); - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); + return (pigeonVar_replyValue as List?)?.cast(); } @override @@ -9391,9 +7845,6 @@ class SecCertificate extends NSObject { super.observeValue, }) : super.pigeon_detached(); - late final _PigeonInternalProxyApiBaseCodec _pigeonVar_codecSecCertificate = - _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); - static void pigeon_setUpMessageHandlers({ bool pigeon_clearHandlers = false, BinaryMessenger? pigeon_binaryMessenger, @@ -9414,16 +7865,8 @@ class SecCertificate extends NSObject { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert( - message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.SecCertificate.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.SecCertificate.pigeon_newInstance was null, expected non-null int.', - ); + final List args = message! as List; + final int arg_pigeon_instanceIdentifier = args[0]! as int; try { (pigeon_instanceManager ?? PigeonInstanceManager.instance).addHostCreatedInstance( pigeon_newInstance?.call() ?? @@ -9431,7 +7874,7 @@ class SecCertificate extends NSObject { pigeon_binaryMessenger: pigeon_binaryMessenger, pigeon_instanceManager: pigeon_instanceManager, ), - arg_pigeon_instanceIdentifier!, + arg_pigeon_instanceIdentifier, ); return wrapResponse(empty: true); } on PlatformException catch (e) { @@ -9468,22 +7911,13 @@ class SecCertificate extends NSObject { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([certificate]); final 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 Uint8List?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as Uint8List; } @override @@ -9574,17 +8008,8 @@ class UIColor extends NSObject { ]); () async { final 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; - } + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); }(); } @@ -9622,16 +8047,8 @@ class UIColor extends NSObject { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert( - message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.UIColor.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.UIColor.pigeon_newInstance was null, expected non-null int.', - ); + final List args = message! as List; + final int arg_pigeon_instanceIdentifier = args[0]! as int; try { (pigeon_instanceManager ?? PigeonInstanceManager.instance).addHostCreatedInstance( pigeon_newInstance?.call() ?? @@ -9639,7 +8056,7 @@ class UIColor extends NSObject { pigeon_binaryMessenger: pigeon_binaryMessenger, pigeon_instanceManager: pigeon_instanceManager, ), - arg_pigeon_instanceIdentifier!, + arg_pigeon_instanceIdentifier, ); return wrapResponse(empty: true); } on PlatformException catch (e) { diff --git a/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml b/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml index 5a1c07a9c271..ce1d28db29ad 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.26.0 +version: 3.26.1 environment: sdk: ^3.12.0 @@ -33,7 +33,7 @@ dev_dependencies: flutter_test: sdk: flutter mockito: ^5.4.4 - pigeon: ^26.1.4 + pigeon: ^27.3.2 topics: - html