diff --git a/packages/webview_flutter/webview_flutter_android/CHANGELOG.md b/packages/webview_flutter/webview_flutter_android/CHANGELOG.md index 4e600c635ad..4b90957df14 100644 --- a/packages/webview_flutter/webview_flutter_android/CHANGELOG.md +++ b/packages/webview_flutter/webview_flutter_android/CHANGELOG.md @@ -1,3 +1,7 @@ +## 4.3.5 + +* Adds internal wrapper methods for native `WebViewClient`. + ## 4.3.4 * Bumps gradle from 8.0.0 to 8.9.0. diff --git a/packages/webview_flutter/webview_flutter_android/android/build.gradle b/packages/webview_flutter/webview_flutter_android/android/build.gradle index 050e9b6d887..6c4148fb681 100644 --- a/packages/webview_flutter/webview_flutter_android/android/build.gradle +++ b/packages/webview_flutter/webview_flutter_android/android/build.gradle @@ -52,6 +52,7 @@ android { implementation 'androidx.annotation:annotation:1.9.1' implementation 'androidx.webkit:webkit:1.12.1' testImplementation 'junit:junit:4.13.2' + testImplementation 'org.mockito:mockito-core:5.16.1' testImplementation 'org.mockito:mockito-inline:5.1.0' testImplementation 'androidx.test:core:1.4.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 92cbf74aaa1..a347b77fa97 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. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Autogenerated from Pigeon (v22.5.0), do not edit directly. +// Autogenerated from Pigeon (v25.3.0), do not edit directly. // See also: https://pub.dev/packages/pigeon @file:Suppress("UNCHECKED_CAST", "ArrayInDataClass", "SyntheticAccessor") @@ -501,6 +501,58 @@ abstract class AndroidWebkitLibraryPigeonProxyApiRegistrar(val binaryMessenger: */ abstract fun getPigeonApiHttpAuthHandler(): PigeonApiHttpAuthHandler + /** + * An implementation of [PigeonApiAndroidMessage] used to add a new Dart instance of + * `AndroidMessage` to the Dart `InstanceManager`. + */ + abstract fun getPigeonApiAndroidMessage(): PigeonApiAndroidMessage + + /** + * An implementation of [PigeonApiClientCertRequest] used to add a new Dart instance of + * `ClientCertRequest` to the Dart `InstanceManager`. + */ + abstract fun getPigeonApiClientCertRequest(): PigeonApiClientCertRequest + + /** + * An implementation of [PigeonApiPrivateKey] used to add a new Dart instance of `PrivateKey` to + * the Dart `InstanceManager`. + */ + open fun getPigeonApiPrivateKey(): PigeonApiPrivateKey { + return PigeonApiPrivateKey(this) + } + + /** + * An implementation of [PigeonApiX509Certificate] used to add a new Dart instance of + * `X509Certificate` to the Dart `InstanceManager`. + */ + open fun getPigeonApiX509Certificate(): PigeonApiX509Certificate { + return PigeonApiX509Certificate(this) + } + + /** + * An implementation of [PigeonApiSslErrorHandler] used to add a new Dart instance of + * `SslErrorHandler` to the Dart `InstanceManager`. + */ + abstract fun getPigeonApiSslErrorHandler(): PigeonApiSslErrorHandler + + /** + * An implementation of [PigeonApiSslError] used to add a new Dart instance of `SslError` to the + * Dart `InstanceManager`. + */ + abstract fun getPigeonApiSslError(): PigeonApiSslError + + /** + * An implementation of [PigeonApiSslCertificateDName] used to add a new Dart instance of + * `SslCertificateDName` to the Dart `InstanceManager`. + */ + abstract fun getPigeonApiSslCertificateDName(): PigeonApiSslCertificateDName + + /** + * An implementation of [PigeonApiSslCertificate] used to add a new Dart instance of + * `SslCertificate` to the Dart `InstanceManager`. + */ + abstract fun getPigeonApiSslCertificate(): PigeonApiSslCertificate + fun setUp() { AndroidWebkitLibraryPigeonInstanceManagerApi.setUpMessageHandlers( binaryMessenger, instanceManager) @@ -523,6 +575,14 @@ abstract class AndroidWebkitLibraryPigeonProxyApiRegistrar(val binaryMessenger: PigeonApiGeolocationPermissionsCallback.setUpMessageHandlers( binaryMessenger, getPigeonApiGeolocationPermissionsCallback()) PigeonApiHttpAuthHandler.setUpMessageHandlers(binaryMessenger, getPigeonApiHttpAuthHandler()) + PigeonApiAndroidMessage.setUpMessageHandlers(binaryMessenger, getPigeonApiAndroidMessage()) + PigeonApiClientCertRequest.setUpMessageHandlers( + binaryMessenger, getPigeonApiClientCertRequest()) + PigeonApiSslErrorHandler.setUpMessageHandlers(binaryMessenger, getPigeonApiSslErrorHandler()) + PigeonApiSslError.setUpMessageHandlers(binaryMessenger, getPigeonApiSslError()) + PigeonApiSslCertificateDName.setUpMessageHandlers( + binaryMessenger, getPigeonApiSslCertificateDName()) + PigeonApiSslCertificate.setUpMessageHandlers(binaryMessenger, getPigeonApiSslCertificate()) } fun tearDown() { @@ -541,6 +601,12 @@ abstract class AndroidWebkitLibraryPigeonProxyApiRegistrar(val binaryMessenger: PigeonApiView.setUpMessageHandlers(binaryMessenger, null) PigeonApiGeolocationPermissionsCallback.setUpMessageHandlers(binaryMessenger, null) PigeonApiHttpAuthHandler.setUpMessageHandlers(binaryMessenger, null) + PigeonApiAndroidMessage.setUpMessageHandlers(binaryMessenger, null) + PigeonApiClientCertRequest.setUpMessageHandlers(binaryMessenger, null) + PigeonApiSslErrorHandler.setUpMessageHandlers(binaryMessenger, null) + PigeonApiSslError.setUpMessageHandlers(binaryMessenger, null) + PigeonApiSslCertificateDName.setUpMessageHandlers(binaryMessenger, null) + PigeonApiSslCertificate.setUpMessageHandlers(binaryMessenger, null) } } @@ -550,7 +616,12 @@ private class AndroidWebkitLibraryPigeonProxyApiBaseCodec( override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { 128.toByte() -> { - return registrar.instanceManager.getInstance(readValue(buffer) as Long) + val identifier: Long = readValue(buffer) as Long + val instance: Any? = registrar.instanceManager.getInstance(identifier) + if (instance == null) { + Log.e("PigeonProxyApiBaseCodec", "Failed to find instance with identifier: $identifier") + } + return instance } else -> super.readValueOfType(type, buffer) } @@ -571,6 +642,7 @@ private class AndroidWebkitLibraryPigeonProxyApiBaseCodec( value is String || value is FileChooserMode || value is ConsoleMessageLevel || + value is SslErrorType || value == null) { super.writeValue(stream, value) return @@ -619,6 +691,22 @@ private class AndroidWebkitLibraryPigeonProxyApiBaseCodec( registrar.getPigeonApiGeolocationPermissionsCallback().pigeon_newInstance(value) {} } else if (value is android.webkit.HttpAuthHandler) { registrar.getPigeonApiHttpAuthHandler().pigeon_newInstance(value) {} + } else if (value is android.os.Message) { + registrar.getPigeonApiAndroidMessage().pigeon_newInstance(value) {} + } else if (value is android.webkit.ClientCertRequest) { + registrar.getPigeonApiClientCertRequest().pigeon_newInstance(value) {} + } else if (value is java.security.PrivateKey) { + registrar.getPigeonApiPrivateKey().pigeon_newInstance(value) {} + } else if (value is java.security.cert.X509Certificate) { + registrar.getPigeonApiX509Certificate().pigeon_newInstance(value) {} + } else if (value is android.webkit.SslErrorHandler) { + registrar.getPigeonApiSslErrorHandler().pigeon_newInstance(value) {} + } else if (value is android.net.http.SslError) { + registrar.getPigeonApiSslError().pigeon_newInstance(value) {} + } else if (value is android.net.http.SslCertificate.DName) { + registrar.getPigeonApiSslCertificateDName().pigeon_newInstance(value) {} + } else if (value is android.net.http.SslCertificate) { + registrar.getPigeonApiSslCertificate().pigeon_newInstance(value) {} } when { @@ -726,6 +814,34 @@ enum class ConsoleMessageLevel(val raw: Int) { } } +/** + * Type of error for a SslCertificate. + * + * See https://developer.android.com/reference/android/net/http/SslError#SSL_DATE_INVALID. + */ +enum class SslErrorType(val raw: Int) { + /** The date of the certificate is invalid. */ + DATE_INVALID(0), + /** The certificate has expired. */ + EXPIRED(1), + /** Hostname mismatch. */ + ID_MISMATCH(2), + /** A generic error occurred. */ + INVALID(3), + /** The certificate is not yet valid. */ + NOT_YET_VALID(4), + /** The certificate authority is not trusted. */ + UNTRUSTED(5), + /** The type is not recognized by this wrapper. */ + UNKNOWN(6); + + companion object { + fun ofRaw(raw: Int): SslErrorType? { + return values().firstOrNull { it.raw == raw } + } + } +} + private open class AndroidWebkitLibraryPigeonCodec : StandardMessageCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { @@ -735,6 +851,9 @@ private open class AndroidWebkitLibraryPigeonCodec : StandardMessageCodec() { 130.toByte() -> { return (readValue(buffer) as Long?)?.let { ConsoleMessageLevel.ofRaw(it.toInt()) } } + 131.toByte() -> { + return (readValue(buffer) as Long?)?.let { SslErrorType.ofRaw(it.toInt()) } + } else -> super.readValueOfType(type, buffer) } } @@ -749,6 +868,10 @@ private open class AndroidWebkitLibraryPigeonCodec : StandardMessageCodec() { stream.write(130) writeValue(stream, value.raw) } + is SslErrorType -> { + stream.write(131) + writeValue(stream, value.raw) + } else -> super.writeValue(stream, value) } } @@ -793,46 +916,44 @@ abstract class PigeonApiWebResourceRequest( callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - return - } - if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { - Result.success(Unit) - return - } - val pigeon_identifierArg = - pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) - val urlArg = url(pigeon_instanceArg) - val isForMainFrameArg = isForMainFrame(pigeon_instanceArg) - val isRedirectArg = isRedirect(pigeon_instanceArg) - val hasGestureArg = hasGesture(pigeon_instanceArg) - val methodArg = method(pigeon_instanceArg) - val requestHeadersArg = requestHeaders(pigeon_instanceArg) - val binaryMessenger = pigeonRegistrar.binaryMessenger - val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.webview_flutter_android.WebResourceRequest.pigeon_newInstance" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send( - listOf( - pigeon_identifierArg, - urlArg, - isForMainFrameArg, - isRedirectArg, - hasGestureArg, - methodArg, - requestHeadersArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + callback(Result.success(Unit)) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val urlArg = url(pigeon_instanceArg) + val isForMainFrameArg = isForMainFrame(pigeon_instanceArg) + val isRedirectArg = isRedirect(pigeon_instanceArg) + val hasGestureArg = hasGesture(pigeon_instanceArg) + val methodArg = method(pigeon_instanceArg) + val requestHeadersArg = requestHeaders(pigeon_instanceArg) + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.webview_flutter_android.WebResourceRequest.pigeon_newInstance" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send( + listOf( + pigeon_identifierArg, + urlArg, + isForMainFrameArg, + isRedirectArg, + hasGestureArg, + methodArg, + requestHeadersArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } } else { - callback(Result.success(Unit)) + callback(Result.failure(createConnectionError(channelName))) } - } else { - callback(Result.failure(createConnectionError(channelName))) } - } + } } } /** @@ -857,31 +978,29 @@ abstract class PigeonApiWebResourceResponse( callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - return - } - if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { - Result.success(Unit) - return - } - val pigeon_identifierArg = - pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) - val statusCodeArg = statusCode(pigeon_instanceArg) - val binaryMessenger = pigeonRegistrar.binaryMessenger - val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.webview_flutter_android.WebResourceResponse.pigeon_newInstance" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_identifierArg, statusCodeArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + callback(Result.success(Unit)) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val statusCodeArg = statusCode(pigeon_instanceArg) + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.webview_flutter_android.WebResourceResponse.pigeon_newInstance" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_identifierArg, statusCodeArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } } else { - callback(Result.success(Unit)) + callback(Result.failure(createConnectionError(channelName))) } - } else { - callback(Result.failure(createConnectionError(channelName))) } } } @@ -914,32 +1033,30 @@ abstract class PigeonApiWebResourceError( callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - return - } - if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { - Result.success(Unit) - return - } - val pigeon_identifierArg = - pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) - val errorCodeArg = errorCode(pigeon_instanceArg) - val descriptionArg = description(pigeon_instanceArg) - val binaryMessenger = pigeonRegistrar.binaryMessenger - val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.webview_flutter_android.WebResourceError.pigeon_newInstance" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_identifierArg, errorCodeArg, descriptionArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + callback(Result.success(Unit)) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val errorCodeArg = errorCode(pigeon_instanceArg) + val descriptionArg = description(pigeon_instanceArg) + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.webview_flutter_android.WebResourceError.pigeon_newInstance" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_identifierArg, errorCodeArg, descriptionArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } } else { - callback(Result.success(Unit)) + callback(Result.failure(createConnectionError(channelName))) } - } else { - callback(Result.failure(createConnectionError(channelName))) } } } @@ -969,32 +1086,30 @@ abstract class PigeonApiWebResourceErrorCompat( callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - return - } - if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { - Result.success(Unit) - return - } - val pigeon_identifierArg = - pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) - val errorCodeArg = errorCode(pigeon_instanceArg) - val descriptionArg = description(pigeon_instanceArg) - val binaryMessenger = pigeonRegistrar.binaryMessenger - val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.webview_flutter_android.WebResourceErrorCompat.pigeon_newInstance" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_identifierArg, errorCodeArg, descriptionArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + callback(Result.success(Unit)) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val errorCodeArg = errorCode(pigeon_instanceArg) + val descriptionArg = description(pigeon_instanceArg) + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.webview_flutter_android.WebResourceErrorCompat.pigeon_newInstance" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_identifierArg, errorCodeArg, descriptionArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } } else { - callback(Result.success(Unit)) + callback(Result.failure(createConnectionError(channelName))) } - } else { - callback(Result.failure(createConnectionError(channelName))) } } } @@ -1019,31 +1134,29 @@ abstract class PigeonApiWebViewPoint( callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - return - } - if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { - Result.success(Unit) - return - } - val pigeon_identifierArg = - pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) - val xArg = x(pigeon_instanceArg) - val yArg = y(pigeon_instanceArg) - val binaryMessenger = pigeonRegistrar.binaryMessenger - val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.WebViewPoint.pigeon_newInstance" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_identifierArg, xArg, yArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + callback(Result.success(Unit)) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val xArg = x(pigeon_instanceArg) + val yArg = y(pigeon_instanceArg) + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = "dev.flutter.pigeon.webview_flutter_android.WebViewPoint.pigeon_newInstance" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_identifierArg, xArg, yArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } } else { - callback(Result.success(Unit)) + callback(Result.failure(createConnectionError(channelName))) } - } else { - callback(Result.failure(createConnectionError(channelName))) } } } @@ -1075,33 +1188,32 @@ abstract class PigeonApiConsoleMessage( callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - return - } - if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { - Result.success(Unit) - return - } - val pigeon_identifierArg = - pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) - val lineNumberArg = lineNumber(pigeon_instanceArg) - val messageArg = message(pigeon_instanceArg) - val levelArg = level(pigeon_instanceArg) - val sourceIdArg = sourceId(pigeon_instanceArg) - val binaryMessenger = pigeonRegistrar.binaryMessenger - val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.ConsoleMessage.pigeon_newInstance" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_identifierArg, lineNumberArg, messageArg, levelArg, sourceIdArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + callback(Result.success(Unit)) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val lineNumberArg = lineNumber(pigeon_instanceArg) + val messageArg = message(pigeon_instanceArg) + val levelArg = level(pigeon_instanceArg) + val sourceIdArg = sourceId(pigeon_instanceArg) + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.webview_flutter_android.ConsoleMessage.pigeon_newInstance" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_identifierArg, lineNumberArg, messageArg, levelArg, sourceIdArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } } else { - callback(Result.success(Unit)) + callback(Result.failure(createConnectionError(channelName))) } - } else { - callback(Result.failure(createConnectionError(channelName))) } } } @@ -1248,29 +1360,28 @@ abstract class PigeonApiCookieManager( callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - return - } - if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { - Result.success(Unit) - return - } - val pigeon_identifierArg = - pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) - val binaryMessenger = pigeonRegistrar.binaryMessenger - val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.CookieManager.pigeon_newInstance" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_identifierArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + callback(Result.success(Unit)) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.webview_flutter_android.CookieManager.pigeon_newInstance" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_identifierArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } } else { - callback(Result.success(Unit)) + callback(Result.failure(createConnectionError(channelName))) } - } else { - callback(Result.failure(createConnectionError(channelName))) } } } @@ -1960,29 +2071,27 @@ abstract class PigeonApiWebView( callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - return - } - if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { - Result.success(Unit) - return - } - val pigeon_identifierArg = - pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) - val binaryMessenger = pigeonRegistrar.binaryMessenger - val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.WebView.pigeon_newInstance" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_identifierArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + callback(Result.success(Unit)) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = "dev.flutter.pigeon.webview_flutter_android.WebView.pigeon_newInstance" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_identifierArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } } else { - callback(Result.success(Unit)) + callback(Result.failure(createConnectionError(channelName))) } - } else { - callback(Result.failure(createConnectionError(channelName))) } } } @@ -2515,29 +2624,27 @@ abstract class PigeonApiWebSettings( callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - return - } - if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { - Result.success(Unit) - return - } - val pigeon_identifierArg = - pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) - val binaryMessenger = pigeonRegistrar.binaryMessenger - val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.WebSettings.pigeon_newInstance" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_identifierArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + callback(Result.success(Unit)) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = "dev.flutter.pigeon.webview_flutter_android.WebSettings.pigeon_newInstance" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_identifierArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } } else { - callback(Result.success(Unit)) + callback(Result.failure(createConnectionError(channelName))) } - } else { - callback(Result.failure(createConnectionError(channelName))) } } } @@ -2593,14 +2700,16 @@ abstract class PigeonApiJavaScriptChannel( callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - return - } - if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { - Result.success(Unit) - return + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + callback(Result.success(Unit)) + } else { + callback( + Result.failure( + AndroidWebKitError( + "new-instance-error", + "Attempting to create a new Dart instance of JavaScriptChannel, but the class has a nonnull callback method.", + ""))) } - throw IllegalStateException( - "Attempting to create a new Dart instance of JavaScriptChannel, but the class has a nonnull callback method.") } /** Handles callbacks messages from JavaScript. */ @@ -2729,29 +2838,28 @@ abstract class PigeonApiWebViewClient( callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - return - } - if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { - Result.success(Unit) - return - } - val pigeon_identifierArg = - pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) - val binaryMessenger = pigeonRegistrar.binaryMessenger - val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.WebViewClient.pigeon_newInstance" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_identifierArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + callback(Result.success(Unit)) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.webview_flutter_android.WebViewClient.pigeon_newInstance" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_identifierArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } } else { - callback(Result.success(Unit)) + callback(Result.failure(createConnectionError(channelName))) } - } else { - callback(Result.failure(createConnectionError(channelName))) } } } @@ -3098,37 +3206,278 @@ abstract class PigeonApiWebViewClient( } } } -} -/** - * Handles notifications that a file should be downloaded. - * - * See https://developer.android.com/reference/android/webkit/DownloadListener. - */ -@Suppress("UNCHECKED_CAST") -abstract class PigeonApiDownloadListener( - open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar -) { - abstract fun pigeon_defaultConstructor(): android.webkit.DownloadListener - companion object { - @Suppress("LocalVariableName") - fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiDownloadListener?) { - val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.webview_flutter_android.DownloadListener.pigeon_defaultConstructor", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_identifierArg = args[0] as Long - val wrapped: List = - try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - api.pigeon_defaultConstructor(), pigeon_identifierArg) - listOf(null) + /** + * Ask the host application if the browser should resend data as the requested page was a result + * of a POST. + */ + fun onFormResubmission( + pigeon_instanceArg: android.webkit.WebViewClient, + viewArg: android.webkit.WebView, + dontResendArg: android.os.Message, + resendArg: android.os.Message, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = "dev.flutter.pigeon.webview_flutter_android.WebViewClient.onFormResubmission" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, viewArg, dontResendArg, resendArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** + * Notify the host application that the WebView will load the resource specified by the given url. + */ + fun onLoadResource( + pigeon_instanceArg: android.webkit.WebViewClient, + viewArg: android.webkit.WebView, + urlArg: String, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = "dev.flutter.pigeon.webview_flutter_android.WebViewClient.onLoadResource" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, viewArg, urlArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** + * Notify the host application that WebView content left over from previous page navigations will + * no longer be drawn. + */ + fun onPageCommitVisible( + pigeon_instanceArg: android.webkit.WebViewClient, + viewArg: android.webkit.WebView, + urlArg: String, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = "dev.flutter.pigeon.webview_flutter_android.WebViewClient.onPageCommitVisible" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, viewArg, urlArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Notify the host application to handle a SSL client certificate request. */ + fun onReceivedClientCertRequest( + pigeon_instanceArg: android.webkit.WebViewClient, + viewArg: android.webkit.WebView, + requestArg: android.webkit.ClientCertRequest, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedClientCertRequest" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, viewArg, requestArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** + * Notify the host application that a request to automatically log in the user has been processed. + */ + fun onReceivedLoginRequest( + pigeon_instanceArg: android.webkit.WebViewClient, + viewArg: android.webkit.WebView, + realmArg: String, + accountArg: String?, + argsArg: String, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedLoginRequest" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, viewArg, realmArg, accountArg, argsArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Notifies the host application that an SSL error occurred while loading a resource. */ + fun onReceivedSslError( + pigeon_instanceArg: android.webkit.WebViewClient, + viewArg: android.webkit.WebView, + handlerArg: android.webkit.SslErrorHandler, + errorArg: android.net.http.SslError, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = "dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedSslError" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, viewArg, handlerArg, errorArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Notify the host application that the scale applied to the WebView has changed. */ + fun onScaleChanged( + pigeon_instanceArg: android.webkit.WebViewClient, + viewArg: android.webkit.WebView, + oldScaleArg: Double, + newScaleArg: Double, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = "dev.flutter.pigeon.webview_flutter_android.WebViewClient.onScaleChanged" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, viewArg, oldScaleArg, newScaleArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } +} +/** + * Handles notifications that a file should be downloaded. + * + * See https://developer.android.com/reference/android/webkit/DownloadListener. + */ +@Suppress("UNCHECKED_CAST") +abstract class PigeonApiDownloadListener( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { + abstract fun pigeon_defaultConstructor(): android.webkit.DownloadListener + + companion object { + @Suppress("LocalVariableName") + fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiDownloadListener?) { + val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.DownloadListener.pigeon_defaultConstructor", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_identifierArg = args[0] as Long + val wrapped: List = + try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + api.pigeon_defaultConstructor(), pigeon_identifierArg) + listOf(null) } catch (exception: Throwable) { wrapError(exception) } @@ -3151,14 +3500,16 @@ abstract class PigeonApiDownloadListener( callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - return - } - if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { - Result.success(Unit) - return + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + callback(Result.success(Unit)) + } else { + callback( + Result.failure( + AndroidWebKitError( + "new-instance-error", + "Attempting to create a new Dart instance of DownloadListener, but the class has a nonnull callback method.", + ""))) } - throw IllegalStateException( - "Attempting to create a new Dart instance of DownloadListener, but the class has a nonnull callback method.") } /** Notify the host application that a file should be downloaded. */ @@ -3485,31 +3836,15 @@ abstract class PigeonApiWebChromeClient( callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - return - } - if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { - Result.success(Unit) - return - } - val pigeon_identifierArg = - pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) - val binaryMessenger = pigeonRegistrar.binaryMessenger - val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.webview_flutter_android.WebChromeClient.pigeon_newInstance" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_identifierArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) - } else { - callback(Result.success(Unit)) - } - } else { - callback(Result.failure(createConnectionError(channelName))) - } + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + callback(Result.success(Unit)) + } else { + callback( + Result.failure( + AndroidWebKitError( + "new-instance-error", + "Attempting to create a new Dart instance of WebChromeClient, but the class has a nonnull callback method.", + ""))) } } @@ -4033,30 +4368,28 @@ abstract class PigeonApiFlutterAssetManager( callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - return - } - if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { - Result.success(Unit) - return - } - val pigeon_identifierArg = - pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) - val binaryMessenger = pigeonRegistrar.binaryMessenger - val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.webview_flutter_android.FlutterAssetManager.pigeon_newInstance" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_identifierArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + callback(Result.success(Unit)) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.webview_flutter_android.FlutterAssetManager.pigeon_newInstance" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_identifierArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } } else { - callback(Result.success(Unit)) + callback(Result.failure(createConnectionError(channelName))) } - } else { - callback(Result.failure(createConnectionError(channelName))) } } } @@ -4139,29 +4472,27 @@ abstract class PigeonApiWebStorage( callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - return - } - if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { - Result.success(Unit) - return - } - val pigeon_identifierArg = - pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) - val binaryMessenger = pigeonRegistrar.binaryMessenger - val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.WebStorage.pigeon_newInstance" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_identifierArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + callback(Result.success(Unit)) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = "dev.flutter.pigeon.webview_flutter_android.WebStorage.pigeon_newInstance" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_identifierArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } } else { - callback(Result.success(Unit)) + callback(Result.failure(createConnectionError(channelName))) } - } else { - callback(Result.failure(createConnectionError(channelName))) } } } @@ -4205,38 +4536,40 @@ abstract class PigeonApiFileChooserParams( callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - return - } - if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { - Result.success(Unit) - return - } - val pigeon_identifierArg = - pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) - val isCaptureEnabledArg = isCaptureEnabled(pigeon_instanceArg) - val acceptTypesArg = acceptTypes(pigeon_instanceArg) - val modeArg = mode(pigeon_instanceArg) - val filenameHintArg = filenameHint(pigeon_instanceArg) - val binaryMessenger = pigeonRegistrar.binaryMessenger - val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.webview_flutter_android.FileChooserParams.pigeon_newInstance" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send( - listOf( - pigeon_identifierArg, isCaptureEnabledArg, acceptTypesArg, modeArg, filenameHintArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + callback(Result.success(Unit)) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val isCaptureEnabledArg = isCaptureEnabled(pigeon_instanceArg) + val acceptTypesArg = acceptTypes(pigeon_instanceArg) + val modeArg = mode(pigeon_instanceArg) + val filenameHintArg = filenameHint(pigeon_instanceArg) + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.webview_flutter_android.FileChooserParams.pigeon_newInstance" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send( + listOf( + pigeon_identifierArg, + isCaptureEnabledArg, + acceptTypesArg, + modeArg, + filenameHintArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } } else { - callback(Result.success(Unit)) + callback(Result.failure(createConnectionError(channelName))) } - } else { - callback(Result.failure(createConnectionError(channelName))) } - } + } } } /** @@ -4321,31 +4654,29 @@ abstract class PigeonApiPermissionRequest( callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - return - } - if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { - Result.success(Unit) - return - } - val pigeon_identifierArg = - pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) - val resourcesArg = resources(pigeon_instanceArg) - val binaryMessenger = pigeonRegistrar.binaryMessenger - val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.webview_flutter_android.PermissionRequest.pigeon_newInstance" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_identifierArg, resourcesArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + callback(Result.success(Unit)) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val resourcesArg = resources(pigeon_instanceArg) + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.webview_flutter_android.PermissionRequest.pigeon_newInstance" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_identifierArg, resourcesArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } } else { - callback(Result.success(Unit)) + callback(Result.failure(createConnectionError(channelName))) } - } else { - callback(Result.failure(createConnectionError(channelName))) } } } @@ -4405,30 +4736,28 @@ abstract class PigeonApiCustomViewCallback( callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - return - } - if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { - Result.success(Unit) - return - } - val pigeon_identifierArg = - pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) - val binaryMessenger = pigeonRegistrar.binaryMessenger - val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.webview_flutter_android.CustomViewCallback.pigeon_newInstance" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_identifierArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + callback(Result.success(Unit)) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.webview_flutter_android.CustomViewCallback.pigeon_newInstance" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_identifierArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } } else { - callback(Result.success(Unit)) + callback(Result.failure(createConnectionError(channelName))) } - } else { - callback(Result.failure(createConnectionError(channelName))) } } } @@ -4533,29 +4862,27 @@ abstract class PigeonApiView( callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - return - } - if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { - Result.success(Unit) - return - } - val pigeon_identifierArg = - pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) - val binaryMessenger = pigeonRegistrar.binaryMessenger - val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.webview_flutter_android.View.pigeon_newInstance" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_identifierArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + callback(Result.success(Unit)) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = "dev.flutter.pigeon.webview_flutter_android.View.pigeon_newInstance" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_identifierArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } } else { - callback(Result.success(Unit)) + callback(Result.failure(createConnectionError(channelName))) } - } else { - callback(Result.failure(createConnectionError(channelName))) } } } @@ -4627,30 +4954,28 @@ abstract class PigeonApiGeolocationPermissionsCallback( callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - return - } - if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { - Result.success(Unit) - return - } - val pigeon_identifierArg = - pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) - val binaryMessenger = pigeonRegistrar.binaryMessenger - val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.webview_flutter_android.GeolocationPermissionsCallback.pigeon_newInstance" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_identifierArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + callback(Result.success(Unit)) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.webview_flutter_android.GeolocationPermissionsCallback.pigeon_newInstance" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_identifierArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } } else { - callback(Result.success(Unit)) + callback(Result.failure(createConnectionError(channelName))) } - } else { - callback(Result.failure(createConnectionError(channelName))) } } } @@ -4767,30 +5092,903 @@ abstract class PigeonApiHttpAuthHandler( callback( Result.failure( AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - return + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + callback(Result.success(Unit)) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.webview_flutter_android.HttpAuthHandler.pigeon_newInstance" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_identifierArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } } - if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { - Result.success(Unit) - return + } +} +/** + * Defines a message containing a description and arbitrary data object that can be sent to a + * `Handler`. + * + * See https://developer.android.com/reference/android/os/Message. + */ +@Suppress("UNCHECKED_CAST") +abstract class PigeonApiAndroidMessage( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { + /** + * Sends this message to the Android native `Handler` specified by getTarget(). + * + * Throws a null pointer exception if this field has not been set. + */ + abstract fun sendToTarget(pigeon_instance: android.os.Message) + + companion object { + @Suppress("LocalVariableName") + fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiAndroidMessage?) { + val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.AndroidMessage.sendToTarget", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as android.os.Message + val wrapped: List = + try { + api.sendToTarget(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } } - val pigeon_identifierArg = - pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) - val binaryMessenger = pigeonRegistrar.binaryMessenger - val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.webview_flutter_android.HttpAuthHandler.pigeon_newInstance" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_identifierArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } + + @Suppress("LocalVariableName", "FunctionName") + /** Creates a Dart instance of AndroidMessage and attaches it to [pigeon_instanceArg]. */ + fun pigeon_newInstance(pigeon_instanceArg: android.os.Message, callback: (Result) -> Unit) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + callback(Result.success(Unit)) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.webview_flutter_android.AndroidMessage.pigeon_newInstance" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_identifierArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } } else { - callback(Result.success(Unit)) + callback(Result.failure(createConnectionError(channelName))) + } + } + } + } +} +/** + * Defines a message containing a description and arbitrary data object that can be sent to a + * `Handler`. + * + * See https://developer.android.com/reference/android/webkit/ClientCertRequest. + */ +@Suppress("UNCHECKED_CAST") +abstract class PigeonApiClientCertRequest( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { + /** Cancel this request. */ + abstract fun cancel(pigeon_instance: android.webkit.ClientCertRequest) + + /** Ignore the request for now. */ + abstract fun ignore(pigeon_instance: android.webkit.ClientCertRequest) + + /** Proceed with the specified private key and client certificate chain. */ + abstract fun proceed( + pigeon_instance: android.webkit.ClientCertRequest, + privateKey: java.security.PrivateKey, + chain: List + ) + + companion object { + @Suppress("LocalVariableName") + fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiClientCertRequest?) { + val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.ClientCertRequest.cancel", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as android.webkit.ClientCertRequest + val wrapped: List = + try { + api.cancel(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.ClientCertRequest.ignore", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as android.webkit.ClientCertRequest + val wrapped: List = + try { + api.ignore(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.ClientCertRequest.proceed", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as android.webkit.ClientCertRequest + val privateKeyArg = args[1] as java.security.PrivateKey + val chainArg = args[2] as List + val wrapped: List = + try { + api.proceed(pigeon_instanceArg, privateKeyArg, chainArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + } + } + + @Suppress("LocalVariableName", "FunctionName") + /** Creates a Dart instance of ClientCertRequest and attaches it to [pigeon_instanceArg]. */ + fun pigeon_newInstance( + pigeon_instanceArg: android.webkit.ClientCertRequest, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + callback(Result.success(Unit)) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.webview_flutter_android.ClientCertRequest.pigeon_newInstance" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_identifierArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + } +} +/** + * A private key. + * + * The purpose of this interface is to group (and provide type safety for) all private key + * interfaces. + * + * See https://developer.android.com/reference/java/security/PrivateKey. + */ +@Suppress("UNCHECKED_CAST") +open class PigeonApiPrivateKey( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { + @Suppress("LocalVariableName", "FunctionName") + /** Creates a Dart instance of PrivateKey and attaches it to [pigeon_instanceArg]. */ + fun pigeon_newInstance( + pigeon_instanceArg: java.security.PrivateKey, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + callback(Result.success(Unit)) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = "dev.flutter.pigeon.webview_flutter_android.PrivateKey.pigeon_newInstance" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_identifierArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + } +} +/** + * Abstract class for X.509 certificates. + * + * This provides a standard way to access all the attributes of an X.509 certificate. + * + * See https://developer.android.com/reference/java/security/cert/X509Certificate. + */ +@Suppress("UNCHECKED_CAST") +open class PigeonApiX509Certificate( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { + @Suppress("LocalVariableName", "FunctionName") + /** Creates a Dart instance of X509Certificate and attaches it to [pigeon_instanceArg]. */ + fun pigeon_newInstance( + pigeon_instanceArg: java.security.cert.X509Certificate, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + callback(Result.success(Unit)) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.webview_flutter_android.X509Certificate.pigeon_newInstance" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_identifierArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + } +} +/** + * Represents a request for handling an SSL error. + * + * See https://developer.android.com/reference/android/webkit/SslErrorHandler. + */ +@Suppress("UNCHECKED_CAST") +abstract class PigeonApiSslErrorHandler( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { + /** + * Instructs the WebView that encountered the SSL certificate error to terminate communication + * with the server. + */ + abstract fun cancel(pigeon_instance: android.webkit.SslErrorHandler) + + /** + * Instructs the WebView that encountered the SSL certificate error to ignore the error and + * continue communicating with the server. + */ + abstract fun proceed(pigeon_instance: android.webkit.SslErrorHandler) + + companion object { + @Suppress("LocalVariableName") + fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiSslErrorHandler?) { + val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.SslErrorHandler.cancel", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as android.webkit.SslErrorHandler + val wrapped: List = + try { + api.cancel(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.SslErrorHandler.proceed", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as android.webkit.SslErrorHandler + val wrapped: List = + try { + api.proceed(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + } + } + + @Suppress("LocalVariableName", "FunctionName") + /** Creates a Dart instance of SslErrorHandler and attaches it to [pigeon_instanceArg]. */ + fun pigeon_newInstance( + pigeon_instanceArg: android.webkit.SslErrorHandler, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + callback(Result.success(Unit)) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.webview_flutter_android.SslErrorHandler.pigeon_newInstance" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_identifierArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + } +} +/** + * This class represents a set of one or more SSL errors and the associated SSL certificate. + * + * See https://developer.android.com/reference/android/net/http/SslError. + */ +@Suppress("UNCHECKED_CAST") +abstract class PigeonApiSslError( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { + /** Gets the SSL certificate associated with this object. */ + abstract fun certificate( + pigeon_instance: android.net.http.SslError + ): android.net.http.SslCertificate + + /** Gets the URL associated with this object. */ + abstract fun url(pigeon_instance: android.net.http.SslError): String + + /** Gets the most severe SSL error in this object's set of errors. */ + abstract fun getPrimaryError(pigeon_instance: android.net.http.SslError): SslErrorType + + /** Determines whether this object includes the supplied error. */ + abstract fun hasError(pigeon_instance: android.net.http.SslError, error: SslErrorType): Boolean + + companion object { + @Suppress("LocalVariableName") + fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiSslError?) { + val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.SslError.getPrimaryError", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as android.net.http.SslError + val wrapped: List = + try { + listOf(api.getPrimaryError(pigeon_instanceArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.SslError.hasError", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as android.net.http.SslError + val errorArg = args[1] as SslErrorType + val wrapped: List = + try { + listOf(api.hasError(pigeon_instanceArg, errorArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + } + } + + @Suppress("LocalVariableName", "FunctionName") + /** Creates a Dart instance of SslError and attaches it to [pigeon_instanceArg]. */ + fun pigeon_newInstance( + pigeon_instanceArg: android.net.http.SslError, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + callback(Result.success(Unit)) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val certificateArg = certificate(pigeon_instanceArg) + val urlArg = url(pigeon_instanceArg) + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = "dev.flutter.pigeon.webview_flutter_android.SslError.pigeon_newInstance" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_identifierArg, certificateArg, urlArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + } +} +/** + * A distinguished name helper class. + * + * A 3-tuple of: the most specific common name (CN) the most specific organization (O) the most + * specific organizational unit (OU) + */ +@Suppress("UNCHECKED_CAST") +abstract class PigeonApiSslCertificateDName( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { + /** The most specific Common-name (CN) component of this name. */ + abstract fun getCName(pigeon_instance: android.net.http.SslCertificate.DName): String + + /** The distinguished name (normally includes CN, O, and OU names). */ + abstract fun getDName(pigeon_instance: android.net.http.SslCertificate.DName): String + + /** The most specific Organization (O) component of this name. */ + abstract fun getOName(pigeon_instance: android.net.http.SslCertificate.DName): String + + /** The most specific Organizational Unit (OU) component of this name. */ + abstract fun getUName(pigeon_instance: android.net.http.SslCertificate.DName): String + + companion object { + @Suppress("LocalVariableName") + fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiSslCertificateDName?) { + val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.SslCertificateDName.getCName", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as android.net.http.SslCertificate.DName + val wrapped: List = + try { + listOf(api.getCName(pigeon_instanceArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.SslCertificateDName.getDName", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as android.net.http.SslCertificate.DName + val wrapped: List = + try { + listOf(api.getDName(pigeon_instanceArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.SslCertificateDName.getOName", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as android.net.http.SslCertificate.DName + val wrapped: List = + try { + listOf(api.getOName(pigeon_instanceArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.SslCertificateDName.getUName", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as android.net.http.SslCertificate.DName + val wrapped: List = + try { + listOf(api.getUName(pigeon_instanceArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + } + } + + @Suppress("LocalVariableName", "FunctionName") + /** Creates a Dart instance of SslCertificateDName and attaches it to [pigeon_instanceArg]. */ + fun pigeon_newInstance( + pigeon_instanceArg: android.net.http.SslCertificate.DName, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + callback(Result.success(Unit)) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.webview_flutter_android.SslCertificateDName.pigeon_newInstance" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_identifierArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + } +} +/** + * SSL certificate info (certificate details) class. + * + * See https://developer.android.com/reference/android/net/http/SslCertificate. + */ +@Suppress("UNCHECKED_CAST") +abstract class PigeonApiSslCertificate( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { + /** Issued-by distinguished name or null if none has been set. */ + abstract fun getIssuedBy( + pigeon_instance: android.net.http.SslCertificate + ): android.net.http.SslCertificate.DName? + + /** Issued-to distinguished name or null if none has been set. */ + abstract fun getIssuedTo( + pigeon_instance: android.net.http.SslCertificate + ): android.net.http.SslCertificate.DName? + + /** Not-after date from the certificate validity period or null if none has been set. */ + abstract fun getValidNotAfterMsSinceEpoch(pigeon_instance: android.net.http.SslCertificate): Long? + + /** Not-before date from the certificate validity period or null if none has been set. */ + abstract fun getValidNotBeforeMsSinceEpoch( + pigeon_instance: android.net.http.SslCertificate + ): Long? + + /** + * The X509Certificate used to create this SslCertificate or null if no certificate was provided. + * + * Always returns null on Android versions below Q. + */ + abstract fun getX509Certificate( + pigeon_instance: android.net.http.SslCertificate + ): java.security.cert.X509Certificate? + + companion object { + @Suppress("LocalVariableName") + fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiSslCertificate?) { + val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.SslCertificate.getIssuedBy", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as android.net.http.SslCertificate + val wrapped: List = + try { + listOf(api.getIssuedBy(pigeon_instanceArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.SslCertificate.getIssuedTo", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as android.net.http.SslCertificate + val wrapped: List = + try { + listOf(api.getIssuedTo(pigeon_instanceArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.SslCertificate.getValidNotAfterMsSinceEpoch", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as android.net.http.SslCertificate + val wrapped: List = + try { + listOf(api.getValidNotAfterMsSinceEpoch(pigeon_instanceArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.SslCertificate.getValidNotBeforeMsSinceEpoch", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as android.net.http.SslCertificate + val wrapped: List = + try { + listOf(api.getValidNotBeforeMsSinceEpoch(pigeon_instanceArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.SslCertificate.getX509Certificate", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as android.net.http.SslCertificate + val wrapped: List = + try { + listOf(api.getX509Certificate(pigeon_instanceArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + } + } + + @Suppress("LocalVariableName", "FunctionName") + /** Creates a Dart instance of SslCertificate and attaches it to [pigeon_instanceArg]. */ + fun pigeon_newInstance( + pigeon_instanceArg: android.net.http.SslCertificate, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + callback(Result.success(Unit)) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.webview_flutter_android.SslCertificate.pigeon_newInstance" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_identifierArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) } - } else { - callback(Result.failure(createConnectionError(channelName))) } } } diff --git a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/ClientCertRequestProxyApi.java b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/ClientCertRequestProxyApi.java new file mode 100644 index 00000000000..54bedf8d8ec --- /dev/null +++ b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/ClientCertRequestProxyApi.java @@ -0,0 +1,40 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package io.flutter.plugins.webviewflutter; + +import android.webkit.ClientCertRequest; +import androidx.annotation.NonNull; +import java.security.PrivateKey; +import java.security.cert.X509Certificate; +import java.util.List; + +/** + * ProxyApi implementation for {@link ClientCertRequest}. This class may handle instantiating native + * object instances that are attached to a Dart instance or handle method calls on the associated + * native class or an instance of that class. + */ +class ClientCertRequestProxyApi extends PigeonApiClientCertRequest { + ClientCertRequestProxyApi(@NonNull ProxyApiRegistrar pigeonRegistrar) { + super(pigeonRegistrar); + } + + @Override + public void cancel(@NonNull ClientCertRequest pigeon_instance) { + pigeon_instance.cancel(); + } + + @Override + public void ignore(@NonNull ClientCertRequest pigeon_instance) { + pigeon_instance.ignore(); + } + + @Override + public void proceed( + @NonNull ClientCertRequest pigeon_instance, + @NonNull PrivateKey privateKey, + @NonNull List chain) { + pigeon_instance.proceed(privateKey, chain.toArray(new X509Certificate[0])); + } +} diff --git a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/MessageProxyApi.java b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/MessageProxyApi.java new file mode 100644 index 00000000000..e0cb6f57293 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/MessageProxyApi.java @@ -0,0 +1,25 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package io.flutter.plugins.webviewflutter; + +import android.os.Message; +import androidx.annotation.NonNull; + +/** + * Proxy API implementation for `Message`. + * + *

This class may handle instantiating and adding native object instances that are attached to a + * Dart instance or handle method calls on the associated native class or an instance of the class. + */ +public class MessageProxyApi extends PigeonApiAndroidMessage { + public MessageProxyApi(@NonNull AndroidWebkitLibraryPigeonProxyApiRegistrar pigeonRegistrar) { + super(pigeonRegistrar); + } + + @Override + public void sendToTarget(@NonNull Message pigeon_instance) { + pigeon_instance.sendToTarget(); + } +} diff --git a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/ProxyApiRegistrar.java b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/ProxyApiRegistrar.java index bc86c51dd28..c4d8d556746 100644 --- a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/ProxyApiRegistrar.java +++ b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/ProxyApiRegistrar.java @@ -56,6 +56,19 @@ void logError(String tag, Throwable exception) { + Log.getStackTraceString(exception)); } + /** Creates an exception when the `unknown` enum value is passed to a host method. */ + @NonNull + IllegalArgumentException createUnknownEnumException(@NonNull Object enumValue) { + return new IllegalArgumentException(enumValue + " doesn't represent a native value."); + } + + /** Creates the error message when a method is called on an unsupported version. */ + @NonNull + String createUnsupportedVersionMessage( + @NonNull String method, @NonNull String versionRequirements) { + return method + " requires " + versionRequirements + "."; + } + @NonNull @Override public PigeonApiWebResourceRequest getPigeonApiWebResourceRequest() { @@ -183,6 +196,42 @@ public PigeonApiHttpAuthHandler getPigeonApiHttpAuthHandler() { return new HttpAuthHandlerProxyApi(this); } + @NonNull + @Override + public PigeonApiClientCertRequest getPigeonApiClientCertRequest() { + return new ClientCertRequestProxyApi(this); + } + + @NonNull + @Override + public PigeonApiSslErrorHandler getPigeonApiSslErrorHandler() { + return new SslErrorHandlerProxyApi(this); + } + + @NonNull + @Override + public PigeonApiSslError getPigeonApiSslError() { + return new SslErrorProxyApi(this); + } + + @NonNull + @Override + public PigeonApiSslCertificateDName getPigeonApiSslCertificateDName() { + return new SslCertificateDNameProxyApi(this); + } + + @NonNull + @Override + public PigeonApiSslCertificate getPigeonApiSslCertificate() { + return new SslCertificateProxyApi(this); + } + + @NonNull + @Override + public PigeonApiAndroidMessage getPigeonApiAndroidMessage() { + return new MessageProxyApi(this); + } + @NonNull public Context getContext() { return context; diff --git a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/SslCertificateDNameProxyApi.java b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/SslCertificateDNameProxyApi.java new file mode 100644 index 00000000000..d26b0656408 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/SslCertificateDNameProxyApi.java @@ -0,0 +1,43 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package io.flutter.plugins.webviewflutter; + +import android.net.http.SslCertificate; +import androidx.annotation.NonNull; + +/** + * ProxyApi implementation for {@link SslCertificate.DName}. This class may handle instantiating + * native object instances that are attached to a Dart instance or handle method calls on the + * associated native class or an instance of that class. + */ +class SslCertificateDNameProxyApi extends PigeonApiSslCertificateDName { + SslCertificateDNameProxyApi(@NonNull ProxyApiRegistrar pigeonRegistrar) { + super(pigeonRegistrar); + } + + @NonNull + @Override + public String getCName(@NonNull SslCertificate.DName pigeon_instance) { + return pigeon_instance.getCName(); + } + + @NonNull + @Override + public String getDName(@NonNull SslCertificate.DName pigeon_instance) { + return pigeon_instance.getDName(); + } + + @NonNull + @Override + public String getOName(@NonNull SslCertificate.DName pigeon_instance) { + return pigeon_instance.getOName(); + } + + @NonNull + @Override + public String getUName(@NonNull SslCertificate.DName pigeon_instance) { + return pigeon_instance.getUName(); + } +} diff --git a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/SslCertificateProxyApi.java b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/SslCertificateProxyApi.java new file mode 100644 index 00000000000..8286961f06a --- /dev/null +++ b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/SslCertificateProxyApi.java @@ -0,0 +1,79 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package io.flutter.plugins.webviewflutter; + +import android.net.http.SslCertificate; +import android.os.Build; +import android.util.Log; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import java.util.Date; + +/** + * ProxyApi implementation for {@link SslCertificate}. This class may handle instantiating native + * object instances that are attached to a Dart instance or handle method calls on the associated + * native class or an instance of that class. + */ +class SslCertificateProxyApi extends PigeonApiSslCertificate { + SslCertificateProxyApi(@NonNull ProxyApiRegistrar pigeonRegistrar) { + super(pigeonRegistrar); + } + + @NonNull + @Override + public ProxyApiRegistrar getPigeonRegistrar() { + return (ProxyApiRegistrar) super.getPigeonRegistrar(); + } + + @Nullable + @Override + public android.net.http.SslCertificate.DName getIssuedBy( + @NonNull SslCertificate pigeon_instance) { + return pigeon_instance.getIssuedBy(); + } + + @Nullable + @Override + public android.net.http.SslCertificate.DName getIssuedTo( + @NonNull SslCertificate pigeon_instance) { + return pigeon_instance.getIssuedTo(); + } + + @Nullable + @Override + public Long getValidNotAfterMsSinceEpoch(@NonNull SslCertificate pigeon_instance) { + final Date date = pigeon_instance.getValidNotAfterDate(); + if (date != null) { + return date.getTime(); + } + return null; + } + + @Nullable + @Override + public Long getValidNotBeforeMsSinceEpoch(@NonNull SslCertificate pigeon_instance) { + final Date date = pigeon_instance.getValidNotBeforeDate(); + if (date != null) { + return date.getTime(); + } + return null; + } + + @Nullable + @Override + public java.security.cert.X509Certificate getX509Certificate( + @NonNull SslCertificate pigeon_instance) { + if (getPigeonRegistrar().sdkIsAtLeast(Build.VERSION_CODES.Q)) { + return pigeon_instance.getX509Certificate(); + } else { + Log.d( + "SslCertificateProxyApi", + getPigeonRegistrar() + .createUnsupportedVersionMessage( + "SslCertificate.getX509Certificate", "Build.VERSION_CODES.Q")); + return null; + } + } +} diff --git a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/SslErrorHandlerProxyApi.java b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/SslErrorHandlerProxyApi.java new file mode 100644 index 00000000000..8fec9f1a4ea --- /dev/null +++ b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/SslErrorHandlerProxyApi.java @@ -0,0 +1,29 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package io.flutter.plugins.webviewflutter; + +import android.webkit.SslErrorHandler; +import androidx.annotation.NonNull; + +/** + * ProxyApi implementation for {@link SslErrorHandler}. This class may handle instantiating native + * object instances that are attached to a Dart instance or handle method calls on the associated + * native class or an instance of that class. + */ +class SslErrorHandlerProxyApi extends PigeonApiSslErrorHandler { + SslErrorHandlerProxyApi(@NonNull ProxyApiRegistrar pigeonRegistrar) { + super(pigeonRegistrar); + } + + @Override + public void cancel(@NonNull SslErrorHandler pigeon_instance) { + pigeon_instance.cancel(); + } + + @Override + public void proceed(@NonNull SslErrorHandler pigeon_instance) { + pigeon_instance.proceed(); + } +} diff --git a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/SslErrorProxyApi.java b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/SslErrorProxyApi.java new file mode 100644 index 00000000000..1f26c110b84 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/SslErrorProxyApi.java @@ -0,0 +1,86 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package io.flutter.plugins.webviewflutter; + +import android.net.http.SslError; +import androidx.annotation.NonNull; + +/** + * ProxyApi implementation for {@link SslError}. This class may handle instantiating native object + * instances that are attached to a Dart instance or handle method calls on the associated native + * class or an instance of that class. + */ +class SslErrorProxyApi extends PigeonApiSslError { + SslErrorProxyApi(@NonNull ProxyApiRegistrar pigeonRegistrar) { + super(pigeonRegistrar); + } + + @NonNull + @Override + public ProxyApiRegistrar getPigeonRegistrar() { + return (ProxyApiRegistrar) super.getPigeonRegistrar(); + } + + @NonNull + @Override + public android.net.http.SslCertificate certificate(@NonNull SslError pigeon_instance) { + return pigeon_instance.getCertificate(); + } + + @NonNull + @Override + public String url(@NonNull SslError pigeon_instance) { + return pigeon_instance.getUrl(); + } + + @NonNull + @Override + public SslErrorType getPrimaryError(@NonNull SslError pigeon_instance) { + switch (pigeon_instance.getPrimaryError()) { + case SslError.SSL_DATE_INVALID: + return SslErrorType.DATE_INVALID; + case SslError.SSL_EXPIRED: + return SslErrorType.EXPIRED; + case SslError.SSL_IDMISMATCH: + return SslErrorType.ID_MISMATCH; + case SslError.SSL_INVALID: + return SslErrorType.INVALID; + case SslError.SSL_NOTYETVALID: + return SslErrorType.NOT_YET_VALID; + case SslError.SSL_UNTRUSTED: + return SslErrorType.UNTRUSTED; + default: + return SslErrorType.UNKNOWN; + } + } + + @Override + public boolean hasError(@NonNull SslError pigeon_instance, @NonNull SslErrorType error) { + int nativeError = -1; + switch (error) { + case DATE_INVALID: + nativeError = SslError.SSL_DATE_INVALID; + break; + case EXPIRED: + nativeError = SslError.SSL_EXPIRED; + break; + case ID_MISMATCH: + nativeError = SslError.SSL_IDMISMATCH; + break; + case INVALID: + nativeError = SslError.SSL_INVALID; + break; + case NOT_YET_VALID: + nativeError = SslError.SSL_NOTYETVALID; + break; + case UNTRUSTED: + nativeError = SslError.SSL_UNTRUSTED; + break; + case UNKNOWN: + throw getPigeonRegistrar().createUnknownEnumException(error); + } + return pigeon_instance.hasError(nativeError); + } +} diff --git a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebViewClientProxyApi.java b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebViewClientProxyApi.java index ca456528a91..d5fd065ac86 100644 --- a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebViewClientProxyApi.java +++ b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebViewClientProxyApi.java @@ -14,6 +14,7 @@ import android.webkit.WebView; import android.webkit.WebViewClient; import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import androidx.annotation.RequiresApi; import androidx.webkit.WebResourceErrorCompat; import androidx.webkit.WebViewClientCompat; @@ -125,6 +126,63 @@ public void onReceivedHttpAuthRequest( () -> api.onReceivedHttpAuthRequest(this, view, handler, host, realm, reply -> null)); } + @Override + public void onFormResubmission( + @NonNull android.webkit.WebView view, + @NonNull android.os.Message dontResend, + @NonNull android.os.Message resend) { + api.getPigeonRegistrar() + .runOnMainThread( + () -> api.onFormResubmission(this, view, dontResend, resend, reply -> null)); + } + + @Override + public void onLoadResource(@NonNull android.webkit.WebView view, @NonNull String url) { + api.getPigeonRegistrar() + .runOnMainThread(() -> api.onLoadResource(this, view, url, reply -> null)); + } + + @Override + public void onPageCommitVisible(@NonNull android.webkit.WebView view, @NonNull String url) { + api.getPigeonRegistrar() + .runOnMainThread(() -> api.onPageCommitVisible(this, view, url, reply -> null)); + } + + @Override + public void onReceivedClientCertRequest( + @NonNull android.webkit.WebView view, @NonNull android.webkit.ClientCertRequest request) { + api.getPigeonRegistrar() + .runOnMainThread( + () -> api.onReceivedClientCertRequest(this, view, request, reply -> null)); + } + + @Override + public void onReceivedLoginRequest( + @NonNull android.webkit.WebView view, + @NonNull String realm, + @Nullable String account, + @NonNull String args) { + api.getPigeonRegistrar() + .runOnMainThread( + () -> api.onReceivedLoginRequest(this, view, realm, account, args, reply -> null)); + } + + @Override + public void onReceivedSslError( + @NonNull android.webkit.WebView view, + @NonNull android.webkit.SslErrorHandler handler, + @NonNull android.net.http.SslError error) { + api.getPigeonRegistrar() + .runOnMainThread(() -> api.onReceivedSslError(this, view, handler, error, reply -> null)); + } + + @Override + public void onScaleChanged( + @NonNull android.webkit.WebView view, float oldScale, float newScale) { + api.getPigeonRegistrar() + .runOnMainThread(() -> api.onScaleChanged(this, view, oldScale, newScale, reply -> null)); + } + @Override public void onUnhandledKeyEvent(@NonNull WebView view, @NonNull KeyEvent event) { // Deliberately empty. Occasionally the webview will mark events as having failed to be @@ -236,6 +294,63 @@ public void onReceivedHttpAuthRequest( () -> api.onReceivedHttpAuthRequest(this, view, handler, host, realm, reply -> null)); } + @Override + public void onFormResubmission( + @NonNull android.webkit.WebView view, + @NonNull android.os.Message dontResend, + @NonNull android.os.Message resend) { + api.getPigeonRegistrar() + .runOnMainThread( + () -> api.onFormResubmission(this, view, dontResend, resend, reply -> null)); + } + + @Override + public void onLoadResource(@NonNull android.webkit.WebView view, @NonNull String url) { + api.getPigeonRegistrar() + .runOnMainThread(() -> api.onLoadResource(this, view, url, reply -> null)); + } + + @Override + public void onPageCommitVisible(@NonNull android.webkit.WebView view, @NonNull String url) { + api.getPigeonRegistrar() + .runOnMainThread(() -> api.onPageCommitVisible(this, view, url, reply -> null)); + } + + @Override + public void onReceivedClientCertRequest( + @NonNull android.webkit.WebView view, @NonNull android.webkit.ClientCertRequest request) { + api.getPigeonRegistrar() + .runOnMainThread( + () -> api.onReceivedClientCertRequest(this, view, request, reply -> null)); + } + + @Override + public void onReceivedLoginRequest( + @NonNull android.webkit.WebView view, + @NonNull String realm, + @Nullable String account, + @NonNull String args) { + api.getPigeonRegistrar() + .runOnMainThread( + () -> api.onReceivedLoginRequest(this, view, realm, account, args, reply -> null)); + } + + @Override + public void onReceivedSslError( + @NonNull android.webkit.WebView view, + @NonNull android.webkit.SslErrorHandler handler, + @NonNull android.net.http.SslError error) { + api.getPigeonRegistrar() + .runOnMainThread(() -> api.onReceivedSslError(this, view, handler, error, reply -> null)); + } + + @Override + public void onScaleChanged( + @NonNull android.webkit.WebView view, float oldScale, float newScale) { + api.getPigeonRegistrar() + .runOnMainThread(() -> api.onScaleChanged(this, view, oldScale, newScale, reply -> null)); + } + @Override public void onUnhandledKeyEvent(@NonNull WebView view, @NonNull KeyEvent event) { // Deliberately empty. Occasionally the webview will mark events as having failed to be diff --git a/packages/webview_flutter/webview_flutter_android/android/src/test/java/io/flutter/plugins/webviewflutter/ClientCertRequestProxyApiTest.java b/packages/webview_flutter/webview_flutter_android/android/src/test/java/io/flutter/plugins/webviewflutter/ClientCertRequestProxyApiTest.java new file mode 100644 index 00000000000..37a816539fd --- /dev/null +++ b/packages/webview_flutter/webview_flutter_android/android/src/test/java/io/flutter/plugins/webviewflutter/ClientCertRequestProxyApiTest.java @@ -0,0 +1,53 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package io.flutter.plugins.webviewflutter; + +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; + +import android.webkit.ClientCertRequest; +import java.security.PrivateKey; +import java.security.cert.X509Certificate; +import java.util.Collections; +import java.util.List; +import org.junit.Test; + +public class ClientCertRequestProxyApiTest { + @Test + public void cancel() { + final PigeonApiClientCertRequest api = + new TestProxyApiRegistrar().getPigeonApiClientCertRequest(); + + final ClientCertRequest instance = mock(ClientCertRequest.class); + api.cancel(instance); + + verify(instance).cancel(); + } + + @Test + public void ignore() { + final PigeonApiClientCertRequest api = + new TestProxyApiRegistrar().getPigeonApiClientCertRequest(); + + final ClientCertRequest instance = mock(ClientCertRequest.class); + api.ignore(instance); + + verify(instance).ignore(); + } + + @Test + public void proceed() { + final PigeonApiClientCertRequest api = + new TestProxyApiRegistrar().getPigeonApiClientCertRequest(); + + final ClientCertRequest instance = mock(ClientCertRequest.class); + final java.security.PrivateKey privateKey = mock(PrivateKey.class); + final X509Certificate cert = mock(X509Certificate.class); + final List chain = Collections.singletonList(cert); + api.proceed(instance, privateKey, chain); + + verify(instance).proceed(privateKey, new X509Certificate[] {cert}); + } +} diff --git a/packages/webview_flutter/webview_flutter_android/android/src/test/java/io/flutter/plugins/webviewflutter/MessageTest.java b/packages/webview_flutter/webview_flutter_android/android/src/test/java/io/flutter/plugins/webviewflutter/MessageTest.java new file mode 100644 index 00000000000..295f052e1bc --- /dev/null +++ b/packages/webview_flutter/webview_flutter_android/android/src/test/java/io/flutter/plugins/webviewflutter/MessageTest.java @@ -0,0 +1,23 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package io.flutter.plugins.webviewflutter; + +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; + +import android.os.Message; +import org.junit.Test; + +public class MessageTest { + @Test + public void sendToTarget() { + final PigeonApiAndroidMessage api = new TestProxyApiRegistrar().getPigeonApiAndroidMessage(); + + final Message instance = mock(Message.class); + api.sendToTarget(instance); + + verify(instance).sendToTarget(); + } +} diff --git a/packages/webview_flutter/webview_flutter_android/android/src/test/java/io/flutter/plugins/webviewflutter/SslCertificateDNameProxyApiTest.java b/packages/webview_flutter/webview_flutter_android/android/src/test/java/io/flutter/plugins/webviewflutter/SslCertificateDNameProxyApiTest.java new file mode 100644 index 00000000000..51477e7765e --- /dev/null +++ b/packages/webview_flutter/webview_flutter_android/android/src/test/java/io/flutter/plugins/webviewflutter/SslCertificateDNameProxyApiTest.java @@ -0,0 +1,62 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package io.flutter.plugins.webviewflutter; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import android.net.http.SslCertificate; +import org.junit.Test; + +public class SslCertificateDNameProxyApiTest { + @Test + public void getCName() { + final PigeonApiSslCertificateDName api = + new TestProxyApiRegistrar().getPigeonApiSslCertificateDName(); + + final SslCertificate.DName instance = mock(SslCertificate.DName.class); + final String value = "myString"; + when(instance.getCName()).thenReturn(value); + + assertEquals(value, api.getCName(instance)); + } + + @Test + public void getDName() { + final PigeonApiSslCertificateDName api = + new TestProxyApiRegistrar().getPigeonApiSslCertificateDName(); + + final SslCertificate.DName instance = mock(SslCertificate.DName.class); + final String value = "myString"; + when(instance.getDName()).thenReturn(value); + + assertEquals(value, api.getDName(instance)); + } + + @Test + public void getOName() { + final PigeonApiSslCertificateDName api = + new TestProxyApiRegistrar().getPigeonApiSslCertificateDName(); + + final SslCertificate.DName instance = mock(SslCertificate.DName.class); + final String value = "myString"; + when(instance.getOName()).thenReturn(value); + + assertEquals(value, api.getOName(instance)); + } + + @Test + public void getUName() { + final PigeonApiSslCertificateDName api = + new TestProxyApiRegistrar().getPigeonApiSslCertificateDName(); + + final SslCertificate.DName instance = mock(SslCertificate.DName.class); + final String value = "myString"; + when(instance.getUName()).thenReturn(value); + + assertEquals(value, api.getUName(instance)); + } +} diff --git a/packages/webview_flutter/webview_flutter_android/android/src/test/java/io/flutter/plugins/webviewflutter/SslCertificateProxyApiTest.java b/packages/webview_flutter/webview_flutter_android/android/src/test/java/io/flutter/plugins/webviewflutter/SslCertificateProxyApiTest.java new file mode 100644 index 00000000000..0b9f8999a2d --- /dev/null +++ b/packages/webview_flutter/webview_flutter_android/android/src/test/java/io/flutter/plugins/webviewflutter/SslCertificateProxyApiTest.java @@ -0,0 +1,71 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package io.flutter.plugins.webviewflutter; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import android.net.http.SslCertificate; +import java.security.cert.X509Certificate; +import java.util.Date; +import org.junit.Test; + +public class SslCertificateProxyApiTest { + @Test + public void getIssuedBy() { + final PigeonApiSslCertificate api = new TestProxyApiRegistrar().getPigeonApiSslCertificate(); + + final SslCertificate instance = mock(SslCertificate.class); + final android.net.http.SslCertificate.DName value = mock(SslCertificate.DName.class); + when(instance.getIssuedBy()).thenReturn(value); + + assertEquals(value, api.getIssuedBy(instance)); + } + + @Test + public void getIssuedTo() { + final PigeonApiSslCertificate api = new TestProxyApiRegistrar().getPigeonApiSslCertificate(); + + final SslCertificate instance = mock(SslCertificate.class); + final android.net.http.SslCertificate.DName value = mock(SslCertificate.DName.class); + when(instance.getIssuedTo()).thenReturn(value); + + assertEquals(value, api.getIssuedTo(instance)); + } + + @Test + public void getValidNotAfterMsSinceEpoch() { + final PigeonApiSslCertificate api = new TestProxyApiRegistrar().getPigeonApiSslCertificate(); + + final SslCertificate instance = mock(SslCertificate.class); + final Date value = new Date(1000); + when(instance.getValidNotAfterDate()).thenReturn(value); + + assertEquals(value.getTime(), (long) api.getValidNotAfterMsSinceEpoch(instance)); + } + + @Test + public void getValidNotBeforeMsSinceEpoch() { + final PigeonApiSslCertificate api = new TestProxyApiRegistrar().getPigeonApiSslCertificate(); + + final SslCertificate instance = mock(SslCertificate.class); + final Date value = new Date(1000); + when(instance.getValidNotBeforeDate()).thenReturn(value); + + assertEquals(value.getTime(), (long) api.getValidNotBeforeMsSinceEpoch(instance)); + } + + @Test + public void getX509Certificate() { + final PigeonApiSslCertificate api = new TestProxyApiRegistrar().getPigeonApiSslCertificate(); + + final SslCertificate instance = mock(SslCertificate.class); + final java.security.cert.X509Certificate value = mock(X509Certificate.class); + when(instance.getX509Certificate()).thenReturn(value); + + assertEquals(value, api.getX509Certificate(instance)); + } +} diff --git a/packages/webview_flutter/webview_flutter_android/android/src/test/java/io/flutter/plugins/webviewflutter/SslErrorHandlerProxyApiTest.java b/packages/webview_flutter/webview_flutter_android/android/src/test/java/io/flutter/plugins/webviewflutter/SslErrorHandlerProxyApiTest.java new file mode 100644 index 00000000000..f308a9682ec --- /dev/null +++ b/packages/webview_flutter/webview_flutter_android/android/src/test/java/io/flutter/plugins/webviewflutter/SslErrorHandlerProxyApiTest.java @@ -0,0 +1,33 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package io.flutter.plugins.webviewflutter; + +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; + +import android.webkit.SslErrorHandler; +import org.junit.Test; + +public class SslErrorHandlerProxyApiTest { + @Test + public void cancel() { + final PigeonApiSslErrorHandler api = new TestProxyApiRegistrar().getPigeonApiSslErrorHandler(); + + final SslErrorHandler instance = mock(SslErrorHandler.class); + api.cancel(instance); + + verify(instance).cancel(); + } + + @Test + public void proceed() { + final PigeonApiSslErrorHandler api = new TestProxyApiRegistrar().getPigeonApiSslErrorHandler(); + + final SslErrorHandler instance = mock(SslErrorHandler.class); + api.proceed(instance); + + verify(instance).proceed(); + } +} diff --git a/packages/webview_flutter/webview_flutter_android/android/src/test/java/io/flutter/plugins/webviewflutter/SslErrorProxyApiTest.java b/packages/webview_flutter/webview_flutter_android/android/src/test/java/io/flutter/plugins/webviewflutter/SslErrorProxyApiTest.java new file mode 100644 index 00000000000..6ce87546132 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_android/android/src/test/java/io/flutter/plugins/webviewflutter/SslErrorProxyApiTest.java @@ -0,0 +1,60 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package io.flutter.plugins.webviewflutter; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import android.net.http.SslCertificate; +import android.net.http.SslError; +import org.junit.Test; + +public class SslErrorProxyApiTest { + @Test + public void certificate() { + final PigeonApiSslError api = new TestProxyApiRegistrar().getPigeonApiSslError(); + + final SslError instance = mock(SslError.class); + final android.net.http.SslCertificate value = mock(SslCertificate.class); + when(instance.getCertificate()).thenReturn(value); + + assertEquals(value, api.certificate(instance)); + } + + @Test + public void url() { + final PigeonApiSslError api = new TestProxyApiRegistrar().getPigeonApiSslError(); + + final SslError instance = mock(SslError.class); + final String value = "myString"; + when(instance.getUrl()).thenReturn(value); + + assertEquals(value, api.url(instance)); + } + + @Test + public void getPrimaryError() { + final PigeonApiSslError api = new TestProxyApiRegistrar().getPigeonApiSslError(); + + final SslError instance = mock(SslError.class); + final SslErrorType value = io.flutter.plugins.webviewflutter.SslErrorType.DATE_INVALID; + when(instance.getPrimaryError()).thenReturn(SslError.SSL_DATE_INVALID); + + assertEquals(value, api.getPrimaryError(instance)); + } + + @Test + public void hasError() { + final PigeonApiSslError api = new TestProxyApiRegistrar().getPigeonApiSslError(); + + final SslError instance = mock(SslError.class); + final SslErrorType error = io.flutter.plugins.webviewflutter.SslErrorType.DATE_INVALID; + final Boolean value = true; + when(instance.hasError(SslError.SSL_DATE_INVALID)).thenReturn(value); + + assertEquals(value, api.hasError(instance, error)); + } +} diff --git a/packages/webview_flutter/webview_flutter_android/android/src/test/java/io/flutter/plugins/webviewflutter/WebViewClientCompatTest.java b/packages/webview_flutter/webview_flutter_android/android/src/test/java/io/flutter/plugins/webviewflutter/WebViewClientCompatTest.java index 6c9bf1c7eff..07c1bd41f00 100644 --- a/packages/webview_flutter/webview_flutter_android/android/src/test/java/io/flutter/plugins/webviewflutter/WebViewClientCompatTest.java +++ b/packages/webview_flutter/webview_flutter_android/android/src/test/java/io/flutter/plugins/webviewflutter/WebViewClientCompatTest.java @@ -12,7 +12,11 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; +import android.net.http.SslError; +import android.os.Message; +import android.webkit.ClientCertRequest; import android.webkit.HttpAuthHandler; +import android.webkit.SslErrorHandler; import android.webkit.WebResourceRequest; import android.webkit.WebView; import org.junit.Test; @@ -158,4 +162,110 @@ public void onReceivedHttpError() { .onReceivedHttpAuthRequest( eq(instance), eq(webView), eq(handler), eq(host), eq(realm), any()); } + + @Test + public void onFormResubmission() { + final WebViewClientProxyApi mockApi = mock(WebViewClientProxyApi.class); + when(mockApi.getPigeonRegistrar()).thenReturn(new TestProxyApiRegistrar()); + + final WebViewClientProxyApi.WebViewClientImpl instance = + new WebViewClientProxyApi.WebViewClientImpl(mockApi); + final android.webkit.WebView view = mock(WebView.class); + final android.os.Message dontResend = mock(Message.class); + final android.os.Message resend = mock(Message.class); + instance.onFormResubmission(view, dontResend, resend); + + verify(mockApi).onFormResubmission(eq(instance), eq(view), eq(dontResend), eq(resend), any()); + } + + @Test + public void onLoadResource() { + final WebViewClientProxyApi mockApi = mock(WebViewClientProxyApi.class); + when(mockApi.getPigeonRegistrar()).thenReturn(new TestProxyApiRegistrar()); + + final WebViewClientProxyApi.WebViewClientImpl instance = + new WebViewClientProxyApi.WebViewClientImpl(mockApi); + final android.webkit.WebView view = mock(WebView.class); + final String url = "myString"; + instance.onLoadResource(view, url); + + verify(mockApi).onLoadResource(eq(instance), eq(view), eq(url), any()); + } + + @Test + public void onPageCommitVisible() { + final WebViewClientProxyApi mockApi = mock(WebViewClientProxyApi.class); + when(mockApi.getPigeonRegistrar()).thenReturn(new TestProxyApiRegistrar()); + + final WebViewClientProxyApi.WebViewClientImpl instance = + new WebViewClientProxyApi.WebViewClientImpl(mockApi); + final android.webkit.WebView view = mock(WebView.class); + final String url = "myString"; + instance.onPageCommitVisible(view, url); + + verify(mockApi).onPageCommitVisible(eq(instance), eq(view), eq(url), any()); + } + + @Test + public void onReceivedClientCertRequest() { + final WebViewClientProxyApi mockApi = mock(WebViewClientProxyApi.class); + when(mockApi.getPigeonRegistrar()).thenReturn(new TestProxyApiRegistrar()); + + final WebViewClientProxyApi.WebViewClientImpl instance = + new WebViewClientProxyApi.WebViewClientImpl(mockApi); + final android.webkit.WebView view = mock(WebView.class); + final android.webkit.ClientCertRequest request = mock(ClientCertRequest.class); + instance.onReceivedClientCertRequest(view, request); + + verify(mockApi).onReceivedClientCertRequest(eq(instance), eq(view), eq(request), any()); + } + + @Test + public void onReceivedLoginRequest() { + final WebViewClientProxyApi mockApi = mock(WebViewClientProxyApi.class); + when(mockApi.getPigeonRegistrar()).thenReturn(new TestProxyApiRegistrar()); + + final WebViewClientProxyApi.WebViewClientImpl instance = + new WebViewClientProxyApi.WebViewClientImpl(mockApi); + final android.webkit.WebView view = mock(WebView.class); + final String realm = "myString"; + final String account = "myString1"; + final String args = "myString2"; + instance.onReceivedLoginRequest(view, realm, account, args); + + verify(mockApi) + .onReceivedLoginRequest(eq(instance), eq(view), eq(realm), eq(account), eq(args), any()); + } + + @Test + public void onReceivedSslError() { + final WebViewClientProxyApi mockApi = mock(WebViewClientProxyApi.class); + when(mockApi.getPigeonRegistrar()).thenReturn(new TestProxyApiRegistrar()); + + final WebViewClientProxyApi.WebViewClientImpl instance = + new WebViewClientProxyApi.WebViewClientImpl(mockApi); + final android.webkit.WebView view = mock(WebView.class); + final android.webkit.SslErrorHandler handler = mock(SslErrorHandler.class); + final android.net.http.SslError error = mock(SslError.class); + instance.onReceivedSslError(view, handler, error); + + verify(mockApi).onReceivedSslError(eq(instance), eq(view), eq(handler), eq(error), any()); + } + + @Test + public void onScaleChanged() { + final WebViewClientProxyApi mockApi = mock(WebViewClientProxyApi.class); + when(mockApi.getPigeonRegistrar()).thenReturn(new TestProxyApiRegistrar()); + + final WebViewClientProxyApi.WebViewClientImpl instance = + new WebViewClientProxyApi.WebViewClientImpl(mockApi); + final android.webkit.WebView view = mock(WebView.class); + final float oldScale = 1.0f; + final float newScale = 2.0f; + instance.onScaleChanged(view, oldScale, newScale); + + verify(mockApi) + .onScaleChanged( + eq(instance), eq(view), eq((double) oldScale), eq((double) newScale), any()); + } } diff --git a/packages/webview_flutter/webview_flutter_android/android/src/test/java/io/flutter/plugins/webviewflutter/WebViewClientTest.java b/packages/webview_flutter/webview_flutter_android/android/src/test/java/io/flutter/plugins/webviewflutter/WebViewClientTest.java index 015bf46705d..9f8bb4ea295 100644 --- a/packages/webview_flutter/webview_flutter_android/android/src/test/java/io/flutter/plugins/webviewflutter/WebViewClientTest.java +++ b/packages/webview_flutter/webview_flutter_android/android/src/test/java/io/flutter/plugins/webviewflutter/WebViewClientTest.java @@ -12,7 +12,11 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; +import android.net.http.SslError; +import android.os.Message; +import android.webkit.ClientCertRequest; import android.webkit.HttpAuthHandler; +import android.webkit.SslErrorHandler; import android.webkit.WebResourceRequest; import android.webkit.WebView; import io.flutter.plugins.webviewflutter.WebViewClientProxyApi.WebViewClientImpl; @@ -148,4 +152,103 @@ public void onReceivedHttpError() { .onReceivedHttpAuthRequest( eq(instance), eq(webView), eq(handler), eq(host), eq(realm), any()); } + + @Test + public void onFormResubmission() { + final WebViewClientProxyApi mockApi = mock(WebViewClientProxyApi.class); + when(mockApi.getPigeonRegistrar()).thenReturn(new TestProxyApiRegistrar()); + + final WebViewClientImpl instance = new WebViewClientImpl(mockApi); + final android.webkit.WebView view = mock(WebView.class); + final android.os.Message dontResend = mock(Message.class); + final android.os.Message resend = mock(Message.class); + instance.onFormResubmission(view, dontResend, resend); + + verify(mockApi).onFormResubmission(eq(instance), eq(view), eq(dontResend), eq(resend), any()); + } + + @Test + public void onLoadResource() { + final WebViewClientProxyApi mockApi = mock(WebViewClientProxyApi.class); + when(mockApi.getPigeonRegistrar()).thenReturn(new TestProxyApiRegistrar()); + + final WebViewClientImpl instance = new WebViewClientImpl(mockApi); + final android.webkit.WebView view = mock(WebView.class); + final String url = "myString"; + instance.onLoadResource(view, url); + + verify(mockApi).onLoadResource(eq(instance), eq(view), eq(url), any()); + } + + @Test + public void onPageCommitVisible() { + final WebViewClientProxyApi mockApi = mock(WebViewClientProxyApi.class); + when(mockApi.getPigeonRegistrar()).thenReturn(new TestProxyApiRegistrar()); + + final WebViewClientImpl instance = new WebViewClientImpl(mockApi); + final android.webkit.WebView view = mock(WebView.class); + final String url = "myString"; + instance.onPageCommitVisible(view, url); + + verify(mockApi).onPageCommitVisible(eq(instance), eq(view), eq(url), any()); + } + + @Test + public void onReceivedClientCertRequest() { + final WebViewClientProxyApi mockApi = mock(WebViewClientProxyApi.class); + when(mockApi.getPigeonRegistrar()).thenReturn(new TestProxyApiRegistrar()); + + final WebViewClientImpl instance = new WebViewClientImpl(mockApi); + final android.webkit.WebView view = mock(WebView.class); + final android.webkit.ClientCertRequest request = mock(ClientCertRequest.class); + instance.onReceivedClientCertRequest(view, request); + + verify(mockApi).onReceivedClientCertRequest(eq(instance), eq(view), eq(request), any()); + } + + @Test + public void onReceivedLoginRequest() { + final WebViewClientProxyApi mockApi = mock(WebViewClientProxyApi.class); + when(mockApi.getPigeonRegistrar()).thenReturn(new TestProxyApiRegistrar()); + + final WebViewClientImpl instance = new WebViewClientImpl(mockApi); + final android.webkit.WebView view = mock(WebView.class); + final String realm = "myString"; + final String account = "myString1"; + final String args = "myString2"; + instance.onReceivedLoginRequest(view, realm, account, args); + + verify(mockApi) + .onReceivedLoginRequest(eq(instance), eq(view), eq(realm), eq(account), eq(args), any()); + } + + @Test + public void onReceivedSslError() { + final WebViewClientProxyApi mockApi = mock(WebViewClientProxyApi.class); + when(mockApi.getPigeonRegistrar()).thenReturn(new TestProxyApiRegistrar()); + + final WebViewClientImpl instance = new WebViewClientImpl(mockApi); + final android.webkit.WebView view = mock(WebView.class); + final android.webkit.SslErrorHandler handler = mock(SslErrorHandler.class); + final android.net.http.SslError error = mock(SslError.class); + instance.onReceivedSslError(view, handler, error); + + verify(mockApi).onReceivedSslError(eq(instance), eq(view), eq(handler), eq(error), any()); + } + + @Test + public void onScaleChanged() { + final WebViewClientProxyApi mockApi = mock(WebViewClientProxyApi.class); + when(mockApi.getPigeonRegistrar()).thenReturn(new TestProxyApiRegistrar()); + + final WebViewClientImpl instance = new WebViewClientImpl(mockApi); + final android.webkit.WebView view = mock(WebView.class); + final float oldScale = 1.0f; + final float newScale = 2.0f; + instance.onScaleChanged(view, oldScale, newScale); + + verify(mockApi) + .onScaleChanged( + eq(instance), eq(view), eq((double) oldScale), eq((double) newScale), any()); + } } diff --git a/packages/webview_flutter/webview_flutter_android/example/android/app/build.gradle b/packages/webview_flutter/webview_flutter_android/example/android/app/build.gradle index 78de78e10f9..c8bf2055a3d 100644 --- a/packages/webview_flutter/webview_flutter_android/example/android/app/build.gradle +++ b/packages/webview_flutter/webview_flutter_android/example/android/app/build.gradle @@ -25,7 +25,7 @@ if (flutterVersionName == null) { android { namespace 'io.flutter.plugins.webviewflutterexample' compileSdk = flutter.compileSdkVersion - + ndkVersion = flutter.ndkVersion defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). @@ -37,6 +37,15 @@ android { testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } + compileOptions { + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 + } + + kotlinOptions { + jvmTarget = '11' + } + buildTypes { release { // TODO: Add your own signing config for the release build. diff --git a/packages/webview_flutter/webview_flutter_android/lib/src/android_proxy.dart b/packages/webview_flutter/webview_flutter_android/lib/src/android_proxy.dart index ccb9dc77f50..e32520c358b 100644 --- a/packages/webview_flutter/webview_flutter_android/lib/src/android_proxy.dart +++ b/packages/webview_flutter/webview_flutter_android/lib/src/android_proxy.dart @@ -73,6 +73,46 @@ class AndroidWebViewProxy { void Function(WebViewClient, WebView, String, bool)? doUpdateVisitedHistory, void Function(WebViewClient, WebView, HttpAuthHandler, String, String)? onReceivedHttpAuthRequest, + void Function( + WebViewClient, + WebView, + AndroidMessage, + AndroidMessage, + )? onFormResubmission, + void Function( + WebViewClient, + WebView, + String, + )? onLoadResource, + void Function( + WebViewClient, + WebView, + String, + )? onPageCommitVisible, + void Function( + WebViewClient, + WebView, + ClientCertRequest, + )? onReceivedClientCertRequest, + void Function( + WebViewClient, + WebView, + String, + String?, + String, + )? onReceivedLoginRequest, + void Function( + WebViewClient, + WebView, + SslErrorHandler, + SslError, + )? onReceivedSslError, + void Function( + WebViewClient, + WebView, + double, + double, + )? onScaleChanged, }) newWebViewClient; /// Constructs [DownloadListener]. @@ -85,11 +125,11 @@ class AndroidWebViewProxy { /// Constructs [WebChromeClient]. final WebChromeClient Function({ void Function(WebChromeClient, WebView, int)? onProgressChanged, - Future> Function( + required Future> Function( WebChromeClient, WebView, FileChooserParams, - )? onShowFileChooser, + ) onShowFileChooser, void Function(WebChromeClient, PermissionRequest)? onPermissionRequest, void Function(WebChromeClient, View, CustomViewCallback)? onShowCustomView, void Function(WebChromeClient)? onHideCustomView, @@ -101,12 +141,12 @@ class AndroidWebViewProxy { void Function(WebChromeClient)? onGeolocationPermissionsHidePrompt, void Function(WebChromeClient, ConsoleMessage)? onConsoleMessage, Future Function(WebChromeClient, WebView, String, String)? onJsAlert, - Future Function( + required Future Function( WebChromeClient, WebView, String, String, - )? onJsConfirm, + ) onJsConfirm, Future Function( WebChromeClient, WebView, 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 3ae3a187867..f67bae562ad 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. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Autogenerated from Pigeon (v22.5.0), do not edit directly. +// Autogenerated from Pigeon (v25.3.0), do not edit directly. // See also: https://pub.dev/packages/pigeon // ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name, unnecessary_import, no_leading_underscores_for_local_identifiers @@ -53,7 +53,6 @@ abstract class PigeonInternalProxyApiBaseClass { final BinaryMessenger? pigeon_binaryMessenger; /// Maintains instances stored to communicate with native language objects. - @protected final PigeonInstanceManager pigeon_instanceManager; /// Instantiates and returns a functionally identical object to oneself. @@ -179,6 +178,22 @@ class PigeonInstanceManager { pigeon_instanceManager: instanceManager); HttpAuthHandler.pigeon_setUpMessageHandlers( pigeon_instanceManager: instanceManager); + AndroidMessage.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + ClientCertRequest.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + PrivateKey.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + X509Certificate.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + SslErrorHandler.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + SslError.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + SslCertificateDName.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + SslCertificate.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); return instanceManager; } @@ -372,8 +387,10 @@ class _PigeonInternalInstanceManagerApi { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([identifier]); final List? pigeonVar_replyList = - await pigeonVar_channel.send([identifier]) as List?; + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -399,8 +416,9 @@ class _PigeonInternalInstanceManagerApi { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); + final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); final List? pigeonVar_replyList = - await pigeonVar_channel.send(null) as List?; + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -503,6 +521,32 @@ enum ConsoleMessageLevel { unknown, } +/// Type of error for a SslCertificate. +/// +/// See https://developer.android.com/reference/android/net/http/SslError#SSL_DATE_INVALID. +enum SslErrorType { + /// The date of the certificate is invalid. + dateInvalid, + + /// The certificate has expired. + expired, + + /// Hostname mismatch. + idMismatch, + + /// A generic error occurred. + invalid, + + /// The certificate is not yet valid. + notYetValid, + + /// The certificate authority is not trusted. + untrusted, + + /// The type is not recognized by this wrapper. + unknown, +} + class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override @@ -516,6 +560,9 @@ class _PigeonCodec extends StandardMessageCodec { } else if (value is ConsoleMessageLevel) { buffer.putUint8(130); writeValue(buffer, value.index); + } else if (value is SslErrorType) { + buffer.putUint8(131); + writeValue(buffer, value.index); } else { super.writeValue(buffer, value); } @@ -530,6 +577,9 @@ class _PigeonCodec extends StandardMessageCodec { case 130: final int? value = readValue(buffer) as int?; return value == null ? null : ConsoleMessageLevel.values[value]; + case 131: + final int? value = readValue(buffer) as int?; + return value == null ? null : SslErrorType.values[value]; default: return super.readValueOfType(type, buffer); } @@ -1228,8 +1278,10 @@ class CookieManager extends PigeonInternalProxyApiBaseClass { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([pigeonVar_instanceIdentifier]) as List?; + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([pigeonVar_instanceIdentifier]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1261,8 +1313,10 @@ class CookieManager extends PigeonInternalProxyApiBaseClass { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([this, url, value]) as List?; + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, url, value]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1289,8 +1343,10 @@ class CookieManager extends PigeonInternalProxyApiBaseClass { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); final List? pigeonVar_replyList = - await pigeonVar_channel.send([this]) as List?; + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1325,8 +1381,10 @@ class CookieManager extends PigeonInternalProxyApiBaseClass { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([this, webView, accept]) as List?; + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, webView, accept]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1363,17 +1421,19 @@ class WebView extends View { final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = _pigeonVar_codecWebView; final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_android.WebView.pigeon_defaultConstructor'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([pigeonVar_instanceIdentifier]); () async { - const String pigeonVar_channelName = - 'dev.flutter.pigeon.webview_flutter_android.WebView.pigeon_defaultConstructor'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( - pigeonVar_channelName, - pigeonChannelCodec, - binaryMessenger: pigeonVar_binaryMessenger, - ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([pigeonVar_instanceIdentifier]) as List?; + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1555,9 +1615,10 @@ class WebView extends View { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([this, pigeonVar_instanceIdentifier]) - as List?; + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, pigeonVar_instanceIdentifier]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1590,8 +1651,10 @@ class WebView extends View { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([this, data, mimeType, encoding]) as List?; + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, data, mimeType, encoding]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1625,9 +1688,10 @@ class WebView extends View { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = await pigeonVar_channel.send( - [this, baseUrl, data, mimeType, encoding, historyUrl]) - as List?; + final Future pigeonVar_sendFuture = pigeonVar_channel + .send([this, baseUrl, data, mimeType, encoding, historyUrl]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1657,8 +1721,10 @@ class WebView extends View { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([this, url, headers]) as List?; + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, url, headers]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1688,8 +1754,10 @@ class WebView extends View { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([this, url, data]) as List?; + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, url, data]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1716,8 +1784,10 @@ class WebView extends View { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); final List? pigeonVar_replyList = - await pigeonVar_channel.send([this]) as List?; + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1744,8 +1814,10 @@ class WebView extends View { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); final List? pigeonVar_replyList = - await pigeonVar_channel.send([this]) as List?; + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1777,8 +1849,10 @@ class WebView extends View { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); final List? pigeonVar_replyList = - await pigeonVar_channel.send([this]) as List?; + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1810,8 +1884,10 @@ class WebView extends View { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); final List? pigeonVar_replyList = - await pigeonVar_channel.send([this]) as List?; + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1838,8 +1914,10 @@ class WebView extends View { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); final List? pigeonVar_replyList = - await pigeonVar_channel.send([this]) as List?; + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1866,8 +1944,10 @@ class WebView extends View { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); final List? pigeonVar_replyList = - await pigeonVar_channel.send([this]) as List?; + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1894,8 +1974,10 @@ class WebView extends View { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([this, includeDiskFiles]) as List?; + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, includeDiskFiles]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1923,8 +2005,10 @@ class WebView extends View { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([this, javascriptString]) as List?; + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, javascriptString]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1951,8 +2035,10 @@ class WebView extends View { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); final List? pigeonVar_replyList = - await pigeonVar_channel.send([this]) as List?; + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1985,8 +2071,10 @@ class WebView extends View { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([enabled]); final List? pigeonVar_replyList = - await pigeonVar_channel.send([enabled]) as List?; + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2014,8 +2102,10 @@ class WebView extends View { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, client]); final List? pigeonVar_replyList = - await pigeonVar_channel.send([this, client]) as List?; + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2042,8 +2132,10 @@ class WebView extends View { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([this, channel]) as List?; + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, channel]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2070,8 +2162,10 @@ class WebView extends View { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, name]); final List? pigeonVar_replyList = - await pigeonVar_channel.send([this, name]) as List?; + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2099,8 +2193,10 @@ class WebView extends View { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([this, listener]) as List?; + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, listener]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2127,8 +2223,10 @@ class WebView extends View { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, client]); final List? pigeonVar_replyList = - await pigeonVar_channel.send([this, client]) as List?; + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2155,8 +2253,10 @@ class WebView extends View { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, color]); final List? pigeonVar_replyList = - await pigeonVar_channel.send([this, color]) as List?; + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2183,8 +2283,10 @@ class WebView extends View { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); final List? pigeonVar_replyList = - await pigeonVar_channel.send([this]) as List?; + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2287,8 +2389,10 @@ class WebSettings extends PigeonInternalProxyApiBaseClass { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, flag]); final List? pigeonVar_replyList = - await pigeonVar_channel.send([this, flag]) as List?; + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2315,8 +2419,10 @@ class WebSettings extends PigeonInternalProxyApiBaseClass { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, flag]); final List? pigeonVar_replyList = - await pigeonVar_channel.send([this, flag]) as List?; + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2343,8 +2449,10 @@ class WebSettings extends PigeonInternalProxyApiBaseClass { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([this, support]) as List?; + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, support]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2371,8 +2479,10 @@ class WebSettings extends PigeonInternalProxyApiBaseClass { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, flag]); final List? pigeonVar_replyList = - await pigeonVar_channel.send([this, flag]) as List?; + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2399,8 +2509,10 @@ class WebSettings extends PigeonInternalProxyApiBaseClass { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([this, userAgentString]) as List?; + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, userAgentString]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2427,8 +2539,10 @@ class WebSettings extends PigeonInternalProxyApiBaseClass { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([this, require]) as List?; + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, require]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2456,8 +2570,10 @@ class WebSettings extends PigeonInternalProxyApiBaseClass { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([this, support]) as List?; + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, support]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2485,8 +2601,10 @@ class WebSettings extends PigeonInternalProxyApiBaseClass { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([this, overview]) as List?; + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, overview]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2514,8 +2632,10 @@ class WebSettings extends PigeonInternalProxyApiBaseClass { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, use]); final List? pigeonVar_replyList = - await pigeonVar_channel.send([this, use]) as List?; + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2543,8 +2663,10 @@ class WebSettings extends PigeonInternalProxyApiBaseClass { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([this, enabled]) as List?; + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, enabled]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2572,8 +2694,10 @@ class WebSettings extends PigeonInternalProxyApiBaseClass { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([this, enabled]) as List?; + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, enabled]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2600,8 +2724,10 @@ class WebSettings extends PigeonInternalProxyApiBaseClass { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([this, enabled]) as List?; + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, enabled]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2628,8 +2754,10 @@ class WebSettings extends PigeonInternalProxyApiBaseClass { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([this, enabled]) as List?; + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, enabled]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2656,8 +2784,10 @@ class WebSettings extends PigeonInternalProxyApiBaseClass { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([this, enabled]) as List?; + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, enabled]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2684,8 +2814,10 @@ class WebSettings extends PigeonInternalProxyApiBaseClass { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([this, textZoom]) as List?; + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, textZoom]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2712,8 +2844,10 @@ class WebSettings extends PigeonInternalProxyApiBaseClass { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); final List? pigeonVar_replyList = - await pigeonVar_channel.send([this]) as List?; + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2757,18 +2891,19 @@ class JavaScriptChannel extends PigeonInternalProxyApiBaseClass { final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = _pigeonVar_codecJavaScriptChannel; final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_android.JavaScriptChannel.pigeon_defaultConstructor'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = pigeonVar_channel + .send([pigeonVar_instanceIdentifier, channelName]); () async { - const String pigeonVar_channelName = - 'dev.flutter.pigeon.webview_flutter_android.JavaScriptChannel.pigeon_defaultConstructor'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( - pigeonVar_channelName, - pigeonChannelCodec, - binaryMessenger: pigeonVar_binaryMessenger, - ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([pigeonVar_instanceIdentifier, channelName]) - as List?; + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2902,23 +3037,32 @@ class WebViewClient extends PigeonInternalProxyApiBaseClass { this.urlLoading, this.doUpdateVisitedHistory, this.onReceivedHttpAuthRequest, + this.onFormResubmission, + this.onLoadResource, + this.onPageCommitVisible, + this.onReceivedClientCertRequest, + this.onReceivedLoginRequest, + this.onReceivedSslError, + this.onScaleChanged, }) { final int pigeonVar_instanceIdentifier = pigeon_instanceManager.addDartCreatedInstance(this); final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = _pigeonVar_codecWebViewClient; final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_android.WebViewClient.pigeon_defaultConstructor'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([pigeonVar_instanceIdentifier]); () async { - const String pigeonVar_channelName = - 'dev.flutter.pigeon.webview_flutter_android.WebViewClient.pigeon_defaultConstructor'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( - pigeonVar_channelName, - pigeonChannelCodec, - binaryMessenger: pigeonVar_binaryMessenger, - ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([pigeonVar_instanceIdentifier]) as List?; + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2951,6 +3095,13 @@ class WebViewClient extends PigeonInternalProxyApiBaseClass { this.urlLoading, this.doUpdateVisitedHistory, this.onReceivedHttpAuthRequest, + this.onFormResubmission, + this.onLoadResource, + this.onPageCommitVisible, + this.onReceivedClientCertRequest, + this.onReceivedLoginRequest, + this.onReceivedSslError, + this.onScaleChanged, }); late final _PigeonInternalProxyApiBaseCodec _pigeonVar_codecWebViewClient = @@ -3218,6 +3369,192 @@ class WebViewClient extends PigeonInternalProxyApiBaseClass { String realm, )? onReceivedHttpAuthRequest; + /// Ask the host application if the browser should resend data as the + /// requested page was a result of a POST. + /// + /// For the associated Native object to be automatically garbage collected, + /// it is required that the implementation of this `Function` doesn't have a + /// strong reference to the encapsulating class instance. When this `Function` + /// references a non-local variable, it is strongly recommended to access it + /// with a `WeakReference`: + /// + /// ```dart + /// final WeakReference weakMyVariable = WeakReference(myVariable); + /// final WebViewClient instance = WebViewClient( + /// onFormResubmission: (WebViewClient pigeon_instance, ...) { + /// print(weakMyVariable?.target); + /// }, + /// ); + /// ``` + /// + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to + /// release the associated Native object manually. + final void Function( + WebViewClient pigeon_instance, + WebView view, + AndroidMessage dontResend, + AndroidMessage resend, + )? onFormResubmission; + + /// Notify the host application that the WebView will load the resource + /// specified by the given url. + /// + /// For the associated Native object to be automatically garbage collected, + /// it is required that the implementation of this `Function` doesn't have a + /// strong reference to the encapsulating class instance. When this `Function` + /// references a non-local variable, it is strongly recommended to access it + /// with a `WeakReference`: + /// + /// ```dart + /// final WeakReference weakMyVariable = WeakReference(myVariable); + /// final WebViewClient instance = WebViewClient( + /// onLoadResource: (WebViewClient pigeon_instance, ...) { + /// print(weakMyVariable?.target); + /// }, + /// ); + /// ``` + /// + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to + /// release the associated Native object manually. + final void Function( + WebViewClient pigeon_instance, + WebView view, + String url, + )? onLoadResource; + + /// Notify the host application that WebView content left over from previous + /// page navigations will no longer be drawn. + /// + /// For the associated Native object to be automatically garbage collected, + /// it is required that the implementation of this `Function` doesn't have a + /// strong reference to the encapsulating class instance. When this `Function` + /// references a non-local variable, it is strongly recommended to access it + /// with a `WeakReference`: + /// + /// ```dart + /// final WeakReference weakMyVariable = WeakReference(myVariable); + /// final WebViewClient instance = WebViewClient( + /// onPageCommitVisible: (WebViewClient pigeon_instance, ...) { + /// print(weakMyVariable?.target); + /// }, + /// ); + /// ``` + /// + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to + /// release the associated Native object manually. + final void Function( + WebViewClient pigeon_instance, + WebView view, + String url, + )? onPageCommitVisible; + + /// Notify the host application to handle a SSL client certificate request. + /// + /// For the associated Native object to be automatically garbage collected, + /// it is required that the implementation of this `Function` doesn't have a + /// strong reference to the encapsulating class instance. When this `Function` + /// references a non-local variable, it is strongly recommended to access it + /// with a `WeakReference`: + /// + /// ```dart + /// final WeakReference weakMyVariable = WeakReference(myVariable); + /// final WebViewClient instance = WebViewClient( + /// onReceivedClientCertRequest: (WebViewClient pigeon_instance, ...) { + /// print(weakMyVariable?.target); + /// }, + /// ); + /// ``` + /// + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to + /// release the associated Native object manually. + final void Function( + WebViewClient pigeon_instance, + WebView view, + ClientCertRequest request, + )? onReceivedClientCertRequest; + + /// Notify the host application that a request to automatically log in the + /// user has been processed. + /// + /// For the associated Native object to be automatically garbage collected, + /// it is required that the implementation of this `Function` doesn't have a + /// strong reference to the encapsulating class instance. When this `Function` + /// references a non-local variable, it is strongly recommended to access it + /// with a `WeakReference`: + /// + /// ```dart + /// final WeakReference weakMyVariable = WeakReference(myVariable); + /// final WebViewClient instance = WebViewClient( + /// onReceivedLoginRequest: (WebViewClient pigeon_instance, ...) { + /// print(weakMyVariable?.target); + /// }, + /// ); + /// ``` + /// + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to + /// release the associated Native object manually. + final void Function( + WebViewClient pigeon_instance, + WebView view, + String realm, + String? account, + String args, + )? onReceivedLoginRequest; + + /// Notifies the host application that an SSL error occurred while loading a + /// resource. + /// + /// For the associated Native object to be automatically garbage collected, + /// it is required that the implementation of this `Function` doesn't have a + /// strong reference to the encapsulating class instance. When this `Function` + /// references a non-local variable, it is strongly recommended to access it + /// with a `WeakReference`: + /// + /// ```dart + /// final WeakReference weakMyVariable = WeakReference(myVariable); + /// final WebViewClient instance = WebViewClient( + /// onReceivedSslError: (WebViewClient pigeon_instance, ...) { + /// print(weakMyVariable?.target); + /// }, + /// ); + /// ``` + /// + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to + /// release the associated Native object manually. + final void Function( + WebViewClient pigeon_instance, + WebView view, + SslErrorHandler handler, + SslError error, + )? onReceivedSslError; + + /// Notify the host application that the scale applied to the WebView has + /// changed. + /// + /// For the associated Native object to be automatically garbage collected, + /// it is required that the implementation of this `Function` doesn't have a + /// strong reference to the encapsulating class instance. When this `Function` + /// references a non-local variable, it is strongly recommended to access it + /// with a `WeakReference`: + /// + /// ```dart + /// final WeakReference weakMyVariable = WeakReference(myVariable); + /// final WebViewClient instance = WebViewClient( + /// onScaleChanged: (WebViewClient pigeon_instance, ...) { + /// print(weakMyVariable?.target); + /// }, + /// ); + /// ``` + /// + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to + /// release the associated Native object manually. + final void Function( + WebViewClient pigeon_instance, + WebView view, + double oldScale, + double newScale, + )? onScaleChanged; + static void pigeon_setUpMessageHandlers({ bool pigeon_clearHandlers = false, BinaryMessenger? pigeon_binaryMessenger, @@ -3281,6 +3618,46 @@ class WebViewClient extends PigeonInternalProxyApiBaseClass { String host, String realm, )? onReceivedHttpAuthRequest, + void Function( + WebViewClient pigeon_instance, + WebView view, + AndroidMessage dontResend, + AndroidMessage resend, + )? onFormResubmission, + void Function( + WebViewClient pigeon_instance, + WebView view, + String url, + )? onLoadResource, + void Function( + WebViewClient pigeon_instance, + WebView view, + String url, + )? onPageCommitVisible, + void Function( + WebViewClient pigeon_instance, + WebView view, + ClientCertRequest request, + )? onReceivedClientCertRequest, + void Function( + WebViewClient pigeon_instance, + WebView view, + String realm, + String? account, + String args, + )? onReceivedLoginRequest, + void Function( + WebViewClient pigeon_instance, + WebView view, + SslErrorHandler handler, + SslError error, + )? onReceivedSslError, + void Function( + WebViewClient pigeon_instance, + WebView view, + double oldScale, + double newScale, + )? onScaleChanged, }) { final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = _PigeonInternalProxyApiBaseCodec( @@ -3746,19 +4123,304 @@ class WebViewClient extends PigeonInternalProxyApiBaseClass { }); } } - } - /// Sets the required synchronous return value for the Java method, - /// `WebViewClient.shouldOverrideUrlLoading(...)`. - /// - /// The Java method, `WebViewClient.shouldOverrideUrlLoading(...)`, requires - /// a boolean to be returned and this method sets the returned value for all - /// calls to the Java method. - /// - /// Setting this to true causes the current [WebView] to abort loading any URL - /// received by [requestLoading] or [urlLoading], while setting this to false - /// causes the [WebView] to continue loading a URL as usual. - /// + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_android.WebViewClient.onFormResubmission', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (pigeon_clearHandlers) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.webview_flutter_android.WebViewClient.onFormResubmission was null.'); + final List args = (message as List?)!; + final WebViewClient? arg_pigeon_instance = + (args[0] as WebViewClient?); + assert(arg_pigeon_instance != null, + 'Argument for dev.flutter.pigeon.webview_flutter_android.WebViewClient.onFormResubmission was null, expected non-null WebViewClient.'); + final WebView? arg_view = (args[1] as WebView?); + assert(arg_view != null, + 'Argument for dev.flutter.pigeon.webview_flutter_android.WebViewClient.onFormResubmission was null, expected non-null WebView.'); + final AndroidMessage? arg_dontResend = (args[2] as AndroidMessage?); + assert(arg_dontResend != null, + 'Argument for dev.flutter.pigeon.webview_flutter_android.WebViewClient.onFormResubmission was null, expected non-null AndroidMessage.'); + final AndroidMessage? arg_resend = (args[3] as AndroidMessage?); + assert(arg_resend != null, + 'Argument for dev.flutter.pigeon.webview_flutter_android.WebViewClient.onFormResubmission was null, expected non-null AndroidMessage.'); + try { + (onFormResubmission ?? arg_pigeon_instance!.onFormResubmission) + ?.call(arg_pigeon_instance!, arg_view!, arg_dontResend!, + arg_resend!); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_android.WebViewClient.onLoadResource', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (pigeon_clearHandlers) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.webview_flutter_android.WebViewClient.onLoadResource was null.'); + final List args = (message as List?)!; + final WebViewClient? arg_pigeon_instance = + (args[0] as WebViewClient?); + assert(arg_pigeon_instance != null, + 'Argument for dev.flutter.pigeon.webview_flutter_android.WebViewClient.onLoadResource was null, expected non-null WebViewClient.'); + final WebView? arg_view = (args[1] as WebView?); + assert(arg_view != null, + 'Argument for dev.flutter.pigeon.webview_flutter_android.WebViewClient.onLoadResource was null, expected non-null WebView.'); + final String? arg_url = (args[2] as String?); + assert(arg_url != null, + 'Argument for dev.flutter.pigeon.webview_flutter_android.WebViewClient.onLoadResource was null, expected non-null String.'); + try { + (onLoadResource ?? arg_pigeon_instance!.onLoadResource) + ?.call(arg_pigeon_instance!, arg_view!, arg_url!); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_android.WebViewClient.onPageCommitVisible', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (pigeon_clearHandlers) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.webview_flutter_android.WebViewClient.onPageCommitVisible was null.'); + final List args = (message as List?)!; + final WebViewClient? arg_pigeon_instance = + (args[0] as WebViewClient?); + assert(arg_pigeon_instance != null, + 'Argument for dev.flutter.pigeon.webview_flutter_android.WebViewClient.onPageCommitVisible was null, expected non-null WebViewClient.'); + final WebView? arg_view = (args[1] as WebView?); + assert(arg_view != null, + 'Argument for dev.flutter.pigeon.webview_flutter_android.WebViewClient.onPageCommitVisible was null, expected non-null WebView.'); + final String? arg_url = (args[2] as String?); + assert(arg_url != null, + 'Argument for dev.flutter.pigeon.webview_flutter_android.WebViewClient.onPageCommitVisible was null, expected non-null String.'); + try { + (onPageCommitVisible ?? arg_pigeon_instance!.onPageCommitVisible) + ?.call(arg_pigeon_instance!, arg_view!, arg_url!); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedClientCertRequest', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (pigeon_clearHandlers) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedClientCertRequest was null.'); + final List args = (message as List?)!; + final WebViewClient? arg_pigeon_instance = + (args[0] as WebViewClient?); + assert(arg_pigeon_instance != null, + 'Argument for dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedClientCertRequest was null, expected non-null WebViewClient.'); + final WebView? arg_view = (args[1] as WebView?); + assert(arg_view != null, + 'Argument for dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedClientCertRequest was null, expected non-null WebView.'); + final ClientCertRequest? arg_request = + (args[2] as ClientCertRequest?); + assert(arg_request != null, + 'Argument for dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedClientCertRequest was null, expected non-null ClientCertRequest.'); + try { + (onReceivedClientCertRequest ?? + arg_pigeon_instance!.onReceivedClientCertRequest) + ?.call(arg_pigeon_instance!, arg_view!, arg_request!); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedLoginRequest', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (pigeon_clearHandlers) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedLoginRequest was null.'); + final List args = (message as List?)!; + final WebViewClient? arg_pigeon_instance = + (args[0] as WebViewClient?); + assert(arg_pigeon_instance != null, + 'Argument for dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedLoginRequest was null, expected non-null WebViewClient.'); + final WebView? arg_view = (args[1] as WebView?); + assert(arg_view != null, + 'Argument for dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedLoginRequest was null, expected non-null WebView.'); + final String? arg_realm = (args[2] as String?); + assert(arg_realm != null, + 'Argument for dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedLoginRequest was null, expected non-null String.'); + final String? arg_account = (args[3] as String?); + final String? arg_args = (args[4] as String?); + assert(arg_args != null, + 'Argument for dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedLoginRequest was null, expected non-null String.'); + try { + (onReceivedLoginRequest ?? + arg_pigeon_instance!.onReceivedLoginRequest) + ?.call(arg_pigeon_instance!, arg_view!, arg_realm!, arg_account, + arg_args!); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedSslError', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (pigeon_clearHandlers) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedSslError was null.'); + final List args = (message as List?)!; + final WebViewClient? arg_pigeon_instance = + (args[0] as WebViewClient?); + assert(arg_pigeon_instance != null, + 'Argument for dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedSslError was null, expected non-null WebViewClient.'); + final WebView? arg_view = (args[1] as WebView?); + assert(arg_view != null, + 'Argument for dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedSslError was null, expected non-null WebView.'); + final SslErrorHandler? arg_handler = (args[2] as SslErrorHandler?); + assert(arg_handler != null, + 'Argument for dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedSslError was null, expected non-null SslErrorHandler.'); + final SslError? arg_error = (args[3] as SslError?); + assert(arg_error != null, + 'Argument for dev.flutter.pigeon.webview_flutter_android.WebViewClient.onReceivedSslError was null, expected non-null SslError.'); + try { + (onReceivedSslError ?? arg_pigeon_instance!.onReceivedSslError) + ?.call( + arg_pigeon_instance!, arg_view!, arg_handler!, arg_error!); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_android.WebViewClient.onScaleChanged', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (pigeon_clearHandlers) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.webview_flutter_android.WebViewClient.onScaleChanged was null.'); + final List args = (message as List?)!; + final WebViewClient? arg_pigeon_instance = + (args[0] as WebViewClient?); + assert(arg_pigeon_instance != null, + 'Argument for dev.flutter.pigeon.webview_flutter_android.WebViewClient.onScaleChanged was null, expected non-null WebViewClient.'); + final WebView? arg_view = (args[1] as WebView?); + assert(arg_view != null, + 'Argument for dev.flutter.pigeon.webview_flutter_android.WebViewClient.onScaleChanged was null, expected non-null WebView.'); + final double? arg_oldScale = (args[2] as double?); + assert(arg_oldScale != null, + 'Argument for dev.flutter.pigeon.webview_flutter_android.WebViewClient.onScaleChanged was null, expected non-null double.'); + final double? arg_newScale = (args[3] as double?); + assert(arg_newScale != null, + 'Argument for dev.flutter.pigeon.webview_flutter_android.WebViewClient.onScaleChanged was null, expected non-null double.'); + try { + (onScaleChanged ?? arg_pigeon_instance!.onScaleChanged)?.call( + arg_pigeon_instance!, arg_view!, arg_oldScale!, arg_newScale!); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + } + + /// Sets the required synchronous return value for the Java method, + /// `WebViewClient.shouldOverrideUrlLoading(...)`. + /// + /// The Java method, `WebViewClient.shouldOverrideUrlLoading(...)`, requires + /// a boolean to be returned and this method sets the returned value for all + /// calls to the Java method. + /// + /// Setting this to true causes the current [WebView] to abort loading any URL + /// received by [requestLoading] or [urlLoading], while setting this to false + /// causes the [WebView] to continue loading a URL as usual. + /// /// Defaults to false. Future setSynchronousReturnValueForShouldOverrideUrlLoading( bool value) async { @@ -3773,8 +4435,10 @@ class WebViewClient extends PigeonInternalProxyApiBaseClass { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, value]); final List? pigeonVar_replyList = - await pigeonVar_channel.send([this, value]) as List?; + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -3803,6 +4467,13 @@ class WebViewClient extends PigeonInternalProxyApiBaseClass { urlLoading: urlLoading, doUpdateVisitedHistory: doUpdateVisitedHistory, onReceivedHttpAuthRequest: onReceivedHttpAuthRequest, + onFormResubmission: onFormResubmission, + onLoadResource: onLoadResource, + onPageCommitVisible: onPageCommitVisible, + onReceivedClientCertRequest: onReceivedClientCertRequest, + onReceivedLoginRequest: onReceivedLoginRequest, + onReceivedSslError: onReceivedSslError, + onScaleChanged: onScaleChanged, ); } } @@ -3821,17 +4492,19 @@ class DownloadListener extends PigeonInternalProxyApiBaseClass { final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = _pigeonVar_codecDownloadListener; final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_android.DownloadListener.pigeon_defaultConstructor'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([pigeonVar_instanceIdentifier]); () async { - const String pigeonVar_channelName = - 'dev.flutter.pigeon.webview_flutter_android.DownloadListener.pigeon_defaultConstructor'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( - pigeonVar_channelName, - pigeonChannelCodec, - binaryMessenger: pigeonVar_binaryMessenger, - ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([pigeonVar_instanceIdentifier]) as List?; + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -3977,7 +4650,7 @@ class WebChromeClient extends PigeonInternalProxyApiBaseClass { super.pigeon_binaryMessenger, super.pigeon_instanceManager, this.onProgressChanged, - this.onShowFileChooser, + required this.onShowFileChooser, this.onPermissionRequest, this.onShowCustomView, this.onHideCustomView, @@ -3985,7 +4658,7 @@ class WebChromeClient extends PigeonInternalProxyApiBaseClass { this.onGeolocationPermissionsHidePrompt, this.onConsoleMessage, this.onJsAlert, - this.onJsConfirm, + required this.onJsConfirm, this.onJsPrompt, }) { final int pigeonVar_instanceIdentifier = @@ -3993,17 +4666,19 @@ class WebChromeClient extends PigeonInternalProxyApiBaseClass { final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = _pigeonVar_codecWebChromeClient; final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_android.WebChromeClient.pigeon_defaultConstructor'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([pigeonVar_instanceIdentifier]); () async { - const String pigeonVar_channelName = - 'dev.flutter.pigeon.webview_flutter_android.WebChromeClient.pigeon_defaultConstructor'; - final BasicMessageChannel pigeonVar_channel = - BasicMessageChannel( - pigeonVar_channelName, - pigeonChannelCodec, - binaryMessenger: pigeonVar_binaryMessenger, - ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([pigeonVar_instanceIdentifier]) as List?; + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -4027,7 +4702,7 @@ class WebChromeClient extends PigeonInternalProxyApiBaseClass { super.pigeon_binaryMessenger, super.pigeon_instanceManager, this.onProgressChanged, - this.onShowFileChooser, + required this.onShowFileChooser, this.onPermissionRequest, this.onShowCustomView, this.onHideCustomView, @@ -4035,7 +4710,7 @@ class WebChromeClient extends PigeonInternalProxyApiBaseClass { this.onGeolocationPermissionsHidePrompt, this.onConsoleMessage, this.onJsAlert, - this.onJsConfirm, + required this.onJsConfirm, this.onJsPrompt, }); @@ -4090,7 +4765,7 @@ class WebChromeClient extends PigeonInternalProxyApiBaseClass { WebChromeClient pigeon_instance, WebView webView, FileChooserParams params, - )? onShowFileChooser; + ) onShowFileChooser; /// Notify the host application that web content is requesting permission to /// access the specified resources and the permission currently isn't granted @@ -4292,7 +4967,7 @@ class WebChromeClient extends PigeonInternalProxyApiBaseClass { WebView webView, String url, String message, - )? onJsConfirm; + ) onJsConfirm; /// Notify the host application that the web page wants to display a /// JavaScript `prompt()` dialog. @@ -4326,7 +5001,6 @@ class WebChromeClient extends PigeonInternalProxyApiBaseClass { bool pigeon_clearHandlers = false, BinaryMessenger? pigeon_binaryMessenger, PigeonInstanceManager? pigeon_instanceManager, - WebChromeClient Function()? pigeon_newInstance, void Function( WebChromeClient pigeon_instance, WebView webView, @@ -4386,7 +5060,7 @@ class WebChromeClient extends PigeonInternalProxyApiBaseClass { final BasicMessageChannel< Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.webview_flutter_android.WebChromeClient.pigeon_newInstance', + 'dev.flutter.pigeon.webview_flutter_android.WebChromeClient.onProgressChanged', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { @@ -4394,45 +5068,7 @@ class WebChromeClient extends PigeonInternalProxyApiBaseClass { } else { pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_android.WebChromeClient.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_android.WebChromeClient.pigeon_newInstance was null, expected non-null int.'); - try { - (pigeon_instanceManager ?? PigeonInstanceManager.instance) - .addHostCreatedInstance( - pigeon_newInstance?.call() ?? - WebChromeClient.pigeon_detached( - pigeon_binaryMessenger: pigeon_binaryMessenger, - pigeon_instanceManager: pigeon_instanceManager, - ), - arg_pigeon_instanceIdentifier!, - ); - return wrapResponse(empty: true); - } on PlatformException catch (e) { - return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); - } - }); - } - } - - { - final BasicMessageChannel< - Object?> pigeonVar_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.webview_flutter_android.WebChromeClient.onProgressChanged', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); - if (pigeon_clearHandlers) { - pigeonVar_channel.setMessageHandler(null); - } else { - pigeonVar_channel.setMessageHandler((Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.webview_flutter_android.WebChromeClient.onProgressChanged was null.'); + 'Argument for dev.flutter.pigeon.webview_flutter_android.WebChromeClient.onProgressChanged was null.'); final List args = (message as List?)!; final WebChromeClient? arg_pigeon_instance = (args[0] as WebChromeClient?); @@ -4483,9 +5119,9 @@ class WebChromeClient extends PigeonInternalProxyApiBaseClass { assert(arg_params != null, 'Argument for dev.flutter.pigeon.webview_flutter_android.WebChromeClient.onShowFileChooser was null, expected non-null FileChooserParams.'); try { - final List? output = await (onShowFileChooser ?? + final List output = await (onShowFileChooser ?? arg_pigeon_instance!.onShowFileChooser) - ?.call(arg_pigeon_instance!, arg_webView!, arg_params!); + .call(arg_pigeon_instance!, arg_webView!, arg_params!); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -4781,8 +5417,8 @@ class WebChromeClient extends PigeonInternalProxyApiBaseClass { assert(arg_message != null, 'Argument for dev.flutter.pigeon.webview_flutter_android.WebChromeClient.onJsConfirm was null, expected non-null String.'); try { - final bool? output = - await (onJsConfirm ?? arg_pigeon_instance!.onJsConfirm)?.call( + final bool output = + await (onJsConfirm ?? arg_pigeon_instance!.onJsConfirm).call( arg_pigeon_instance!, arg_webView!, arg_url!, arg_message!); return wrapResponse(result: output); } on PlatformException catch (e) { @@ -4872,8 +5508,10 @@ class WebChromeClient extends PigeonInternalProxyApiBaseClass { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, value]); final List? pigeonVar_replyList = - await pigeonVar_channel.send([this, value]) as List?; + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -4912,8 +5550,10 @@ class WebChromeClient extends PigeonInternalProxyApiBaseClass { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, value]); final List? pigeonVar_replyList = - await pigeonVar_channel.send([this, value]) as List?; + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -4952,8 +5592,10 @@ class WebChromeClient extends PigeonInternalProxyApiBaseClass { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, value]); final List? pigeonVar_replyList = - await pigeonVar_channel.send([this, value]) as List?; + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -4992,8 +5634,10 @@ class WebChromeClient extends PigeonInternalProxyApiBaseClass { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, value]); final List? pigeonVar_replyList = - await pigeonVar_channel.send([this, value]) as List?; + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -5032,8 +5676,10 @@ class WebChromeClient extends PigeonInternalProxyApiBaseClass { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, value]); final List? pigeonVar_replyList = - await pigeonVar_channel.send([this, value]) as List?; + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -5155,8 +5801,10 @@ class FlutterAssetManager extends PigeonInternalProxyApiBaseClass { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([pigeonVar_instanceIdentifier]) as List?; + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([pigeonVar_instanceIdentifier]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -5187,8 +5835,10 @@ class FlutterAssetManager extends PigeonInternalProxyApiBaseClass { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, path]); final List? pigeonVar_replyList = - await pigeonVar_channel.send([this, path]) as List?; + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -5226,8 +5876,10 @@ class FlutterAssetManager extends PigeonInternalProxyApiBaseClass { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, name]); final List? pigeonVar_replyList = - await pigeonVar_channel.send([this, name]) as List?; + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -5341,8 +5993,10 @@ class WebStorage extends PigeonInternalProxyApiBaseClass { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([pigeonVar_instanceIdentifier]) as List?; + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([pigeonVar_instanceIdentifier]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -5371,8 +6025,10 @@ class WebStorage extends PigeonInternalProxyApiBaseClass { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); final List? pigeonVar_replyList = - await pigeonVar_channel.send([this]) as List?; + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -5598,8 +6254,10 @@ class PermissionRequest extends PigeonInternalProxyApiBaseClass { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([this, resources]) as List?; + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, resources]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -5626,8 +6284,10 @@ class PermissionRequest extends PigeonInternalProxyApiBaseClass { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); final List? pigeonVar_replyList = - await pigeonVar_channel.send([this]) as List?; + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -5732,8 +6392,10 @@ class CustomViewCallback extends PigeonInternalProxyApiBaseClass { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); final List? pigeonVar_replyList = - await pigeonVar_channel.send([this]) as List?; + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -5839,8 +6501,10 @@ class View extends PigeonInternalProxyApiBaseClass { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, x, y]); final List? pigeonVar_replyList = - await pigeonVar_channel.send([this, x, y]) as List?; + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -5870,8 +6534,10 @@ class View extends PigeonInternalProxyApiBaseClass { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, x, y]); final List? pigeonVar_replyList = - await pigeonVar_channel.send([this, x, y]) as List?; + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -5898,8 +6564,10 @@ class View extends PigeonInternalProxyApiBaseClass { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); final List? pigeonVar_replyList = - await pigeonVar_channel.send([this]) as List?; + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -6012,8 +6680,10 @@ class GeolocationPermissionsCallback extends PigeonInternalProxyApiBaseClass { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([this, origin, allow, retain]) as List?; + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, origin, allow, retain]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -6117,8 +6787,10 @@ class HttpAuthHandler extends PigeonInternalProxyApiBaseClass { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); final List? pigeonVar_replyList = - await pigeonVar_channel.send([this]) as List?; + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -6150,8 +6822,10 @@ class HttpAuthHandler extends PigeonInternalProxyApiBaseClass { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); final List? pigeonVar_replyList = - await pigeonVar_channel.send([this]) as List?; + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -6182,8 +6856,10 @@ class HttpAuthHandler extends PigeonInternalProxyApiBaseClass { pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([this, username, password]) as List?; + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, username, password]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -6205,3 +6881,1185 @@ class HttpAuthHandler extends PigeonInternalProxyApiBaseClass { ); } } + +/// Defines a message containing a description and arbitrary data object that +/// can be sent to a `Handler`. +/// +/// See https://developer.android.com/reference/android/os/Message. +class AndroidMessage extends PigeonInternalProxyApiBaseClass { + /// Constructs [AndroidMessage] without creating the associated native object. + /// + /// This should only be used by subclasses created by this library or to + /// create copies for an [PigeonInstanceManager]. + @protected + AndroidMessage.pigeon_detached({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + }); + + late final _PigeonInternalProxyApiBaseCodec _pigeonVar_codecAndroidMessage = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); + + static void pigeon_setUpMessageHandlers({ + bool pigeon_clearHandlers = false, + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + AndroidMessage Function()? pigeon_newInstance, + }) { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( + pigeon_instanceManager ?? PigeonInstanceManager.instance); + final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_android.AndroidMessage.pigeon_newInstance', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (pigeon_clearHandlers) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.webview_flutter_android.AndroidMessage.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_android.AndroidMessage.pigeon_newInstance was null, expected non-null int.'); + try { + (pigeon_instanceManager ?? PigeonInstanceManager.instance) + .addHostCreatedInstance( + pigeon_newInstance?.call() ?? + AndroidMessage.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + ), + arg_pigeon_instanceIdentifier!, + ); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + } + + /// Sends this message to the Android native `Handler` specified by + /// getTarget(). + /// + /// Throws a null pointer exception if this field has not been set. + Future sendToTarget() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecAndroidMessage; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_android.AndroidMessage.sendToTarget'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + } + + @override + AndroidMessage pigeon_copy() { + return AndroidMessage.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + ); + } +} + +/// Defines a message containing a description and arbitrary data object that +/// can be sent to a `Handler`. +/// +/// See https://developer.android.com/reference/android/webkit/ClientCertRequest. +class ClientCertRequest extends PigeonInternalProxyApiBaseClass { + /// Constructs [ClientCertRequest] without creating the associated native object. + /// + /// This should only be used by subclasses created by this library or to + /// create copies for an [PigeonInstanceManager]. + @protected + ClientCertRequest.pigeon_detached({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + }); + + late final _PigeonInternalProxyApiBaseCodec + _pigeonVar_codecClientCertRequest = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); + + static void pigeon_setUpMessageHandlers({ + bool pigeon_clearHandlers = false, + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + ClientCertRequest Function()? pigeon_newInstance, + }) { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( + pigeon_instanceManager ?? PigeonInstanceManager.instance); + final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_android.ClientCertRequest.pigeon_newInstance', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (pigeon_clearHandlers) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.webview_flutter_android.ClientCertRequest.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_android.ClientCertRequest.pigeon_newInstance was null, expected non-null int.'); + try { + (pigeon_instanceManager ?? PigeonInstanceManager.instance) + .addHostCreatedInstance( + pigeon_newInstance?.call() ?? + ClientCertRequest.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + ), + arg_pigeon_instanceIdentifier!, + ); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + } + + /// Cancel this request. + Future cancel() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecClientCertRequest; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_android.ClientCertRequest.cancel'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + } + + /// Ignore the request for now. + Future ignore() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecClientCertRequest; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_android.ClientCertRequest.ignore'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + } + + /// Proceed with the specified private key and client certificate chain. + Future proceed( + PrivateKey privateKey, + List chain, + ) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecClientCertRequest; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_android.ClientCertRequest.proceed'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, privateKey, chain]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + } + + @override + ClientCertRequest pigeon_copy() { + return ClientCertRequest.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + ); + } +} + +/// A private key. +/// +/// The purpose of this interface is to group (and provide type safety for) all +/// private key interfaces. +/// +/// See https://developer.android.com/reference/java/security/PrivateKey. +class PrivateKey extends PigeonInternalProxyApiBaseClass { + /// Constructs [PrivateKey] without creating the associated native object. + /// + /// This should only be used by subclasses created by this library or to + /// create copies for an [PigeonInstanceManager]. + @protected + PrivateKey.pigeon_detached({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + }); + + static void pigeon_setUpMessageHandlers({ + bool pigeon_clearHandlers = false, + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + PrivateKey Function()? pigeon_newInstance, + }) { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( + pigeon_instanceManager ?? PigeonInstanceManager.instance); + final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_android.PrivateKey.pigeon_newInstance', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (pigeon_clearHandlers) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.webview_flutter_android.PrivateKey.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_android.PrivateKey.pigeon_newInstance was null, expected non-null int.'); + try { + (pigeon_instanceManager ?? PigeonInstanceManager.instance) + .addHostCreatedInstance( + pigeon_newInstance?.call() ?? + PrivateKey.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + ), + arg_pigeon_instanceIdentifier!, + ); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + } + + @override + PrivateKey pigeon_copy() { + return PrivateKey.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + ); + } +} + +/// Abstract class for X.509 certificates. +/// +/// This provides a standard way to access all the attributes of an X.509 +/// certificate. +/// +/// See https://developer.android.com/reference/java/security/cert/X509Certificate. +class X509Certificate extends PigeonInternalProxyApiBaseClass { + /// Constructs [X509Certificate] without creating the associated native object. + /// + /// This should only be used by subclasses created by this library or to + /// create copies for an [PigeonInstanceManager]. + @protected + X509Certificate.pigeon_detached({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + }); + + static void pigeon_setUpMessageHandlers({ + bool pigeon_clearHandlers = false, + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + X509Certificate Function()? pigeon_newInstance, + }) { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( + pigeon_instanceManager ?? PigeonInstanceManager.instance); + final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_android.X509Certificate.pigeon_newInstance', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (pigeon_clearHandlers) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.webview_flutter_android.X509Certificate.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_android.X509Certificate.pigeon_newInstance was null, expected non-null int.'); + try { + (pigeon_instanceManager ?? PigeonInstanceManager.instance) + .addHostCreatedInstance( + pigeon_newInstance?.call() ?? + X509Certificate.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + ), + arg_pigeon_instanceIdentifier!, + ); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + } + + @override + X509Certificate pigeon_copy() { + return X509Certificate.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + ); + } +} + +/// Represents a request for handling an SSL error. +/// +/// See https://developer.android.com/reference/android/webkit/SslErrorHandler. +class SslErrorHandler extends PigeonInternalProxyApiBaseClass { + /// Constructs [SslErrorHandler] without creating the associated native object. + /// + /// This should only be used by subclasses created by this library or to + /// create copies for an [PigeonInstanceManager]. + @protected + SslErrorHandler.pigeon_detached({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + }); + + late final _PigeonInternalProxyApiBaseCodec _pigeonVar_codecSslErrorHandler = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); + + static void pigeon_setUpMessageHandlers({ + bool pigeon_clearHandlers = false, + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + SslErrorHandler Function()? pigeon_newInstance, + }) { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( + pigeon_instanceManager ?? PigeonInstanceManager.instance); + final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_android.SslErrorHandler.pigeon_newInstance', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (pigeon_clearHandlers) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.webview_flutter_android.SslErrorHandler.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_android.SslErrorHandler.pigeon_newInstance was null, expected non-null int.'); + try { + (pigeon_instanceManager ?? PigeonInstanceManager.instance) + .addHostCreatedInstance( + pigeon_newInstance?.call() ?? + SslErrorHandler.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + ), + arg_pigeon_instanceIdentifier!, + ); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + } + + /// Instructs the WebView that encountered the SSL certificate error to + /// terminate communication with the server. + Future cancel() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecSslErrorHandler; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_android.SslErrorHandler.cancel'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + } + + /// Instructs the WebView that encountered the SSL certificate error to ignore + /// the error and continue communicating with the server. + Future proceed() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecSslErrorHandler; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_android.SslErrorHandler.proceed'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + } + + @override + SslErrorHandler pigeon_copy() { + return SslErrorHandler.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + ); + } +} + +/// This class represents a set of one or more SSL errors and the associated SSL +/// certificate. +/// +/// See https://developer.android.com/reference/android/net/http/SslError. +class SslError extends PigeonInternalProxyApiBaseClass { + /// Constructs [SslError] without creating the associated native object. + /// + /// This should only be used by subclasses created by this library or to + /// create copies for an [PigeonInstanceManager]. + @protected + SslError.pigeon_detached({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + required this.certificate, + required this.url, + }); + + late final _PigeonInternalProxyApiBaseCodec _pigeonVar_codecSslError = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); + + /// Gets the SSL certificate associated with this object. + final SslCertificate certificate; + + /// Gets the URL associated with this object. + final String url; + + static void pigeon_setUpMessageHandlers({ + bool pigeon_clearHandlers = false, + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + SslError Function( + SslCertificate certificate, + String url, + )? pigeon_newInstance, + }) { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( + pigeon_instanceManager ?? PigeonInstanceManager.instance); + final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_android.SslError.pigeon_newInstance', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (pigeon_clearHandlers) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.webview_flutter_android.SslError.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_android.SslError.pigeon_newInstance was null, expected non-null int.'); + final SslCertificate? arg_certificate = (args[1] as SslCertificate?); + assert(arg_certificate != null, + 'Argument for dev.flutter.pigeon.webview_flutter_android.SslError.pigeon_newInstance was null, expected non-null SslCertificate.'); + final String? arg_url = (args[2] as String?); + assert(arg_url != null, + 'Argument for dev.flutter.pigeon.webview_flutter_android.SslError.pigeon_newInstance was null, expected non-null String.'); + try { + (pigeon_instanceManager ?? PigeonInstanceManager.instance) + .addHostCreatedInstance( + pigeon_newInstance?.call(arg_certificate!, arg_url!) ?? + SslError.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + certificate: arg_certificate!, + url: arg_url!, + ), + arg_pigeon_instanceIdentifier!, + ); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + } + + /// Gets the most severe SSL error in this object's set of errors. + Future getPrimaryError() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecSslError; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_android.SslError.getPrimaryError'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as SslErrorType?)!; + } + } + + /// Determines whether this object includes the supplied error. + Future hasError(SslErrorType error) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecSslError; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_android.SslError.hasError'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this, error]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as bool?)!; + } + } + + @override + SslError pigeon_copy() { + return SslError.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + certificate: certificate, + url: url, + ); + } +} + +/// A distinguished name helper class. +/// +/// A 3-tuple of: +/// the most specific common name (CN) +/// the most specific organization (O) +/// the most specific organizational unit (OU) +class SslCertificateDName extends PigeonInternalProxyApiBaseClass { + /// Constructs [SslCertificateDName] without creating the associated native object. + /// + /// This should only be used by subclasses created by this library or to + /// create copies for an [PigeonInstanceManager]. + @protected + SslCertificateDName.pigeon_detached({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + }); + + late final _PigeonInternalProxyApiBaseCodec + _pigeonVar_codecSslCertificateDName = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); + + static void pigeon_setUpMessageHandlers({ + bool pigeon_clearHandlers = false, + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + SslCertificateDName Function()? pigeon_newInstance, + }) { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( + pigeon_instanceManager ?? PigeonInstanceManager.instance); + final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_android.SslCertificateDName.pigeon_newInstance', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (pigeon_clearHandlers) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.webview_flutter_android.SslCertificateDName.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_android.SslCertificateDName.pigeon_newInstance was null, expected non-null int.'); + try { + (pigeon_instanceManager ?? PigeonInstanceManager.instance) + .addHostCreatedInstance( + pigeon_newInstance?.call() ?? + SslCertificateDName.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + ), + arg_pigeon_instanceIdentifier!, + ); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + } + + /// The most specific Common-name (CN) component of this name. + Future getCName() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecSslCertificateDName; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_android.SslCertificateDName.getCName'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as String?)!; + } + } + + /// The distinguished name (normally includes CN, O, and OU names). + Future getDName() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecSslCertificateDName; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_android.SslCertificateDName.getDName'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as String?)!; + } + } + + /// The most specific Organization (O) component of this name. + Future getOName() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecSslCertificateDName; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_android.SslCertificateDName.getOName'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as String?)!; + } + } + + /// The most specific Organizational Unit (OU) component of this name. + Future getUName() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecSslCertificateDName; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_android.SslCertificateDName.getUName'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as String?)!; + } + } + + @override + SslCertificateDName pigeon_copy() { + return SslCertificateDName.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + ); + } +} + +/// SSL certificate info (certificate details) class. +/// +/// See https://developer.android.com/reference/android/net/http/SslCertificate. +class SslCertificate extends PigeonInternalProxyApiBaseClass { + /// Constructs [SslCertificate] without creating the associated native object. + /// + /// This should only be used by subclasses created by this library or to + /// create copies for an [PigeonInstanceManager]. + @protected + SslCertificate.pigeon_detached({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + }); + + late final _PigeonInternalProxyApiBaseCodec _pigeonVar_codecSslCertificate = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); + + static void pigeon_setUpMessageHandlers({ + bool pigeon_clearHandlers = false, + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + SslCertificate Function()? pigeon_newInstance, + }) { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( + pigeon_instanceManager ?? PigeonInstanceManager.instance); + final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_android.SslCertificate.pigeon_newInstance', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (pigeon_clearHandlers) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.webview_flutter_android.SslCertificate.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_android.SslCertificate.pigeon_newInstance was null, expected non-null int.'); + try { + (pigeon_instanceManager ?? PigeonInstanceManager.instance) + .addHostCreatedInstance( + pigeon_newInstance?.call() ?? + SslCertificate.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + ), + arg_pigeon_instanceIdentifier!, + ); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + } + + /// Issued-by distinguished name or null if none has been set. + Future getIssuedBy() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecSslCertificate; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_android.SslCertificate.getIssuedBy'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return (pigeonVar_replyList[0] as SslCertificateDName?); + } + } + + /// Issued-to distinguished name or null if none has been set. + Future getIssuedTo() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecSslCertificate; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_android.SslCertificate.getIssuedTo'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return (pigeonVar_replyList[0] as SslCertificateDName?); + } + } + + /// Not-after date from the certificate validity period or null if none has been + /// set. + Future getValidNotAfterMsSinceEpoch() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecSslCertificate; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_android.SslCertificate.getValidNotAfterMsSinceEpoch'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return (pigeonVar_replyList[0] as int?); + } + } + + /// Not-before date from the certificate validity period or null if none has + /// been set. + Future getValidNotBeforeMsSinceEpoch() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecSslCertificate; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_android.SslCertificate.getValidNotBeforeMsSinceEpoch'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return (pigeonVar_replyList[0] as int?); + } + } + + /// The X509Certificate used to create this SslCertificate or null if no + /// certificate was provided. + /// + /// Always returns null on Android versions below Q. + Future getX509Certificate() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecSslCertificate; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_android.SslCertificate.getX509Certificate'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return (pigeonVar_replyList[0] as X509Certificate?); + } + } + + @override + SslCertificate pigeon_copy() { + return SslCertificate.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + ); + } +} diff --git a/packages/webview_flutter/webview_flutter_android/lib/src/android_webview_controller.dart b/packages/webview_flutter/webview_flutter_android/lib/src/android_webview_controller.dart index 7dc1c797376..7317affbd85 100644 --- a/packages/webview_flutter/webview_flutter_android/lib/src/android_webview_controller.dart +++ b/packages/webview_flutter/webview_flutter_android/lib/src/android_webview_controller.dart @@ -1450,6 +1450,25 @@ class AndroidNavigationDelegate extends PlatformNavigationDelegate { httpAuthHandler.cancel(); } }, + onFormResubmission: + (_, __, android_webview.AndroidMessage dontResend, ___) { + dontResend.sendToTarget(); + }, + onReceivedClientCertRequest: ( + _, + __, + android_webview.ClientCertRequest request, + ) { + request.cancel(); + }, + onReceivedSslError: ( + _, + __, + android_webview.SslErrorHandler handler, + ___, + ) { + handler.cancel(); + }, ); _downloadListener = (this.params as AndroidNavigationDelegateCreationParams) @@ -1474,7 +1493,10 @@ class AndroidNavigationDelegate extends PlatformNavigationDelegate { params as AndroidNavigationDelegateCreationParams; late final android_webview.WebChromeClient _webChromeClient = - _androidParams.androidWebViewProxy.newWebChromeClient(); + _androidParams.androidWebViewProxy.newWebChromeClient( + onJsConfirm: (_, __, ___, ____) async => false, + onShowFileChooser: (_, __, ___) async => [], + ); /// Gets the native [android_webview.WebChromeClient] that is bridged by this [AndroidNavigationDelegate]. /// diff --git a/packages/webview_flutter/webview_flutter_android/lib/src/legacy/webview_android_widget.dart b/packages/webview_flutter/webview_flutter_android/lib/src/legacy/webview_android_widget.dart index e17e50ec6df..b9b311a1abc 100644 --- a/packages/webview_flutter/webview_flutter_android/lib/src/legacy/webview_android_widget.dart +++ b/packages/webview_flutter/webview_flutter_android/lib/src/legacy/webview_android_widget.dart @@ -185,6 +185,25 @@ class WebViewAndroidPlatformController extends WebViewPlatformController { ); }; }), + onFormResubmission: + (_, __, android_webview.AndroidMessage dontResend, ___) { + dontResend.sendToTarget(); + }, + onReceivedClientCertRequest: ( + _, + __, + android_webview.ClientCertRequest request, + ) { + request.cancel(); + }, + onReceivedSslError: ( + _, + __, + android_webview.SslErrorHandler handler, + ___, + ) { + handler.cancel(); + }, requestLoading: withWeakReferenceTo(this, ( WeakReference weakReference, ) { @@ -247,18 +266,21 @@ class WebViewAndroidPlatformController extends WebViewPlatformController { @visibleForTesting late final android_webview.WebChromeClient webChromeClient = android_webview.WebChromeClient( - onProgressChanged: withWeakReferenceTo( - this, - (WeakReference weakReference) { - return (_, __, int progress) { - final WebViewAndroidPlatformController? controller = - weakReference.target; - if (controller != null && controller._hasProgressTracking) { - controller.callbacksHandler.onProgress(progress); - } - }; - }, - )); + onProgressChanged: withWeakReferenceTo( + this, + (WeakReference weakReference) { + return (_, __, int progress) { + final WebViewAndroidPlatformController? controller = + weakReference.target; + if (controller != null && controller._hasProgressTracking) { + controller.callbacksHandler.onProgress(progress); + } + }; + }, + ), + onJsConfirm: (_, __, ___, ____) async => false, + onShowFileChooser: (_, __, ___) async => [], + ); /// Manages the JavaScript storage APIs. final android_webview.WebStorage webStorage; @@ -647,6 +669,23 @@ class WebViewProxy { android_webview.WebView webView, android_webview.WebResourceRequest request, )? requestLoading, + void Function( + android_webview.WebViewClient, + android_webview.WebView, + android_webview.AndroidMessage, + android_webview.AndroidMessage, + )? onFormResubmission, + void Function( + android_webview.WebViewClient, + android_webview.WebView, + android_webview.ClientCertRequest, + )? onReceivedClientCertRequest, + void Function( + android_webview.WebViewClient, + android_webview.WebView, + android_webview.SslErrorHandler, + android_webview.SslError, + )? onReceivedSslError, void Function( android_webview.WebViewClient, android_webview.WebView webView, diff --git a/packages/webview_flutter/webview_flutter_android/pigeons/android_webkit.dart b/packages/webview_flutter/webview_flutter_android/pigeons/android_webkit.dart index 8d3a4dbed5c..cc173f8f875 100644 --- a/packages/webview_flutter/webview_flutter_android/pigeons/android_webkit.dart +++ b/packages/webview_flutter/webview_flutter_android/pigeons/android_webkit.dart @@ -80,6 +80,32 @@ enum ConsoleMessageLevel { unknown, } +/// Type of error for a SslCertificate. +/// +/// See https://developer.android.com/reference/android/net/http/SslError#SSL_DATE_INVALID. +enum SslErrorType { + /// The date of the certificate is invalid. + dateInvalid, + + /// The certificate has expired. + expired, + + /// Hostname mismatch. + idMismatch, + + /// A generic error occurred. + invalid, + + /// The certificate is not yet valid. + notYetValid, + + /// The certificate authority is not trusted. + untrusted, + + /// The type is not recognized by this wrapper. + unknown, +} + /// Encompasses parameters to the `WebViewClient.shouldInterceptRequest` method. /// /// See https://developer.android.com/reference/android/webkit/WebResourceRequest. @@ -456,6 +482,49 @@ abstract class WebViewClient { String realm, )? onReceivedHttpAuthRequest; + /// Ask the host application if the browser should resend data as the + /// requested page was a result of a POST. + void Function( + WebView view, + AndroidMessage dontResend, + AndroidMessage resend, + )? onFormResubmission; + + /// Notify the host application that the WebView will load the resource + /// specified by the given url. + void Function(WebView view, String url)? onLoadResource; + + /// Notify the host application that WebView content left over from previous + /// page navigations will no longer be drawn. + void Function(WebView view, String url)? onPageCommitVisible; + + /// Notify the host application to handle a SSL client certificate request. + void Function( + WebView view, + ClientCertRequest request, + )? onReceivedClientCertRequest; + + /// Notify the host application that a request to automatically log in the + /// user has been processed. + void Function( + WebView view, + String realm, + String? account, + String args, + )? onReceivedLoginRequest; + + /// Notifies the host application that an SSL error occurred while loading a + /// resource. + void Function( + WebView view, + SslErrorHandler handler, + SslError error, + )? onReceivedSslError; + + /// Notify the host application that the scale applied to the WebView has + /// changed. + void Function(WebView view, double oldScale, double newScale)? onScaleChanged; + /// Sets the required synchronous return value for the Java method, /// `WebViewClient.shouldOverrideUrlLoading(...)`. /// @@ -513,7 +582,7 @@ abstract class WebChromeClient { late List Function( WebView webView, FileChooserParams params, - )? onShowFileChooser; + ) onShowFileChooser; /// Notify the host application that web content is requesting permission to /// access the specified resources and the permission currently isn't granted @@ -554,7 +623,7 @@ abstract class WebChromeClient { /// Notify the host application that the web page wants to display a /// JavaScript `confirm()` dialog. @async - late bool Function(WebView webView, String url, String message)? onJsConfirm; + late bool Function(WebView webView, String url, String message) onJsConfirm; /// Notify the host application that the web page wants to display a /// JavaScript `prompt()` dialog. @@ -800,3 +869,160 @@ abstract class HttpAuthHandler { /// credentials. void proceed(String username, String password); } + +/// Defines a message containing a description and arbitrary data object that +/// can be sent to a `Handler`. +/// +/// See https://developer.android.com/reference/android/os/Message. +@ProxyApi( + kotlinOptions: KotlinProxyApiOptions(fullClassName: 'android.os.Message'), +) +abstract class AndroidMessage { + /// Sends this message to the Android native `Handler` specified by + /// getTarget(). + /// + /// Throws a null pointer exception if this field has not been set. + void sendToTarget(); +} + +/// Defines a message containing a description and arbitrary data object that +/// can be sent to a `Handler`. +/// +/// See https://developer.android.com/reference/android/webkit/ClientCertRequest. +@ProxyApi( + kotlinOptions: KotlinProxyApiOptions( + fullClassName: 'android.webkit.ClientCertRequest', + ), +) +abstract class ClientCertRequest { + /// Cancel this request. + void cancel(); + + /// Ignore the request for now. + void ignore(); + + /// Proceed with the specified private key and client certificate chain. + void proceed(PrivateKey privateKey, List chain); +} + +/// A private key. +/// +/// The purpose of this interface is to group (and provide type safety for) all +/// private key interfaces. +/// +/// See https://developer.android.com/reference/java/security/PrivateKey. +@ProxyApi( + kotlinOptions: KotlinProxyApiOptions( + fullClassName: 'java.security.PrivateKey', + ), +) +abstract class PrivateKey {} + +/// Abstract class for X.509 certificates. +/// +/// This provides a standard way to access all the attributes of an X.509 +/// certificate. +/// +/// See https://developer.android.com/reference/java/security/cert/X509Certificate. +@ProxyApi( + kotlinOptions: KotlinProxyApiOptions( + fullClassName: 'java.security.cert.X509Certificate', + ), +) +abstract class X509Certificate {} + +/// Represents a request for handling an SSL error. +/// +/// See https://developer.android.com/reference/android/webkit/SslErrorHandler. +@ProxyApi( + kotlinOptions: KotlinProxyApiOptions( + fullClassName: 'android.webkit.SslErrorHandler', + ), +) +abstract class SslErrorHandler { + /// Instructs the WebView that encountered the SSL certificate error to + /// terminate communication with the server. + void cancel(); + + /// Instructs the WebView that encountered the SSL certificate error to ignore + /// the error and continue communicating with the server. + void proceed(); +} + +/// This class represents a set of one or more SSL errors and the associated SSL +/// certificate. +/// +/// See https://developer.android.com/reference/android/net/http/SslError. +@ProxyApi( + kotlinOptions: KotlinProxyApiOptions( + fullClassName: 'android.net.http.SslError', + ), +) +abstract class SslError { + /// Gets the SSL certificate associated with this object. + late SslCertificate certificate; + + /// Gets the URL associated with this object. + late String url; + + /// Gets the most severe SSL error in this object's set of errors. + SslErrorType getPrimaryError(); + + /// Determines whether this object includes the supplied error. + bool hasError(SslErrorType error); +} + +/// A distinguished name helper class. +/// +/// A 3-tuple of: +/// the most specific common name (CN) +/// the most specific organization (O) +/// the most specific organizational unit (OU) +@ProxyApi( + kotlinOptions: KotlinProxyApiOptions( + fullClassName: 'android.net.http.SslCertificate.DName', + ), +) +abstract class SslCertificateDName { + /// The most specific Common-name (CN) component of this name. + String getCName(); + + /// The distinguished name (normally includes CN, O, and OU names). + String getDName(); + + /// The most specific Organization (O) component of this name. + String getOName(); + + /// The most specific Organizational Unit (OU) component of this name. + String getUName(); +} + +/// SSL certificate info (certificate details) class. +/// +/// See https://developer.android.com/reference/android/net/http/SslCertificate. +@ProxyApi( + kotlinOptions: KotlinProxyApiOptions( + fullClassName: 'android.net.http.SslCertificate', + ), +) +abstract class SslCertificate { + /// Issued-by distinguished name or null if none has been set. + SslCertificateDName? getIssuedBy(); + + /// Issued-to distinguished name or null if none has been set. + SslCertificateDName? getIssuedTo(); + + /// Not-after date from the certificate validity period or null if none has been + /// set. + int? getValidNotAfterMsSinceEpoch(); + + /// Not-before date from the certificate validity period or null if none has + /// been set. + int? getValidNotBeforeMsSinceEpoch(); + + /// The X509Certificate used to create this SslCertificate or null if no + /// certificate was provided. + /// + /// Always returns null on Android versions below Q. + X509Certificate? getX509Certificate(); +} diff --git a/packages/webview_flutter/webview_flutter_android/pubspec.yaml b/packages/webview_flutter/webview_flutter_android/pubspec.yaml index f9b5eae6e96..915ac70f768 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.3.4 +version: 4.3.5 environment: sdk: ^3.6.0 @@ -27,7 +27,7 @@ dev_dependencies: flutter_test: sdk: flutter mockito: ^5.4.4 - pigeon: ^22.5.0 + pigeon: ^25.2.0 topics: - html diff --git a/packages/webview_flutter/webview_flutter_android/test/android_navigation_delegate_test.dart b/packages/webview_flutter/webview_flutter_android/test/android_navigation_delegate_test.dart index b61e0a2561c..fef0b9f1e80 100644 --- a/packages/webview_flutter/webview_flutter_android/test/android_navigation_delegate_test.dart +++ b/packages/webview_flutter/webview_flutter_android/test/android_navigation_delegate_test.dart @@ -653,6 +653,13 @@ class CapturingWebViewClient extends android_webview.WebViewClient { super.onReceivedRequestError, super.requestLoading, super.urlLoading, + super.onFormResubmission, + super.onLoadResource, + super.onPageCommitVisible, + super.onReceivedClientCertRequest, + super.onReceivedLoginRequest, + super.onReceivedSslError, + super.onScaleChanged, }) : super.pigeon_detached( pigeon_instanceManager: android_webview.PigeonInstanceManager( onWeakReferenceRemoved: (_) {})) { @@ -674,7 +681,7 @@ class CapturingWebViewClient extends android_webview.WebViewClient { class CapturingWebChromeClient extends android_webview.WebChromeClient { CapturingWebChromeClient({ super.onProgressChanged, - super.onShowFileChooser, + required super.onShowFileChooser, super.onGeolocationPermissionsShowPrompt, super.onGeolocationPermissionsHidePrompt, super.onShowCustomView, @@ -682,7 +689,7 @@ class CapturingWebChromeClient extends android_webview.WebChromeClient { super.onPermissionRequest, super.onConsoleMessage, super.onJsAlert, - super.onJsConfirm, + required super.onJsConfirm, super.onJsPrompt, }) : super.pigeon_detached( pigeon_instanceManager: android_webview.PigeonInstanceManager( @@ -691,7 +698,10 @@ class CapturingWebChromeClient extends android_webview.WebChromeClient { } static CapturingWebChromeClient lastCreatedDelegate = - CapturingWebChromeClient(); + CapturingWebChromeClient( + onJsConfirm: (_, __, ___, ____) async => false, + onShowFileChooser: (_, __, ___) async => [], + ); } // Records the last created instance of itself. diff --git a/packages/webview_flutter/webview_flutter_android/test/android_navigation_delegate_test.mocks.dart b/packages/webview_flutter/webview_flutter_android/test/android_navigation_delegate_test.mocks.dart index efe2191cc97..7d84c4694a1 100644 --- a/packages/webview_flutter/webview_flutter_android/test/android_navigation_delegate_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_android/test/android_navigation_delegate_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.5 from annotations // in webview_flutter_android/test/android_navigation_delegate_test.dart. // Do not manually edit this file. @@ -16,6 +16,7 @@ import 'package:webview_flutter_android/src/android_webkit.g.dart' as _i2; // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types @@ -23,35 +24,20 @@ import 'package:webview_flutter_android/src/android_webkit.g.dart' as _i2; class _FakePigeonInstanceManager_0 extends _i1.SmartFake implements _i2.PigeonInstanceManager { - _FakePigeonInstanceManager_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakePigeonInstanceManager_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeHttpAuthHandler_1 extends _i1.SmartFake implements _i2.HttpAuthHandler { - _FakeHttpAuthHandler_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeHttpAuthHandler_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeDownloadListener_2 extends _i1.SmartFake implements _i2.DownloadListener { - _FakeDownloadListener_2( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeDownloadListener_2(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [HttpAuthHandler]. @@ -73,52 +59,31 @@ class MockHttpAuthHandler extends _i1.Mock implements _i2.HttpAuthHandler { @override _i3.Future useHttpAuthUsernamePassword() => (super.noSuchMethod( - Invocation.method( - #useHttpAuthUsernamePassword, - [], - ), + Invocation.method(#useHttpAuthUsernamePassword, []), returnValue: _i3.Future.value(false), ) as _i3.Future); @override _i3.Future cancel() => (super.noSuchMethod( - Invocation.method( - #cancel, - [], - ), + Invocation.method(#cancel, []), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override - _i3.Future proceed( - String? username, - String? password, - ) => + _i3.Future proceed(String? username, String? password) => (super.noSuchMethod( - Invocation.method( - #proceed, - [ - username, - password, - ], - ), + Invocation.method(#proceed, [username, password]), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override _i2.HttpAuthHandler pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), returnValue: _FakeHttpAuthHandler_1( this, - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), ), ) as _i2.HttpAuthHandler); } @@ -132,31 +97,25 @@ class MockDownloadListener extends _i1.Mock implements _i2.DownloadListener { } @override - void Function( - _i2.DownloadListener, - String, - String, - String, - String, - int, - ) get onDownloadStart => (super.noSuchMethod( - Invocation.getter(#onDownloadStart), - returnValue: ( - _i2.DownloadListener pigeon_instance, - String url, - String userAgent, - String contentDisposition, - String mimetype, - int contentLength, - ) {}, - ) as void Function( - _i2.DownloadListener, - String, - String, - String, - String, - int, - )); + void Function(_i2.DownloadListener, String, String, String, String, int) + get onDownloadStart => (super.noSuchMethod( + Invocation.getter(#onDownloadStart), + returnValue: ( + _i2.DownloadListener pigeon_instance, + String url, + String userAgent, + String contentDisposition, + String mimetype, + int contentLength, + ) {}, + ) as void Function( + _i2.DownloadListener, + String, + String, + String, + String, + int, + )); @override _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( @@ -169,16 +128,10 @@ class MockDownloadListener extends _i1.Mock implements _i2.DownloadListener { @override _i2.DownloadListener pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), returnValue: _FakeDownloadListener_2( this, - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), ), ) as _i2.DownloadListener); } diff --git a/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.dart b/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.dart index 6762d1f0169..4fd19cf68a8 100644 --- a/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.dart +++ b/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.dart @@ -46,11 +46,11 @@ void main() { void Function( android_webview.WebChromeClient, android_webview.WebView, int)? onProgressChanged, - Future> Function( + required Future> Function( android_webview.WebChromeClient, android_webview.WebView, android_webview.FileChooserParams, - )? onShowFileChooser, + ) onShowFileChooser, void Function(android_webview.WebChromeClient, android_webview.PermissionRequest)? onPermissionRequest, @@ -71,12 +71,12 @@ void main() { Future Function(android_webview.WebChromeClient, android_webview.WebView, String, String)? onJsAlert, - Future Function( + required Future Function( android_webview.WebChromeClient, android_webview.WebView, String, String, - )? onJsConfirm, + ) onJsConfirm, Future Function( android_webview.WebChromeClient, android_webview.WebView, @@ -196,6 +196,46 @@ void main() { String, String)? onReceivedHttpAuthRequest, + void Function( + android_webview.WebViewClient, + android_webview.WebView, + android_webview.AndroidMessage, + android_webview.AndroidMessage, + )? onFormResubmission, + void Function( + android_webview.WebViewClient, + android_webview.WebView, + String, + )? onLoadResource, + void Function( + android_webview.WebViewClient, + android_webview.WebView, + String, + )? onPageCommitVisible, + void Function( + android_webview.WebViewClient, + android_webview.WebView, + android_webview.ClientCertRequest, + )? onReceivedClientCertRequest, + void Function( + android_webview.WebViewClient, + android_webview.WebView, + String, + String, + String, + )? onReceivedLoginRequest, + void Function( + android_webview.WebViewClient, + android_webview.WebView, + android_webview.SslErrorHandler, + android_webview.SslError, + )? onReceivedSslError, + void Function( + android_webview.WebViewClient, + android_webview.WebView, + double, + double, + )? onScaleChanged, }) => mockWebViewClient ?? MockWebViewClient(), instanceFlutterAssetManager: () => @@ -629,7 +669,10 @@ void main() { controller.setPlatformNavigationDelegate(androidNavigationDelegate); CapturingWebChromeClient.lastCreatedDelegate.onProgressChanged!( - TestWebChromeClient(), + TestWebChromeClient( + onJsConfirm: (_, __, ___, ____) async => false, + onShowFileChooser: (_, __, ___) async => [], + ), MockWebView(), 42, ); @@ -645,7 +688,10 @@ void main() { // Should not cause LateInitializationError CapturingWebChromeClient.lastCreatedDelegate.onProgressChanged!( - TestWebChromeClient(), + TestWebChromeClient( + onJsConfirm: (_, __, ___, ____) async => false, + onShowFileChooser: (_, __, ___) async => [], + ), MockWebView(), 42, ); @@ -895,6 +941,8 @@ void main() { onPermissionRequestCallback( android_webview.WebChromeClient.pigeon_detached( + onJsConfirm: (_, __, ___, ____) async => false, + onShowFileChooser: (_, __, ___) async => [], pigeon_instanceManager: testInstanceManager), mockPermissionRequest, ); @@ -949,6 +997,8 @@ void main() { onPermissionRequestCallback( android_webview.WebChromeClient.pigeon_detached( + onJsConfirm: (_, __, ___, ____) async => false, + onShowFileChooser: (_, __, ___) async => [], pigeon_instanceManager: testInstanceManager, ), mockPermissionRequest, @@ -2069,6 +2119,13 @@ class TestWebViewClient extends android_webview.WebViewClient { super.urlLoading, super.doUpdateVisitedHistory, super.onReceivedHttpAuthRequest, + super.onFormResubmission, + super.onLoadResource, + super.onPageCommitVisible, + super.onReceivedClientCertRequest, + super.onReceivedLoginRequest, + super.onReceivedSslError, + super.onScaleChanged, }) : super.pigeon_detached( pigeon_instanceManager: android_webview.PigeonInstanceManager( onWeakReferenceRemoved: (_) {}, @@ -2079,7 +2136,7 @@ class TestWebViewClient extends android_webview.WebViewClient { class TestWebChromeClient extends android_webview.WebChromeClient { TestWebChromeClient({ super.onProgressChanged, - super.onShowFileChooser, + required super.onShowFileChooser, super.onPermissionRequest, super.onShowCustomView, super.onHideCustomView, @@ -2087,7 +2144,7 @@ class TestWebChromeClient extends android_webview.WebChromeClient { super.onGeolocationPermissionsHidePrompt, super.onConsoleMessage, super.onJsAlert, - super.onJsConfirm, + required super.onJsConfirm, super.onJsPrompt, }) : super.pigeon_detached( pigeon_instanceManager: android_webview.PigeonInstanceManager( diff --git a/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.mocks.dart b/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.mocks.dart index 2e13f747bd6..02bcae66842 100644 --- a/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.5 from annotations // in webview_flutter_android/test/android_webview_controller_test.dart. // Do not manually edit this file. @@ -29,6 +29,7 @@ import 'package:webview_flutter_platform_interface/webview_flutter_platform_inte // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types @@ -36,34 +37,19 @@ import 'package:webview_flutter_platform_interface/webview_flutter_platform_inte class _FakeWebChromeClient_0 extends _i1.SmartFake implements _i2.WebChromeClient { - _FakeWebChromeClient_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWebChromeClient_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeWebViewClient_1 extends _i1.SmartFake implements _i2.WebViewClient { - _FakeWebViewClient_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWebViewClient_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeDownloadListener_2 extends _i1.SmartFake implements _i2.DownloadListener { - _FakeDownloadListener_2( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeDownloadListener_2(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakePlatformNavigationDelegateCreationParams_3 extends _i1.SmartFake @@ -71,10 +57,7 @@ class _FakePlatformNavigationDelegateCreationParams_3 extends _i1.SmartFake _FakePlatformNavigationDelegateCreationParams_3( Object parent, Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + ) : super(parent, parentInvocation); } class _FakePlatformWebViewControllerCreationParams_4 extends _i1.SmartFake @@ -82,125 +65,67 @@ class _FakePlatformWebViewControllerCreationParams_4 extends _i1.SmartFake _FakePlatformWebViewControllerCreationParams_4( Object parent, Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + ) : super(parent, parentInvocation); } class _FakeObject_5 extends _i1.SmartFake implements Object { - _FakeObject_5( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeObject_5(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeOffset_6 extends _i1.SmartFake implements _i4.Offset { - _FakeOffset_6( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeOffset_6(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeWebView_7 extends _i1.SmartFake implements _i2.WebView { - _FakeWebView_7( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWebView_7(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeJavaScriptChannel_8 extends _i1.SmartFake implements _i2.JavaScriptChannel { - _FakeJavaScriptChannel_8( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeJavaScriptChannel_8(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeCookieManager_9 extends _i1.SmartFake implements _i2.CookieManager { - _FakeCookieManager_9( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeCookieManager_9(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeFlutterAssetManager_10 extends _i1.SmartFake implements _i2.FlutterAssetManager { - _FakeFlutterAssetManager_10( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeFlutterAssetManager_10(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeWebStorage_11 extends _i1.SmartFake implements _i2.WebStorage { - _FakeWebStorage_11( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWebStorage_11(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakePigeonInstanceManager_12 extends _i1.SmartFake implements _i2.PigeonInstanceManager { - _FakePigeonInstanceManager_12( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakePigeonInstanceManager_12(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakePlatformViewsServiceProxy_13 extends _i1.SmartFake implements _i5.PlatformViewsServiceProxy { - _FakePlatformViewsServiceProxy_13( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakePlatformViewsServiceProxy_13(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakePlatformWebViewController_14 extends _i1.SmartFake implements _i3.PlatformWebViewController { - _FakePlatformWebViewController_14( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakePlatformWebViewController_14(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeSize_15 extends _i1.SmartFake implements _i4.Size { - _FakeSize_15( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeSize_15(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeGeolocationPermissionsCallback_16 extends _i1.SmartFake @@ -208,21 +133,13 @@ class _FakeGeolocationPermissionsCallback_16 extends _i1.SmartFake _FakeGeolocationPermissionsCallback_16( Object parent, Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + ) : super(parent, parentInvocation); } class _FakePermissionRequest_17 extends _i1.SmartFake implements _i2.PermissionRequest { - _FakePermissionRequest_17( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakePermissionRequest_17(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeExpensiveAndroidViewController_18 extends _i1.SmartFake @@ -230,10 +147,7 @@ class _FakeExpensiveAndroidViewController_18 extends _i1.SmartFake _FakeExpensiveAndroidViewController_18( Object parent, Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + ) : super(parent, parentInvocation); } class _FakeSurfaceAndroidViewController_19 extends _i1.SmartFake @@ -241,30 +155,17 @@ class _FakeSurfaceAndroidViewController_19 extends _i1.SmartFake _FakeSurfaceAndroidViewController_19( Object parent, Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + ) : super(parent, parentInvocation); } class _FakeWebSettings_20 extends _i1.SmartFake implements _i2.WebSettings { - _FakeWebSettings_20( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWebSettings_20(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeWebViewPoint_21 extends _i1.SmartFake implements _i2.WebViewPoint { - _FakeWebViewPoint_21( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWebViewPoint_21(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [AndroidNavigationDelegate]. @@ -329,22 +230,17 @@ class MockAndroidNavigationDelegate extends _i1.Mock @override _i8.Future setOnLoadRequest(_i7.LoadRequestCallback? onLoadRequest) => (super.noSuchMethod( - Invocation.method( - #setOnLoadRequest, - [onLoadRequest], - ), + Invocation.method(#setOnLoadRequest, [onLoadRequest]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setOnNavigationRequest( - _i3.NavigationRequestCallback? onNavigationRequest) => + _i3.NavigationRequestCallback? onNavigationRequest, + ) => (super.noSuchMethod( - Invocation.method( - #setOnNavigationRequest, - [onNavigationRequest], - ), + Invocation.method(#setOnNavigationRequest, [onNavigationRequest]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -352,10 +248,7 @@ class MockAndroidNavigationDelegate extends _i1.Mock @override _i8.Future setOnPageStarted(_i3.PageEventCallback? onPageStarted) => (super.noSuchMethod( - Invocation.method( - #setOnPageStarted, - [onPageStarted], - ), + Invocation.method(#setOnPageStarted, [onPageStarted]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -363,10 +256,7 @@ class MockAndroidNavigationDelegate extends _i1.Mock @override _i8.Future setOnPageFinished(_i3.PageEventCallback? onPageFinished) => (super.noSuchMethod( - Invocation.method( - #setOnPageFinished, - [onPageFinished], - ), + Invocation.method(#setOnPageFinished, [onPageFinished]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -374,10 +264,7 @@ class MockAndroidNavigationDelegate extends _i1.Mock @override _i8.Future setOnHttpError(_i3.HttpResponseErrorCallback? onHttpError) => (super.noSuchMethod( - Invocation.method( - #setOnHttpError, - [onHttpError], - ), + Invocation.method(#setOnHttpError, [onHttpError]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -385,22 +272,17 @@ class MockAndroidNavigationDelegate extends _i1.Mock @override _i8.Future setOnProgress(_i3.ProgressCallback? onProgress) => (super.noSuchMethod( - Invocation.method( - #setOnProgress, - [onProgress], - ), + Invocation.method(#setOnProgress, [onProgress]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setOnWebResourceError( - _i3.WebResourceErrorCallback? onWebResourceError) => + _i3.WebResourceErrorCallback? onWebResourceError, + ) => (super.noSuchMethod( - Invocation.method( - #setOnWebResourceError, - [onWebResourceError], - ), + Invocation.method(#setOnWebResourceError, [onWebResourceError]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -408,22 +290,17 @@ class MockAndroidNavigationDelegate extends _i1.Mock @override _i8.Future setOnUrlChange(_i3.UrlChangeCallback? onUrlChange) => (super.noSuchMethod( - Invocation.method( - #setOnUrlChange, - [onUrlChange], - ), + Invocation.method(#setOnUrlChange, [onUrlChange]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setOnHttpAuthRequest( - _i3.HttpAuthRequestCallback? onHttpAuthRequest) => + _i3.HttpAuthRequestCallback? onHttpAuthRequest, + ) => (super.noSuchMethod( - Invocation.method( - #setOnHttpAuthRequest, - [onHttpAuthRequest], - ), + Invocation.method(#setOnHttpAuthRequest, [onHttpAuthRequest]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -457,45 +334,29 @@ class MockAndroidWebViewController extends _i1.Mock @override _i8.Future setAllowFileAccess(bool? allow) => (super.noSuchMethod( - Invocation.method( - #setAllowFileAccess, - [allow], - ), + Invocation.method(#setAllowFileAccess, [allow]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future loadFile(String? absoluteFilePath) => (super.noSuchMethod( - Invocation.method( - #loadFile, - [absoluteFilePath], - ), + Invocation.method(#loadFile, [absoluteFilePath]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future loadFlutterAsset(String? key) => (super.noSuchMethod( - Invocation.method( - #loadFlutterAsset, - [key], - ), + Invocation.method(#loadFlutterAsset, [key]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override - _i8.Future loadHtmlString( - String? html, { - String? baseUrl, - }) => + _i8.Future loadHtmlString(String? html, {String? baseUrl}) => (super.noSuchMethod( - Invocation.method( - #loadHtmlString, - [html], - {#baseUrl: baseUrl}, - ), + Invocation.method(#loadHtmlString, [html], {#baseUrl: baseUrl}), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -503,112 +364,80 @@ class MockAndroidWebViewController extends _i1.Mock @override _i8.Future loadRequest(_i3.LoadRequestParams? params) => (super.noSuchMethod( - Invocation.method( - #loadRequest, - [params], - ), + Invocation.method(#loadRequest, [params]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future currentUrl() => (super.noSuchMethod( - Invocation.method( - #currentUrl, - [], - ), + Invocation.method(#currentUrl, []), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future canGoBack() => (super.noSuchMethod( - Invocation.method( - #canGoBack, - [], - ), + Invocation.method(#canGoBack, []), returnValue: _i8.Future.value(false), returnValueForMissingStub: _i8.Future.value(false), ) as _i8.Future); @override _i8.Future canGoForward() => (super.noSuchMethod( - Invocation.method( - #canGoForward, - [], - ), + Invocation.method(#canGoForward, []), returnValue: _i8.Future.value(false), returnValueForMissingStub: _i8.Future.value(false), ) as _i8.Future); @override _i8.Future goBack() => (super.noSuchMethod( - Invocation.method( - #goBack, - [], - ), + Invocation.method(#goBack, []), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future goForward() => (super.noSuchMethod( - Invocation.method( - #goForward, - [], - ), + Invocation.method(#goForward, []), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future reload() => (super.noSuchMethod( - Invocation.method( - #reload, - [], - ), + Invocation.method(#reload, []), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future clearCache() => (super.noSuchMethod( - Invocation.method( - #clearCache, - [], - ), + Invocation.method(#clearCache, []), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future clearLocalStorage() => (super.noSuchMethod( - Invocation.method( - #clearLocalStorage, - [], - ), + Invocation.method(#clearLocalStorage, []), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setPlatformNavigationDelegate( - _i3.PlatformNavigationDelegate? handler) => + _i3.PlatformNavigationDelegate? handler, + ) => (super.noSuchMethod( - Invocation.method( - #setPlatformNavigationDelegate, - [handler], - ), + Invocation.method(#setPlatformNavigationDelegate, [handler]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future runJavaScript(String? javaScript) => (super.noSuchMethod( - Invocation.method( - #runJavaScript, - [javaScript], - ), + Invocation.method(#runJavaScript, [javaScript]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -616,34 +445,27 @@ class MockAndroidWebViewController extends _i1.Mock @override _i8.Future runJavaScriptReturningResult(String? javaScript) => (super.noSuchMethod( - Invocation.method( - #runJavaScriptReturningResult, - [javaScript], - ), - returnValue: _i8.Future.value(_FakeObject_5( - this, - Invocation.method( - #runJavaScriptReturningResult, - [javaScript], + Invocation.method(#runJavaScriptReturningResult, [javaScript]), + returnValue: _i8.Future.value( + _FakeObject_5( + this, + Invocation.method(#runJavaScriptReturningResult, [javaScript]), ), - )), - returnValueForMissingStub: _i8.Future.value(_FakeObject_5( - this, - Invocation.method( - #runJavaScriptReturningResult, - [javaScript], + ), + returnValueForMissingStub: _i8.Future.value( + _FakeObject_5( + this, + Invocation.method(#runJavaScriptReturningResult, [javaScript]), ), - )), + ), ) as _i8.Future); @override _i8.Future addJavaScriptChannel( - _i3.JavaScriptChannelParams? javaScriptChannelParams) => + _i3.JavaScriptChannelParams? javaScriptChannelParams, + ) => (super.noSuchMethod( - Invocation.method( - #addJavaScriptChannel, - [javaScriptChannelParams], - ), + Invocation.method(#addJavaScriptChannel, [javaScriptChannelParams]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -651,96 +473,55 @@ class MockAndroidWebViewController extends _i1.Mock @override _i8.Future removeJavaScriptChannel(String? javaScriptChannelName) => (super.noSuchMethod( - Invocation.method( - #removeJavaScriptChannel, - [javaScriptChannelName], - ), + Invocation.method(#removeJavaScriptChannel, [ + javaScriptChannelName, + ]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future getTitle() => (super.noSuchMethod( - Invocation.method( - #getTitle, - [], - ), + Invocation.method(#getTitle, []), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override - _i8.Future scrollTo( - int? x, - int? y, - ) => - (super.noSuchMethod( - Invocation.method( - #scrollTo, - [ - x, - y, - ], - ), + _i8.Future scrollTo(int? x, int? y) => (super.noSuchMethod( + Invocation.method(#scrollTo, [x, y]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override - _i8.Future scrollBy( - int? x, - int? y, - ) => - (super.noSuchMethod( - Invocation.method( - #scrollBy, - [ - x, - y, - ], - ), + _i8.Future scrollBy(int? x, int? y) => (super.noSuchMethod( + Invocation.method(#scrollBy, [x, y]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future<_i4.Offset> getScrollPosition() => (super.noSuchMethod( - Invocation.method( - #getScrollPosition, - [], + Invocation.method(#getScrollPosition, []), + returnValue: _i8.Future<_i4.Offset>.value( + _FakeOffset_6(this, Invocation.method(#getScrollPosition, [])), + ), + returnValueForMissingStub: _i8.Future<_i4.Offset>.value( + _FakeOffset_6(this, Invocation.method(#getScrollPosition, [])), ), - returnValue: _i8.Future<_i4.Offset>.value(_FakeOffset_6( - this, - Invocation.method( - #getScrollPosition, - [], - ), - )), - returnValueForMissingStub: _i8.Future<_i4.Offset>.value(_FakeOffset_6( - this, - Invocation.method( - #getScrollPosition, - [], - ), - )), ) as _i8.Future<_i4.Offset>); @override _i8.Future enableZoom(bool? enabled) => (super.noSuchMethod( - Invocation.method( - #enableZoom, - [enabled], - ), + Invocation.method(#enableZoom, [enabled]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setBackgroundColor(_i4.Color? color) => (super.noSuchMethod( - Invocation.method( - #setBackgroundColor, - [color], - ), + Invocation.method(#setBackgroundColor, [color]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -748,32 +529,26 @@ class MockAndroidWebViewController extends _i1.Mock @override _i8.Future setJavaScriptMode(_i3.JavaScriptMode? javaScriptMode) => (super.noSuchMethod( - Invocation.method( - #setJavaScriptMode, - [javaScriptMode], - ), + Invocation.method(#setJavaScriptMode, [javaScriptMode]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setUserAgent(String? userAgent) => (super.noSuchMethod( - Invocation.method( - #setUserAgent, - [userAgent], - ), + Invocation.method(#setUserAgent, [userAgent]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setOnScrollPositionChange( - void Function(_i3.ScrollPositionChange)? onScrollPositionChange) => + void Function(_i3.ScrollPositionChange)? onScrollPositionChange, + ) => (super.noSuchMethod( - Invocation.method( - #setOnScrollPositionChange, - [onScrollPositionChange], - ), + Invocation.method(#setOnScrollPositionChange, [ + onScrollPositionChange, + ]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -781,66 +556,51 @@ class MockAndroidWebViewController extends _i1.Mock @override _i8.Future setMediaPlaybackRequiresUserGesture(bool? require) => (super.noSuchMethod( - Invocation.method( - #setMediaPlaybackRequiresUserGesture, - [require], - ), + Invocation.method(#setMediaPlaybackRequiresUserGesture, [require]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setTextZoom(int? textZoom) => (super.noSuchMethod( - Invocation.method( - #setTextZoom, - [textZoom], - ), + Invocation.method(#setTextZoom, [textZoom]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setAllowContentAccess(bool? enabled) => (super.noSuchMethod( - Invocation.method( - #setAllowContentAccess, - [enabled], - ), + Invocation.method(#setAllowContentAccess, [enabled]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setGeolocationEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method( - #setGeolocationEnabled, - [enabled], - ), + Invocation.method(#setGeolocationEnabled, [enabled]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setOnShowFileSelector( - _i8.Future> Function(_i7.FileSelectorParams)? - onShowFileSelector) => + _i8.Future> Function(_i7.FileSelectorParams)? + onShowFileSelector, + ) => (super.noSuchMethod( - Invocation.method( - #setOnShowFileSelector, - [onShowFileSelector], - ), + Invocation.method(#setOnShowFileSelector, [onShowFileSelector]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setOnPlatformPermissionRequest( - void Function(_i3.PlatformWebViewPermissionRequest)? - onPermissionRequest) => + void Function(_i3.PlatformWebViewPermissionRequest)? onPermissionRequest, + ) => (super.noSuchMethod( - Invocation.method( - #setOnPlatformPermissionRequest, - [onPermissionRequest], - ), + Invocation.method(#setOnPlatformPermissionRequest, [ + onPermissionRequest, + ]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -851,14 +611,10 @@ class MockAndroidWebViewController extends _i1.Mock _i7.OnGeolocationPermissionsHidePrompt? onHidePrompt, }) => (super.noSuchMethod( - Invocation.method( - #setGeolocationPermissionsPromptCallbacks, - [], - { - #onShowPrompt: onShowPrompt, - #onHidePrompt: onHidePrompt, - }, - ), + Invocation.method(#setGeolocationPermissionsPromptCallbacks, [], { + #onShowPrompt: onShowPrompt, + #onHidePrompt: onHidePrompt, + }), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -869,75 +625,66 @@ class MockAndroidWebViewController extends _i1.Mock required _i7.OnHideCustomWidgetCallback? onHideCustomWidget, }) => (super.noSuchMethod( - Invocation.method( - #setCustomWidgetCallbacks, - [], - { - #onShowCustomWidget: onShowCustomWidget, - #onHideCustomWidget: onHideCustomWidget, - }, - ), + Invocation.method(#setCustomWidgetCallbacks, [], { + #onShowCustomWidget: onShowCustomWidget, + #onHideCustomWidget: onHideCustomWidget, + }), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setOnConsoleMessage( - void Function(_i3.JavaScriptConsoleMessage)? onConsoleMessage) => + void Function(_i3.JavaScriptConsoleMessage)? onConsoleMessage, + ) => (super.noSuchMethod( - Invocation.method( - #setOnConsoleMessage, - [onConsoleMessage], - ), + Invocation.method(#setOnConsoleMessage, [onConsoleMessage]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future getUserAgent() => (super.noSuchMethod( - Invocation.method( - #getUserAgent, - [], - ), + Invocation.method(#getUserAgent, []), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setOnJavaScriptAlertDialog( - _i8.Future Function(_i3.JavaScriptAlertDialogRequest)? - onJavaScriptAlertDialog) => + _i8.Future Function(_i3.JavaScriptAlertDialogRequest)? + onJavaScriptAlertDialog, + ) => (super.noSuchMethod( - Invocation.method( - #setOnJavaScriptAlertDialog, - [onJavaScriptAlertDialog], - ), + Invocation.method(#setOnJavaScriptAlertDialog, [ + onJavaScriptAlertDialog, + ]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setOnJavaScriptConfirmDialog( - _i8.Future Function(_i3.JavaScriptConfirmDialogRequest)? - onJavaScriptConfirmDialog) => + _i8.Future Function(_i3.JavaScriptConfirmDialogRequest)? + onJavaScriptConfirmDialog, + ) => (super.noSuchMethod( - Invocation.method( - #setOnJavaScriptConfirmDialog, - [onJavaScriptConfirmDialog], - ), + Invocation.method(#setOnJavaScriptConfirmDialog, [ + onJavaScriptConfirmDialog, + ]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setOnJavaScriptTextInputDialog( - _i8.Future Function(_i3.JavaScriptTextInputDialogRequest)? - onJavaScriptTextInputDialog) => + _i8.Future Function(_i3.JavaScriptTextInputDialogRequest)? + onJavaScriptTextInputDialog, + ) => (super.noSuchMethod( - Invocation.method( - #setOnJavaScriptTextInputDialog, - [onJavaScriptTextInputDialog], - ), + Invocation.method(#setOnJavaScriptTextInputDialog, [ + onJavaScriptTextInputDialog, + ]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -949,63 +696,31 @@ class MockAndroidWebViewController extends _i1.Mock class MockAndroidWebViewProxy extends _i1.Mock implements _i9.AndroidWebViewProxy { @override - _i2.WebView Function( - {void Function( - _i2.WebView, - int, - int, - int, - int, - )? onScrollChanged}) get newWebView => (super.noSuchMethod( + _i2.WebView Function({ + void Function(_i2.WebView, int, int, int, int)? onScrollChanged, + }) get newWebView => (super.noSuchMethod( Invocation.getter(#newWebView), - returnValue: ( - {void Function( - _i2.WebView, - int, - int, - int, - int, - )? onScrollChanged}) => - _FakeWebView_7( - this, - Invocation.getter(#newWebView), - ), - returnValueForMissingStub: ( - {void Function( - _i2.WebView, - int, - int, - int, - int, - )? onScrollChanged}) => - _FakeWebView_7( - this, - Invocation.getter(#newWebView), - ), - ) as _i2.WebView Function( - {void Function( - _i2.WebView, - int, - int, - int, - int, - )? onScrollChanged})); + returnValue: ({ + void Function(_i2.WebView, int, int, int, int)? onScrollChanged, + }) => + _FakeWebView_7(this, Invocation.getter(#newWebView)), + returnValueForMissingStub: ({ + void Function(_i2.WebView, int, int, int, int)? onScrollChanged, + }) => + _FakeWebView_7(this, Invocation.getter(#newWebView)), + ) as _i2.WebView Function({ + void Function(_i2.WebView, int, int, int, int)? onScrollChanged, + })); @override _i2.JavaScriptChannel Function({ required String channelName, - required void Function( - _i2.JavaScriptChannel, - String, - ) postMessage, + required void Function(_i2.JavaScriptChannel, String) postMessage, }) get newJavaScriptChannel => (super.noSuchMethod( Invocation.getter(#newJavaScriptChannel), returnValue: ({ required String channelName, - required void Function( - _i2.JavaScriptChannel, - String, - ) postMessage, + required void Function(_i2.JavaScriptChannel, String) postMessage, }) => _FakeJavaScriptChannel_8( this, @@ -1013,10 +728,7 @@ class MockAndroidWebViewProxy extends _i1.Mock ), returnValueForMissingStub: ({ required String channelName, - required void Function( - _i2.JavaScriptChannel, - String, - ) postMessage, + required void Function(_i2.JavaScriptChannel, String) postMessage, }) => _FakeJavaScriptChannel_8( this, @@ -1024,37 +736,27 @@ class MockAndroidWebViewProxy extends _i1.Mock ), ) as _i2.JavaScriptChannel Function({ required String channelName, - required void Function( - _i2.JavaScriptChannel, - String, - ) postMessage, + required void Function(_i2.JavaScriptChannel, String) postMessage, })); @override _i2.WebViewClient Function({ + void Function(_i2.WebViewClient, _i2.WebView, String, bool)? + doUpdateVisitedHistory, void Function( _i2.WebViewClient, _i2.WebView, - String, - bool, - )? doUpdateVisitedHistory, - void Function( - _i2.WebViewClient, - _i2.WebView, - String, - )? onPageFinished, - void Function( - _i2.WebViewClient, - _i2.WebView, - String, - )? onPageStarted, - void Function( - _i2.WebViewClient, - _i2.WebView, - int, - String, - String, - )? onReceivedError, + _i2.AndroidMessage, + _i2.AndroidMessage, + )? onFormResubmission, + void Function(_i2.WebViewClient, _i2.WebView, String)? onLoadResource, + void Function(_i2.WebViewClient, _i2.WebView, String)? onPageCommitVisible, + void Function(_i2.WebViewClient, _i2.WebView, String)? onPageFinished, + void Function(_i2.WebViewClient, _i2.WebView, String)? onPageStarted, + void Function(_i2.WebViewClient, _i2.WebView, _i2.ClientCertRequest)? + onReceivedClientCertRequest, + void Function(_i2.WebViewClient, _i2.WebView, int, String, String)? + onReceivedError, void Function( _i2.WebViewClient, _i2.WebView, @@ -1068,6 +770,8 @@ class MockAndroidWebViewProxy extends _i1.Mock _i2.WebResourceRequest, _i2.WebResourceResponse, )? onReceivedHttpError, + void Function(_i2.WebViewClient, _i2.WebView, String, String?, String)? + onReceivedLoginRequest, void Function( _i2.WebViewClient, _i2.WebView, @@ -1083,32 +787,35 @@ class MockAndroidWebViewProxy extends _i1.Mock void Function( _i2.WebViewClient, _i2.WebView, - _i2.WebResourceRequest, - )? requestLoading, - void Function( - _i2.WebViewClient, - _i2.WebView, - String, - )? urlLoading, + _i2.SslErrorHandler, + _i2.SslError, + )? onReceivedSslError, + void Function(_i2.WebViewClient, _i2.WebView, double, double)? + onScaleChanged, + void Function(_i2.WebViewClient, _i2.WebView, _i2.WebResourceRequest)? + requestLoading, + void Function(_i2.WebViewClient, _i2.WebView, String)? urlLoading, }) get newWebViewClient => (super.noSuchMethod( Invocation.getter(#newWebViewClient), returnValue: ({ + void Function(_i2.WebViewClient, _i2.WebView, String, bool)? + doUpdateVisitedHistory, void Function( _i2.WebViewClient, _i2.WebView, - String, - bool, - )? doUpdateVisitedHistory, - void Function( - _i2.WebViewClient, - _i2.WebView, - String, - )? onPageFinished, + _i2.AndroidMessage, + _i2.AndroidMessage, + )? onFormResubmission, + void Function(_i2.WebViewClient, _i2.WebView, String)? onLoadResource, + void Function(_i2.WebViewClient, _i2.WebView, String)? + onPageCommitVisible, + void Function(_i2.WebViewClient, _i2.WebView, String)? onPageFinished, + void Function(_i2.WebViewClient, _i2.WebView, String)? onPageStarted, void Function( _i2.WebViewClient, _i2.WebView, - String, - )? onPageStarted, + _i2.ClientCertRequest, + )? onReceivedClientCertRequest, void Function( _i2.WebViewClient, _i2.WebView, @@ -1129,6 +836,13 @@ class MockAndroidWebViewProxy extends _i1.Mock _i2.WebResourceRequest, _i2.WebResourceResponse, )? onReceivedHttpError, + void Function( + _i2.WebViewClient, + _i2.WebView, + String, + String?, + String, + )? onReceivedLoginRequest, void Function( _i2.WebViewClient, _i2.WebView, @@ -1144,35 +858,41 @@ class MockAndroidWebViewProxy extends _i1.Mock void Function( _i2.WebViewClient, _i2.WebView, - _i2.WebResourceRequest, - )? requestLoading, + _i2.SslErrorHandler, + _i2.SslError, + )? onReceivedSslError, + void Function(_i2.WebViewClient, _i2.WebView, double, double)? + onScaleChanged, void Function( _i2.WebViewClient, _i2.WebView, - String, - )? urlLoading, + _i2.WebResourceRequest, + )? requestLoading, + void Function(_i2.WebViewClient, _i2.WebView, String)? urlLoading, }) => _FakeWebViewClient_1( this, Invocation.getter(#newWebViewClient), ), returnValueForMissingStub: ({ + void Function(_i2.WebViewClient, _i2.WebView, String, bool)? + doUpdateVisitedHistory, void Function( _i2.WebViewClient, _i2.WebView, - String, - bool, - )? doUpdateVisitedHistory, - void Function( - _i2.WebViewClient, - _i2.WebView, - String, - )? onPageFinished, + _i2.AndroidMessage, + _i2.AndroidMessage, + )? onFormResubmission, + void Function(_i2.WebViewClient, _i2.WebView, String)? onLoadResource, + void Function(_i2.WebViewClient, _i2.WebView, String)? + onPageCommitVisible, + void Function(_i2.WebViewClient, _i2.WebView, String)? onPageFinished, + void Function(_i2.WebViewClient, _i2.WebView, String)? onPageStarted, void Function( _i2.WebViewClient, _i2.WebView, - String, - )? onPageStarted, + _i2.ClientCertRequest, + )? onReceivedClientCertRequest, void Function( _i2.WebViewClient, _i2.WebView, @@ -1193,6 +913,13 @@ class MockAndroidWebViewProxy extends _i1.Mock _i2.WebResourceRequest, _i2.WebResourceResponse, )? onReceivedHttpError, + void Function( + _i2.WebViewClient, + _i2.WebView, + String, + String?, + String, + )? onReceivedLoginRequest, void Function( _i2.WebViewClient, _i2.WebView, @@ -1208,42 +935,43 @@ class MockAndroidWebViewProxy extends _i1.Mock void Function( _i2.WebViewClient, _i2.WebView, - _i2.WebResourceRequest, - )? requestLoading, + _i2.SslErrorHandler, + _i2.SslError, + )? onReceivedSslError, + void Function(_i2.WebViewClient, _i2.WebView, double, double)? + onScaleChanged, void Function( _i2.WebViewClient, _i2.WebView, - String, - )? urlLoading, + _i2.WebResourceRequest, + )? requestLoading, + void Function(_i2.WebViewClient, _i2.WebView, String)? urlLoading, }) => _FakeWebViewClient_1( this, Invocation.getter(#newWebViewClient), ), ) as _i2.WebViewClient Function({ + void Function(_i2.WebViewClient, _i2.WebView, String, bool)? + doUpdateVisitedHistory, void Function( _i2.WebViewClient, _i2.WebView, - String, - bool, - )? doUpdateVisitedHistory, + _i2.AndroidMessage, + _i2.AndroidMessage, + )? onFormResubmission, + void Function(_i2.WebViewClient, _i2.WebView, String)? onLoadResource, + void Function(_i2.WebViewClient, _i2.WebView, String)? + onPageCommitVisible, + void Function(_i2.WebViewClient, _i2.WebView, String)? onPageFinished, + void Function(_i2.WebViewClient, _i2.WebView, String)? onPageStarted, void Function( _i2.WebViewClient, _i2.WebView, - String, - )? onPageFinished, - void Function( - _i2.WebViewClient, - _i2.WebView, - String, - )? onPageStarted, - void Function( - _i2.WebViewClient, - _i2.WebView, - int, - String, - String, - )? onReceivedError, + _i2.ClientCertRequest, + )? onReceivedClientCertRequest, + void Function(_i2.WebViewClient, _i2.WebView, int, String, String)? + onReceivedError, void Function( _i2.WebViewClient, _i2.WebView, @@ -1257,6 +985,13 @@ class MockAndroidWebViewProxy extends _i1.Mock _i2.WebResourceRequest, _i2.WebResourceResponse, )? onReceivedHttpError, + void Function( + _i2.WebViewClient, + _i2.WebView, + String, + String?, + String, + )? onReceivedLoginRequest, void Function( _i2.WebViewClient, _i2.WebView, @@ -1272,68 +1007,84 @@ class MockAndroidWebViewProxy extends _i1.Mock void Function( _i2.WebViewClient, _i2.WebView, - _i2.WebResourceRequest, - )? requestLoading, + _i2.SslErrorHandler, + _i2.SslError, + )? onReceivedSslError, + void Function(_i2.WebViewClient, _i2.WebView, double, double)? + onScaleChanged, void Function( _i2.WebViewClient, _i2.WebView, - String, - )? urlLoading, + _i2.WebResourceRequest, + )? requestLoading, + void Function(_i2.WebViewClient, _i2.WebView, String)? urlLoading, })); @override - _i2.DownloadListener Function( - {required void Function( - _i2.DownloadListener, - String, - String, - String, - String, - int, - ) onDownloadStart}) get newDownloadListener => (super.noSuchMethod( + _i2.DownloadListener Function({ + required void Function( + _i2.DownloadListener, + String, + String, + String, + String, + int, + ) onDownloadStart, + }) get newDownloadListener => (super.noSuchMethod( Invocation.getter(#newDownloadListener), - returnValue: ( - {required void Function( - _i2.DownloadListener, - String, - String, - String, - String, - int, - ) onDownloadStart}) => - _FakeDownloadListener_2( - this, - Invocation.getter(#newDownloadListener), - ), - returnValueForMissingStub: ( - {required void Function( - _i2.DownloadListener, - String, - String, - String, - String, - int, - ) onDownloadStart}) => + returnValue: ({ + required void Function( + _i2.DownloadListener, + String, + String, + String, + String, + int, + ) onDownloadStart, + }) => _FakeDownloadListener_2( this, Invocation.getter(#newDownloadListener), ), - ) as _i2.DownloadListener Function( - {required void Function( + returnValueForMissingStub: ({ + required void Function( _i2.DownloadListener, String, String, String, String, int, - ) onDownloadStart})); + ) onDownloadStart, + }) => + _FakeDownloadListener_2( + this, + Invocation.getter(#newDownloadListener), + ), + ) as _i2.DownloadListener Function({ + required void Function( + _i2.DownloadListener, + String, + String, + String, + String, + int, + ) onDownloadStart, + })); @override _i2.WebChromeClient Function({ - void Function( + required _i8.Future Function( + _i2.WebChromeClient, + _i2.WebView, + String, + String, + ) onJsConfirm, + required _i8.Future> Function( _i2.WebChromeClient, - _i2.ConsoleMessage, - )? onConsoleMessage, + _i2.WebView, + _i2.FileChooserParams, + ) onShowFileChooser, + void Function(_i2.WebChromeClient, _i2.ConsoleMessage)? onConsoleMessage, void Function(_i2.WebChromeClient)? onGeolocationPermissionsHidePrompt, void Function( _i2.WebChromeClient, @@ -1341,18 +1092,8 @@ class MockAndroidWebViewProxy extends _i1.Mock _i2.GeolocationPermissionsCallback, )? onGeolocationPermissionsShowPrompt, void Function(_i2.WebChromeClient)? onHideCustomView, - _i8.Future Function( - _i2.WebChromeClient, - _i2.WebView, - String, - String, - )? onJsAlert, - _i8.Future Function( - _i2.WebChromeClient, - _i2.WebView, - String, - String, - )? onJsConfirm, + _i8.Future Function(_i2.WebChromeClient, _i2.WebView, String, String)? + onJsAlert, _i8.Future Function( _i2.WebChromeClient, _i2.WebView, @@ -1360,32 +1101,16 @@ class MockAndroidWebViewProxy extends _i1.Mock String, String, )? onJsPrompt, - void Function( - _i2.WebChromeClient, - _i2.PermissionRequest, - )? onPermissionRequest, - void Function( - _i2.WebChromeClient, - _i2.WebView, - int, - )? onProgressChanged, - void Function( - _i2.WebChromeClient, - _i2.View, - _i2.CustomViewCallback, - )? onShowCustomView, - _i8.Future> Function( - _i2.WebChromeClient, - _i2.WebView, - _i2.FileChooserParams, - )? onShowFileChooser, + void Function(_i2.WebChromeClient, _i2.PermissionRequest)? + onPermissionRequest, + void Function(_i2.WebChromeClient, _i2.WebView, int)? onProgressChanged, + void Function(_i2.WebChromeClient, _i2.View, _i2.CustomViewCallback)? + onShowCustomView, }) get newWebChromeClient => (super.noSuchMethod( Invocation.getter(#newWebChromeClient), returnValue: ({ - void Function( - _i2.WebChromeClient, - _i2.ConsoleMessage, - )? onConsoleMessage, + void Function(_i2.WebChromeClient, _i2.ConsoleMessage)? + onConsoleMessage, void Function(_i2.WebChromeClient)? onGeolocationPermissionsHidePrompt, void Function( @@ -1400,12 +1125,12 @@ class MockAndroidWebViewProxy extends _i1.Mock String, String, )? onJsAlert, - _i8.Future Function( + required _i8.Future Function( _i2.WebChromeClient, _i2.WebView, String, String, - )? onJsConfirm, + ) onJsConfirm, _i8.Future Function( _i2.WebChromeClient, _i2.WebView, @@ -1413,35 +1138,28 @@ class MockAndroidWebViewProxy extends _i1.Mock String, String, )? onJsPrompt, - void Function( - _i2.WebChromeClient, - _i2.PermissionRequest, - )? onPermissionRequest, - void Function( - _i2.WebChromeClient, - _i2.WebView, - int, - )? onProgressChanged, + void Function(_i2.WebChromeClient, _i2.PermissionRequest)? + onPermissionRequest, + void Function(_i2.WebChromeClient, _i2.WebView, int)? + onProgressChanged, void Function( _i2.WebChromeClient, _i2.View, _i2.CustomViewCallback, )? onShowCustomView, - _i8.Future> Function( + required _i8.Future> Function( _i2.WebChromeClient, _i2.WebView, _i2.FileChooserParams, - )? onShowFileChooser, + ) onShowFileChooser, }) => _FakeWebChromeClient_0( this, Invocation.getter(#newWebChromeClient), ), returnValueForMissingStub: ({ - void Function( - _i2.WebChromeClient, - _i2.ConsoleMessage, - )? onConsoleMessage, + void Function(_i2.WebChromeClient, _i2.ConsoleMessage)? + onConsoleMessage, void Function(_i2.WebChromeClient)? onGeolocationPermissionsHidePrompt, void Function( @@ -1456,12 +1174,12 @@ class MockAndroidWebViewProxy extends _i1.Mock String, String, )? onJsAlert, - _i8.Future Function( + required _i8.Future Function( _i2.WebChromeClient, _i2.WebView, String, String, - )? onJsConfirm, + ) onJsConfirm, _i8.Future Function( _i2.WebChromeClient, _i2.WebView, @@ -1469,35 +1187,39 @@ class MockAndroidWebViewProxy extends _i1.Mock String, String, )? onJsPrompt, - void Function( - _i2.WebChromeClient, - _i2.PermissionRequest, - )? onPermissionRequest, - void Function( - _i2.WebChromeClient, - _i2.WebView, - int, - )? onProgressChanged, + void Function(_i2.WebChromeClient, _i2.PermissionRequest)? + onPermissionRequest, + void Function(_i2.WebChromeClient, _i2.WebView, int)? + onProgressChanged, void Function( _i2.WebChromeClient, _i2.View, _i2.CustomViewCallback, )? onShowCustomView, - _i8.Future> Function( + required _i8.Future> Function( _i2.WebChromeClient, _i2.WebView, _i2.FileChooserParams, - )? onShowFileChooser, + ) onShowFileChooser, }) => _FakeWebChromeClient_0( this, Invocation.getter(#newWebChromeClient), ), ) as _i2.WebChromeClient Function({ - void Function( + required _i8.Future Function( + _i2.WebChromeClient, + _i2.WebView, + String, + String, + ) onJsConfirm, + required _i8.Future> Function( _i2.WebChromeClient, - _i2.ConsoleMessage, - )? onConsoleMessage, + _i2.WebView, + _i2.FileChooserParams, + ) onShowFileChooser, + void Function(_i2.WebChromeClient, _i2.ConsoleMessage)? + onConsoleMessage, void Function(_i2.WebChromeClient)? onGeolocationPermissionsHidePrompt, void Function( _i2.WebChromeClient, @@ -1511,12 +1233,6 @@ class MockAndroidWebViewProxy extends _i1.Mock String, String, )? onJsAlert, - _i8.Future Function( - _i2.WebChromeClient, - _i2.WebView, - String, - String, - )? onJsConfirm, _i8.Future Function( _i2.WebChromeClient, _i2.WebView, @@ -1524,25 +1240,14 @@ class MockAndroidWebViewProxy extends _i1.Mock String, String, )? onJsPrompt, - void Function( - _i2.WebChromeClient, - _i2.PermissionRequest, - )? onPermissionRequest, - void Function( - _i2.WebChromeClient, - _i2.WebView, - int, - )? onProgressChanged, + void Function(_i2.WebChromeClient, _i2.PermissionRequest)? + onPermissionRequest, + void Function(_i2.WebChromeClient, _i2.WebView, int)? onProgressChanged, void Function( _i2.WebChromeClient, _i2.View, _i2.CustomViewCallback, )? onShowCustomView, - _i8.Future> Function( - _i2.WebChromeClient, - _i2.WebView, - _i2.FileChooserParams, - )? onShowFileChooser, })); @override @@ -1693,22 +1398,15 @@ class MockExpensiveAndroidViewController extends _i1.Mock @override _i6.PointTransformer get pointTransformer => (super.noSuchMethod( Invocation.getter(#pointTransformer), - returnValue: (_i4.Offset position) => _FakeOffset_6( - this, - Invocation.getter(#pointTransformer), - ), - returnValueForMissingStub: (_i4.Offset position) => _FakeOffset_6( - this, - Invocation.getter(#pointTransformer), - ), + returnValue: (_i4.Offset position) => + _FakeOffset_6(this, Invocation.getter(#pointTransformer)), + returnValueForMissingStub: (_i4.Offset position) => + _FakeOffset_6(this, Invocation.getter(#pointTransformer)), ) as _i6.PointTransformer); @override set pointTransformer(_i6.PointTransformer? transformer) => super.noSuchMethod( - Invocation.setter( - #pointTransformer, - transformer, - ), + Invocation.setter(#pointTransformer, transformer), returnValueForMissingStub: null, ); @@ -1729,94 +1427,60 @@ class MockExpensiveAndroidViewController extends _i1.Mock @override _i8.Future setOffset(_i4.Offset? off) => (super.noSuchMethod( - Invocation.method( - #setOffset, - [off], - ), + Invocation.method(#setOffset, [off]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override - _i8.Future create({ - _i4.Size? size, - _i4.Offset? position, - }) => + _i8.Future create({_i4.Size? size, _i4.Offset? position}) => (super.noSuchMethod( - Invocation.method( - #create, - [], - { - #size: size, - #position: position, - }, - ), + Invocation.method(#create, [], {#size: size, #position: position}), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future<_i4.Size> setSize(_i4.Size? size) => (super.noSuchMethod( - Invocation.method( - #setSize, - [size], + Invocation.method(#setSize, [size]), + returnValue: _i8.Future<_i4.Size>.value( + _FakeSize_15(this, Invocation.method(#setSize, [size])), + ), + returnValueForMissingStub: _i8.Future<_i4.Size>.value( + _FakeSize_15(this, Invocation.method(#setSize, [size])), ), - returnValue: _i8.Future<_i4.Size>.value(_FakeSize_15( - this, - Invocation.method( - #setSize, - [size], - ), - )), - returnValueForMissingStub: _i8.Future<_i4.Size>.value(_FakeSize_15( - this, - Invocation.method( - #setSize, - [size], - ), - )), ) as _i8.Future<_i4.Size>); @override _i8.Future sendMotionEvent(_i6.AndroidMotionEvent? event) => (super.noSuchMethod( - Invocation.method( - #sendMotionEvent, - [event], - ), + Invocation.method(#sendMotionEvent, [event]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override void addOnPlatformViewCreatedListener( - _i6.PlatformViewCreatedCallback? listener) => + _i6.PlatformViewCreatedCallback? listener, + ) => super.noSuchMethod( - Invocation.method( - #addOnPlatformViewCreatedListener, - [listener], - ), + Invocation.method(#addOnPlatformViewCreatedListener, [listener]), returnValueForMissingStub: null, ); @override void removeOnPlatformViewCreatedListener( - _i6.PlatformViewCreatedCallback? listener) => + _i6.PlatformViewCreatedCallback? listener, + ) => super.noSuchMethod( - Invocation.method( - #removeOnPlatformViewCreatedListener, - [listener], - ), + Invocation.method(#removeOnPlatformViewCreatedListener, [listener]), returnValueForMissingStub: null, ); @override _i8.Future setLayoutDirection(_i4.TextDirection? layoutDirection) => (super.noSuchMethod( - Invocation.method( - #setLayoutDirection, - [layoutDirection], - ), + Invocation.method(#setLayoutDirection, [layoutDirection]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -1824,30 +1488,21 @@ class MockExpensiveAndroidViewController extends _i1.Mock @override _i8.Future dispatchPointerEvent(_i11.PointerEvent? event) => (super.noSuchMethod( - Invocation.method( - #dispatchPointerEvent, - [event], - ), + Invocation.method(#dispatchPointerEvent, [event]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future clearFocus() => (super.noSuchMethod( - Invocation.method( - #clearFocus, - [], - ), + Invocation.method(#clearFocus, []), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future dispose() => (super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), + Invocation.method(#dispose, []), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -1873,57 +1528,41 @@ class MockFlutterAssetManager extends _i1.Mock @override _i8.Future> list(String? path) => (super.noSuchMethod( - Invocation.method( - #list, - [path], - ), + Invocation.method(#list, [path]), returnValue: _i8.Future>.value([]), - returnValueForMissingStub: _i8.Future>.value([]), + returnValueForMissingStub: _i8.Future>.value( + [], + ), ) as _i8.Future>); @override _i8.Future getAssetFilePathByName(String? name) => (super.noSuchMethod( - Invocation.method( - #getAssetFilePathByName, - [name], - ), - returnValue: _i8.Future.value(_i12.dummyValue( - this, - Invocation.method( - #getAssetFilePathByName, - [name], + Invocation.method(#getAssetFilePathByName, [name]), + returnValue: _i8.Future.value( + _i12.dummyValue( + this, + Invocation.method(#getAssetFilePathByName, [name]), ), - )), - returnValueForMissingStub: - _i8.Future.value(_i12.dummyValue( - this, - Invocation.method( - #getAssetFilePathByName, - [name], + ), + returnValueForMissingStub: _i8.Future.value( + _i12.dummyValue( + this, + Invocation.method(#getAssetFilePathByName, [name]), ), - )), + ), ) as _i8.Future); @override _i2.FlutterAssetManager pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), returnValue: _FakeFlutterAssetManager_10( this, - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), ), returnValueForMissingStub: _FakeFlutterAssetManager_10( this, - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), ), ) as _i2.FlutterAssetManager); } @@ -1947,43 +1586,23 @@ class MockGeolocationPermissionsCallback extends _i1.Mock ) as _i2.PigeonInstanceManager); @override - _i8.Future invoke( - String? origin, - bool? allow, - bool? retain, - ) => + _i8.Future invoke(String? origin, bool? allow, bool? retain) => (super.noSuchMethod( - Invocation.method( - #invoke, - [ - origin, - allow, - retain, - ], - ), + Invocation.method(#invoke, [origin, allow, retain]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i2.GeolocationPermissionsCallback pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), returnValue: _FakeGeolocationPermissionsCallback_16( this, - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), ), returnValueForMissingStub: _FakeGeolocationPermissionsCallback_16( this, - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), ), ) as _i2.GeolocationPermissionsCallback); } @@ -2006,23 +1625,13 @@ class MockJavaScriptChannel extends _i1.Mock implements _i2.JavaScriptChannel { ) as String); @override - void Function( - _i2.JavaScriptChannel, - String, - ) get postMessage => (super.noSuchMethod( + void Function(_i2.JavaScriptChannel, String) get postMessage => + (super.noSuchMethod( Invocation.getter(#postMessage), - returnValue: ( - _i2.JavaScriptChannel pigeon_instance, - String message, - ) {}, - returnValueForMissingStub: ( - _i2.JavaScriptChannel pigeon_instance, - String message, - ) {}, - ) as void Function( - _i2.JavaScriptChannel, - String, - )); + returnValue: (_i2.JavaScriptChannel pigeon_instance, String message) {}, + returnValueForMissingStub: + (_i2.JavaScriptChannel pigeon_instance, String message) {}, + ) as void Function(_i2.JavaScriptChannel, String)); @override _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( @@ -2039,23 +1648,14 @@ class MockJavaScriptChannel extends _i1.Mock implements _i2.JavaScriptChannel { @override _i2.JavaScriptChannel pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), returnValue: _FakeJavaScriptChannel_8( this, - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), ), returnValueForMissingStub: _FakeJavaScriptChannel_8( this, - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), ), ) as _i2.JavaScriptChannel); } @@ -2086,43 +1686,28 @@ class MockPermissionRequest extends _i1.Mock implements _i2.PermissionRequest { @override _i8.Future grant(List? resources) => (super.noSuchMethod( - Invocation.method( - #grant, - [resources], - ), + Invocation.method(#grant, [resources]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future deny() => (super.noSuchMethod( - Invocation.method( - #deny, - [], - ), + Invocation.method(#deny, []), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i2.PermissionRequest pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), returnValue: _FakePermissionRequest_17( this, - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), ), returnValueForMissingStub: _FakePermissionRequest_17( this, - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), ), ) as _i2.PermissionRequest); } @@ -2143,47 +1728,35 @@ class MockPlatformViewsServiceProxy extends _i1.Mock _i4.VoidCallback? onFocus, }) => (super.noSuchMethod( - Invocation.method( - #initExpensiveAndroidView, - [], - { + Invocation.method(#initExpensiveAndroidView, [], { + #id: id, + #viewType: viewType, + #layoutDirection: layoutDirection, + #creationParams: creationParams, + #creationParamsCodec: creationParamsCodec, + #onFocus: onFocus, + }), + returnValue: _FakeExpensiveAndroidViewController_18( + this, + Invocation.method(#initExpensiveAndroidView, [], { #id: id, #viewType: viewType, #layoutDirection: layoutDirection, #creationParams: creationParams, #creationParamsCodec: creationParamsCodec, #onFocus: onFocus, - }, - ), - returnValue: _FakeExpensiveAndroidViewController_18( - this, - Invocation.method( - #initExpensiveAndroidView, - [], - { - #id: id, - #viewType: viewType, - #layoutDirection: layoutDirection, - #creationParams: creationParams, - #creationParamsCodec: creationParamsCodec, - #onFocus: onFocus, - }, - ), + }), ), returnValueForMissingStub: _FakeExpensiveAndroidViewController_18( this, - Invocation.method( - #initExpensiveAndroidView, - [], - { - #id: id, - #viewType: viewType, - #layoutDirection: layoutDirection, - #creationParams: creationParams, - #creationParamsCodec: creationParamsCodec, - #onFocus: onFocus, - }, - ), + Invocation.method(#initExpensiveAndroidView, [], { + #id: id, + #viewType: viewType, + #layoutDirection: layoutDirection, + #creationParams: creationParams, + #creationParamsCodec: creationParamsCodec, + #onFocus: onFocus, + }), ), ) as _i6.ExpensiveAndroidViewController); @@ -2197,47 +1770,35 @@ class MockPlatformViewsServiceProxy extends _i1.Mock _i4.VoidCallback? onFocus, }) => (super.noSuchMethod( - Invocation.method( - #initSurfaceAndroidView, - [], - { + Invocation.method(#initSurfaceAndroidView, [], { + #id: id, + #viewType: viewType, + #layoutDirection: layoutDirection, + #creationParams: creationParams, + #creationParamsCodec: creationParamsCodec, + #onFocus: onFocus, + }), + returnValue: _FakeSurfaceAndroidViewController_19( + this, + Invocation.method(#initSurfaceAndroidView, [], { #id: id, #viewType: viewType, #layoutDirection: layoutDirection, #creationParams: creationParams, #creationParamsCodec: creationParamsCodec, #onFocus: onFocus, - }, - ), - returnValue: _FakeSurfaceAndroidViewController_19( - this, - Invocation.method( - #initSurfaceAndroidView, - [], - { - #id: id, - #viewType: viewType, - #layoutDirection: layoutDirection, - #creationParams: creationParams, - #creationParamsCodec: creationParamsCodec, - #onFocus: onFocus, - }, - ), + }), ), returnValueForMissingStub: _FakeSurfaceAndroidViewController_19( this, - Invocation.method( - #initSurfaceAndroidView, - [], - { - #id: id, - #viewType: viewType, - #layoutDirection: layoutDirection, - #creationParams: creationParams, - #creationParamsCodec: creationParamsCodec, - #onFocus: onFocus, - }, - ), + Invocation.method(#initSurfaceAndroidView, [], { + #id: id, + #viewType: viewType, + #layoutDirection: layoutDirection, + #creationParams: creationParams, + #creationParamsCodec: creationParamsCodec, + #onFocus: onFocus, + }), ), ) as _i6.SurfaceAndroidViewController); } @@ -2271,22 +1832,15 @@ class MockSurfaceAndroidViewController extends _i1.Mock @override _i6.PointTransformer get pointTransformer => (super.noSuchMethod( Invocation.getter(#pointTransformer), - returnValue: (_i4.Offset position) => _FakeOffset_6( - this, - Invocation.getter(#pointTransformer), - ), - returnValueForMissingStub: (_i4.Offset position) => _FakeOffset_6( - this, - Invocation.getter(#pointTransformer), - ), + returnValue: (_i4.Offset position) => + _FakeOffset_6(this, Invocation.getter(#pointTransformer)), + returnValueForMissingStub: (_i4.Offset position) => + _FakeOffset_6(this, Invocation.getter(#pointTransformer)), ) as _i6.PointTransformer); @override set pointTransformer(_i6.PointTransformer? transformer) => super.noSuchMethod( - Invocation.setter( - #pointTransformer, - transformer, - ), + Invocation.setter(#pointTransformer, transformer), returnValueForMissingStub: null, ); @@ -2307,94 +1861,60 @@ class MockSurfaceAndroidViewController extends _i1.Mock @override _i8.Future setOffset(_i4.Offset? off) => (super.noSuchMethod( - Invocation.method( - #setOffset, - [off], - ), + Invocation.method(#setOffset, [off]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override - _i8.Future create({ - _i4.Size? size, - _i4.Offset? position, - }) => + _i8.Future create({_i4.Size? size, _i4.Offset? position}) => (super.noSuchMethod( - Invocation.method( - #create, - [], - { - #size: size, - #position: position, - }, - ), + Invocation.method(#create, [], {#size: size, #position: position}), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future<_i4.Size> setSize(_i4.Size? size) => (super.noSuchMethod( - Invocation.method( - #setSize, - [size], + Invocation.method(#setSize, [size]), + returnValue: _i8.Future<_i4.Size>.value( + _FakeSize_15(this, Invocation.method(#setSize, [size])), + ), + returnValueForMissingStub: _i8.Future<_i4.Size>.value( + _FakeSize_15(this, Invocation.method(#setSize, [size])), ), - returnValue: _i8.Future<_i4.Size>.value(_FakeSize_15( - this, - Invocation.method( - #setSize, - [size], - ), - )), - returnValueForMissingStub: _i8.Future<_i4.Size>.value(_FakeSize_15( - this, - Invocation.method( - #setSize, - [size], - ), - )), ) as _i8.Future<_i4.Size>); @override _i8.Future sendMotionEvent(_i6.AndroidMotionEvent? event) => (super.noSuchMethod( - Invocation.method( - #sendMotionEvent, - [event], - ), + Invocation.method(#sendMotionEvent, [event]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override void addOnPlatformViewCreatedListener( - _i6.PlatformViewCreatedCallback? listener) => + _i6.PlatformViewCreatedCallback? listener, + ) => super.noSuchMethod( - Invocation.method( - #addOnPlatformViewCreatedListener, - [listener], - ), + Invocation.method(#addOnPlatformViewCreatedListener, [listener]), returnValueForMissingStub: null, ); @override void removeOnPlatformViewCreatedListener( - _i6.PlatformViewCreatedCallback? listener) => + _i6.PlatformViewCreatedCallback? listener, + ) => super.noSuchMethod( - Invocation.method( - #removeOnPlatformViewCreatedListener, - [listener], - ), + Invocation.method(#removeOnPlatformViewCreatedListener, [listener]), returnValueForMissingStub: null, ); @override _i8.Future setLayoutDirection(_i4.TextDirection? layoutDirection) => (super.noSuchMethod( - Invocation.method( - #setLayoutDirection, - [layoutDirection], - ), + Invocation.method(#setLayoutDirection, [layoutDirection]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -2402,30 +1922,21 @@ class MockSurfaceAndroidViewController extends _i1.Mock @override _i8.Future dispatchPointerEvent(_i11.PointerEvent? event) => (super.noSuchMethod( - Invocation.method( - #dispatchPointerEvent, - [event], - ), + Invocation.method(#dispatchPointerEvent, [event]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future clearFocus() => (super.noSuchMethod( - Invocation.method( - #clearFocus, - [], - ), + Invocation.method(#clearFocus, []), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future dispose() => (super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), + Invocation.method(#dispose, []), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -2435,6 +1946,56 @@ class MockSurfaceAndroidViewController extends _i1.Mock /// /// See the documentation for Mockito's code generation for more information. class MockWebChromeClient extends _i1.Mock implements _i2.WebChromeClient { + @override + _i8.Future> Function( + _i2.WebChromeClient, + _i2.WebView, + _i2.FileChooserParams, + ) get onShowFileChooser => (super.noSuchMethod( + Invocation.getter(#onShowFileChooser), + returnValue: ( + _i2.WebChromeClient pigeon_instance, + _i2.WebView webView, + _i2.FileChooserParams params, + ) => + _i8.Future>.value([]), + returnValueForMissingStub: ( + _i2.WebChromeClient pigeon_instance, + _i2.WebView webView, + _i2.FileChooserParams params, + ) => + _i8.Future>.value([]), + ) as _i8.Future> Function( + _i2.WebChromeClient, + _i2.WebView, + _i2.FileChooserParams, + )); + + @override + _i8.Future Function(_i2.WebChromeClient, _i2.WebView, String, String) + get onJsConfirm => (super.noSuchMethod( + Invocation.getter(#onJsConfirm), + returnValue: ( + _i2.WebChromeClient pigeon_instance, + _i2.WebView webView, + String url, + String message, + ) => + _i8.Future.value(false), + returnValueForMissingStub: ( + _i2.WebChromeClient pigeon_instance, + _i2.WebView webView, + String url, + String message, + ) => + _i8.Future.value(false), + ) as _i8.Future Function( + _i2.WebChromeClient, + _i2.WebView, + String, + String, + )); + @override _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( Invocation.getter(#pigeon_instanceManager), @@ -2451,10 +2012,9 @@ class MockWebChromeClient extends _i1.Mock implements _i2.WebChromeClient { @override _i8.Future setSynchronousReturnValueForOnShowFileChooser(bool? value) => (super.noSuchMethod( - Invocation.method( - #setSynchronousReturnValueForOnShowFileChooser, - [value], - ), + Invocation.method(#setSynchronousReturnValueForOnShowFileChooser, [ + value, + ]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -2462,10 +2022,9 @@ class MockWebChromeClient extends _i1.Mock implements _i2.WebChromeClient { @override _i8.Future setSynchronousReturnValueForOnConsoleMessage(bool? value) => (super.noSuchMethod( - Invocation.method( - #setSynchronousReturnValueForOnConsoleMessage, - [value], - ), + Invocation.method(#setSynchronousReturnValueForOnConsoleMessage, [ + value, + ]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -2473,10 +2032,7 @@ class MockWebChromeClient extends _i1.Mock implements _i2.WebChromeClient { @override _i8.Future setSynchronousReturnValueForOnJsAlert(bool? value) => (super.noSuchMethod( - Invocation.method( - #setSynchronousReturnValueForOnJsAlert, - [value], - ), + Invocation.method(#setSynchronousReturnValueForOnJsAlert, [value]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -2484,10 +2040,9 @@ class MockWebChromeClient extends _i1.Mock implements _i2.WebChromeClient { @override _i8.Future setSynchronousReturnValueForOnJsConfirm(bool? value) => (super.noSuchMethod( - Invocation.method( - #setSynchronousReturnValueForOnJsConfirm, - [value], - ), + Invocation.method(#setSynchronousReturnValueForOnJsConfirm, [ + value, + ]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -2495,33 +2050,21 @@ class MockWebChromeClient extends _i1.Mock implements _i2.WebChromeClient { @override _i8.Future setSynchronousReturnValueForOnJsPrompt(bool? value) => (super.noSuchMethod( - Invocation.method( - #setSynchronousReturnValueForOnJsPrompt, - [value], - ), + Invocation.method(#setSynchronousReturnValueForOnJsPrompt, [value]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i2.WebChromeClient pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), returnValue: _FakeWebChromeClient_0( this, - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), ), returnValueForMissingStub: _FakeWebChromeClient_0( this, - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), ), ) as _i2.WebChromeClient); } @@ -2545,10 +2088,7 @@ class MockWebSettings extends _i1.Mock implements _i2.WebSettings { @override _i8.Future setDomStorageEnabled(bool? flag) => (super.noSuchMethod( - Invocation.method( - #setDomStorageEnabled, - [flag], - ), + Invocation.method(#setDomStorageEnabled, [flag]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -2556,10 +2096,9 @@ class MockWebSettings extends _i1.Mock implements _i2.WebSettings { @override _i8.Future setJavaScriptCanOpenWindowsAutomatically(bool? flag) => (super.noSuchMethod( - Invocation.method( - #setJavaScriptCanOpenWindowsAutomatically, - [flag], - ), + Invocation.method(#setJavaScriptCanOpenWindowsAutomatically, [ + flag, + ]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -2567,20 +2106,14 @@ class MockWebSettings extends _i1.Mock implements _i2.WebSettings { @override _i8.Future setSupportMultipleWindows(bool? support) => (super.noSuchMethod( - Invocation.method( - #setSupportMultipleWindows, - [support], - ), + Invocation.method(#setSupportMultipleWindows, [support]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setJavaScriptEnabled(bool? flag) => (super.noSuchMethod( - Invocation.method( - #setJavaScriptEnabled, - [flag], - ), + Invocation.method(#setJavaScriptEnabled, [flag]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -2588,10 +2121,7 @@ class MockWebSettings extends _i1.Mock implements _i2.WebSettings { @override _i8.Future setUserAgentString(String? userAgentString) => (super.noSuchMethod( - Invocation.method( - #setUserAgentString, - [userAgentString], - ), + Invocation.method(#setUserAgentString, [userAgentString]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -2599,20 +2129,14 @@ class MockWebSettings extends _i1.Mock implements _i2.WebSettings { @override _i8.Future setMediaPlaybackRequiresUserGesture(bool? require) => (super.noSuchMethod( - Invocation.method( - #setMediaPlaybackRequiresUserGesture, - [require], - ), + Invocation.method(#setMediaPlaybackRequiresUserGesture, [require]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setSupportZoom(bool? support) => (super.noSuchMethod( - Invocation.method( - #setSupportZoom, - [support], - ), + Invocation.method(#setSupportZoom, [support]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -2620,126 +2144,87 @@ class MockWebSettings extends _i1.Mock implements _i2.WebSettings { @override _i8.Future setLoadWithOverviewMode(bool? overview) => (super.noSuchMethod( - Invocation.method( - #setLoadWithOverviewMode, - [overview], - ), + Invocation.method(#setLoadWithOverviewMode, [overview]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setUseWideViewPort(bool? use) => (super.noSuchMethod( - Invocation.method( - #setUseWideViewPort, - [use], - ), + Invocation.method(#setUseWideViewPort, [use]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setDisplayZoomControls(bool? enabled) => (super.noSuchMethod( - Invocation.method( - #setDisplayZoomControls, - [enabled], - ), + Invocation.method(#setDisplayZoomControls, [enabled]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setBuiltInZoomControls(bool? enabled) => (super.noSuchMethod( - Invocation.method( - #setBuiltInZoomControls, - [enabled], - ), + Invocation.method(#setBuiltInZoomControls, [enabled]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setAllowFileAccess(bool? enabled) => (super.noSuchMethod( - Invocation.method( - #setAllowFileAccess, - [enabled], - ), + Invocation.method(#setAllowFileAccess, [enabled]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setAllowContentAccess(bool? enabled) => (super.noSuchMethod( - Invocation.method( - #setAllowContentAccess, - [enabled], - ), + Invocation.method(#setAllowContentAccess, [enabled]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setGeolocationEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method( - #setGeolocationEnabled, - [enabled], - ), + Invocation.method(#setGeolocationEnabled, [enabled]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setTextZoom(int? textZoom) => (super.noSuchMethod( - Invocation.method( - #setTextZoom, - [textZoom], - ), + Invocation.method(#setTextZoom, [textZoom]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future getUserAgentString() => (super.noSuchMethod( - Invocation.method( - #getUserAgentString, - [], - ), - returnValue: _i8.Future.value(_i12.dummyValue( - this, - Invocation.method( - #getUserAgentString, - [], + Invocation.method(#getUserAgentString, []), + returnValue: _i8.Future.value( + _i12.dummyValue( + this, + Invocation.method(#getUserAgentString, []), ), - )), - returnValueForMissingStub: - _i8.Future.value(_i12.dummyValue( - this, - Invocation.method( - #getUserAgentString, - [], + ), + returnValueForMissingStub: _i8.Future.value( + _i12.dummyValue( + this, + Invocation.method(#getUserAgentString, []), ), - )), + ), ) as _i8.Future); @override _i2.WebSettings pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), returnValue: _FakeWebSettings_20( this, - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), ), returnValueForMissingStub: _FakeWebSettings_20( this, - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), ), ) as _i2.WebSettings); } @@ -2776,41 +2261,21 @@ class MockWebView extends _i1.Mock implements _i2.WebView { @override _i2.WebSettings pigeonVar_settings() => (super.noSuchMethod( - Invocation.method( - #pigeonVar_settings, - [], - ), + Invocation.method(#pigeonVar_settings, []), returnValue: _FakeWebSettings_20( this, - Invocation.method( - #pigeonVar_settings, - [], - ), + Invocation.method(#pigeonVar_settings, []), ), returnValueForMissingStub: _FakeWebSettings_20( this, - Invocation.method( - #pigeonVar_settings, - [], - ), + Invocation.method(#pigeonVar_settings, []), ), ) as _i2.WebSettings); @override - _i8.Future loadData( - String? data, - String? mimeType, - String? encoding, - ) => + _i8.Future loadData(String? data, String? mimeType, String? encoding) => (super.noSuchMethod( - Invocation.method( - #loadData, - [ - data, - mimeType, - encoding, - ], - ), + Invocation.method(#loadData, [data, mimeType, encoding]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -2824,120 +2289,78 @@ class MockWebView extends _i1.Mock implements _i2.WebView { String? historyUrl, ) => (super.noSuchMethod( - Invocation.method( - #loadDataWithBaseUrl, - [ - baseUrl, - data, - mimeType, - encoding, - historyUrl, - ], - ), + Invocation.method(#loadDataWithBaseUrl, [ + baseUrl, + data, + mimeType, + encoding, + historyUrl, + ]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override - _i8.Future loadUrl( - String? url, - Map? headers, - ) => + _i8.Future loadUrl(String? url, Map? headers) => (super.noSuchMethod( - Invocation.method( - #loadUrl, - [ - url, - headers, - ], - ), + Invocation.method(#loadUrl, [url, headers]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override - _i8.Future postUrl( - String? url, - _i13.Uint8List? data, - ) => + _i8.Future postUrl(String? url, _i13.Uint8List? data) => (super.noSuchMethod( - Invocation.method( - #postUrl, - [ - url, - data, - ], - ), + Invocation.method(#postUrl, [url, data]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future getUrl() => (super.noSuchMethod( - Invocation.method( - #getUrl, - [], - ), + Invocation.method(#getUrl, []), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future canGoBack() => (super.noSuchMethod( - Invocation.method( - #canGoBack, - [], - ), + Invocation.method(#canGoBack, []), returnValue: _i8.Future.value(false), returnValueForMissingStub: _i8.Future.value(false), ) as _i8.Future); @override _i8.Future canGoForward() => (super.noSuchMethod( - Invocation.method( - #canGoForward, - [], - ), + Invocation.method(#canGoForward, []), returnValue: _i8.Future.value(false), returnValueForMissingStub: _i8.Future.value(false), ) as _i8.Future); @override _i8.Future goBack() => (super.noSuchMethod( - Invocation.method( - #goBack, - [], - ), + Invocation.method(#goBack, []), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future goForward() => (super.noSuchMethod( - Invocation.method( - #goForward, - [], - ), + Invocation.method(#goForward, []), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future reload() => (super.noSuchMethod( - Invocation.method( - #reload, - [], - ), + Invocation.method(#reload, []), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future clearCache(bool? includeDiskFiles) => (super.noSuchMethod( - Invocation.method( - #clearCache, - [includeDiskFiles], - ), + Invocation.method(#clearCache, [includeDiskFiles]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -2945,20 +2368,14 @@ class MockWebView extends _i1.Mock implements _i2.WebView { @override _i8.Future evaluateJavascript(String? javascriptString) => (super.noSuchMethod( - Invocation.method( - #evaluateJavascript, - [javascriptString], - ), + Invocation.method(#evaluateJavascript, [javascriptString]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future getTitle() => (super.noSuchMethod( - Invocation.method( - #getTitle, - [], - ), + Invocation.method(#getTitle, []), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -2966,10 +2383,7 @@ class MockWebView extends _i1.Mock implements _i2.WebView { @override _i8.Future setWebViewClient(_i2.WebViewClient? client) => (super.noSuchMethod( - Invocation.method( - #setWebViewClient, - [client], - ), + Invocation.method(#setWebViewClient, [client]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -2977,20 +2391,14 @@ class MockWebView extends _i1.Mock implements _i2.WebView { @override _i8.Future addJavaScriptChannel(_i2.JavaScriptChannel? channel) => (super.noSuchMethod( - Invocation.method( - #addJavaScriptChannel, - [channel], - ), + Invocation.method(#addJavaScriptChannel, [channel]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future removeJavaScriptChannel(String? name) => (super.noSuchMethod( - Invocation.method( - #removeJavaScriptChannel, - [name], - ), + Invocation.method(#removeJavaScriptChannel, [name]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -2998,10 +2406,7 @@ class MockWebView extends _i1.Mock implements _i2.WebView { @override _i8.Future setDownloadListener(_i2.DownloadListener? listener) => (super.noSuchMethod( - Invocation.method( - #setDownloadListener, - [listener], - ), + Invocation.method(#setDownloadListener, [listener]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -3009,111 +2414,67 @@ class MockWebView extends _i1.Mock implements _i2.WebView { @override _i8.Future setWebChromeClient(_i2.WebChromeClient? client) => (super.noSuchMethod( - Invocation.method( - #setWebChromeClient, - [client], - ), + Invocation.method(#setWebChromeClient, [client]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setBackgroundColor(int? color) => (super.noSuchMethod( - Invocation.method( - #setBackgroundColor, - [color], - ), + Invocation.method(#setBackgroundColor, [color]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future destroy() => (super.noSuchMethod( - Invocation.method( - #destroy, - [], - ), + Invocation.method(#destroy, []), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i2.WebView pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), returnValue: _FakeWebView_7( this, - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), ), returnValueForMissingStub: _FakeWebView_7( this, - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), ), ) as _i2.WebView); @override - _i8.Future scrollTo( - int? x, - int? y, - ) => - (super.noSuchMethod( - Invocation.method( - #scrollTo, - [ - x, - y, - ], - ), + _i8.Future scrollTo(int? x, int? y) => (super.noSuchMethod( + Invocation.method(#scrollTo, [x, y]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override - _i8.Future scrollBy( - int? x, - int? y, - ) => - (super.noSuchMethod( - Invocation.method( - #scrollBy, - [ - x, - y, - ], - ), + _i8.Future scrollBy(int? x, int? y) => (super.noSuchMethod( + Invocation.method(#scrollBy, [x, y]), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future<_i2.WebViewPoint> getScrollPosition() => (super.noSuchMethod( - Invocation.method( - #getScrollPosition, - [], - ), - returnValue: _i8.Future<_i2.WebViewPoint>.value(_FakeWebViewPoint_21( - this, - Invocation.method( - #getScrollPosition, - [], + Invocation.method(#getScrollPosition, []), + returnValue: _i8.Future<_i2.WebViewPoint>.value( + _FakeWebViewPoint_21( + this, + Invocation.method(#getScrollPosition, []), ), - )), - returnValueForMissingStub: - _i8.Future<_i2.WebViewPoint>.value(_FakeWebViewPoint_21( - this, - Invocation.method( - #getScrollPosition, - [], + ), + returnValueForMissingStub: _i8.Future<_i2.WebViewPoint>.value( + _FakeWebViewPoint_21( + this, + Invocation.method(#getScrollPosition, []), ), - )), + ), ) as _i8.Future<_i2.WebViewPoint>); } @@ -3136,7 +2497,8 @@ class MockWebViewClient extends _i1.Mock implements _i2.WebViewClient { @override _i8.Future setSynchronousReturnValueForShouldOverrideUrlLoading( - bool? value) => + bool? value, + ) => (super.noSuchMethod( Invocation.method( #setSynchronousReturnValueForShouldOverrideUrlLoading, @@ -3148,23 +2510,14 @@ class MockWebViewClient extends _i1.Mock implements _i2.WebViewClient { @override _i2.WebViewClient pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), returnValue: _FakeWebViewClient_1( this, - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), ), returnValueForMissingStub: _FakeWebViewClient_1( this, - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), ), ) as _i2.WebViewClient); } @@ -3188,33 +2541,21 @@ class MockWebStorage extends _i1.Mock implements _i2.WebStorage { @override _i8.Future deleteAllData() => (super.noSuchMethod( - Invocation.method( - #deleteAllData, - [], - ), + Invocation.method(#deleteAllData, []), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i2.WebStorage pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), returnValue: _FakeWebStorage_11( this, - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), ), returnValueForMissingStub: _FakeWebStorage_11( this, - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), ), ) as _i2.WebStorage); } diff --git a/packages/webview_flutter/webview_flutter_android/test/android_webview_cookie_manager_test.mocks.dart b/packages/webview_flutter/webview_flutter_android/test/android_webview_cookie_manager_test.mocks.dart index 9a80b3c10f1..8d6b892fcfc 100644 --- a/packages/webview_flutter/webview_flutter_android/test/android_webview_cookie_manager_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_android/test/android_webview_cookie_manager_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.5 from annotations // in webview_flutter_android/test/android_webview_cookie_manager_test.dart. // Do not manually edit this file. @@ -21,6 +21,7 @@ import 'package:webview_flutter_platform_interface/webview_flutter_platform_inte // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types @@ -28,23 +29,13 @@ import 'package:webview_flutter_platform_interface/webview_flutter_platform_inte class _FakePigeonInstanceManager_0 extends _i1.SmartFake implements _i2.PigeonInstanceManager { - _FakePigeonInstanceManager_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakePigeonInstanceManager_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeCookieManager_1 extends _i1.SmartFake implements _i2.CookieManager { - _FakeCookieManager_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeCookieManager_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakePlatformWebViewControllerCreationParams_2 extends _i1.SmartFake @@ -52,30 +43,17 @@ class _FakePlatformWebViewControllerCreationParams_2 extends _i1.SmartFake _FakePlatformWebViewControllerCreationParams_2( Object parent, Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + ) : super(parent, parentInvocation); } class _FakeObject_3 extends _i1.SmartFake implements Object { - _FakeObject_3( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeObject_3(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeOffset_4 extends _i1.SmartFake implements _i4.Offset { - _FakeOffset_4( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeOffset_4(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [CookieManager]. @@ -96,28 +74,15 @@ class MockCookieManager extends _i1.Mock implements _i2.CookieManager { ) as _i2.PigeonInstanceManager); @override - _i5.Future setCookie( - String? url, - String? value, - ) => - (super.noSuchMethod( - Invocation.method( - #setCookie, - [ - url, - value, - ], - ), + _i5.Future setCookie(String? url, String? value) => (super.noSuchMethod( + Invocation.method(#setCookie, [url, value]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future removeAllCookies() => (super.noSuchMethod( - Invocation.method( - #removeAllCookies, - [], - ), + Invocation.method(#removeAllCookies, []), returnValue: _i5.Future.value(false), ) as _i5.Future); @@ -127,29 +92,17 @@ class MockCookieManager extends _i1.Mock implements _i2.CookieManager { bool? accept, ) => (super.noSuchMethod( - Invocation.method( - #setAcceptThirdPartyCookies, - [ - webView, - accept, - ], - ), + Invocation.method(#setAcceptThirdPartyCookies, [webView, accept]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i2.CookieManager pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), returnValue: _FakeCookieManager_1( this, - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), ), ) as _i2.CookieManager); } @@ -164,10 +117,9 @@ class MockAndroidWebViewController extends _i1.Mock } @override - int get webViewIdentifier => (super.noSuchMethod( - Invocation.getter(#webViewIdentifier), - returnValue: 0, - ) as int); + int get webViewIdentifier => + (super.noSuchMethod(Invocation.getter(#webViewIdentifier), returnValue: 0) + as int); @override _i3.PlatformWebViewControllerCreationParams get params => (super.noSuchMethod( @@ -180,45 +132,29 @@ class MockAndroidWebViewController extends _i1.Mock @override _i5.Future setAllowFileAccess(bool? allow) => (super.noSuchMethod( - Invocation.method( - #setAllowFileAccess, - [allow], - ), + Invocation.method(#setAllowFileAccess, [allow]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future loadFile(String? absoluteFilePath) => (super.noSuchMethod( - Invocation.method( - #loadFile, - [absoluteFilePath], - ), + Invocation.method(#loadFile, [absoluteFilePath]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future loadFlutterAsset(String? key) => (super.noSuchMethod( - Invocation.method( - #loadFlutterAsset, - [key], - ), + Invocation.method(#loadFlutterAsset, [key]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override - _i5.Future loadHtmlString( - String? html, { - String? baseUrl, - }) => + _i5.Future loadHtmlString(String? html, {String? baseUrl}) => (super.noSuchMethod( - Invocation.method( - #loadHtmlString, - [html], - {#baseUrl: baseUrl}, - ), + Invocation.method(#loadHtmlString, [html], {#baseUrl: baseUrl}), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @@ -226,109 +162,77 @@ class MockAndroidWebViewController extends _i1.Mock @override _i5.Future loadRequest(_i3.LoadRequestParams? params) => (super.noSuchMethod( - Invocation.method( - #loadRequest, - [params], - ), + Invocation.method(#loadRequest, [params]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future currentUrl() => (super.noSuchMethod( - Invocation.method( - #currentUrl, - [], - ), + Invocation.method(#currentUrl, []), returnValue: _i5.Future.value(), ) as _i5.Future); @override _i5.Future canGoBack() => (super.noSuchMethod( - Invocation.method( - #canGoBack, - [], - ), + Invocation.method(#canGoBack, []), returnValue: _i5.Future.value(false), ) as _i5.Future); @override _i5.Future canGoForward() => (super.noSuchMethod( - Invocation.method( - #canGoForward, - [], - ), + Invocation.method(#canGoForward, []), returnValue: _i5.Future.value(false), ) as _i5.Future); @override _i5.Future goBack() => (super.noSuchMethod( - Invocation.method( - #goBack, - [], - ), + Invocation.method(#goBack, []), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future goForward() => (super.noSuchMethod( - Invocation.method( - #goForward, - [], - ), + Invocation.method(#goForward, []), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future reload() => (super.noSuchMethod( - Invocation.method( - #reload, - [], - ), + Invocation.method(#reload, []), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future clearCache() => (super.noSuchMethod( - Invocation.method( - #clearCache, - [], - ), + Invocation.method(#clearCache, []), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future clearLocalStorage() => (super.noSuchMethod( - Invocation.method( - #clearLocalStorage, - [], - ), + Invocation.method(#clearLocalStorage, []), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future setPlatformNavigationDelegate( - _i3.PlatformNavigationDelegate? handler) => + _i3.PlatformNavigationDelegate? handler, + ) => (super.noSuchMethod( - Invocation.method( - #setPlatformNavigationDelegate, - [handler], - ), + Invocation.method(#setPlatformNavigationDelegate, [handler]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future runJavaScript(String? javaScript) => (super.noSuchMethod( - Invocation.method( - #runJavaScript, - [javaScript], - ), + Invocation.method(#runJavaScript, [javaScript]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @@ -336,27 +240,21 @@ class MockAndroidWebViewController extends _i1.Mock @override _i5.Future runJavaScriptReturningResult(String? javaScript) => (super.noSuchMethod( - Invocation.method( - #runJavaScriptReturningResult, - [javaScript], - ), - returnValue: _i5.Future.value(_FakeObject_3( - this, - Invocation.method( - #runJavaScriptReturningResult, - [javaScript], + Invocation.method(#runJavaScriptReturningResult, [javaScript]), + returnValue: _i5.Future.value( + _FakeObject_3( + this, + Invocation.method(#runJavaScriptReturningResult, [javaScript]), ), - )), + ), ) as _i5.Future); @override _i5.Future addJavaScriptChannel( - _i3.JavaScriptChannelParams? javaScriptChannelParams) => + _i3.JavaScriptChannelParams? javaScriptChannelParams, + ) => (super.noSuchMethod( - Invocation.method( - #addJavaScriptChannel, - [javaScriptChannelParams], - ), + Invocation.method(#addJavaScriptChannel, [javaScriptChannelParams]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @@ -364,88 +262,51 @@ class MockAndroidWebViewController extends _i1.Mock @override _i5.Future removeJavaScriptChannel(String? javaScriptChannelName) => (super.noSuchMethod( - Invocation.method( - #removeJavaScriptChannel, - [javaScriptChannelName], - ), + Invocation.method(#removeJavaScriptChannel, [ + javaScriptChannelName, + ]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future getTitle() => (super.noSuchMethod( - Invocation.method( - #getTitle, - [], - ), + Invocation.method(#getTitle, []), returnValue: _i5.Future.value(), ) as _i5.Future); @override - _i5.Future scrollTo( - int? x, - int? y, - ) => - (super.noSuchMethod( - Invocation.method( - #scrollTo, - [ - x, - y, - ], - ), + _i5.Future scrollTo(int? x, int? y) => (super.noSuchMethod( + Invocation.method(#scrollTo, [x, y]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override - _i5.Future scrollBy( - int? x, - int? y, - ) => - (super.noSuchMethod( - Invocation.method( - #scrollBy, - [ - x, - y, - ], - ), + _i5.Future scrollBy(int? x, int? y) => (super.noSuchMethod( + Invocation.method(#scrollBy, [x, y]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future<_i4.Offset> getScrollPosition() => (super.noSuchMethod( - Invocation.method( - #getScrollPosition, - [], + Invocation.method(#getScrollPosition, []), + returnValue: _i5.Future<_i4.Offset>.value( + _FakeOffset_4(this, Invocation.method(#getScrollPosition, [])), ), - returnValue: _i5.Future<_i4.Offset>.value(_FakeOffset_4( - this, - Invocation.method( - #getScrollPosition, - [], - ), - )), ) as _i5.Future<_i4.Offset>); @override _i5.Future enableZoom(bool? enabled) => (super.noSuchMethod( - Invocation.method( - #enableZoom, - [enabled], - ), + Invocation.method(#enableZoom, [enabled]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future setBackgroundColor(_i4.Color? color) => (super.noSuchMethod( - Invocation.method( - #setBackgroundColor, - [color], - ), + Invocation.method(#setBackgroundColor, [color]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @@ -453,32 +314,26 @@ class MockAndroidWebViewController extends _i1.Mock @override _i5.Future setJavaScriptMode(_i3.JavaScriptMode? javaScriptMode) => (super.noSuchMethod( - Invocation.method( - #setJavaScriptMode, - [javaScriptMode], - ), + Invocation.method(#setJavaScriptMode, [javaScriptMode]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future setUserAgent(String? userAgent) => (super.noSuchMethod( - Invocation.method( - #setUserAgent, - [userAgent], - ), + Invocation.method(#setUserAgent, [userAgent]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future setOnScrollPositionChange( - void Function(_i3.ScrollPositionChange)? onScrollPositionChange) => + void Function(_i3.ScrollPositionChange)? onScrollPositionChange, + ) => (super.noSuchMethod( - Invocation.method( - #setOnScrollPositionChange, - [onScrollPositionChange], - ), + Invocation.method(#setOnScrollPositionChange, [ + onScrollPositionChange, + ]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @@ -486,66 +341,51 @@ class MockAndroidWebViewController extends _i1.Mock @override _i5.Future setMediaPlaybackRequiresUserGesture(bool? require) => (super.noSuchMethod( - Invocation.method( - #setMediaPlaybackRequiresUserGesture, - [require], - ), + Invocation.method(#setMediaPlaybackRequiresUserGesture, [require]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future setTextZoom(int? textZoom) => (super.noSuchMethod( - Invocation.method( - #setTextZoom, - [textZoom], - ), + Invocation.method(#setTextZoom, [textZoom]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future setAllowContentAccess(bool? enabled) => (super.noSuchMethod( - Invocation.method( - #setAllowContentAccess, - [enabled], - ), + Invocation.method(#setAllowContentAccess, [enabled]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future setGeolocationEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method( - #setGeolocationEnabled, - [enabled], - ), + Invocation.method(#setGeolocationEnabled, [enabled]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future setOnShowFileSelector( - _i5.Future> Function(_i6.FileSelectorParams)? - onShowFileSelector) => + _i5.Future> Function(_i6.FileSelectorParams)? + onShowFileSelector, + ) => (super.noSuchMethod( - Invocation.method( - #setOnShowFileSelector, - [onShowFileSelector], - ), + Invocation.method(#setOnShowFileSelector, [onShowFileSelector]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future setOnPlatformPermissionRequest( - void Function(_i3.PlatformWebViewPermissionRequest)? - onPermissionRequest) => + void Function(_i3.PlatformWebViewPermissionRequest)? onPermissionRequest, + ) => (super.noSuchMethod( - Invocation.method( - #setOnPlatformPermissionRequest, - [onPermissionRequest], - ), + Invocation.method(#setOnPlatformPermissionRequest, [ + onPermissionRequest, + ]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @@ -556,14 +396,10 @@ class MockAndroidWebViewController extends _i1.Mock _i6.OnGeolocationPermissionsHidePrompt? onHidePrompt, }) => (super.noSuchMethod( - Invocation.method( - #setGeolocationPermissionsPromptCallbacks, - [], - { - #onShowPrompt: onShowPrompt, - #onHidePrompt: onHidePrompt, - }, - ), + Invocation.method(#setGeolocationPermissionsPromptCallbacks, [], { + #onShowPrompt: onShowPrompt, + #onHidePrompt: onHidePrompt, + }), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @@ -574,74 +410,65 @@ class MockAndroidWebViewController extends _i1.Mock required _i6.OnHideCustomWidgetCallback? onHideCustomWidget, }) => (super.noSuchMethod( - Invocation.method( - #setCustomWidgetCallbacks, - [], - { - #onShowCustomWidget: onShowCustomWidget, - #onHideCustomWidget: onHideCustomWidget, - }, - ), + Invocation.method(#setCustomWidgetCallbacks, [], { + #onShowCustomWidget: onShowCustomWidget, + #onHideCustomWidget: onHideCustomWidget, + }), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future setOnConsoleMessage( - void Function(_i3.JavaScriptConsoleMessage)? onConsoleMessage) => + void Function(_i3.JavaScriptConsoleMessage)? onConsoleMessage, + ) => (super.noSuchMethod( - Invocation.method( - #setOnConsoleMessage, - [onConsoleMessage], - ), + Invocation.method(#setOnConsoleMessage, [onConsoleMessage]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future getUserAgent() => (super.noSuchMethod( - Invocation.method( - #getUserAgent, - [], - ), + Invocation.method(#getUserAgent, []), returnValue: _i5.Future.value(), ) as _i5.Future); @override _i5.Future setOnJavaScriptAlertDialog( - _i5.Future Function(_i3.JavaScriptAlertDialogRequest)? - onJavaScriptAlertDialog) => + _i5.Future Function(_i3.JavaScriptAlertDialogRequest)? + onJavaScriptAlertDialog, + ) => (super.noSuchMethod( - Invocation.method( - #setOnJavaScriptAlertDialog, - [onJavaScriptAlertDialog], - ), + Invocation.method(#setOnJavaScriptAlertDialog, [ + onJavaScriptAlertDialog, + ]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future setOnJavaScriptConfirmDialog( - _i5.Future Function(_i3.JavaScriptConfirmDialogRequest)? - onJavaScriptConfirmDialog) => + _i5.Future Function(_i3.JavaScriptConfirmDialogRequest)? + onJavaScriptConfirmDialog, + ) => (super.noSuchMethod( - Invocation.method( - #setOnJavaScriptConfirmDialog, - [onJavaScriptConfirmDialog], - ), + Invocation.method(#setOnJavaScriptConfirmDialog, [ + onJavaScriptConfirmDialog, + ]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future setOnJavaScriptTextInputDialog( - _i5.Future Function(_i3.JavaScriptTextInputDialogRequest)? - onJavaScriptTextInputDialog) => + _i5.Future Function(_i3.JavaScriptTextInputDialogRequest)? + onJavaScriptTextInputDialog, + ) => (super.noSuchMethod( - Invocation.method( - #setOnJavaScriptTextInputDialog, - [onJavaScriptTextInputDialog], - ), + Invocation.method(#setOnJavaScriptTextInputDialog, [ + onJavaScriptTextInputDialog, + ]), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); diff --git a/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_cookie_manager_test.mocks.dart b/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_cookie_manager_test.mocks.dart index 28c0d95b814..68d1d82b29c 100644 --- a/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_cookie_manager_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_cookie_manager_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.5 from annotations // in webview_flutter_android/test/legacy/webview_android_cookie_manager_test.dart. // Do not manually edit this file. @@ -16,6 +16,7 @@ import 'package:webview_flutter_android/src/android_webkit.g.dart' as _i2; // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types @@ -23,23 +24,13 @@ import 'package:webview_flutter_android/src/android_webkit.g.dart' as _i2; class _FakePigeonInstanceManager_0 extends _i1.SmartFake implements _i2.PigeonInstanceManager { - _FakePigeonInstanceManager_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakePigeonInstanceManager_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeCookieManager_1 extends _i1.SmartFake implements _i2.CookieManager { - _FakeCookieManager_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeCookieManager_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [CookieManager]. @@ -60,28 +51,15 @@ class MockCookieManager extends _i1.Mock implements _i2.CookieManager { ) as _i2.PigeonInstanceManager); @override - _i3.Future setCookie( - String? url, - String? value, - ) => - (super.noSuchMethod( - Invocation.method( - #setCookie, - [ - url, - value, - ], - ), + _i3.Future setCookie(String? url, String? value) => (super.noSuchMethod( + Invocation.method(#setCookie, [url, value]), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override _i3.Future removeAllCookies() => (super.noSuchMethod( - Invocation.method( - #removeAllCookies, - [], - ), + Invocation.method(#removeAllCookies, []), returnValue: _i3.Future.value(false), ) as _i3.Future); @@ -91,29 +69,17 @@ class MockCookieManager extends _i1.Mock implements _i2.CookieManager { bool? accept, ) => (super.noSuchMethod( - Invocation.method( - #setAcceptThirdPartyCookies, - [ - webView, - accept, - ], - ), + Invocation.method(#setAcceptThirdPartyCookies, [webView, accept]), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override _i2.CookieManager pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), returnValue: _FakeCookieManager_1( this, - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), ), ) as _i2.CookieManager); } diff --git a/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_widget_test.dart b/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_widget_test.dart index db160b9e5b8..0729179af85 100644 --- a/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_widget_test.dart +++ b/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_widget_test.dart @@ -66,6 +66,9 @@ void main() { onReceivedRequestError: anyNamed('onReceivedRequestError'), requestLoading: anyNamed('requestLoading'), urlLoading: anyNamed('urlLoading'), + onReceivedSslError: anyNamed('onReceivedSslError'), + onFormResubmission: anyNamed('onFormResubmission'), + onReceivedClientCertRequest: anyNamed('onReceivedClientCertRequest'), )).thenReturn(mockWebViewClient); mockCallbacksHandler = MockWebViewPlatformCallbacksHandler(); @@ -237,6 +240,10 @@ void main() { onReceivedRequestError: anyNamed('onReceivedRequestError'), requestLoading: anyNamed('requestLoading'), urlLoading: anyNamed('urlLoading'), + onReceivedSslError: anyNamed('onReceivedSslError'), + onFormResubmission: anyNamed('onFormResubmission'), + onReceivedClientCertRequest: + anyNamed('onReceivedClientCertRequest'), )).thenReturn(mockWebViewClient); await buildWidget( @@ -733,6 +740,9 @@ void main() { onReceivedRequestError: anyNamed('onReceivedRequestError'), requestLoading: anyNamed('requestLoading'), urlLoading: anyNamed('urlLoading'), + onReceivedSslError: anyNamed('onReceivedSslError'), + onFormResubmission: anyNamed('onFormResubmission'), + onReceivedClientCertRequest: anyNamed('onReceivedClientCertRequest'), )).captured.single as void Function( android_webview.WebViewClient, android_webview.WebView, String); @@ -752,6 +762,9 @@ void main() { onReceivedRequestError: anyNamed('onReceivedRequestError'), requestLoading: anyNamed('requestLoading'), urlLoading: anyNamed('urlLoading'), + onReceivedSslError: anyNamed('onReceivedSslError'), + onFormResubmission: anyNamed('onFormResubmission'), + onReceivedClientCertRequest: anyNamed('onReceivedClientCertRequest'), )).captured.single as void Function( android_webview.WebViewClient, android_webview.WebView, String); @@ -772,6 +785,9 @@ void main() { onReceivedRequestError: anyNamed('onReceivedRequestError'), requestLoading: anyNamed('requestLoading'), urlLoading: anyNamed('urlLoading'), + onReceivedSslError: anyNamed('onReceivedSslError'), + onFormResubmission: anyNamed('onFormResubmission'), + onReceivedClientCertRequest: anyNamed('onReceivedClientCertRequest'), )).captured.single as void Function(android_webview.WebViewClient, android_webview.WebView, int, String, String); @@ -810,6 +826,9 @@ void main() { onReceivedRequestError: captureAnyNamed('onReceivedRequestError'), requestLoading: anyNamed('requestLoading'), urlLoading: anyNamed('urlLoading'), + onReceivedSslError: anyNamed('onReceivedSslError'), + onFormResubmission: anyNamed('onFormResubmission'), + onReceivedClientCertRequest: anyNamed('onReceivedClientCertRequest'), )).captured.single as void Function( android_webview.WebViewClient, android_webview.WebView, @@ -862,6 +881,9 @@ void main() { onReceivedRequestError: anyNamed('onReceivedRequestError'), requestLoading: anyNamed('requestLoading'), urlLoading: captureAnyNamed('urlLoading'), + onReceivedSslError: anyNamed('onReceivedSslError'), + onFormResubmission: anyNamed('onFormResubmission'), + onReceivedClientCertRequest: anyNamed('onReceivedClientCertRequest'), )).captured.single as void Function( android_webview.WebViewClient, android_webview.WebView, String); @@ -892,6 +914,9 @@ void main() { onReceivedRequestError: anyNamed('onReceivedRequestError'), requestLoading: captureAnyNamed('requestLoading'), urlLoading: anyNamed('urlLoading'), + onReceivedSslError: anyNamed('onReceivedSslError'), + onFormResubmission: anyNamed('onFormResubmission'), + onReceivedClientCertRequest: anyNamed('onReceivedClientCertRequest'), )).captured.single as void Function( android_webview.WebViewClient, android_webview.WebView, diff --git a/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_widget_test.mocks.dart b/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_widget_test.mocks.dart index ff695040404..b7d9898b9c0 100644 --- a/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_widget_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_widget_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.4 from annotations +// Mocks generated by Mockito 5.4.5 from annotations // in webview_flutter_android/test/legacy/webview_android_widget_test.dart. // Do not manually edit this file. @@ -22,6 +22,7 @@ import 'package:webview_flutter_platform_interface/src/webview_flutter_platform_ // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types @@ -29,129 +30,69 @@ import 'package:webview_flutter_platform_interface/src/webview_flutter_platform_ class _FakePigeonInstanceManager_0 extends _i1.SmartFake implements _i2.PigeonInstanceManager { - _FakePigeonInstanceManager_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakePigeonInstanceManager_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeFlutterAssetManager_1 extends _i1.SmartFake implements _i2.FlutterAssetManager { - _FakeFlutterAssetManager_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeFlutterAssetManager_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeWebSettings_2 extends _i1.SmartFake implements _i2.WebSettings { - _FakeWebSettings_2( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWebSettings_2(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeWebStorage_3 extends _i1.SmartFake implements _i2.WebStorage { - _FakeWebStorage_3( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWebStorage_3(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeWebView_4 extends _i1.SmartFake implements _i2.WebView { - _FakeWebView_4( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWebView_4(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeWebViewPoint_5 extends _i1.SmartFake implements _i2.WebViewPoint { - _FakeWebViewPoint_5( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWebViewPoint_5(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeWebResourceRequest_6 extends _i1.SmartFake implements _i2.WebResourceRequest { - _FakeWebResourceRequest_6( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWebResourceRequest_6(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeDownloadListener_7 extends _i1.SmartFake implements _i2.DownloadListener { - _FakeDownloadListener_7( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeDownloadListener_7(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeJavascriptChannelRegistry_8 extends _i1.SmartFake implements _i3.JavascriptChannelRegistry { - _FakeJavascriptChannelRegistry_8( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeJavascriptChannelRegistry_8(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeJavaScriptChannel_9 extends _i1.SmartFake implements _i2.JavaScriptChannel { - _FakeJavaScriptChannel_9( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeJavaScriptChannel_9(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeWebChromeClient_10 extends _i1.SmartFake implements _i2.WebChromeClient { - _FakeWebChromeClient_10( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWebChromeClient_10(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeWebViewClient_11 extends _i1.SmartFake implements _i2.WebViewClient { - _FakeWebViewClient_11( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeWebViewClient_11(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [FlutterAssetManager]. @@ -174,41 +115,28 @@ class MockFlutterAssetManager extends _i1.Mock @override _i4.Future> list(String? path) => (super.noSuchMethod( - Invocation.method( - #list, - [path], - ), + Invocation.method(#list, [path]), returnValue: _i4.Future>.value([]), ) as _i4.Future>); @override _i4.Future getAssetFilePathByName(String? name) => (super.noSuchMethod( - Invocation.method( - #getAssetFilePathByName, - [name], - ), - returnValue: _i4.Future.value(_i5.dummyValue( - this, - Invocation.method( - #getAssetFilePathByName, - [name], + Invocation.method(#getAssetFilePathByName, [name]), + returnValue: _i4.Future.value( + _i5.dummyValue( + this, + Invocation.method(#getAssetFilePathByName, [name]), ), - )), + ), ) as _i4.Future); @override _i2.FlutterAssetManager pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), returnValue: _FakeFlutterAssetManager_1( this, - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), ), ) as _i2.FlutterAssetManager); } @@ -232,10 +160,7 @@ class MockWebSettings extends _i1.Mock implements _i2.WebSettings { @override _i4.Future setDomStorageEnabled(bool? flag) => (super.noSuchMethod( - Invocation.method( - #setDomStorageEnabled, - [flag], - ), + Invocation.method(#setDomStorageEnabled, [flag]), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -243,10 +168,9 @@ class MockWebSettings extends _i1.Mock implements _i2.WebSettings { @override _i4.Future setJavaScriptCanOpenWindowsAutomatically(bool? flag) => (super.noSuchMethod( - Invocation.method( - #setJavaScriptCanOpenWindowsAutomatically, - [flag], - ), + Invocation.method(#setJavaScriptCanOpenWindowsAutomatically, [ + flag, + ]), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -254,20 +178,14 @@ class MockWebSettings extends _i1.Mock implements _i2.WebSettings { @override _i4.Future setSupportMultipleWindows(bool? support) => (super.noSuchMethod( - Invocation.method( - #setSupportMultipleWindows, - [support], - ), + Invocation.method(#setSupportMultipleWindows, [support]), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future setJavaScriptEnabled(bool? flag) => (super.noSuchMethod( - Invocation.method( - #setJavaScriptEnabled, - [flag], - ), + Invocation.method(#setJavaScriptEnabled, [flag]), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -275,10 +193,7 @@ class MockWebSettings extends _i1.Mock implements _i2.WebSettings { @override _i4.Future setUserAgentString(String? userAgentString) => (super.noSuchMethod( - Invocation.method( - #setUserAgentString, - [userAgentString], - ), + Invocation.method(#setUserAgentString, [userAgentString]), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -286,20 +201,14 @@ class MockWebSettings extends _i1.Mock implements _i2.WebSettings { @override _i4.Future setMediaPlaybackRequiresUserGesture(bool? require) => (super.noSuchMethod( - Invocation.method( - #setMediaPlaybackRequiresUserGesture, - [require], - ), + Invocation.method(#setMediaPlaybackRequiresUserGesture, [require]), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future setSupportZoom(bool? support) => (super.noSuchMethod( - Invocation.method( - #setSupportZoom, - [support], - ), + Invocation.method(#setSupportZoom, [support]), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -307,111 +216,77 @@ class MockWebSettings extends _i1.Mock implements _i2.WebSettings { @override _i4.Future setLoadWithOverviewMode(bool? overview) => (super.noSuchMethod( - Invocation.method( - #setLoadWithOverviewMode, - [overview], - ), + Invocation.method(#setLoadWithOverviewMode, [overview]), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future setUseWideViewPort(bool? use) => (super.noSuchMethod( - Invocation.method( - #setUseWideViewPort, - [use], - ), + Invocation.method(#setUseWideViewPort, [use]), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future setDisplayZoomControls(bool? enabled) => (super.noSuchMethod( - Invocation.method( - #setDisplayZoomControls, - [enabled], - ), + Invocation.method(#setDisplayZoomControls, [enabled]), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future setBuiltInZoomControls(bool? enabled) => (super.noSuchMethod( - Invocation.method( - #setBuiltInZoomControls, - [enabled], - ), + Invocation.method(#setBuiltInZoomControls, [enabled]), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future setAllowFileAccess(bool? enabled) => (super.noSuchMethod( - Invocation.method( - #setAllowFileAccess, - [enabled], - ), + Invocation.method(#setAllowFileAccess, [enabled]), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future setAllowContentAccess(bool? enabled) => (super.noSuchMethod( - Invocation.method( - #setAllowContentAccess, - [enabled], - ), + Invocation.method(#setAllowContentAccess, [enabled]), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future setGeolocationEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method( - #setGeolocationEnabled, - [enabled], - ), + Invocation.method(#setGeolocationEnabled, [enabled]), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future setTextZoom(int? textZoom) => (super.noSuchMethod( - Invocation.method( - #setTextZoom, - [textZoom], - ), + Invocation.method(#setTextZoom, [textZoom]), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future getUserAgentString() => (super.noSuchMethod( - Invocation.method( - #getUserAgentString, - [], - ), - returnValue: _i4.Future.value(_i5.dummyValue( - this, - Invocation.method( - #getUserAgentString, - [], + Invocation.method(#getUserAgentString, []), + returnValue: _i4.Future.value( + _i5.dummyValue( + this, + Invocation.method(#getUserAgentString, []), ), - )), + ), ) as _i4.Future); @override _i2.WebSettings pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), returnValue: _FakeWebSettings_2( this, - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), ), ) as _i2.WebSettings); } @@ -435,26 +310,17 @@ class MockWebStorage extends _i1.Mock implements _i2.WebStorage { @override _i4.Future deleteAllData() => (super.noSuchMethod( - Invocation.method( - #deleteAllData, - [], - ), + Invocation.method(#deleteAllData, []), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i2.WebStorage pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), returnValue: _FakeWebStorage_3( this, - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), ), ) as _i2.WebStorage); } @@ -470,10 +336,7 @@ class MockWebView extends _i1.Mock implements _i2.WebView { @override _i2.WebSettings get settings => (super.noSuchMethod( Invocation.getter(#settings), - returnValue: _FakeWebSettings_2( - this, - Invocation.getter(#settings), - ), + returnValue: _FakeWebSettings_2(this, Invocation.getter(#settings)), ) as _i2.WebSettings); @override @@ -487,34 +350,17 @@ class MockWebView extends _i1.Mock implements _i2.WebView { @override _i2.WebSettings pigeonVar_settings() => (super.noSuchMethod( - Invocation.method( - #pigeonVar_settings, - [], - ), + Invocation.method(#pigeonVar_settings, []), returnValue: _FakeWebSettings_2( this, - Invocation.method( - #pigeonVar_settings, - [], - ), + Invocation.method(#pigeonVar_settings, []), ), ) as _i2.WebSettings); @override - _i4.Future loadData( - String? data, - String? mimeType, - String? encoding, - ) => + _i4.Future loadData(String? data, String? mimeType, String? encoding) => (super.noSuchMethod( - Invocation.method( - #loadData, - [ - data, - mimeType, - encoding, - ], - ), + Invocation.method(#loadData, [data, mimeType, encoding]), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -528,117 +374,75 @@ class MockWebView extends _i1.Mock implements _i2.WebView { String? historyUrl, ) => (super.noSuchMethod( - Invocation.method( - #loadDataWithBaseUrl, - [ - baseUrl, - data, - mimeType, - encoding, - historyUrl, - ], - ), + Invocation.method(#loadDataWithBaseUrl, [ + baseUrl, + data, + mimeType, + encoding, + historyUrl, + ]), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override - _i4.Future loadUrl( - String? url, - Map? headers, - ) => + _i4.Future loadUrl(String? url, Map? headers) => (super.noSuchMethod( - Invocation.method( - #loadUrl, - [ - url, - headers, - ], - ), + Invocation.method(#loadUrl, [url, headers]), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override - _i4.Future postUrl( - String? url, - _i6.Uint8List? data, - ) => + _i4.Future postUrl(String? url, _i6.Uint8List? data) => (super.noSuchMethod( - Invocation.method( - #postUrl, - [ - url, - data, - ], - ), + Invocation.method(#postUrl, [url, data]), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future getUrl() => (super.noSuchMethod( - Invocation.method( - #getUrl, - [], - ), + Invocation.method(#getUrl, []), returnValue: _i4.Future.value(), ) as _i4.Future); @override _i4.Future canGoBack() => (super.noSuchMethod( - Invocation.method( - #canGoBack, - [], - ), + Invocation.method(#canGoBack, []), returnValue: _i4.Future.value(false), ) as _i4.Future); @override _i4.Future canGoForward() => (super.noSuchMethod( - Invocation.method( - #canGoForward, - [], - ), + Invocation.method(#canGoForward, []), returnValue: _i4.Future.value(false), ) as _i4.Future); @override _i4.Future goBack() => (super.noSuchMethod( - Invocation.method( - #goBack, - [], - ), + Invocation.method(#goBack, []), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future goForward() => (super.noSuchMethod( - Invocation.method( - #goForward, - [], - ), + Invocation.method(#goForward, []), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future reload() => (super.noSuchMethod( - Invocation.method( - #reload, - [], - ), + Invocation.method(#reload, []), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future clearCache(bool? includeDiskFiles) => (super.noSuchMethod( - Invocation.method( - #clearCache, - [includeDiskFiles], - ), + Invocation.method(#clearCache, [includeDiskFiles]), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -646,29 +450,20 @@ class MockWebView extends _i1.Mock implements _i2.WebView { @override _i4.Future evaluateJavascript(String? javascriptString) => (super.noSuchMethod( - Invocation.method( - #evaluateJavascript, - [javascriptString], - ), + Invocation.method(#evaluateJavascript, [javascriptString]), returnValue: _i4.Future.value(), ) as _i4.Future); @override _i4.Future getTitle() => (super.noSuchMethod( - Invocation.method( - #getTitle, - [], - ), + Invocation.method(#getTitle, []), returnValue: _i4.Future.value(), ) as _i4.Future); @override _i4.Future setWebViewClient(_i2.WebViewClient? client) => (super.noSuchMethod( - Invocation.method( - #setWebViewClient, - [client], - ), + Invocation.method(#setWebViewClient, [client]), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -676,20 +471,14 @@ class MockWebView extends _i1.Mock implements _i2.WebView { @override _i4.Future addJavaScriptChannel(_i2.JavaScriptChannel? channel) => (super.noSuchMethod( - Invocation.method( - #addJavaScriptChannel, - [channel], - ), + Invocation.method(#addJavaScriptChannel, [channel]), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future removeJavaScriptChannel(String? name) => (super.noSuchMethod( - Invocation.method( - #removeJavaScriptChannel, - [name], - ), + Invocation.method(#removeJavaScriptChannel, [name]), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -697,10 +486,7 @@ class MockWebView extends _i1.Mock implements _i2.WebView { @override _i4.Future setDownloadListener(_i2.DownloadListener? listener) => (super.noSuchMethod( - Invocation.method( - #setDownloadListener, - [listener], - ), + Invocation.method(#setDownloadListener, [listener]), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -708,96 +494,57 @@ class MockWebView extends _i1.Mock implements _i2.WebView { @override _i4.Future setWebChromeClient(_i2.WebChromeClient? client) => (super.noSuchMethod( - Invocation.method( - #setWebChromeClient, - [client], - ), + Invocation.method(#setWebChromeClient, [client]), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future setBackgroundColor(int? color) => (super.noSuchMethod( - Invocation.method( - #setBackgroundColor, - [color], - ), + Invocation.method(#setBackgroundColor, [color]), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future destroy() => (super.noSuchMethod( - Invocation.method( - #destroy, - [], - ), + Invocation.method(#destroy, []), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i2.WebView pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), returnValue: _FakeWebView_4( this, - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), ), ) as _i2.WebView); @override - _i4.Future scrollTo( - int? x, - int? y, - ) => - (super.noSuchMethod( - Invocation.method( - #scrollTo, - [ - x, - y, - ], - ), + _i4.Future scrollTo(int? x, int? y) => (super.noSuchMethod( + Invocation.method(#scrollTo, [x, y]), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override - _i4.Future scrollBy( - int? x, - int? y, - ) => - (super.noSuchMethod( - Invocation.method( - #scrollBy, - [ - x, - y, - ], - ), + _i4.Future scrollBy(int? x, int? y) => (super.noSuchMethod( + Invocation.method(#scrollBy, [x, y]), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future<_i2.WebViewPoint> getScrollPosition() => (super.noSuchMethod( - Invocation.method( - #getScrollPosition, - [], - ), - returnValue: _i4.Future<_i2.WebViewPoint>.value(_FakeWebViewPoint_5( - this, - Invocation.method( - #getScrollPosition, - [], + Invocation.method(#getScrollPosition, []), + returnValue: _i4.Future<_i2.WebViewPoint>.value( + _FakeWebViewPoint_5( + this, + Invocation.method(#getScrollPosition, []), ), - )), + ), ) as _i4.Future<_i2.WebViewPoint>); } @@ -813,10 +560,7 @@ class MockWebResourceRequest extends _i1.Mock @override String get url => (super.noSuchMethod( Invocation.getter(#url), - returnValue: _i5.dummyValue( - this, - Invocation.getter(#url), - ), + returnValue: _i5.dummyValue(this, Invocation.getter(#url)), ) as String); @override @@ -826,10 +570,9 @@ class MockWebResourceRequest extends _i1.Mock ) as bool); @override - bool get hasGesture => (super.noSuchMethod( - Invocation.getter(#hasGesture), - returnValue: false, - ) as bool); + bool get hasGesture => + (super.noSuchMethod(Invocation.getter(#hasGesture), returnValue: false) + as bool); @override String get method => (super.noSuchMethod( @@ -851,16 +594,10 @@ class MockWebResourceRequest extends _i1.Mock @override _i2.WebResourceRequest pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), returnValue: _FakeWebResourceRequest_6( this, - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), ), ) as _i2.WebResourceRequest); } @@ -874,31 +611,25 @@ class MockDownloadListener extends _i1.Mock implements _i2.DownloadListener { } @override - void Function( - _i2.DownloadListener, - String, - String, - String, - String, - int, - ) get onDownloadStart => (super.noSuchMethod( - Invocation.getter(#onDownloadStart), - returnValue: ( - _i2.DownloadListener pigeon_instance, - String url, - String userAgent, - String contentDisposition, - String mimetype, - int contentLength, - ) {}, - ) as void Function( - _i2.DownloadListener, - String, - String, - String, - String, - int, - )); + void Function(_i2.DownloadListener, String, String, String, String, int) + get onDownloadStart => (super.noSuchMethod( + Invocation.getter(#onDownloadStart), + returnValue: ( + _i2.DownloadListener pigeon_instance, + String url, + String userAgent, + String contentDisposition, + String mimetype, + int contentLength, + ) {}, + ) as void Function( + _i2.DownloadListener, + String, + String, + String, + String, + int, + )); @override _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( @@ -911,16 +642,10 @@ class MockDownloadListener extends _i1.Mock implements _i2.DownloadListener { @override _i2.DownloadListener pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), returnValue: _FakeDownloadListener_7( this, - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), ), ) as _i2.DownloadListener); } @@ -954,19 +679,11 @@ class MockWebViewAndroidJavaScriptChannel extends _i1.Mock ) as String); @override - void Function( - _i2.JavaScriptChannel, - String, - ) get postMessage => (super.noSuchMethod( + void Function(_i2.JavaScriptChannel, String) get postMessage => + (super.noSuchMethod( Invocation.getter(#postMessage), - returnValue: ( - _i2.JavaScriptChannel pigeon_instance, - String message, - ) {}, - ) as void Function( - _i2.JavaScriptChannel, - String, - )); + returnValue: (_i2.JavaScriptChannel pigeon_instance, String message) {}, + ) as void Function(_i2.JavaScriptChannel, String)); @override _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( @@ -979,16 +696,10 @@ class MockWebViewAndroidJavaScriptChannel extends _i1.Mock @override _i2.JavaScriptChannel pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), returnValue: _FakeJavaScriptChannel_9( this, - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), ), ) as _i2.JavaScriptChannel); } @@ -1001,6 +712,43 @@ class MockWebChromeClient extends _i1.Mock implements _i2.WebChromeClient { _i1.throwOnMissingStub(this); } + @override + _i4.Future> Function( + _i2.WebChromeClient, + _i2.WebView, + _i2.FileChooserParams, + ) get onShowFileChooser => (super.noSuchMethod( + Invocation.getter(#onShowFileChooser), + returnValue: ( + _i2.WebChromeClient pigeon_instance, + _i2.WebView webView, + _i2.FileChooserParams params, + ) => + _i4.Future>.value([]), + ) as _i4.Future> Function( + _i2.WebChromeClient, + _i2.WebView, + _i2.FileChooserParams, + )); + + @override + _i4.Future Function(_i2.WebChromeClient, _i2.WebView, String, String) + get onJsConfirm => (super.noSuchMethod( + Invocation.getter(#onJsConfirm), + returnValue: ( + _i2.WebChromeClient pigeon_instance, + _i2.WebView webView, + String url, + String message, + ) => + _i4.Future.value(false), + ) as _i4.Future Function( + _i2.WebChromeClient, + _i2.WebView, + String, + String, + )); + @override _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( Invocation.getter(#pigeon_instanceManager), @@ -1013,10 +761,9 @@ class MockWebChromeClient extends _i1.Mock implements _i2.WebChromeClient { @override _i4.Future setSynchronousReturnValueForOnShowFileChooser(bool? value) => (super.noSuchMethod( - Invocation.method( - #setSynchronousReturnValueForOnShowFileChooser, - [value], - ), + Invocation.method(#setSynchronousReturnValueForOnShowFileChooser, [ + value, + ]), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -1024,10 +771,9 @@ class MockWebChromeClient extends _i1.Mock implements _i2.WebChromeClient { @override _i4.Future setSynchronousReturnValueForOnConsoleMessage(bool? value) => (super.noSuchMethod( - Invocation.method( - #setSynchronousReturnValueForOnConsoleMessage, - [value], - ), + Invocation.method(#setSynchronousReturnValueForOnConsoleMessage, [ + value, + ]), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -1035,10 +781,7 @@ class MockWebChromeClient extends _i1.Mock implements _i2.WebChromeClient { @override _i4.Future setSynchronousReturnValueForOnJsAlert(bool? value) => (super.noSuchMethod( - Invocation.method( - #setSynchronousReturnValueForOnJsAlert, - [value], - ), + Invocation.method(#setSynchronousReturnValueForOnJsAlert, [value]), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -1046,10 +789,9 @@ class MockWebChromeClient extends _i1.Mock implements _i2.WebChromeClient { @override _i4.Future setSynchronousReturnValueForOnJsConfirm(bool? value) => (super.noSuchMethod( - Invocation.method( - #setSynchronousReturnValueForOnJsConfirm, - [value], - ), + Invocation.method(#setSynchronousReturnValueForOnJsConfirm, [ + value, + ]), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -1057,26 +799,17 @@ class MockWebChromeClient extends _i1.Mock implements _i2.WebChromeClient { @override _i4.Future setSynchronousReturnValueForOnJsPrompt(bool? value) => (super.noSuchMethod( - Invocation.method( - #setSynchronousReturnValueForOnJsPrompt, - [value], - ), + Invocation.method(#setSynchronousReturnValueForOnJsPrompt, [value]), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i2.WebChromeClient pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), returnValue: _FakeWebChromeClient_10( this, - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), ), ) as _i2.WebChromeClient); } @@ -1100,7 +833,8 @@ class MockWebViewClient extends _i1.Mock implements _i2.WebViewClient { @override _i4.Future setSynchronousReturnValueForShouldOverrideUrlLoading( - bool? value) => + bool? value, + ) => (super.noSuchMethod( Invocation.method( #setSynchronousReturnValueForShouldOverrideUrlLoading, @@ -1112,16 +846,10 @@ class MockWebViewClient extends _i1.Mock implements _i2.WebViewClient { @override _i2.WebViewClient pigeon_copy() => (super.noSuchMethod( - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), returnValue: _FakeWebViewClient_11( this, - Invocation.method( - #pigeon_copy, - [], - ), + Invocation.method(#pigeon_copy, []), ), ) as _i2.WebViewClient); } @@ -1142,28 +870,16 @@ class MockJavascriptChannelRegistry extends _i1.Mock ) as Map); @override - void onJavascriptChannelMessage( - String? channel, - String? message, - ) => + void onJavascriptChannelMessage(String? channel, String? message) => super.noSuchMethod( - Invocation.method( - #onJavascriptChannelMessage, - [ - channel, - message, - ], - ), + Invocation.method(#onJavascriptChannelMessage, [channel, message]), returnValueForMissingStub: null, ); @override void updateJavascriptChannelsFromSet(Set<_i3.JavascriptChannel>? channels) => super.noSuchMethod( - Invocation.method( - #updateJavascriptChannelsFromSet, - [channels], - ), + Invocation.method(#updateJavascriptChannelsFromSet, [channels]), returnValueForMissingStub: null, ); } @@ -1183,50 +899,34 @@ class MockWebViewPlatformCallbacksHandler extends _i1.Mock required bool? isForMainFrame, }) => (super.noSuchMethod( - Invocation.method( - #onNavigationRequest, - [], - { - #url: url, - #isForMainFrame: isForMainFrame, - }, - ), + Invocation.method(#onNavigationRequest, [], { + #url: url, + #isForMainFrame: isForMainFrame, + }), returnValue: _i4.Future.value(false), ) as _i4.FutureOr); @override void onPageStarted(String? url) => super.noSuchMethod( - Invocation.method( - #onPageStarted, - [url], - ), + Invocation.method(#onPageStarted, [url]), returnValueForMissingStub: null, ); @override void onPageFinished(String? url) => super.noSuchMethod( - Invocation.method( - #onPageFinished, - [url], - ), + Invocation.method(#onPageFinished, [url]), returnValueForMissingStub: null, ); @override void onProgress(int? progress) => super.noSuchMethod( - Invocation.method( - #onProgress, - [progress], - ), + Invocation.method(#onProgress, [progress]), returnValueForMissingStub: null, ); @override void onWebResourceError(_i3.WebResourceError? error) => super.noSuchMethod( - Invocation.method( - #onWebResourceError, - [error], - ), + Invocation.method(#onWebResourceError, [error]), returnValueForMissingStub: null, ); } @@ -1241,92 +941,75 @@ class MockWebViewProxy extends _i1.Mock implements _i7.WebViewProxy { @override _i2.WebView createWebView() => (super.noSuchMethod( - Invocation.method( - #createWebView, - [], - ), + Invocation.method(#createWebView, []), returnValue: _FakeWebView_4( this, - Invocation.method( - #createWebView, - [], - ), + Invocation.method(#createWebView, []), ), ) as _i2.WebView); @override _i2.WebViewClient createWebViewClient({ - void Function( - _i2.WebViewClient, - _i2.WebView, - String, - )? onPageStarted, - void Function( - _i2.WebViewClient, - _i2.WebView, - String, - )? onPageFinished, + void Function(_i2.WebViewClient, _i2.WebView, String)? onPageStarted, + void Function(_i2.WebViewClient, _i2.WebView, String)? onPageFinished, void Function( _i2.WebViewClient, _i2.WebView, _i2.WebResourceRequest, _i2.WebResourceError, )? onReceivedRequestError, + void Function(_i2.WebViewClient, _i2.WebView, int, String, String)? + onReceivedError, + void Function(_i2.WebViewClient, _i2.WebView, _i2.WebResourceRequest)? + requestLoading, void Function( _i2.WebViewClient, _i2.WebView, - int, - String, - String, - )? onReceivedError, + _i2.AndroidMessage, + _i2.AndroidMessage, + )? onFormResubmission, + void Function(_i2.WebViewClient, _i2.WebView, _i2.ClientCertRequest)? + onReceivedClientCertRequest, void Function( _i2.WebViewClient, _i2.WebView, - _i2.WebResourceRequest, - )? requestLoading, - void Function( - _i2.WebViewClient, - _i2.WebView, - String, - )? urlLoading, + _i2.SslErrorHandler, + _i2.SslError, + )? onReceivedSslError, + void Function(_i2.WebViewClient, _i2.WebView, String)? urlLoading, }) => (super.noSuchMethod( - Invocation.method( - #createWebViewClient, - [], - { + Invocation.method(#createWebViewClient, [], { + #onPageStarted: onPageStarted, + #onPageFinished: onPageFinished, + #onReceivedRequestError: onReceivedRequestError, + #onReceivedError: onReceivedError, + #requestLoading: requestLoading, + #onFormResubmission: onFormResubmission, + #onReceivedClientCertRequest: onReceivedClientCertRequest, + #onReceivedSslError: onReceivedSslError, + #urlLoading: urlLoading, + }), + returnValue: _FakeWebViewClient_11( + this, + Invocation.method(#createWebViewClient, [], { #onPageStarted: onPageStarted, #onPageFinished: onPageFinished, #onReceivedRequestError: onReceivedRequestError, #onReceivedError: onReceivedError, #requestLoading: requestLoading, + #onFormResubmission: onFormResubmission, + #onReceivedClientCertRequest: onReceivedClientCertRequest, + #onReceivedSslError: onReceivedSslError, #urlLoading: urlLoading, - }, - ), - returnValue: _FakeWebViewClient_11( - this, - Invocation.method( - #createWebViewClient, - [], - { - #onPageStarted: onPageStarted, - #onPageFinished: onPageFinished, - #onReceivedRequestError: onReceivedRequestError, - #onReceivedError: onReceivedError, - #requestLoading: requestLoading, - #urlLoading: urlLoading, - }, - ), + }), ), ) as _i2.WebViewClient); @override _i4.Future setWebContentsDebuggingEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method( - #setWebContentsDebuggingEnabled, - [enabled], - ), + Invocation.method(#setWebContentsDebuggingEnabled, [enabled]), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future);